Storage resource allocation method, device, electronic device and readable storage medium
By obtaining the historical storage and access data of network nodes and reasonably allocating storage resources, the problem of waste and unreasonable allocation of storage resources in traditional solutions is solved, and the utilization efficiency and access hit rate of storage resources are improved.
Patent Information
- Application Number
- CN202010431742.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-05-20
- Publication Date
- 2025-01-03
- Estimated Expiration
- 2040-05-20
AI Technical Summary
The traditional storage resource allocation scheme determines the storage resource quota based on the number of accesses of the domain name, resulting in the problem of waste and unreasonable allocation of storage resources using resources with few historical accesses.
By obtaining a set of data resources that a designated network node may have stored in the first preset time period and data resources requested in the second preset time period, determining the intersection and allocating storage resources according to the number of requests, reasonably allocating storage resource quotas .
Improve the rationality and access hit rate of storage resources, ensure that hotspot resources with high access probability are stored guarantees, and reduce waste of storage resources.
Smart Images

Figure CN113296925B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer application technology, and in particular to a storage resource allocation method, device, electronic device and readable storage medium. Background Art
[0002] With the development of Internet technology, in order to reduce customer access delays and alleviate network congestion, data resources are usually stored on network nodes. In the prior art, the traditional storage resource allocation scheme determines the storage resource quota based on the amount of resources accessed by a domain name over a period of time. However, since some resources that have been accessed in the past will not be accessed again in the future, and different domain names require different storage spaces, the traditional technical scheme is prone to waste of storage resources and unreasonable storage resource allocation. Summary of the invention
[0003] In order to solve the problems in the related art, the embodiments of the present disclosure provide a storage resource allocation method, device, electronic device and readable storage medium.
[0004] In a first aspect, an embodiment of the present disclosure provides a storage resource allocation method.
[0005] Specifically, the storage resource allocation method includes:
[0006] Acquire a first set of data resources of a specified object that is stored or may have been stored by a specified network node within a first preset time period;
[0007] Acquire a second set of data resources of the specified object requested within a second preset time period;
[0008] determining a third set according to the intersection of the first set and the second set;
[0009] According to the number of times each data resource in the third set is requested within the second preset time period, the storage resource of the designated network node is allocated to the designated object.
[0010] In combination with the first aspect, in a first implementation manner of the first aspect of the present disclosure, the designated network node represents a class of network nodes having the same attributes; and / or the designated network node represents any of the following nodes: a network node in a content distribution network; a network node scheduled by a load balancing server; a network node scheduled by a task processing scheduling server; a network node scheduled by a storage resource scheduling server.
[0011] In combination with the first aspect, in a second implementation manner of the first aspect of the present disclosure, the designated object is any one of the following: a designated domain name, a designated service, and a designated server.
[0012] In combination with the first aspect, in a third implementation method of the first aspect of the present disclosure, obtaining a first set of data resources of a specified object that may have been stored by a specified network node within a first preset time period includes: obtaining request data for the data resources of the specified object within the first preset time period; determining the first set based on the probability that the specified network node receives a request for the data resources of the specified object and the request data.
[0013] In combination with the third implementation manner of the first aspect, in the fourth implementation manner of the first aspect of the present disclosure, the method further includes: determining the probability based on the ratio of the network bandwidth allocated by the designated network node to the designated object to the total bandwidth of the designated object.
[0014] In combination with the third implementation method of the first aspect, in the fifth implementation method of the first aspect of the present disclosure, obtaining request data for data resources of the specified object within the first preset time period includes: determining the request data for data resources of the specified object within the first preset time period based on request data for data resources of the specified object received by each network node belonging to the same level as the specified network node within the first preset time period.
[0015] In combination with the first aspect, in a sixth implementation method of the first aspect of the present disclosure, obtaining a second set of data resources of the specified object requested within a second preset time period includes: determining the second set based on request data for the data resources of the specified object received by each network node belonging to the same level as the specified network node within the second preset time period.
[0016] In combination with the first aspect, in the seventh implementation method of the first aspect of the present disclosure, the storage resources of the designated network node are allocated to the designated object according to the number of times each data resource in the third set is requested within the second preset time period, including: according to the number of times each data resource in the third set is requested within the second preset time period, selecting N data resources with the largest number of requests, so that within the second preset time period, the ratio of the total number of times the N data resources are requested to the total number of times each data resource in the third set is requested meets a preset condition; and allocating the storage resources of the designated network node to the designated object according to the size of the N data resources.
[0017] In combination with the seventh implementation method of the first aspect, in the eighth implementation method of the first aspect of the present disclosure, the ratio of the total number of requests for the N data resources to the total number of requests for each data resource in the third set satisfies a preset condition, including making the ratio not less than a preset hit rate for requesting the data resource of the specified object from the specified node.
[0018] In combination with the eighth implementation method of the first aspect, in the ninth implementation method of the first aspect of the present disclosure, the preset hit rate is determined based on a combination of at least one or more of the following: the importance of the service related to the specified object; the level selection of the service related to the specified object; the storage resource usage of the network node represented by the specified network node.
[0019] In combination with the first aspect, in the tenth implementation manner of the first aspect of the present disclosure, the method further includes: determining the storage resources allocated to the designated object by the network node represented by the designated node based on the storage resources allocated to the designated object by the designated node.
[0020] In combination with the first aspect, in the eleventh implementation manner of the first aspect of the present disclosure, the first preset time period is a first preset time period from a specified time point forward; and / or the second preset time period is a second preset time period from the specified time point backward.
[0021] In a second aspect, an embodiment of the present disclosure provides a storage resource allocation device.
[0022] Specifically, the storage resource allocation device includes:
[0023] A first acquisition module is configured to acquire a first set of data resources of a specified object that is stored or may have been stored by a specified network node within a first preset time period;
[0024] A second acquisition module is configured to acquire a second set of data resources of the specified object requested within a second preset time period;
[0025] A first determining module, configured to determine a third set according to the intersection of the first set and the second set;
[0026] The allocation module is configured to allocate the storage resources of the designated network node to the designated object according to the number of times each data resource in the third set is requested within the second preset time period.
[0027] In combination with the second aspect, in a first implementation manner of the second aspect of the present disclosure, the designated network node represents a class of network nodes having the same attributes; and / or the designated network node represents any of the following nodes: a network node in a content distribution network; a network node scheduled by a load balancing server; a network node scheduled by a task processing scheduling server; a network node scheduled by a storage resource scheduling server.
[0028] In combination with the second aspect, in a second implementation manner of the second aspect of the present disclosure, the designated object is any one of the following: a designated domain name, a designated service, and a designated server.
[0029] In combination with the second aspect, in a third implementation method of the second aspect of the present disclosure, the first acquisition module includes: an acquisition sub-module, configured to acquire request data for data resources of the specified object within the first preset time period; a determination sub-module, configured to determine the first set based on the probability that the specified network node receives a request for data resources of the specified object and the request data.
[0030] In combination with the third implementation method of the second aspect, in the fourth implementation method of the second aspect of the present disclosure, the device also includes: determining the part of the probability based on the ratio of the network bandwidth allocated to the designated object by the designated network node to the total bandwidth of the designated object.
[0031] In combination with the third implementation method of the second aspect, in the fifth implementation method of the second aspect of the present disclosure, the first acquisition submodule is configured to: determine the request data for the data resources of the specified object within the first preset time period based on the request data for the data resources of the specified object received by each network node belonging to the same level as the specified network node within the first preset time period.
[0032] In combination with the second aspect, in a sixth implementation method of the second aspect of the present disclosure, the second acquisition module is configured to determine the second set based on request data for data resources of the specified object received by each network node belonging to the same level as the specified network node within the second preset time period.
[0033] In combination with the second aspect, in the seventh implementation method of the second aspect of the present disclosure, the part of allocating the storage resources of the designated network node to the designated object according to the number of times each data resource in the third set is requested within the second preset time period is configured as follows: according to the number of times each data resource in the third set is requested within the second preset time period, selecting the N data resources with the most requests, so that within the second preset time period, the ratio of the total number of times the N data resources are requested to the total number of times each data resource in the third set is requested meets a preset condition; and allocating the storage resources of the designated network node to the designated object according to the size of the N data resources.
[0034] In combination with the seventh implementation method of the second aspect, in the eighth implementation method of the second aspect of the present disclosure, the ratio of the total number of requests for the N data resources to the total number of requests for each data resource in the third set satisfies a preset condition, including making the ratio not less than a preset hit rate for requesting the data resource of the specified object from the specified node.
[0035] In combination with the eighth implementation method of the second aspect, in the ninth implementation method of the second aspect of the present disclosure, the preset hit rate is determined based on a combination of at least one or more of the following: the importance of the service related to the specified object; the level selection of the service related to the specified object; the storage resource usage of the network node represented by the specified network node.
[0036] In combination with the second aspect, in the tenth implementation manner of the second aspect of the present disclosure, the device also includes: a second determination module, configured to determine the storage resources allocated by the network node represented by the designated node to the designated object based on the storage resources allocated by the designated node to the designated object.
[0037] In combination with the second aspect, in an eleventh implementation manner of the second aspect of the present disclosure, the first preset time period is a first preset time period from a specified time point forward; and / or the second preset time period is a second preset time period from the specified time point backward.
[0038] In a third aspect, an embodiment of the present disclosure provides an electronic device, including a memory and a processor, wherein the memory is used to store one or more computer instructions, wherein the one or more computer instructions are executed by the processor to implement the following method steps:
[0039] Acquire a first set of data resources of a specified object that is stored or may have been stored by a specified network node within a first preset time period;
[0040] Acquire a second set of data resources of the specified object requested within a second preset time period;
[0041] determining a third set according to the intersection of the first set and the second set;
[0042] According to the number of times each data resource in the third set is requested within the second preset time period, the storage resource of the designated network node is allocated to the designated object.
[0043] In combination with the third aspect, in a first implementation manner of the third aspect of the present disclosure, the designated network node represents a class of network nodes having the same attributes; and / or the designated network node represents any of the following nodes: a network node in a content distribution network; a network node scheduled by a load balancing server; a network node scheduled by a task processing scheduling server; a network node scheduled by a storage resource scheduling server.
[0044] In combination with the third aspect, in a second implementation manner of the third aspect of the present disclosure, the designated object is any one of the following: a designated domain name, a designated service, or a designated server.
[0045] In combination with the third aspect, in a third implementation method of the third aspect of the present disclosure, obtaining a first set of data resources of a specified object that may have been stored by a specified network node within a first preset time period includes: obtaining request data for the data resources of the specified object within the first preset time period; determining the first set based on the probability that the specified network node receives a request for the data resources of the specified object and the request data.
[0046] In combination with the third implementation manner of the third aspect, in the fourth implementation manner of the third aspect of the present disclosure, the method further includes: determining the probability based on the ratio of the network bandwidth allocated to the designated object by the designated network node to the total bandwidth of the designated object.
[0047] In combination with the third implementation method of the third aspect, in the fifth implementation method of the third aspect of the present disclosure, obtaining request data for the data resources of the specified object within the first preset time period includes: determining the request data for the data resources of the specified object within the first preset time period based on the request data for the data resources of the specified object received by each network node belonging to the same level as the specified network node within the first preset time period.
[0048] In combination with the third aspect, in a sixth implementation method of the third aspect of the present disclosure, the obtaining of a second set of data resources of the specified object requested within a second preset time period includes: determining the second set based on request data for the data resources of the specified object received by each network node belonging to the same level as the specified network node within the second preset time period.
[0049] In combination with the third aspect, in the seventh implementation method of the third aspect of the present disclosure, the storage resources of the designated network node are allocated to the designated object according to the number of times each data resource in the third set is requested within the second preset time period, including: according to the number of times each data resource in the third set is requested within the second preset time period, selecting N data resources with the largest number of requests, so that within the second preset time period, the ratio of the total number of times the N data resources are requested to the total number of times each data resource in the third set is requested meets a preset condition; and allocating the storage resources of the designated network node to the designated object according to the size of the N data resources.
[0050] In combination with the seventh implementation method of the third aspect, in the eighth implementation method of the third aspect of the present disclosure, the ratio of the total number of requests for the N data resources to the total number of requests for each data resource in the third set satisfies a preset condition, including making the ratio not less than a preset hit rate of requesting the data resource of the specified object from the specified node.
[0051] In combination with the eighth implementation method of the third aspect, in the ninth implementation method of the third aspect of the present disclosure, the preset hit rate is determined based on a combination of at least one or more of the following: the importance of the service related to the specified object; the level selection of the service related to the specified object; the storage resource usage of the network node represented by the specified network node.
[0052] In combination with the third aspect, in the tenth implementation manner of the third aspect of the present disclosure, the method further includes: determining the storage resources allocated to the designated object by the network node represented by the designated node based on the storage resources allocated to the designated object by the designated node.
[0053] In combination with the third aspect, in the eleventh implementation manner of the third aspect of the present disclosure, the first preset time period is a first preset time period from a specified time point forward; and / or the second preset time period is a second preset time period from the specified time point backward.
[0054] In a fourth aspect, a readable storage medium is provided in an embodiment of the present disclosure, on which computer instructions are stored. When the computer instructions are executed by a processor, the method described in any one of the first aspect and the first to eleventh implementations of the first aspect is implemented.
[0055] The technical solution provided by the embodiments of the present disclosure may have the following beneficial effects:
[0056] This technical solution allocates storage resources on network nodes to specified objects (e.g., domain names) based on the storage situation and estimated access situation of the resources on network nodes. It can reasonably allocate storage resource quotas on network nodes, ensure storage for hot resources with a high probability of being accessed again, improve the rationality of storage resource use, and increase the hit rate of resource access on network nodes.
[0057] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0058] Other features, objectives and advantages of the present disclosure will become more apparent through the following detailed description of non-limiting embodiments in conjunction with the accompanying drawings. In the accompanying drawings:
[0059] Figure 1 A flowchart showing a storage resource allocation method according to an embodiment of the present disclosure is shown;
[0060] Figure 2 A flowchart showing step S101 of the storage resource allocation method according to an embodiment of the present disclosure;
[0061] Figure 3 A data resource schematic diagram showing a storage resource allocation method according to an embodiment of the present disclosure;
[0062] Figure 4 A schematic diagram showing a preset time period of a storage resource allocation method according to an embodiment of the present disclosure;
[0063] Figure 5 A structural block diagram of a storage resource allocation device according to an embodiment of the present disclosure is shown;
[0064] Figure 6 A structural block diagram of a first acquisition module of a storage resource allocation device according to an embodiment of the present disclosure is shown;
[0065] Figure 7 A structural block diagram of an electronic device according to an embodiment of the present disclosure is shown;
[0066] Figure 8 A schematic diagram showing the structure of a computer system suitable for implementing the storage resource allocation method according to an embodiment of the present disclosure is shown. DETAILED DESCRIPTION
[0067] Hereinafter, exemplary embodiments of the present disclosure will be described in detail with reference to the accompanying drawings so that those skilled in the art can easily implement them. In addition, for the sake of clarity, parts not related to the description of the exemplary embodiments are omitted in the accompanying drawings.
[0068] In the present disclosure, it should be understood that terms such as "include" or "have" are intended to indicate the presence of features, numbers, steps, behaviors, components, parts, or a combination thereof disclosed in the present specification, and are not intended to exclude the possibility that one or more other features, numbers, steps, behaviors, components, parts, or a combination thereof exist or are added.
[0069] It should also be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present disclosure may be combined with each other. The present disclosure will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.
[0070] In the prior art, the traditional storage resource allocation scheme determines the storage resource quota based on the amount of resources accessed by a domain name over a period of time. However, since some resources that have been accessed historically will not be accessed again in the future and different domain names require different storage spaces, the traditional technical scheme is prone to waste of storage resources and unreasonable storage resource allocation.
[0071] Taking the above-mentioned defects into consideration, the technical solution provided by the embodiments of the present disclosure is achieved by obtaining a first set of data resources of a specified object that may have been stored by a specified network node within a first preset time period; obtaining a second set of data resources of the specified object that are requested within a second preset time period; determining a third set based on the intersection of the first set and the second set; and allocating storage resources of the specified network node to the specified object based on the number of times each data resource in the third set is requested within the second preset time period.
[0072] This technical solution allocates storage resources on network nodes to specified objects (e.g., domain names) based on the storage situation and estimated access situation of the resources on network nodes. It can reasonably allocate storage resource quotas on network nodes, ensure storage for hot resources with a high probability of being accessed again, improve the rationality of storage resource use, and increase the hit rate of resource access on network nodes.
[0073] Figure 1 FIG. 1 is a flow chart showing a method for allocating storage resources according to an embodiment of the present disclosure. Figure 1 As shown, the storage resource allocation method includes the following steps S101-S104:
[0074] In step S101, a first set of data resources of a specified object stored or possibly stored by a specified network node within a first preset time period is obtained;
[0075] In step S102, a second set of data resources of the specified object requested within a second preset time period is obtained;
[0076] In step S103, a third set is determined according to the intersection of the first set and the second set;
[0077] In step S104, storage resources of the designated network node are allocated to the designated object according to the number of times each data resource in the third set is requested within the second preset time period.
[0078] According to an embodiment of the present disclosure, the designated network node represents a class of network nodes having the same attributes; and / or the designated network node represents any of the following nodes: a network node in a content distribution network; a network node scheduled by a load balancing server; a network node scheduled by a task processing scheduling server; a network node scheduled by a storage resource scheduling server.
[0079] For a specified object (for example, a specified domain name), the bandwidth allocated to it by different network nodes is different. For example, the first type of network node is allocated 10G bandwidth, the second type of network node is allocated 20G bandwidth, and the third type of network node is allocated 30G bandwidth. The specified network node can represent a network node with 10G bandwidth, or a network node with 20G bandwidth, or a network node with 30G bandwidth.
[0080] The designated node may also represent a CDN (Content Delivery Network) network node, which is a cache server used by the content delivery network and distributed in a region or network where users are relatively concentrated. It can cache resources from the source server and send the cached resources to the user in response to the user's request. When the resource requested by the user is not cached on the CDN node, the CDN node requests the resource from the source server, caches the resource from the source server and forwards it to the client.
[0081] In addition to the CDN network nodes mentioned above, the designated node may also represent a network node scheduled by a load balancing server, or a network node scheduled by a task processing scheduling server, or a network node scheduled by a storage resource scheduling server.
[0082] According to the embodiments of the present disclosure, in application scenarios such as load balancing, task processing scheduling, and storage resource scheduling, the problem of allocating storage resources for specified objects on different network nodes may be involved. In any of the above application scenarios, a specified network node can be used to represent a class of network nodes with the same attributes, thereby applying the technical solution according to the embodiments of the present disclosure. The technical solution provided by the embodiments of the present disclosure is used in the application scenario of load balancing, and can reasonably allocate storage resources for network nodes scheduled by a load balancing server; it is used in the application scenario of task processing scheduling, and can reasonably allocate storage resources for network nodes scheduled by a task processing scheduling server; it is used in the application scenario of storage resource scheduling, and can reasonably allocate storage resources for network nodes scheduled by a storage resource scheduling server.
[0083] According to an embodiment of the present disclosure, the designated node may also be a real network node.
[0084] According to an embodiment of the present disclosure, storage resources are allocated to a class of nodes represented by the designated node according to the storage resources allocated to the designated node. For example, if X bytes of storage resources are allocated to the designated node representing "a network node that allocates 10G bandwidth to a certain domain name", then X bytes of storage resources are also allocated to the "network node that allocates 10G bandwidth to a certain domain name" accordingly.
[0085] According to an embodiment of the present disclosure, the designated object is any one of the following: a designated domain name, a designated service, and a designated server. According to the different bandwidths allocated to different designated objects by the designated network node, the magnitude of the designated object in the designated network node is different. For example, when the designated object is a designated domain name, the designated network node allocates 10G bandwidth to domain name A and 20G bandwidth to domain name B, then the magnitude of domain name B in the designated node is greater than the magnitude of domain name A. In addition, the total bandwidth of the designated object is the sum of the bandwidths allocated to the designated object by all network nodes. For example, the designated object is a designated domain name, and there are two network nodes that allocate bandwidth to it. The first network node allocates 10G bandwidth to the designated domain name, and the second network node allocates 20G bandwidth to the designated domain name. Then the total bandwidth of the designated domain name is 30G.
[0086] According to an embodiment of the present disclosure, the first preset time period is a first preset time period from a specified time point forward; and / or the second preset time period is a second preset time period from the specified time point backward. The specified time point is a moment before the current moment, for example, the specified time point is 12:00 5 days ago, in which case the first preset time period is a period of time before 12:00 5 days ago, and the second preset time period is a period of time after 12:00 5 days ago.
[0087] According to an embodiment of the present disclosure, the network access and storage conditions in the future are predicted by the network access and storage conditions at a specified time point. The first preset time period before the specified time point is used to simulate the conditions before the time point to be predicted, and the second preset time period after the specified time point is used to simulate the conditions after the time point to be predicted.
[0088] According to an embodiment of the present disclosure, the data resource may include any one or more of the following: video data, audio data, text data, image data, web page data, etc. According to an embodiment of the present disclosure, a set of data resources may include, for example, {video data A, video data B, audio data C, text data D, ...}.
[0089] According to an embodiment of the present disclosure, when the designated node is a real network node, a first set of data resources of a designated object stored by the designated node within a first preset time period can be obtained in step S101 according to the log of the designated node.
[0090] According to an embodiment of the present disclosure, when the designated node is a virtual node representing a real network node, step S101 obtains a first set of data resources that may have been stored by a type of real network node represented by the designated node within a first preset time period.
[0091] According to an embodiment of the present disclosure, a third set is determined according to the intersection of the first set and the second set, and the third set is a set of data resources in the first set that are requested within a second preset time period. The set is used to simulate data resources that will be requested in the future among data resources cached by a specified network node at a time point to be predicted.
[0092] Ideally, the designated network node caches all data resources in the third set so that all data resources requested in the future are stored on the designated network node. However, in order to more efficiently utilize storage resources, only data resources that are requested the most times can be cached to achieve reasonable utilization of storage resources.
[0093] According to the embodiments of the present disclosure, storage resources on a network node are allocated to a specified object (e.g., a domain name) based on the storage situation and estimated access situation of the resources of the specified object on the network node. This allows for reasonable allocation of storage resource quotas on the network node, so that hotspot resources with a high probability of being requested are guaranteed storage, thereby improving the rationality of storage resource usage and increasing the hit rate of data resource access requests on the network node.
[0094] Figure 2 FIG. 1 is a flow chart showing step S101 of the storage resource allocation method according to an embodiment of the present disclosure. Figure 2As shown, the step of obtaining a first set of data resources of a specified object that may have been stored by a specified network node within a first preset time period includes the following steps S201-S202:
[0095] In step S201, request data for the data resource of the specified object within the first preset time period is obtained;
[0096] In step S202, the first set is determined according to the probability that the designated network node receives a request for a data resource of the designated object and the request data.
[0097] According to an embodiment of the present disclosure, the probability is determined according to the ratio of the network bandwidth allocated to the designated object by the designated network node to the total bandwidth of the designated object. In order to obtain the first set, first obtain the request data of all requests for the data resources of the designated object received by the network where the designated node is located within the first preset time period; then calculate the data resources that the designated node may store according to the probability that the designated network node receives the request for the data resources of the designated object and the request data. For example, if the total bandwidth of the designated object is 100G, and the bandwidth allocated to the object by the designated node is 10G, then each access request has a probability of 1 / 10 being routed to the designated node, and the access request that will be routed to the designated node is calculated according to this probability and all access requests for the resources of the designated object received by the network where the designated node is located within the first preset time period. After the network node receives the access request, if the requested network data is not stored, it will go back to the source to read the network data and then store it to the node, so if the network node receives the request, it is considered that it will store the corresponding data, so the data resources that the designated network node may store can be determined through the above steps.
[0098] According to an embodiment of the present disclosure, obtaining request data for the data resources of the designated object within the first preset time period includes: determining the request data for the data resources of the designated object within the first preset time period according to the request data for the data resources of the designated object received by each network node belonging to the same level as the designated network node within the first preset time period. For example, assuming that the designated object is a designated domain name, and the designated network node is a first-level node in the CDN network, then the requests for the data resources of the designated domain name received by all first-level nodes in the CDN network within the first preset time period are counted, which is the request data for the data resources of the domain name within the first preset time period. For another example, assuming that the designated object is a designated domain name, and the designated network node is a second-level node in the CDN network, then the requests for the data resources of the designated domain name received by all second-level nodes in the CDN network within the first preset time period are counted, which is the request data for the data resources of the domain name within the first preset time period. In a CDN network, a secondary node is the parent node of a primary node. When a primary node does not store the data resource requested by a client, the primary node can request the data resource from the secondary node. If the secondary node stores the data resource, the secondary node can return the data resource to the primary node. If the secondary node does not store the data resource either, the secondary node can request the data resource from its parent node or from the data source server. After obtaining the data resource, it will be cached locally and sent to the primary node.
[0099] According to an embodiment of the present disclosure, when determining the second set, if the designated network node is a primary node, then the requests for data resources of the designated object received by all primary nodes in the network are counted; if the designated network node is a secondary node, then the requests for data resources of the designated object received by all secondary nodes in the network are counted to avoid duplicate statistics.
[0100] According to an embodiment of the present disclosure, the obtaining of a second set of data resources of the specified object requested within a second preset time period includes: determining the second set based on request data for the data resources of the specified object received by each network node belonging to the same level as the specified network node within the second preset time period.
[0101] By determining the second set through the above scheme, all request data for the data resources of the specified object in the network where the specified node is located within the second preset time period can be obtained. For example, assuming that the specified object is a specified domain name, the specified node is a first-level node of the CDN network, and the CDN has a total of ten first-level nodes for distributing the data resources of the specified domain name, then all requests for the data resources of the specified domain name received by these ten first-level nodes within the second preset time period are counted, and the set of data resources corresponding to all the requests is taken as the second set. For another example, assuming that the specified object is a specified domain name, the specified node is a second-level node of the CDN network, and the CDN has a total of three second-level nodes for distributing the data resources of the specified domain name, then all requests for the data resources of the specified domain name received by these three second-level nodes within the second preset time period are counted, and the set of data resources corresponding to all the requests is taken as the second set.
[0102] According to an embodiment of the present disclosure, allocating the storage resources of the designated network node to the designated object according to the number of times each data resource in the third set is requested within the second preset time period includes: selecting N data resources with the largest number of requests according to the number of times each data resource in the third set is requested within the second preset time period, so that within the second preset time period, the ratio of the total number of times the N data resources are requested to the total number of times each data resource in the third set is requested meets a preset condition; allocating the storage resources of the designated network node to the designated object according to the size of the N data resources.
[0103] According to an embodiment of the present disclosure, the number of times each data resource in the third set is requested within the second preset time period refers to the total number of requests for each data resource received by all network nodes in the network where the designated node is located and which are network nodes of the same level as the designated node. For example, assuming that the designated network node is a first-level node of a CDN network, and the CDN network has ten first-level nodes for distributing data resources from a designated object, the number of times each data resource in the third set is requested within the second preset time period refers to the sum of requests for the data resource of the designated object received by these ten first-level nodes within the second preset time period for each data resource in the third set.
[0104] According to an embodiment of the present disclosure, the ratio of the total number of times the N data resources are requested to the total number of times each data resource in the third set is requested satisfies a preset condition, including making the ratio not less than a preset hit rate for requesting the data resource of the specified object from the specified node. The hit rate is the probability that the resource requested by the specified object is exactly the resource actually stored by the specified network node, and this hit rate directly determines the amount of historical resource return to the source. In the present application, historical resource return to the source means that when the resource accessed by the specified object is not stored on the specified node or has been stored but has been eliminated by the cache when accessed, the network data is re-read. If the hit rate increases, the amount of historical resource return to the source decreases, which means that most of the resources accessed again are successfully stored.
[0105] According to an embodiment of the present disclosure, the preset hit rate is determined based on a combination of at least one or more of the following: the importance of the service related to the specified object; the level selection of the service related to the specified object; and the storage resource usage of the network node represented by the specified network node.
[0106] For example, when the importance of the service related to the designated object is high, a higher preset hit rate may be set; conversely, when the importance of the service related to the designated object is low, a lower preset hit rate may be set.
[0107] For example, the level selection of the service related to the designated object may be a user's fee selection. For example, when the user selects a service related to the designated object with a higher fee, a higher preset hit rate may be set, whereas when the user selects a service related to the designated object with a lower fee, a lower preset hit rate may be set.
[0108] For example, when the storage resources of the network node represented by the designated network node are relatively abundant, a higher preset hit rate may be set; conversely, when the storage resources of the network node represented by the designated network node are not abundant, a lower preset hit rate may be set.
[0109] According to an embodiment of the present disclosure, the preset hit rate may be set by manual adjustment or in an adaptive adjustment manner.
[0110] According to an embodiment of the present disclosure, the method further includes determining the storage resources allocated to the designated object by the network node represented by the designated node based on the storage resources allocated to the designated object by the designated node.
[0111] When allocating storage resources, first obtain the number of times the data resources in the third set are requested within the second preset time period, and then take the N data resources with the most requests, so that the ratio of the total number of times these N data resources are requested to the total number of times all data resources in the third set are requested is greater than or equal to the preset hit rate. The N data resources with the most requests are the data resources that the network node represented by the designated node needs to store for the designated object.
[0112] According to an embodiment of the present disclosure, after the N data resources are determined, storage resources on the designated node may be allocated to the designated object according to the size of the N data resources.
[0113] Figure 3 A data resource schematic diagram of a storage resource allocation method according to an embodiment of the present disclosure is shown.
[0114] Figure 4 A schematic diagram showing a preset time period of a storage resource allocation method according to an embodiment of the present disclosure.
[0115] like Figure 3 As shown, ellipse A represents a first set of data resources of a specified object stored or possibly stored by a specified network node within a first preset time period, ellipse B represents a second set of data resources of a specified object requested within a second preset time period, and the area C where ellipse A and ellipse B overlap is a third set, i.e., the intersection of the first set and the second set. According to an embodiment of the present disclosure, in the case where the specified object is a virtual node representing a class of nodes, firstly, request data for data resources of the specified object within the first preset time period is obtained, and then the probability that the specified network node receives a request for data resources of the specified object is calculated based on the total bandwidth of the specified object and the bandwidth allocated to the object by the specified node, thereby determining the data resources that the specified node may store within the first preset time period as the first set. Alternatively, in the case where the specified network node is a real node, the actual storage situation of the data resources of the specified object by the specified network node within the first preset time period is obtained, and accordingly, the first set is determined to be a set of data resources of the specified object stored on the specified network node within the first preset time period. Then, request data for data resources of the specified object in the entire network within the second preset time period is obtained as the second set. A third set is obtained by taking the intersection of the first set and the second set, and the third set represents the data resources in the second set that are requested within a second preset time period.
[0116] Figure 3The shaded portion of the middle area C shows the storage resources allocated by the network node to the designated object when the preset hit rate of the designated node requesting the data resource of the designated object is 99%. When allocating storage resources, first obtain the number of times the data resources in the third set are requested within the second preset time period, and then take the N data resources with the most requests, so that the ratio of the total number of times these N data resources are requested to the total number of times all data resources in the third set are requested is greater than or equal to the preset hit rate (for example, 99%). At this time, the N data resources with the most requests are the storage resources allocated by the network node represented by the designated node for the designated object.
[0117] Through the technical solution of the embodiments of the present disclosure, the storage resources required by a specified object on a node are accurately calculated, so that most hot spot resources can be guaranteed to have storage, while reducing the waste of storage resources and improving the rationality of storage resource use.
[0118] Figure 5 FIG. 1 is a block diagram showing a storage resource allocation device according to an embodiment of the present disclosure. The device can be implemented as part or all of an electronic device through software, hardware, or a combination of both. Figure 5 As shown, the apparatus 500 for a terminal device includes a first acquisition module 510 , a second acquisition module 520 , a first determination module 530 and an allocation module 540 .
[0119] The first acquisition module 510 is configured to acquire a first set of data resources of a specified object that is stored or may have been stored by a specified network node within a first preset time period;
[0120] The second acquisition module 520 is configured to acquire a second set of data resources of the specified object requested within a second preset time period;
[0121] The first determination module 530 is configured to determine a third set according to the intersection of the first set and the second set;
[0122] The allocation module 540 is configured to allocate storage resources of the designated network node to the designated object according to the number of times each data resource in the third set is requested within the second preset time period.
[0123] According to an embodiment of the present disclosure, the designated network node represents a class of network nodes with the same attributes; and / or the designated network node represents any of the following nodes: a network node in a content distribution network; a network node scheduled by a load balancing server; a network node scheduled by a task processing scheduling server; a network node scheduled by a storage resource scheduling server. For a certain designated object (e.g., a designated domain name), the bandwidth allocated to it by different network nodes is different. For example, the first class of network nodes allocates 10G bandwidth, the second class of network nodes allocates 20G bandwidth, and the third class of network nodes allocates 30G bandwidth. The designated network node can represent a network node with 10G bandwidth, or a network node with 20G bandwidth, or a network node with 30G bandwidth. In addition, the designated node can also represent a CDN (Content Delivery Network) network node. The CDN network node is a cache server used by the content distribution network and distributed in a region or network where users are relatively concentrated. It can cache resources from the source server and send the cached resources to the user in response to the user's request. When the resource requested by the user is not cached on the CDN node, the CDN node requests the resource from the origin server, caches the resource from the origin server and forwards it to the client.
[0124] In addition to the CDN network nodes mentioned above, the designated node may also represent a network node scheduled by a load balancing server, or a network node scheduled by a task processing scheduling server, or a network node scheduled by a storage resource scheduling server.
[0125] According to the embodiments of the present disclosure, in application scenarios such as load balancing, task processing scheduling, and storage resource scheduling, the problem of allocating storage resources for specified objects on different network nodes may be involved. In any of the above application scenarios, a specified network node can be used to represent a class of network nodes with the same attributes, thereby applying the technical solution according to the embodiments of the present disclosure. The technical solution provided by the embodiments of the present disclosure is used in the application scenario of load balancing, and can reasonably allocate storage resources for network nodes scheduled by a load balancing server; it is used in the application scenario of task processing scheduling, and can reasonably allocate storage resources for network nodes scheduled by a task processing scheduling server; it is used in the application scenario of storage resource scheduling, and can reasonably allocate storage resources for network nodes scheduled by a storage resource scheduling server.
[0126] According to an embodiment of the present disclosure, the designated node may also be a real network node.
[0127] According to an embodiment of the present disclosure, storage resources are allocated to a class of nodes represented by the designated node according to the storage resources allocated to the designated node. For example, if X bytes of storage resources are allocated to the designated node representing "a network node that allocates 10G bandwidth to a certain domain name", then X bytes of storage resources are also allocated to the "network node that allocates 10G bandwidth to a certain domain name" accordingly.
[0128] According to an embodiment of the present disclosure, the designated object is any one of the following: a designated domain name, a designated service, and a designated server. According to the different bandwidths allocated to different designated objects by the designated network node, the magnitude of the designated object in the designated network node is different. For example, when the designated object is a designated domain name, the designated network node allocates 10G bandwidth to domain name A and 20G bandwidth to domain name B, then the magnitude of domain name B in the designated node is greater than the magnitude of domain name A. In addition, the total bandwidth of the designated object is the sum of the bandwidths allocated to the designated object by all network nodes. For example, the designated object is a designated domain name, and there are two network nodes that allocate bandwidth to it. The first network node allocates 10G bandwidth to the designated domain name, and the second network node allocates 20G bandwidth to the designated domain name. Then the total bandwidth of the designated domain name is 30G.
[0129] According to an embodiment of the present disclosure, the first preset time period is a first preset time period from a specified time point forward; and / or the second preset time period is a second preset time period from the specified time point backward. The specified time point is a moment before the current moment, for example, the specified time point is 12:00 5 days ago, in which case the first preset time period is a period of time before 12:00 5 days ago, and the second preset time period is a period of time after 12:00 5 days ago.
[0130] According to an embodiment of the present disclosure, the network access and storage conditions in the future are predicted by the network access and storage conditions at a specified time point. The first preset time period before the specified time point is used to simulate the conditions before the time point to be predicted, and the second preset time period after the specified time point is used to simulate the conditions after the time point to be predicted.
[0131] According to an embodiment of the present disclosure, the data resource may include any one or more of the following: video data, audio data, text data, image data, web page data, etc. According to an embodiment of the present disclosure, a set of data resources may include, for example, {video data A, video data B, audio data C, text data D, ...}.
[0132] According to an embodiment of the present disclosure, when the designated node is a real network node, a first set of data resources of a designated object stored by the designated node within a first preset time period can be acquired in the first acquisition module 510 according to the log of the designated node.
[0133] According to an embodiment of the present disclosure, when the designated node is a virtual node representing a real network node, the first acquisition module 510 is configured to acquire a first set of data resources that may have been stored by a class of real network nodes represented by the designated node within a first preset time period.
[0134] According to an embodiment of the present disclosure, a third set is determined according to the intersection of the first set and the second set, and the third set is a set of data resources in the first set that are requested within a second preset time period. The set is used to simulate data resources that will be requested in the future among data resources cached by a specified network node at a time point to be predicted.
[0135] Ideally, the designated network node caches all data resources in the third set so that all data resources requested in the future are stored on the designated network node. However, in order to more efficiently utilize storage resources, only data resources that are requested the most times can be cached to achieve reasonable utilization of storage resources.
[0136] According to the embodiments of the present disclosure, storage resources on a network node are allocated to a specified object (e.g., a domain name) based on the storage situation and estimated access situation of the resources of the specified object on the network node. This allows for reasonable allocation of storage resource quotas on the network node, so that hotspot resources with a high probability of being requested are guaranteed storage, thereby improving the rationality of storage resource usage and increasing the hit rate of data resource access requests on the network node.
[0137] Figure 6 FIG. 5 is a structural block diagram of the first acquisition module 510 of the storage resource allocation device according to an embodiment of the present disclosure. Figure 6 As shown, the first acquisition module 510 includes an acquisition submodule 610 and a determination submodule 620:
[0138] The acquisition submodule 610 is configured to acquire request data for the data resource of the specified object within the first preset time period;
[0139] The determination submodule 620 is configured to determine the first set according to the probability that the designated network node receives a request for the data resource of the designated object and the request data.
[0140] According to an embodiment of the present disclosure, the probability is determined according to the ratio of the network bandwidth allocated to the designated object by the designated network node to the total bandwidth of the designated object. In order to obtain the first set, first obtain the request data of all requests for the data resources of the designated object received by the network where the designated node is located within the first preset time period; then calculate the data resources that the designated node may store according to the probability that the designated network node receives the request for the data resources of the designated object and the request data. For example, if the total bandwidth of the designated object is 100G, and the bandwidth allocated to the object by the designated node is 10G, then each access request has a probability of 1 / 10 being routed to the designated node, and the access request that will be routed to the designated node is calculated according to this probability and all access requests for the resources of the designated object received by the network where the designated node is located within the first preset time period. After the network node receives the access request, if the requested network data is not stored, it will go back to the source to read the network data and then store it to the node, so if the network node receives the request, it is considered that it will store the corresponding data, so the data resources that the designated network node may store can be determined through the above steps.
[0141] According to an embodiment of the present disclosure, the acquisition submodule 610 is configured to: determine the request data for the data resource of the specified object within the first preset time period according to the request data for the data resource of the specified object received by each network node belonging to the same level as the specified network node within the first preset time period. For example, assuming that the specified object is a specified domain name and the specified network node is a first-level node in the CDN network, the requests for the data resource of the specified domain name received by all first-level nodes in the CDN network within the first preset time period are counted, which is the request data for the data resource of the domain name within the first preset time period. For another example, assuming that the specified object is a specified domain name and the specified network node is a second-level node in the CDN network, the requests for the data resource of the specified domain name received by all second-level nodes in the CDN network within the first preset time period are counted, which is the request data for the data resource of the domain name within the first preset time period. In the CDN network, the second-level node is the upper node of the first-level node. When the first-level node does not store the data resource requested by the client, the first-level node can request the data resource from the second-level node. If the second-level node stores the data resource, the second-level node can return the data resource to the first-level node. If the secondary node does not store the data resource, the secondary node may request the data resource from its superior node or from the data source server, and after obtaining the data resource, cache it locally and send it to the primary node.
[0142] According to an embodiment of the present disclosure, when determining the second set, if the designated network node is a primary node, then the requests for data resources of the designated object received by all primary nodes in the network are counted; if the designated network node is a secondary node, then the requests for data resources of the designated object received by all secondary nodes in the network are counted to avoid duplicate statistics.
[0143] According to an embodiment of the present disclosure, the second acquisition module 520 is configured to determine the second set based on request data for data resources of the designated object received by each network node belonging to the same level as the designated network node within the second preset time period.
[0144] By determining the second set through the above scheme, all request data for the data resources of the specified object in the network where the specified node is located within the second preset time period can be obtained. For example, assuming that the specified object is a specified domain name, the specified node is a first-level node of the CDN network, and the CDN has a total of ten first-level nodes for distributing the data resources of the specified domain name, then all requests for the data resources of the specified domain name received by these ten first-level nodes within the second preset time period are counted, and the set of data resources corresponding to all the requests is taken as the second set. For another example, assuming that the specified object is a specified domain name, the specified node is a second-level node of the CDN network, and the CDN has a total of three second-level nodes for distributing the data resources of the specified domain name, then all requests for the data resources of the specified domain name received by these three second-level nodes within the second preset time period are counted, and the set of data resources corresponding to all the requests is taken as the second set.
[0145] According to an embodiment of the present disclosure, the allocation module 540 is configured to: select N data resources with the largest number of requests based on the number of times each data resource in the third set is requested within the second preset time period, so that within the second preset time period, the ratio of the total number of times the N data resources are requested to the total number of times each data resource in the third set is requested meets a preset condition; and allocate storage resources of the designated network node to the designated object based on the size of the N data resources.
[0146] According to an embodiment of the present disclosure, the number of times each data resource in the third set is requested within the second preset time period refers to the total number of requests for each data resource received by all network nodes in the network where the designated node is located and which are network nodes of the same level as the designated node. For example, assuming that the designated network node is a first-level node of a CDN network, and the CDN network has ten first-level nodes for distributing data resources from a designated object, the number of times each data resource in the third set is requested within the second preset time period refers to the sum of requests for the data resource of the designated object received by these ten first-level nodes within the second preset time period for each data resource in the third set.
[0147] According to an embodiment of the present disclosure, the ratio of the total number of times the N data resources are requested to the total number of times each data resource in the third set is requested satisfies a preset condition, including making the ratio not less than a preset hit rate for requesting the data resource of the specified object from the specified node. The hit rate is the probability that the resource requested by the specified object is exactly the resource actually stored by the specified network node, and this hit rate directly determines the amount of historical resource return to the source. In the present application, historical resource return to the source means that when the resource accessed by the specified object is not stored on the specified node or has been stored but has been eliminated by the cache when accessed, the network data is re-read. If the hit rate increases, the amount of historical resource return to the source decreases, which means that most of the resources accessed again are successfully stored.
[0148] According to an embodiment of the present disclosure, the preset hit rate is determined based on a combination of at least one or more of the following: the importance of the service related to the specified object; the level selection of the service related to the specified object; and the storage resource usage of the network node represented by the specified network node.
[0149] For example, when the importance of the service related to the designated object is high, a higher preset hit rate may be set; conversely, when the importance of the service related to the designated object is low, a lower preset hit rate may be set.
[0150] For example, the level selection of the service related to the designated object may be a user's fee selection. For example, when the user selects a service related to the designated object with a higher fee, a higher preset hit rate may be set, whereas when the user selects a service related to the designated object with a lower fee, a lower preset hit rate may be set.
[0151] For example, when the storage resources of the network node represented by the designated network node are relatively abundant, a higher preset hit rate may be set; conversely, when the storage resources of the network node represented by the designated network node are not abundant, a lower preset hit rate may be set.
[0152] According to an embodiment of the present disclosure, the preset hit rate can be set by manual adjustment or in an adaptive adjustment manner. According to an embodiment of the present disclosure, the device also includes a second determination module, which is configured to determine the storage resources allocated by the network node represented by the designated node to the designated object based on the storage resources allocated by the designated node to the designated object.
[0153] When allocating storage resources, first obtain the number of times the data resources in the third set are requested within the second preset time period, then take the N data resources with the most requests, so that the ratio of the total number of times these N data resources are requested to the total number of times all data resources in the third set are requested is greater than or equal to the preset hit rate. Finally, the N data resources with the most requests are the storage resources allocated by the network node represented by the designated node for the designated object.
[0154] According to an embodiment of the present disclosure, after the N data resources are determined, storage resources on the designated node may be allocated to the designated object according to the size of the N data resources.
[0155] Through the technical solution of the embodiments of the present disclosure, the storage resources required by a specified object on a node are accurately calculated, so that most hot spot resources can be guaranteed to have storage, while reducing the waste of storage resources and improving the rationality of storage resource use.
[0156] The present disclosure also discloses an electronic device, Figure 7 A structural block diagram of an electronic device according to an embodiment of the present disclosure is shown.
[0157] like Figure 7 As shown, the electronic device 700 includes a memory 701 and a processor 702; wherein,
[0158] The memory 701 is used to store one or more computer instructions, wherein the one or more computer instructions are executed by the processor 702 to implement the following method steps:
[0159] Acquire a first set of data resources of a specified object that is stored or may have been stored by a specified network node within a first preset time period;
[0160] Acquire a second set of data resources of the specified object requested within a second preset time period;
[0161] determining a third set according to the intersection of the first set and the second set;
[0162] According to the number of times each data resource in the third set is requested within the second preset time period, the storage resource of the designated network node is allocated to the designated object.
[0163] According to an embodiment of the present disclosure, the designated network node represents a class of network nodes having the same attributes; the designated network node represents any of the following nodes: a network node in a content distribution network; a network node scheduled by a load balancing server; a network node scheduled by a task processing scheduling server; a network node scheduled by a storage resource scheduling server.
[0164] According to an embodiment of the present disclosure, the designated object is any one of the following: a designated domain name, a designated service, or a designated server.
[0165] According to an embodiment of the present disclosure, the one or more computer instructions are also executed by the processor to implement the following method steps: obtaining a first set of data resources of a specified object that may have been stored by a specified network node within a first preset time period, including: obtaining request data for the data resources of the specified object within the first preset time period; determining the first set based on the probability that the specified network node receives a request for the data resources of the specified object and the request data.
[0166] According to an embodiment of the present disclosure, the one or more computer instructions are also executed by the processor to implement the following method steps: determining the probability based on a ratio of a network bandwidth allocated to the designated object by the designated network node to a total bandwidth of the designated object.
[0167] According to an embodiment of the present disclosure, the one or more computer instructions are also executed by the processor to implement the following method steps: determining the request data for the data resources of the specified object within the first preset time period based on the request data for the data resources of the specified object received by each network node belonging to the same level as the specified network node within the first preset time period.
[0168] According to an embodiment of the present disclosure, the obtaining of a second set of data resources of the specified object requested within a second preset time period includes: determining the second set based on request data for the data resources of the specified object received by each network node belonging to the same level as the specified network node within the second preset time period.
[0169] According to an embodiment of the present disclosure, allocating the storage resources of the designated network node to the designated object according to the number of times each data resource in the third set is requested within the second preset time period includes: selecting N data resources with the largest number of requests according to the number of times each data resource in the third set is requested within the second preset time period, so that within the second preset time period, the ratio of the total number of times the N data resources are requested to the total number of times each data resource in the third set is requested meets a preset condition; allocating the storage resources of the designated network node to the designated object according to the size of the N data resources.
[0170] According to an embodiment of the present disclosure, the ratio of the total number of times the N data resources are requested to the total number of times each data resource in the third set is requested satisfies a preset condition, including making the ratio not less than a preset hit rate of requesting the data resource of the specified object from the specified node.
[0171] According to an embodiment of the present disclosure, the preset hit rate is determined based on a combination of at least one or more of the following: the importance of the service related to the specified object; the level selection of the service related to the specified object; and the storage resource usage of the network node represented by the specified network node.
[0172] According to an embodiment of the present disclosure, the one or more computer instructions are also executed by the processor to implement the following method steps: determining the storage resources allocated to the designated object by the network node represented by the designated node based on the storage resources allocated to the designated object by the designated node.
[0173] According to an embodiment of the present disclosure, the first preset time period is a first preset time period from a specified time point forward; and / or the second preset time period is a second preset time period from the specified time point backward.
[0174] Figure 8 A schematic diagram showing the structure of a computer system suitable for implementing the storage resource allocation method according to an embodiment of the present disclosure is shown.
[0175] like Figure 8 As shown, the computer system 800 includes a processing unit 801, which can perform various processes in the above-mentioned embodiments according to a program stored in a read-only memory (ROM) 802 or a program loaded from a storage part 808 into a random access memory (RAM) 803. In the RAM 803, various programs and data required for the operation of the system 800 are also stored. The processing unit 801, the ROM 802, and the RAM 803 are connected to each other via a bus 804. An input / output (I / O) interface 805 is also connected to the bus 804.
[0176] The following components are connected to the I / O interface 805: an input section 806 including a keyboard, a mouse, etc.; an output section 807 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker; a storage section 808 including a hard disk, etc.; and a communication section 809 including a network interface card such as a LAN card, a modem, etc. The communication section 809 performs communication processing via a network such as the Internet. The drive 810 is also connected to the I / O interface 805 as needed. A removable medium 811, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 810 as needed, so that the computer program read therefrom is installed into the storage section 808 as needed. Among them, the processing unit 801 can be implemented as a processing unit such as a CPU, a GPU, a TPU, an FPGA, an NPU, etc.
[0177] In particular, according to an embodiment of the present disclosure, the method described above can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program tangibly contained on a machine-readable medium, and the computer program includes a program code for executing the above method. In such an embodiment, the computer program can be downloaded and installed from a network through the communication part 809, and / or installed from a removable medium 811.
[0178] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of a code, and the module, a program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of boxes in the block diagram and / or flowchart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0179] The units or modules involved in the embodiments described in the present disclosure may be implemented by software or programmable hardware. The units or modules described may also be set in a processor, and the names of these units or modules do not constitute limitations on the units or modules themselves in some cases.
[0180] As another aspect, the present disclosure further provides a computer-readable storage medium, which may be a computer-readable storage medium included in the electronic device or computer system in the above embodiment; or a computer-readable storage medium that exists independently and is not assembled into a device. The computer-readable storage medium stores one or more programs, and the programs are used by one or more processors to execute the method described in the present disclosure.
[0181] The above description is only a preferred embodiment of the present disclosure and an explanation of the technical principles used. Those skilled in the art should understand that the scope of the invention involved in the present disclosure is not limited to the technical solution formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the inventive concept. For example, the above features are replaced with the technical features with similar functions disclosed in the present disclosure (but not limited to) by each other.
Claims
1. A storage resource allocation method, characterized in that: include: Acquire a first set of data resources of a specified object that is stored or may have been stored by a specified network node within a first preset time period; Acquire a second set of data resources of the specified object requested within a second preset time period; determining a third set according to the intersection of the first set and the second set; Allocating the storage resource of the designated network node to the designated object according to the number of times each data resource in the third set is requested within the second preset time period includes: According to the number of times each data resource in the third set is requested within the second preset time period, selecting N data resources with the largest number of requests, so that within the second preset time period, the ratio of the total number of times the N data resources are requested to the total number of times each data resource in the third set is requested satisfies a preset condition; The storage resources of the designated network node are allocated to the designated object according to the sizes of the N data resources.
2. The method according to claim 1, characterized in that: The designated network node represents a type of network nodes having the same attributes; and / or The designated network node represents any of the following nodes: a network node in a content distribution network; a network node scheduled by a load balancing server; a network node scheduled by a task processing scheduling server; a network node scheduled by a storage resource scheduling server.
3. The method according to claim 1, characterized in that The designated object is any one of the following: a designated domain name, a designated service, or a designated server.
4. The method according to claim 1, characterized in that: The obtaining a first set of data resources of a specified object that may have been stored by the specified network node within a first preset time period includes: Acquire request data for the data resource of the specified object within the first preset time period; The first set is determined according to the probability that the designated network node receives a request for the data resource of the designated object and the request data.
5. The method according to claim 4, characterized in that Also includes: The probability is determined according to a ratio of a network bandwidth allocated by the designated network node to the designated object to a total bandwidth of the designated object.
6. The method according to claim 4, characterized in that Acquiring request data for the data resource of the specified object within the first preset time period includes: The request data for the data resource of the designated object within the first preset time period is determined according to the request data for the data resource of the designated object received by each network node belonging to the same level as the designated network node within the first preset time period.
7. The method according to claim 1, characterized in that The acquiring a second set of data resources of the specified object requested within a second preset time period includes: The second set is determined according to request data for the data resource of the designated object received by each network node belonging to the same level as the designated network node within the second preset time period.
8. The method according to claim 1, characterized in that The ratio of the total number of times the N data resources are requested to the total number of times each data resource in the third set is requested meets a preset condition, including making the ratio not less than a preset hit rate of requesting the data resource of the designated object from the designated network node.
9. The method according to claim 8, characterized in that The preset hit rate is determined based on at least one or more of the following combinations: the importance of the service related to the specified object; the level selection of the service related to the specified object; and the storage resource usage of the network node represented by the specified network node.
10. The method according to claim 1, characterized in that Also includes: According to the storage resources allocated by the designated network node to the designated object, the storage resources allocated by the network node represented by the designated network node to the designated object are determined.
11. The method according to claim 1, characterized in that: The first preset time period is a first preset time period from a specified time point forward; and / or The second preset time period is a second preset time period after the designated time point.
12. A storage resource allocation device, characterized in that: include: A first acquisition module is configured to acquire a first set of data resources of a specified object that is stored or may have been stored by a specified network node within a first preset time period; A second acquisition module is configured to acquire a second set of data resources of the specified object requested within a second preset time period; A first determining module, configured to determine a third set according to the intersection of the first set and the second set; The allocation module is configured to allocate the storage resource of the designated network node to the designated object according to the number of times each data resource in the third set is requested within the second preset time period, including: According to the number of times each data resource in the third set is requested within the second preset time period, selecting N data resources with the largest number of requests, so that within the second preset time period, the ratio of the total number of times the N data resources are requested to the total number of times each data resource in the third set is requested satisfies a preset condition; The storage resources of the designated network node are allocated to the designated object according to the sizes of the N data resources.
13. The device according to claim 12, characterized in that Also includes: The second determining module is configured to determine the storage resources allocated to the designated object by the network node represented by the designated network node according to the storage resources allocated to the designated object by the designated network node.
14. An electronic device, characterized in that: The method comprises a memory and a processor; wherein the memory is used to store one or more computer instructions, wherein the one or more computer instructions are executed by the processor to implement the method steps described in any one of claims 1 to 11.
15. A readable storage medium having computer instructions stored thereon, characterized in that: When the computer instructions are executed by a processor, the method steps described in any one of claims 1 to 11 are implemented.
