Resource processing method, device, storage medium and cache server

By distinguishing fragment types and performing differential processing on storage location, compression method and storage location change threshold, the cache server's processing efficiency of the first fragment is improved, the problem of low first fragment processing efficiency is solved, and user access is improved Response speed.

CN112433848BActive Publication Date: 2024-08-30BEIJING KINGSOFT CLOUD NETWORK TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202011244948.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-11-10
Publication Date
2024-08-30
Estimated Expiration
2040-11-10

AI Technical Summary

Technical Problem

When the cache server processes user access, the processing efficiency of the first shard is low, resulting in reduced response speed and affecting the user experience.

Method used

Distinguish the shard types of shard resources, perform differential processing on the storage location, compression method, and storage location change threshold for the first shard and the content shard. Prioritize the first shard to be stored in the cache device, and set appropriate compression. Mode and storage location change thresholds.

Benefits of technology

The cache server's processing efficiency and storage efficiency for the first fragment are improved, thereby improving the response speed of user access.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112433848B
    Figure CN112433848B
Patent Text Reader

Abstract

The present disclosure relates to the field of computer technology, and discloses a resource processing method, device, storage medium and cache server. The method includes: obtaining resource information of a slice resource to be processed; based on the resource information, determining the slice type of the slice resource, the slice type includes a first slice or a content slice, the first slice contains the resource summary information of the entire resource corresponding to the slice resource, and the content slice contains the resource content of the entire resource; based on the slice type, determining the storage reference information of the slice resource, the storage reference information includes at least one of a storage location, a compression method and a storage location change threshold, the storage location change threshold is used to determine whether the slice resource is stored from a serial port hard disk to a fixed hard disk or a memory; based on the storage reference information, storing the slice resource. Through the above technical solution, the processing efficiency of the cache server for the slice resource of the first slice is improved, and the response speed of the cache server to user access is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of computer technology, and in particular to a resource processing method, device, storage medium and cache server. Background Art

[0002] With the development of society, most regions are connected to the Internet, but the response speed of users in different regions visiting the same website is different. In order to improve the response speed of websites to user visits, content delivery networks (CDN) have emerged. CDN is an intelligent virtual network built on the basis of the existing network. With the help of various cache servers, users can obtain the required information from the place closest to the user at the fastest speed, greatly reducing network congestion and improving the response speed and hit rate of user access.

[0003] A very important part of CDN is that the cache server pulls resources from the CDN source station and caches them. When a user accesses, the resource can be read and processed from the cache server for feedback. At present, the cache server processes the pulled resources in the way of resource slicing, that is, the cache server first slices the resource according to a certain fixed size, and then compresses each slice and stores it in each unit of the cache server's serial hard disk (Serial ATA, SATA). And as the access popularity of the slice increases (such as the number of times), the corresponding slice is stored from the SATA hard disk to the solid state disk (SSD) or memory in the cache server.

[0004] However, for each user's access, the cache server needs to read the information of the first fragment of the resource corresponding to the accessed content (referred to as the first fragment), and then read the fragment of the content required by the user (referred to as the content fragment). According to the resource processing method of the cache server mentioned above, the processing efficiency of the first fragment is low, which will correspondingly reduce the response speed of the cache server to the user's access, affecting the user experience. Summary of the invention

[0005] In order to solve the above technical problems or at least partially solve the above technical problems, the present disclosure provides a resource processing method, device, storage medium and cache server.

[0006] In a first aspect, the present disclosure provides a resource processing method, comprising:

[0007] Get resource information of the shard resources to be processed;

[0008] Based on the resource information of the slice resource, determine the slice type of the slice resource, the slice type includes a first slice or a content slice, the first slice is a slice containing resource summary information of the entire resource corresponding to the slice resource, and the content slice is a slice containing resource content of the entire resource;

[0009] Based on the shard type, determine storage reference information of the shard resource, the storage reference information including at least one of a storage location, a compression method, and a storage location change threshold, the storage location change threshold being used to determine whether the shard resource is stored from a serial port hard disk to a fixed hard disk or a memory;

[0010] Based on the storage reference information, the slice resource is stored.

[0011] In some embodiments, when the storage reference information includes the storage location, determining the storage reference information of the slice resource based on the slice type includes:

[0012] If the shard type is the first shard, determining that the storage location of the shard resource is a solid state drive or a memory;

[0013] If the segment type is the content segment, it is determined that the storage location of the segment resource is a serial port hard disk.

[0014] In some embodiments, when the storage reference information includes the storage location change threshold, determining the storage reference information of the shard resource based on the shard type includes:

[0015] If the shard type is the first shard, determining a first storage location change threshold for the shard resource;

[0016] If the slice type is the content slice, determining a second storage location change threshold for the slice resource;

[0017] The first storage location change threshold is smaller than the second storage location change threshold.

[0018] In some embodiments, when the storage reference information includes the compression method, determining the storage reference information of the slice resource based on the slice type includes:

[0019] If the slice type is the first slice, determining that the compression method of the slice resource is no compression or a compression method with a first data compression ratio;

[0020] If the segment type is the content segment, determining that the compression method of the segment resource is a compression method with a second data compression ratio;

[0021] The second data compression ratio is greater than the first data compression ratio.

[0022] In some embodiments, the determining the slice type of the slice resource based on the resource information of the slice resource includes:

[0023] If the resource information corresponds to the http header information, it is determined that the fragment type of the fragment resource is the first fragment.

[0024] In some embodiments, the storage location change threshold is determined based on the resource owner priority and the resource type corresponding to the slice resource.

[0025] In some embodiments, the method further comprises:

[0026] Based on the segment type, the segment resources are deleted, and the resource deletion priority of the content segment is higher than the resource deletion priority of the first segment.

[0027] In some embodiments, deleting the slice resource based on the slice type includes:

[0028] If the slice type is the first slice, determining a first resource deletion initial value for the slice resource;

[0029] If the slice type is the content slice, determining a second resource deletion initial value for the slice resource; the second resource deletion initial value is less than the first resource deletion initial value;

[0030] Based on the first resource deletion initial value or the second resource deletion initial value, a resource deletion operation is performed on the slice resource.

[0031] In a second aspect, the present disclosure provides a resource processing device, the device comprising:

[0032] A resource information acquisition module, used to acquire the slice resources to be processed and determine the resource information of the slice resources;

[0033] A fragment type determination module, configured to determine the fragment type of the fragment resource based on the resource information of the fragment resource, wherein the fragment type includes a first fragment or a content fragment, wherein the first fragment is a fragment containing resource summary information of the entire resource corresponding to the fragment resource, and the content fragment is a fragment containing resource content of the entire resource;

[0034] A storage reference information determination module, used to determine at least one of a storage location, a compression method, and a storage location change threshold of the slice resource based on the slice type, wherein the storage location change threshold is used to determine whether the slice resource is stored from the serial port hard disk to the fixed hard disk or the memory;

[0035] A storage module is used to store the slice resource based on the determined storage location, the compression method and the storage location change threshold.

[0036] In some embodiments, the storage reference information determination module is specifically used to:

[0037] When the storage reference information includes the storage location, if the shard type is the first shard, determining that the storage location of the shard resource is a solid state drive or a memory;

[0038] If the segment type is the content segment, it is determined that the storage location of the segment resource is a serial port hard disk.

[0039] In some embodiments, the storage reference information determination module is specifically used to:

[0040] When the storage reference information includes the storage location change threshold, if the slice type is the first slice, determining a first storage location change threshold for the slice resource;

[0041] If the slice type is the content slice, determining a second storage location change threshold for the slice resource;

[0042] The first storage location change threshold is smaller than the second storage location change threshold.

[0043] In some embodiments, the storage reference information determination module is specifically used to:

[0044] When the storage reference information includes the compression method, if the slice type is the first slice, determining the compression method of the slice resource to be no compression or a compression method with a first data compression ratio;

[0045] If the segment type is the content segment, determining that the compression method of the segment resource is a compression method with a second data compression ratio;

[0046] The second data compression ratio is greater than the first data compression ratio.

[0047] In some embodiments, the shard type determination module is specifically configured to:

[0048] If the resource information corresponds to the http header information, it is determined that the fragment type of the fragment resource is the first fragment.

[0049] In some embodiments, the storage location change threshold is determined based on the resource owner priority and the resource type corresponding to the slice resource.

[0050] In some embodiments, the apparatus further comprises a resource deletion module, configured to:

[0051] Based on the segment type, the segment resources are deleted, and the resource deletion priority of the content segment is higher than the resource deletion priority of the first segment.

[0052] In some embodiments, the resource deletion module is specifically used to:

[0053] If the slice type is the first slice, determining a first resource deletion initial value for the slice resource;

[0054] If the slice type is the content slice, determining a second resource deletion initial value for the slice resource; the second resource deletion initial value is less than the first resource deletion initial value;

[0055] Based on the first resource deletion initial value or the second resource deletion initial value, a resource deletion operation is performed on the slice resource.

[0056] In a third aspect, the present disclosure provides a cache server, the cache server comprising:

[0057] one or more processors;

[0058] a storage device for storing one or more programs,

[0059] When the one or more programs are executed by the one or more processors, the one or more processors implement any one embodiment of the resource processing method described above.

[0060] In a fourth aspect, the present disclosure provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, any embodiment of the resource processing method described above is implemented.

[0061] Compared with the prior art, the technical solution provided by the embodiments of the present disclosure has the following advantages:

[0062] In a content distribution network, a cache server differentiates the fragment types of fragment resources to store resources, and performs differential processing on fragment resources of two types, namely, first fragments and content fragments, in at least one of the storage location, compression method, and storage location change threshold setting, thereby improving the processing efficiency of the cache server for the fragment resources of the first fragment that must be processed for each access, thereby improving the response speed of the cache server to user access. BRIEF DESCRIPTION OF THE DRAWINGS

[0063] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.

[0064] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0065] Figure 1 It is a resource access information flow diagram based on a network architecture of a content distribution network provided by an embodiment of the present disclosure;

[0066] Figure 2 It is a node architecture block diagram of any node in the content distribution network provided by the embodiment of the present disclosure;

[0067] Figure 3 is a flow chart of a resource processing method provided by an embodiment of the present disclosure;

[0068] Figure 4 is a flowchart of another resource processing method provided by an embodiment of the present disclosure;

[0069] Figure 5 is a structural diagram of a resource processing device provided by an embodiment of the present disclosure;

[0070] Figure 6 It is a schematic diagram of the structure of a cache server provided in an embodiment of the present disclosure. DETAILED DESCRIPTION

[0071] In order to more clearly understand the above-mentioned objectives, features and advantages of the present disclosure, the scheme of the present disclosure will be further described in detail below. It should be noted that the embodiments of the present disclosure and the features in the embodiments can be combined with each other without conflict.

[0072] In the following description, many specific details are set forth to facilitate a full understanding of the present disclosure, but the present disclosure may also be implemented in other ways different from those described herein; it is obvious that the embodiments in the specification are only part of the embodiments of the present disclosure, rather than all of the embodiments.

[0073] The resource processing solution provided by the embodiments of the present disclosure can be applied to a content delivery network (CDN), and specifically to a cache server of a CDN.

[0074] Figure 1 A resource access information flow diagram based on a network architecture of a content distribution network is provided in an embodiment of the present disclosure. Figure 1As shown, the content distribution network 110 includes a source station 111, an upper node 112, a middle node 113 and an edge node 114, wherein the number of source stations 111 is the least, the number of upper nodes 112 is greater than the number of source stations 111 but less than the number of middle nodes 113, and the number of middle nodes 113 is less than the number of edge nodes 114. The edge node 113 directly communicates with the user end 120 that accesses the resource, and is used to receive the user's access request and feedback the requested resource to the user. The middle node 113 does not directly serve the user, and it communicates with the edge node 112 to aggregate the back-source request of the edge node 114 to request resources from the source station 111 and feedback it; and the middle node 113 communicates with the upper node 112 to pull the resources not stored in the upper node 112 from the upper node 112. The upper node 112 does not directly serve the user. It communicates with the middle node 113 to aggregate the back-to-source requests of the middle node 113 and provide feedback thereto. The upper node 112 communicates with the source station 111 to pull resources that are not stored in the source station 111.

[0075] The node architectures of the upper node 112 , the middle node 113 , and the edge node 114 are the same. Figure 2 It is a node architecture block diagram of any node in the content distribution network provided by the embodiment of the present disclosure. The node includes a load balancing server, multiple cache servers, and http and reverse proxy web servers (such as nginx) corresponding to each cache server. The load balancing server is used to distribute the external requests of the node to the http and reverse proxy web servers in a balanced manner. The http and reverse proxy web servers are used to direct external requests to the appropriate cache server according to the resource storage situation in the cache server. The cache server is used to process external requests and provide resource feedback.

[0076] Combination Figure 1 and Figure 2, the information flow of a user accessing a website resource through the content distribution network 110 is as follows: the user inputs the domain name to be accessed through the user terminal 120. The user terminal 120 sends a domain name resolution request to the domain name resolution server 130 according to information flow 1. The domain name resolution server 130 processes the domain name resolution request and feeds back the most suitable IP address of the edge node 114 to the user terminal 120 according to information flow 2. The user terminal 120 accesses the edge node 114 according to information flow 3 based on the obtained IP address of the edge node 114. If the cache server of the edge node 114 stores the resource accessed by the user, the resource is read from its cache server and the resource is fed back to the user terminal 120 according to information flow 10. If the cache server of the edge node 114 does not store the corresponding resource, it is pulled from the cache server of the middle node 113. Specifically, a back-to-source request is sent to the middle node 113 according to information flow 4, and the middle node 113 reads the resource from its cache server according to the back-to-source request and feeds back to the edge node 114 according to information flow 10. Similarly, if the middle-layer node 113 does not store the corresponding resources, it is pulled from the upper-layer node 112 according to information flows 5 and 8. If the upper-layer node 112 does not store the corresponding resources, it is pulled from the source station 111 according to information flows 6 and 7. It should be noted that after any node pulls resources from the upper-layer node, in addition to feeding back to the next-layer node, the pulled resources must also be stored in the cache server of the node. In the above process, the cache server stores the pulled resources, and the node reads the resources from the cache server, which all belong to the resource processing process of the cache server.

[0077] At present, cache servers store and process resources in a resource slicing manner. When a cache server processes an external request from a user to access a resource, it must read and process the slicing resources of the first slicing corresponding to the resource required by the user, and then read and process the content slicing required by the user, without reading other content slicing. In this way, during the process of user access to resources, the cache server's processing efficiency of the slicing resources of the first slicing has a greater impact on the access response speed. However, when storing or processing slicing resources, current cache servers do not distinguish between the first slicing and the content slicing, and use a unified processing method for all slicing resources, such as the same storage location change rules and compression methods. This results in low processing efficiency of the slicing resources of the first slicing in the cache server, which in turn reduces the website's response speed to user access. To address this problem, the present disclosure provides a resource processing solution, which implements differential processing of two types of fragment resources, namely, the first fragment and the content fragment, in at least one of the storage location, compression method, and storage location change threshold setting. For example, the fragment resources of the first fragment are directly stored in a cache device, or a compression method with a faster decompression speed is set for it, or a smaller storage location change threshold is set for it to speed up the migration of fragment resources to the cache device, etc., thereby improving the storage efficiency and processing efficiency of the cache server for the fragment resources of the first fragment, thereby improving the response speed of the cache server to user access.

[0078] Figure 3 is a flow chart of a resource processing method provided by an embodiment of the present disclosure. The method can be executed by a resource processing device, which can be implemented by software and / or hardware, and can be integrated in a cache server of a CDN. Figure 3 , the resource processing method specifically includes the following steps:

[0079] S310: Obtain resource information of the slice resources to be processed.

[0080] Among them, the fragmented resources refer to the partial resources obtained by splitting the entire resource according to a fixed size. The resources here refer to the resources stored in the content delivery network CDN, such as pictures, audio, video, text resources, or other content that can be displayed on a computer. Resource information refers to the attribute information of the resource, such as the size of the resource, a brief description of the content, time, etc.

[0081] In CDN, if the node where the cache server is located receives a resource request from the node in the next layer or the user end, but the cache server does not store the requested resource, then the node will send a source request back to the node in the previous layer or the source station to pull the requested resource in the form of slices, that is, the cache server obtains the slice resource to be processed. In addition, the cache server obtains its resource information from the obtained slice resource.

[0082] S320: Determine a slice type of the slice resource based on the resource information of the slice resource.

[0083] Among them, the type of shard resource refers to the result obtained by classifying the shard resources from different dimensions of the shard resources. In the embodiment of the present disclosure, the shard resources are divided into the first shard and the content shard according to the resource content and its importance. The first shard refers to the shard resource that contains the general information of the entire resource in the shard, which will be read in each user access and is the most important part of the entire resource. The content shard refers to the shard resource that contains specific resource content in the shard. In some embodiments, since CDN is based on http access, all its resources will add http header information at the front position, and the http header information contains the general information of the entire resource, such as resource size, number of shards and expiration time, etc. Therefore, the first shard is also the first shard of the entire resource, and the content shards are the subsequent shards of the entire resource.

[0084] In the related art, when a cache server stores slice resources, it uses a unified processing method for all slice resources. However, based on the discovery that the processing efficiency of the first slice has a greater impact on the response speed of user access, the embodiment of the present disclosure adopts a method of distinguishing the slice types of slice resources for differentiated storage and processing. In specific implementation, the cache server determines whether the slice type of the slice resource is the first slice or the content slice based on the resource information of the obtained slice resource.

[0085] In some embodiments, based on the resource information of the shard resource, determining the shard type of the shard resource includes: if the resource information corresponds to the http header information, then determining that the shard type of the shard resource is the first shard. The http header information in the related art is used to determine the amount of data that needs to be received during data transmission, and the embodiment of the present disclosure applies the http header information to the shard type judgment process of the shard resource during resource storage. Specifically: the shard resource of the first shard in the CDN must contain the http header information. Therefore, if the resource information of the shard resource can reflect that the shard resource contains the http header information, then it can be determined that the shard type of the acquired shard resource is the first shard. On the contrary, if the resource information of the shard resource indicates that the shard resource does not contain the http header information, then it is determined that the shard type of the shard resource is a content shard. In this way, the shard type of the shard resource can be determined more quickly, thereby further improving the storage efficiency of the shard resource.

[0086] S330. Based on the shard type, determine storage reference information of the shard resource, where the storage reference information includes at least one of a storage location, a compression method, and a storage location change threshold.

[0087] Among them, the storage reference information refers to the relevant information in the resource storage process. The storage location refers to the location where the resource is stored in the cache server, for example, it can be a memory, a solid-state hard disk or a serial port SATA hard disk. The compression method refers to the algorithm for compressing the resource. Different compression methods have different data compression ratios. The larger the data compression ratio, the smaller the data volume of the compressed resource, and the longer the decompression time. The storage location change threshold is used to determine whether the sliced ​​resource is stored from the serial port hard disk to the fixed hard disk or memory. In the related art, the sliced ​​resource is stored in the SATA hard disk of the cache server. As its access heat (such as represented by the number of accesses) reaches the storage location change threshold, it is migrated from the SATA hard disk to a cache device such as a memory or a solid-state hard disk. In some embodiments, the storage location change threshold is determined based on the priority of the resource owner and the resource type corresponding to the sliced ​​resource. For example, for a resource with a high priority of the resource owner (a customer who uses CDN to store its resources), it should be stored in the cache device first, so its storage location change threshold is smaller. For example, for a resource of the resource type of video, it should be stored in the cache device first, so its storage location change threshold is smaller. As for resources whose resource type is application, their importance is not as high as video, so their storage location change threshold is relatively large, so as to ensure that more important resources are stored in the cache device first.

[0088] The disclosed embodiment performs differentiated processing on slice resources of different slice types in at least one aspect of storage location, compression method and storage location change threshold setting, so as to relatively improve the processing efficiency of the slice resources of the first slice in each slice resource through different processing methods.

[0089] In some embodiments, when the storage reference information includes a storage location, based on the shard type, determining the storage reference information of the shard resource includes: if the shard type is the first shard, determining the storage location of the shard resource as a solid state drive or a memory; if the shard type is a content shard, determining the storage location of the shard resource as a serial port hard disk. In this embodiment, the shard resources of the first shard and the content shard are processed differentially from the storage location. If the shard type of the shard resource determined above is a content shard, determining its storage location as a SATA hard disk. If the determined shard type is the first shard, determining its storage location as a cache device of a memory or a solid state drive. In this way, the cache server can directly store the acquired shard resources in the cache device, and its storage and reading efficiency will be greatly improved compared to storing in a SATA hard disk. In this embodiment, in terms of the compression method and the storage location change threshold setting, differential processing can be performed or not.

[0090] In some embodiments, when the storage reference information includes a compression method, based on the shard type, determining the storage reference information of the shard resource includes: if the shard type is the first shard, determining the compression method of the shard resource as non-compression or a compression method with a first data compression ratio; if the shard type is a content shard, determining the compression method of the shard resource as a compression method with a second data compression ratio; wherein the second data compression ratio is greater than the first data compression ratio. In this embodiment, the shard resources of the first shard and the content shard are processed differentially from the compression method. If the shard type of the shard resource determined above is a content shard, determining its compression method as a compression method with a relatively large data compression ratio, that is, using a compression method with a second data compression ratio, to ensure efficient use of storage space. If the determined shard type is the first shard, determining its compression method as non-compression, or a compression method with a relatively small data compression ratio, that is, using a compression method with a first data compression ratio. The first data compression ratio needs to be determined based on the decompression time and whether the bandwidth is idle. For example, the decompression time corresponding to the first data compression ratio should make the bandwidth in a non-idle state, or in an idle state for a shorter time, to ensure a better user experience. Through such a setting, when the cache server stores and reads the fragmented resources of the first fragment, the time occupied by the compression process is relatively shortened, which improves the processing efficiency of the fragmented resources of the first fragment to a certain extent. In this embodiment, differentiated processing can be performed or not in terms of the storage location and the storage location change threshold setting.

[0091] In some embodiments, when the storage reference information includes a storage location change threshold, based on the shard type, determining the storage reference information of the shard resource includes: if the shard type is the first shard, determining a first storage location change threshold for the shard resource; if the shard type is the content shard, determining a second storage location change threshold for the shard resource; wherein the first storage location change threshold is less than the second storage location change threshold. In this embodiment, the shard resources of the first shard and the content shard are processed differently from the storage location change threshold setting. If the shard type of the shard resource determined above is the content shard, a second storage location change threshold with a larger value is determined for it, such as 50 access times. If the determined shard type is the first shard, a first storage location change threshold with a smaller value is determined for it, such as 25 access times. In this way, the number of accesses to the shard resource of the first shard will reach the first storage location change threshold faster, so that it is stored from the SATA hard disk to the cache device faster, and the resource storage and reading efficiency of the cache device are very high, thereby improving the processing efficiency of the shard resource of the first shard to a certain extent. In this embodiment, the initial storage locations of the two types of slice resources are both SATA hard disks. The compression methods may be differentiated or not.

[0092] S340: Store the shard resources based on the storage reference information.

[0093] The cache server stores the slice resource according to the storage reference information (at least one of the storage location, compression method and storage location change threshold) determined in S330. For example, if only the storage location is determined in S330, the slice resource is stored in the storage location; if the compression method and the storage location change threshold are determined in S330, the slice resource is processed according to the compression method, and the determined storage location change threshold is set for the slice resource, and then the processed slice resource is stored in a suitable storage location.

[0094] The above technical solution determines the slice type of the slice resource through the resource information of the slice resource; determines the storage reference information of the slice resource based on the slice type, and the storage reference information includes at least one of the storage location, compression method and storage location change threshold; stores the slice resource based on the determined storage reference information. It realizes differential processing of slice resources of two slice types, namely the first slice and the content slice, in at least one of the storage location, compression method and storage location change threshold setting, such as directly storing the slice resource of the first slice in the cache device, or setting a compression method with faster decompression speed for it, or setting a smaller storage location change threshold for it to speed up the migration of the slice resource to the cache device, etc., thereby improving the storage efficiency and processing efficiency of the cache server for the slice resource of the first slice, thereby improving the response speed of the cache server to user access.

[0095] Figure 4 is a flowchart of another resource processing method provided by an embodiment of the present disclosure. The explanations of the terms that are the same or corresponding to the above technical solution are not repeated here. Figure 4 , the resource processing method comprises the following steps:

[0096] S410: Obtain resource information of the slice resources to be processed.

[0097] S420: Determine a slice type of the slice resource based on the resource information of the slice resource.

[0098] S430: Based on the shard type, determine storage reference information of the shard resource, where the storage reference information includes a storage location, a compression method, and a storage location change threshold.

[0099] In some embodiments, if the shard type is the first shard, the storage location is determined to be a SATA hard disk for the shard resource, and the compression method is determined to be no compression or a compression method with a first data compression ratio, and a first storage location change threshold with a smaller value is determined for it. If the shard type is a content shard, the storage location is determined to be a SATA hard disk for the shard resource, and the compression method is determined to be a compression method with a second data compression ratio, and a second storage location change threshold with a larger value is determined for it.

[0100] S440: Store the shard resources based on the determined storage reference information.

[0101] In this embodiment, the importance and popularity of the resource content of the slice resource are considered at the same time, which is more suitable for optimizing the processing of multiple slice resources with the same or similar popularity in the cache server.

[0102] For example, assuming that the memory and solid-state hard disk of a cache server can accommodate 10 fragmented resources, the cache server needs to store 10 entire resources, of which the heat of 1 entire resource is 5, which is divided into 10 fragmented resources, and the heat of the remaining 9 entire resources is 4. In the related art, the entire resource with a heat of 5 is stored in the memory and solid-state hard disk, and the remaining 9 entire resources are stored in the SATA hard disk. In this way, only the resources with a heat of 5 can be quickly accessed, and the access response speed of the remaining resources is relatively slow. However, by adopting the resource processing scheme of this embodiment, after a period of processing, the fragmented resources of the first fragment of 10 entire resources are stored in the memory and solid-state hard disk, and the fragmented resources of all content fragments are stored in the SATA hard disk, and the fragmented resources of the first fragment do not need to be decompressed or the decompression time is very short, which can ensure that the fragmented resources of the first fragment of all resources have a faster response speed, thereby greatly improving the response speed of the cache server to user access.

[0103] S450. Delete the slice resources based on the slice type; wherein the resource deletion priority of the content slice is higher than the resource deletion priority of the first slice.

[0104] The resource deletion priority refers to the deletion priority when deleting a slice resource. The higher the deletion priority, the earlier the corresponding slice resource will be deleted.

[0105] The storage space of the cache server is limited. When its storage space is full, some of the slice resources need to be deleted. In the disclosed embodiment, when deleting resources, different resource deletion priorities are set for the slice resources of the two slice types, namely, the first slice and the content slice, so as to achieve the purpose of deleting the slice resources of the content slice first and reducing the number of slice resources of the first slice to be deleted. In some embodiments, respective deletion parameters can be set for the two slice types, and the two deletion parameters are maintained independently so as to independently delete the slice resources of the two slice types.

[0106] In some embodiments, based on the shard type, deleting the shard resource includes: if the shard type is the first shard, determining a first resource deletion initial value for the shard resource; if the shard type is the content shard, determining a second resource deletion initial value for the shard resource; the second resource deletion initial value is less than the first resource deletion initial value; based on the first resource deletion initial value or the second resource deletion initial value, performing a resource deletion operation on the shard resource. Among them, the resource deletion initial value is an initial value set for controlling resource deletion. For example, the resource deletion initial value is an initial value of the number of accesses, the first resource deletion initial value can be set to 25 times, and the second resource deletion initial value can be set to 50 times. In specific implementation, the cache server sets the first resource deletion initial value or the second resource deletion initial value for the shard resource according to the shard type. Then, the first resource deletion initial value or the second resource deletion initial value is increased or decreased as the user visits. For example, if the user visits once, the first resource deletion initial value or the second resource deletion initial value increases by 1, and if there is no user access, the first resource deletion initial value or the second resource deletion initial value decreases by 1. If the resource deletion initial value corresponding to the shard resource drops to 0, the shard resource will be deleted. In this way, the importance and popularity of the resource content of the shard resource can be comprehensively considered, and the deletion process of the shard resources of the two shard types can be controlled at the same time, thereby improving the rationality of deleting each shard resource.

[0107] The above technical scheme, under the premise of the resource deletion strategy that the resource deletion priority of the content fragment is higher than the resource deletion priority of the first fragment, deletes the fragment resources based on the fragment type, thereby achieving the priority deletion of the fragment resources of the content fragment and reducing the number of deleted fragment resources of the first fragment, thereby reducing the re-pulling process of the fragment resources of the first fragment and further improving the processing efficiency of the fragment resources of the first fragment.

[0108] Figure 5 is a schematic diagram of a resource processing device provided by an embodiment of the present disclosure. In some embodiments, the resource processing device may be implemented as Figure 2 A cache server or a portion of a cache server in a . Figure 5 , the resource processing device 500 includes:

[0109] Resource information acquisition module 510, used to acquire resource information of the slice resources to be processed;

[0110] A fragment type determination module 520 is used to determine the fragment type of the fragment resource based on the resource information of the fragment resource, where the fragment type includes a first fragment or a content fragment, where the first fragment is a fragment containing resource summary information of the entire resource corresponding to the fragment resource, and the content fragment is a fragment containing resource content of the entire resource;

[0111] A storage reference information determination module 530 is used to determine storage reference information of a slice resource based on the slice type, where the storage reference information includes at least one of a storage location, a compression method, and a storage location change threshold, where the storage location change threshold is used to determine whether the slice resource is stored from a serial port hard disk to a fixed hard disk or a memory;

[0112] The storage module 540 is used to store the slice resources based on the storage reference information.

[0113] In some embodiments, the storage reference information determination module 530 is specifically used to:

[0114] When the storage reference information includes a storage location, if the shard type is a first shard, the storage location of the shard resource is determined to be a solid state drive or a memory;

[0115] If the shard type is content shard, the storage location of the shard resource is determined to be a serial port hard disk.

[0116] In some embodiments, the storage reference information determination module 530 is specifically used to:

[0117] When the storage reference information includes a storage location change threshold, if the shard type is a first shard, determining a first storage location change threshold for the shard resource;

[0118] If the shard type is a content shard, determining a second storage location change threshold for the shard resource;

[0119] The first storage location change threshold is smaller than the second storage location change threshold.

[0120] In some embodiments, the storage reference information determination module 530 is specifically used to:

[0121] When the storage reference information includes a compression method, if the slice type is a first slice, determining the compression method of the slice resource to be no compression or a compression method with a first data compression ratio;

[0122] If the segment type is content segment, determining that the compression method of the segment resource is a compression method having a second data compression ratio;

[0123] The second data compression ratio is greater than the first data compression ratio.

[0124] In some embodiments, the fragment type determination module 520 is specifically configured to:

[0125] If the resource information corresponds to the http header information, the fragment type of the fragment resource is determined to be the first fragment.

[0126] In some embodiments, the storage location change threshold is determined based on the resource owner priority and the resource type corresponding to the slice resource.

[0127] In some embodiments, the resource processing device 500 further includes a resource deletion module, which is used to:

[0128] Based on the shard type, shard resources are deleted. The priority of deleting resources of the content shard is higher than that of the primary shard.

[0129] In some embodiments, the resource deletion module is specifically used to:

[0130] If the shard type is the first shard, determining the first resource deletion initial value for the shard resource;

[0131] If the shard type is content shard, determining a second resource deletion initial value for the shard resource; the second resource deletion initial value is less than the first resource deletion initial value;

[0132] Based on the first resource deletion initial value or the second resource deletion initial value, a resource deletion operation is performed on the slice resource.

[0133] A resource processing device provided by an embodiment of the present disclosure implements differential processing of two types of fragment resources, namely, the first fragment and the content fragment, in at least one of the storage location, compression method, and storage location change threshold setting, thereby improving the storage efficiency and processing efficiency of the cache server for the fragment resources of the first fragment, thereby improving the response speed of the cache server to user access.

[0134] The resource processing device provided in the embodiments of the present disclosure can execute the resource processing method provided in any embodiment of the present disclosure, and has the corresponding functional modules and beneficial effects of the execution method.

[0135] It is worth noting that in the embodiment of the above-mentioned resource processing device, the various modules included are only divided according to functional logic, but are not limited to the above-mentioned division, as long as the corresponding functions can be realized; in addition, the specific names of the various functional modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this disclosure.

[0136] Figure 6 Schematic diagram of a cache server provided by an embodiment of the present disclosure. Figure 6The cache server 600 includes: one or more processors 620; a storage device 610, which is used to store one or more programs. When the one or more programs are executed by the one or more processors 620, the one or more processors 620 implement the resource processing method provided by the embodiment of the present disclosure, including:

[0137] Get resource information of the shard resources to be processed;

[0138] Based on the resource information of the slice resource, determine the slice type of the slice resource, where the slice type includes a first slice or a content slice, where the first slice is a slice containing resource summary information of the entire resource corresponding to the slice resource, and the content slice is a slice containing resource content of the entire resource;

[0139] Based on the shard type, determine storage reference information of the shard resource, the storage reference information including at least one of a storage location, a compression method, and a storage location change threshold, the storage location change threshold being used to determine whether the shard resource is stored from the serial port hard disk to the fixed hard disk or the memory;

[0140] Based on the storage reference information, the shard resources are stored.

[0141] Of course, those skilled in the art can understand that the processor 620 can also implement the technical solution of the resource processing method provided by any embodiment of the present disclosure.

[0142] Figure 6 The cache server 600 shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.

[0143] like Figure 6 As shown, cache server 600 is in the form of a general-purpose computing device. Components of cache server 600 may include, but are not limited to: one or more processors 620, storage device 610, and bus 650 connecting different system components (including storage device 610 and processor 620).

[0144] Bus 650 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processor or a local bus using any of a variety of bus architectures. Examples of these architectures include, but are not limited to, an Industry Standard Architecture (ISA) bus, a Micro Channel Architecture (MAC) bus, an Enhanced ISA bus, a Video Electronics Standards Association (VESA) local bus, and a Peripheral Component Interconnect (PCI) bus.

[0145] Cache server 600 typically includes a variety of computer system readable media. These media can be any available media that can be accessed by cache server 600, including volatile and non-volatile media, removable and non-removable media.

[0146] The storage device 610 may include a computer system readable medium in the form of a volatile memory, such as a cache memory 611 (such as a memory and / or a solid state drive) and / or a serial port hard disk (SATA hard disk) 612. The cache server 600 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, the storage system 613 may be used to read and write non-removable, non-volatile magnetic media ( Figure 6 not shown, usually called a "hard drive"). Although Figure 6 Not shown in the figure, the cache server 600 may provide a disk drive for reading and writing a removable non-volatile disk (e.g., a "floppy disk"), and an optical disk drive for reading and writing a removable non-volatile optical disk (e.g., a CD-ROM, a DVD-ROM, or other optical media). In these cases, each drive may be connected to the bus 650 via one or more data medium interfaces. The storage device 610 may include at least one program product having a set (e.g., at least one) of program modules that are configured to perform the functions of the various embodiments of the present disclosure.

[0147] A program / utility 614 having a set (at least one) of program modules 615 may be stored, for example, in a storage device 610, such program modules 615 including but not limited to an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment. The program modules 615 generally perform the functions and / or methods of any embodiment described in the present disclosure.

[0148] The cache server 600 may also communicate with one or more external devices 660 (e.g., keyboards, pointing devices, displays 670, etc.), one or more devices that enable a user to interact with the cache server 600, and / or any device that enables the cache server 600 to communicate with one or more other computing devices (e.g., a network card, a modem, etc.). Such communication may be performed via an input / output interface (I / O interface) 630. Furthermore, the cache server 600 may also communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) via a network adapter 640. Figure 6As shown, the network adapter 640 communicates with other modules of the cache server 600 via the bus 650. It should be understood that, although not shown in the figure, other hardware and / or software modules can be used in conjunction with the cache server 600, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.

[0149] The present disclosure also provides a storage medium containing computer executable instructions. When the computer executable instructions are executed by a computer processor, they are used to execute a resource processing method. The method includes:

[0150] Get resource information of the shard resources to be processed;

[0151] Based on the resource information of the slice resource, determine the slice type of the slice resource, where the slice type includes a first slice or a content slice, where the first slice is a slice containing resource summary information of the entire resource corresponding to the slice resource, and the content slice is a slice containing resource content of the entire resource;

[0152] Based on the shard type, determine storage reference information of the shard resource, the storage reference information including at least one of a storage location, a compression method, and a storage location change threshold, the storage location change threshold being used to determine whether the shard resource is stored from the serial port hard disk to the fixed hard disk or the memory;

[0153] Based on the storage reference information, the shard resources are stored.

[0154] Of course, the computer executable instructions of a storage medium including computer executable instructions provided by an embodiment of the present disclosure are not limited to the above method operations, and can also execute related operations in the resource processing method provided by any embodiment of the present disclosure.

[0155] The computer storage medium of the embodiment of the present disclosure may adopt any combination of one or more computer-readable media. The computer-readable medium may be a computer-readable signal medium or a computer-readable storage medium. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples (non-exhaustive list) of computer-readable storage media include: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this document, a computer-readable storage medium may be any tangible medium containing or storing a program, which may be used by an instruction execution system, device or device or used in combination with it.

[0156] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, which carry computer-readable program code. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.

[0157] Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.

[0158] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, C++, and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider).

[0159] It should be noted that the terms used in the present disclosure are only for describing specific embodiments, rather than limiting the scope of the present application. As shown in the present disclosure specification and claims, unless the context clearly indicates an exception, the words "one", "a", "a kind of" and / or "the" do not specifically refer to the singular, but may also include the plural. The term "and / or" includes any and all combinations of one or more related listed items. Relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply that there is any such actual relationship or order between these entities or operations. The term "include", "comprise" or any other variant thereof is intended to cover non-exclusive inclusion, so that the process, method, article or equipment including a series of elements includes not only those elements, but also includes other elements that are not clearly listed, or also includes elements inherent to such process, method, article or equipment. In the absence of more restrictions, the elements defined by the sentence "including one..." do not exclude the existence of other identical elements in the process, method, article or equipment including the elements. The terms "device" and / or "module" are a method for distinguishing different parts, elements, parts or components at different levels in a sequential arrangement. However, these terms may be replaced by other expressions if the other expressions can achieve the same purpose.

[0160] The above description is only a specific embodiment of the present disclosure, so that those skilled in the art can understand or implement the present disclosure. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present disclosure. Therefore, the present disclosure will not be limited to the embodiments described herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A resource processing method, It is characterized in that include: Get resource information of the shard resources to be processed; Based on the resource information of the slice resource, determine the slice type of the slice resource, the slice type includes a first slice or a content slice, the first slice is a slice containing resource summary information of the entire resource corresponding to the slice resource, and the content slice is a slice containing resource content of the entire resource; Based on the shard type, determine storage reference information of the shard resource, the storage reference information including storage location, compression mode and storage location change threshold, the storage location change threshold is used to determine whether the shard resource is stored from the serial port hard disk to the fixed hard disk or the memory; Based on the storage reference information, storing the slice resource; When the storage reference information includes the storage location change threshold, the determining the storage reference information of the slice resource based on the slice type includes: If the shard type is the first shard, determining a first storage location change threshold for the shard resource; If the slice type is the content slice, determining a second storage location change threshold for the slice resource; Wherein, the first storage location change threshold is less than the second storage location change threshold; When the storage reference information includes the compression mode, the determining the storage reference information of the slice resource based on the slice type includes: If the slice type is the first slice, determining that the compression method of the slice resource is no compression or a compression method with a first data compression ratio; If the segment type is the content segment, determining that the compression method of the segment resource is a compression method with a second data compression ratio; wherein the second data compression ratio is greater than the first data compression ratio; The storage location change threshold is determined based on the resource owner priority and the resource type corresponding to the slice resource.

2. The method according to claim 1, It is characterized in that When the storage reference information includes the storage location, the determining the storage reference information of the slice resource based on the slice type includes: If the shard type is the first shard, determining that the storage location of the shard resource is a solid state drive or a memory; If the segment type is the content segment, it is determined that the storage location of the segment resource is a serial port hard disk.

3. The method according to claim 1, It is characterized in that The determining the slice type of the slice resource based on the resource information of the slice resource comprises: If the resource information corresponds to the http header information, it is determined that the fragment type of the fragment resource is the first fragment.

4. The method according to claim 1, It is characterized in that The method further comprises: Based on the segment type, the segment resources are deleted, and the resource deletion priority of the content segment is higher than the resource deletion priority of the first segment.

5. The method according to claim 4, It is characterized in that The deleting the slice resource based on the slice type includes: If the slice type is the first slice, determining a first resource deletion initial value for the slice resource; If the slice type is the content slice, determining a second resource deletion initial value for the slice resource; the second resource deletion initial value is less than the first resource deletion initial value; Based on the first resource deletion initial value or the second resource deletion initial value, a resource deletion operation is performed on the slice resource.

6. A resource processing device, It is characterized in that include: A resource information acquisition module is used to obtain resource information of the slice resources to be processed; A fragment type determination module, configured to determine the fragment type of the fragment resource based on the resource information of the fragment resource, wherein the fragment type includes a first fragment or a content fragment, wherein the first fragment is a fragment containing resource summary information of the entire resource corresponding to the fragment resource, and the content fragment is a fragment containing resource content of the entire resource; A storage reference information determination module, used to determine the storage reference information of the slice resource based on the slice type, the storage reference information including a storage location, a compression method and a storage location change threshold, the storage location change threshold is used to determine whether the slice resource is stored from the serial port hard disk to the fixed hard disk or the memory; A storage module, used for storing the slice resources based on the storage reference information; The storage reference information determination module is specifically used for: When the storage reference information includes a storage location change threshold, if the shard type is a first shard, determining a first storage location change threshold for the shard resource; If the shard type is a content shard, determining a second storage location change threshold for the shard resource; wherein the first storage location change threshold is less than the second storage location change threshold; The storage reference information determination module is specifically used for: When the storage reference information includes a compression method, if the slice type is a first slice, determining the compression method of the slice resource to be no compression or a compression method with a first data compression ratio; If the segment type is content segment, determining that the compression method of the segment resource is a compression method having a second data compression ratio; wherein the second data compression ratio is greater than the first data compression ratio; The storage location change threshold is determined based on the resource owner priority and the resource type corresponding to the slice resource.

7. A computer-readable storage medium having a computer program stored thereon, It is characterized in that When the program is executed by a processor, the resource processing method as described in any one of claims 1 to 5 is implemented.

8. A cache server, It is characterized in that The cache server comprises: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the resource processing method as described in any one of claims 1-5.

Citation Information

Patent Citations

  • Method and device for optimizing P2P traffic

    CN101854287A

  • Content service implementation method and apparatus, and CDN (Content Delivery Network) node

    CN108063769A