Hot file deployment method, device, electronic device and storage medium
By predicting the initial quota of nodes to be deployed and selecting matching target nodes for hot file deployment, the access delay problem caused by the incompatibility between nodes and hot files in the existing technology is solved, and the rationality and efficiency of deployment are improved.
Patent Information
- Application Number
- CN202311657260.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-05
- Publication Date
- 2024-09-20
- Estimated Expiration
- 2043-12-05
AI Technical Summary
The existing hot file deployment strategy cannot guarantee the adaptability of nodes and hot files, resulting in access delay issues.
By obtaining the number of accesses and file size of the hot files to be deployed, as well as the bandwidth of each node to be deployed, the initial quota of each node is predicted, and target nodes with matching data transmission capabilities are selected for deployment.
It improves the adaptability of nodes and hot files, reduces access delays, increases the rationality of deployment, and ensures that data transmission capabilities match access requirements.
Smart Images

Figure CN117640388B
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of file deployment, and in particular to a hot file deployment method, device, electronic device and storage medium. Background Art
[0002] At present, CDN (Content Delivery Network) and PCDN (P2PContent Delivery Network) are mainly used for online deployment of hot files. Hot files are deployed on CDN nodes or PCDN nodes, for example, hot files are deployed on nodes with sufficient storage space. However, since hot files are files that are accessed frequently, the nodes where hot files are deployed will also be accessed frequently, and there is no guarantee that the node can meet the frequent access needs of users, that is, the compatibility of the node with the hot files cannot be guaranteed, which leads to access delay problems. Summary of the invention
[0003] The present application provides a hot file deployment method, device, electronic device and storage medium, which improves the adaptability of nodes and hot files to be deployed, reduces access latency, and increases the rationality of hot file deployment.
[0004] In a first aspect, the present application provides a hot file deployment method, the method comprising:
[0005] Obtain the number of accesses and file size of the hot file to be deployed corresponding to the current period in the previous period;
[0006] Obtaining the bandwidth of each of the multiple nodes to be deployed corresponding to the current time period;
[0007] Based on the number of accesses and file size of the hot files to be deployed corresponding to the current period in the previous period, and the bandwidth of each node to be deployed in the current period, predict the initial quota corresponding to each node to be deployed in the current period, where the initial quota corresponding to each node to be deployed in the current period represents the total amount of data transmitted by the bandwidth of each node to be deployed in the current period;
[0008] Based on the initial quota corresponding to each to-be-deployed node in the current period, a target node corresponding to the to-be-deployed hot file among the multiple to-be-deployed nodes in the current period is determined to deploy the to-be-deployed hot file to the target node.
[0009] In a second aspect, the present application provides a hot file deployment device, the device comprising: an acquisition unit and a processing unit;
[0010] An acquisition unit, used to acquire the number of accesses and the file size of the hot file to be deployed corresponding to the current time period in the previous time period;
[0011] The acquisition unit is further used to acquire the bandwidth of each node to be deployed among the multiple nodes to be deployed corresponding to the current time period;
[0012] The processing unit is used to predict the initial quota corresponding to each node to be deployed in the current period based on the number of accesses and the file size of the hot file to be deployed corresponding to the current period in the previous period, and the bandwidth of each node to be deployed in the current period, wherein the initial quota corresponding to each node to be deployed in the current period represents the total amount of data transmitted by the bandwidth of each node to be deployed in the current period;
[0013] The processing unit is further configured to determine a target node corresponding to the hot file to be deployed among multiple nodes to be deployed in the current period based on the initial quota corresponding to each node to be deployed in the current period, so as to deploy the hot file to be deployed to the target node.
[0014] In a third aspect, the present application provides an electronic device, comprising: a processor and a memory, the processor being connected to the memory, the memory being used to store a computer program, and the processor being used to execute the computer program stored in the memory, so that the electronic device performs the method of the first aspect.
[0015] In a fourth aspect, the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and the computer program enables a computer to execute the method of the first aspect.
[0016] In a fifth aspect, the present application provides a computer program product, which includes a non-transitory computer-readable storage medium storing a computer program, and is computer-operable to cause the computer to execute the method of the first aspect.
[0017] The implementation of this application has the following beneficial effects:
[0018] First, obtain the number of accesses and the file size of the hot file to be deployed corresponding to the current time period in the previous time period, and obtain the bandwidth of each node to be deployed among the multiple nodes to be deployed corresponding to the current time period; then, based on the number of accesses and the file size of the hot file to be deployed corresponding to the current time period in the previous time period, and the bandwidth of each node to be deployed in the current time period, predict the initial quota corresponding to each node to be deployed in the current time period, wherein the initial quota corresponding to each node to be deployed in the current time period represents the total amount of data transmitted by the bandwidth of each node to be deployed in the current time period; then, based on the initial quota corresponding to each node to be deployed in the current time period, determine the target node corresponding to the hot file to be deployed among the multiple nodes to be deployed in the current time period, so as to deploy the hot file to be deployed to the target node; that is, the predicted initial quota can represent the data transmission capacity of each node to be deployed, and the data transmission capacity is crucial for hot files. For example, for hot files with more accesses, it means that they need to be deployed in the target time period. The hot file to be deployed is frequently accessed in the target time period, and each access requires a file to be downloaded from the node, and each download requires a certain amount of traffic, which is reflected in the required data transmission capacity. Based on the file size of the hot file to be deployed and the number of accesses in the previous period, the total amount of data corresponding to the hot file to be deployed transmitted in the previous period can be known. The total amount of data is used as the total amount of data that can be transmitted by the bandwidth of multiple nodes to be deployed in the current period. Based on the bandwidth of each node to be deployed in the current period and the total amount of data, the total amount of data that can be transmitted by the bandwidth of each node to be deployed in the current period can be predicted, that is, the initial quota, which is equivalent to considering the traffic and bandwidth factors at the same time, increasing the rationality of deployment, and then selecting the target node matching the hot file to be deployed based on the initial quota, so that the data transmission capacity of the target node can match the access demand of the hot file to be deployed, reducing the possibility of delay when the target node accesses the hot file to be deployed. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0020] Figure 1 A schematic diagram of a hot file deployment system provided in an embodiment of the present application;
[0021] Figure 2 A schematic diagram of a hot file deployment scenario provided in an embodiment of the present application;
[0022] Figure 3A schematic diagram of a hot file deployment method provided in an embodiment of the present application;
[0023] Figure 4 A flowchart of another hot file deployment method provided in an embodiment of the present application;
[0024] Figure 5 A block diagram of the functional units of a hot file deployment device provided in an embodiment of the present application;
[0025] Figure 6 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0026] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0027] The terms "first", "second", "third" and "fourth" etc. in the specification, claims and drawings of the present application are used to distinguish different objects, rather than to describe a specific order. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but optionally includes steps or units that are not listed, or optionally includes other steps or units inherent to these processes, methods, products or devices.
[0028] Reference to "embodiments" herein means that a particular feature, result, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.
[0029] First, the relevant terms involved in this application are explained:
[0030] Hot files: refers to files that are frequently accessed within a period of time, such as files that are accessed more than a first preset threshold number of times within a period of time; in addition, the specific forms of hot files include but are not limited to: video, audio, image, text, web page, etc.
[0031] From the above background technology, it can be known that the existing hot file deployment strategy cannot guarantee the compatibility of nodes and hot files, and thus cannot avoid the problem of delay when nodes access hot files. Therefore, the present application provides a hot file deployment method, device, electronic device and storage medium. In the present application, by combining the file size of the hot file to be deployed, the number of times it was accessed in the previous period and the bandwidth of each node to be deployed corresponding to the current period, the initial quota corresponding to each node to be deployed in the current period is predicted, that is, the total amount of data that can be transmitted by the bandwidth of each node to be deployed in the current period, that is, how many times the user can access the file, and then based on the initial quota corresponding to each node to be deployed, the target node matching the hot file to be deployed is selected, so that the data transmission capacity of the target node can match the access requirements of the hot file to be deployed, and the possibility of delay when the target node accesses the hot file to be deployed is reduced.
[0032] See also Figure 1 , Figure 1 A schematic diagram of a hot file deployment system provided in an embodiment of the present application.
[0033] The hot file deployment system includes a hot file deployment device and multiple nodes to be deployed; the hot file deployment device can be a server, which is not specifically limited in this application; each node to be deployed can be a server, an embedded device (such as a router), etc., which is not specifically limited in this application.
[0034] Before the hot file deployment device obtains the number of accesses and the file size of the hot file to be deployed corresponding to the current time period in the previous time period, for example, in the previous time period, the user can access the file through the target application installed on the user terminal. Each time the user accesses the file, the user terminal will send a counting request (including the file identification ID) to the statistics server. The statistics server will increase the number of accesses of the accessed file by one based on the counting request, and so on, until the statistics server has counted the number of accesses of each file in the previous time period; further, the hot file deployment device can obtain the file whose number of accesses in the previous time period is greater than the first preset threshold and the corresponding file size from the statistics server, and determine it as the hot file to be deployed corresponding to the current time period, that is, the number of accesses and the file size of the hot file to be deployed corresponding to the current time period in the previous time period can be obtained;
[0035] Then, the hot file deployment device obtains the bandwidth of each node to be deployed among the multiple nodes to be deployed corresponding to the current time period. It should be noted that the bandwidth of each node to be deployed is pre-set. When the hot file needs to be deployed in the current time period, the hot file deployment device will traverse all nodes, and then select nodes that can be used normally (for example, nodes with normal network, storage, and CPU resources), and clean up the files historically deployed on these nodes and determine them as the multiple nodes to be deployed corresponding to the current time period; further, the hot file deployment device predicts the initial quota corresponding to each node to be deployed in the current time period based on the number of accesses and the file size of the hot file to be deployed corresponding to the current time period in the previous time period, and the bandwidth of each node to be deployed in the current time period, wherein the initial quota corresponding to each node to be deployed in the current time period represents the total amount of data transmitted by the bandwidth of each node to be deployed in the current time period; finally, based on the initial quota corresponding to each node to be deployed in the current time period, the target node corresponding to the hot file to be deployed among the multiple nodes to be deployed in the current time period is determined, so as to deploy the hot file to be deployed to the target node.
[0036] Further, after the hot file to be deployed is deployed to the corresponding target node, the user can access the corresponding hot file through the user terminal. For details, refer to Figure 2 , Figure 2 A schematic diagram of a hot file deployment scenario provided in an embodiment of the present application.
[0037] The scenario includes a hot file deployment device, a user terminal, and multiple nodes to be deployed; the hot file deployment device includes a deployment module and a scheduling module, and the deployment module is used to deploy hot files according to the hot file deployment method provided by the implementation of this application (no further details are given here); the user terminal can be a smart phone, tablet computer, laptop computer, desktop computer, smart TV, desktop computer, smart watch, smart car-mounted and other smart terminals, and this application does not make specific limitations; the number of user terminals can be one or more, and this application mainly takes one as an example for illustration.
[0038] The scheduling module receives an access request from a user terminal, where the access request is used to request access to a hot file to be deployed; then the scheduling module determines the node information of a target node corresponding to the access request based on the access request and pre-acquired node information of multiple nodes to be deployed (for example, each node to be deployed reports node information to the scheduling module, including node address, deployed files, etc.); then the scheduling module sends the node information to the user terminal; the user terminal accesses the target node based on the node information to obtain the hot file to be deployed from the target node.
[0039] It can be seen that in the embodiment of the present application, by obtaining the number of accesses and the file size of the hot file to be deployed corresponding to the current time period in the previous time period, and obtaining the bandwidth of each node to be deployed in the multiple nodes to be deployed corresponding to the current time period; then based on the number of accesses and the file size of the hot file to be deployed corresponding to the current time period in the previous time period, and the bandwidth of each node to be deployed in the current time period, predict the initial quota corresponding to each node to be deployed in the current time period, wherein the initial quota corresponding to each node to be deployed in the current time period represents the total amount of data transmitted by the bandwidth of each node to be deployed in the current time period; then based on the initial quota corresponding to each node to be deployed in the current time period, determine the target node corresponding to the hot file to be deployed in the multiple nodes to be deployed in the current time period, so as to deploy the hot file to be deployed to the target node; that is, the predicted initial quota can represent the data transmission capacity of each node to be deployed, and the data transmission capacity is crucial for hot files, for example, For hot files that are accessed more times, it means that they need to be frequently accessed within the target time period. Each access requires downloading the file from the node, and each download requires a certain amount of traffic, which is reflected in the required data transmission capacity. Based on the file size of the hot file to be deployed and the number of accesses in the previous time period, the total amount of data corresponding to the transmission of the hot file to be deployed in the previous time period can be known. The total amount of data is used as the total amount of data that can be transmitted by the bandwidth of multiple nodes to be deployed in the current time period. Based on the bandwidth of each node to be deployed in the current time period and the total amount of data, the total amount of data that can be transmitted by the bandwidth of each node to be deployed in the current time period, that is, the initial quota, can be predicted. Based on the initial quota, the target node matching the hot file to be deployed is selected, so that the data transmission capacity of the target node can match the access demand of the hot file to be deployed, thereby reducing the possibility of delay when the target node accesses the hot file to be deployed.
[0040] See also Figure 3 , Figure 3 A flowchart of a hot file deployment method provided in an embodiment of the present application is shown below. The method is applied to the hot file deployment device in the above embodiment. The method includes but is not limited to steps S301-S304:
[0041] S301: Obtain the number of accesses and the file size of the hot file to be deployed corresponding to the current time period in the previous time period.
[0042] In the embodiment of the present application, the hot file deployment device deploys the corresponding hot file at regular intervals, and the statistics server counts the number of times each file is accessed in each time period, that is, the hot file deployment of the present application belongs to periodic deployment. Therefore, when deploying the hot file to be deployed in the current time period, the hot file deployment device will obtain the number of times the hot file to be deployed was accessed in the previous time period. The time length of the current time period is the same as that of the previous time period, and the present application does not limit the specific value.
[0043] S302: Obtain the bandwidth of each node to be deployed among multiple nodes to be deployed corresponding to the current time period.
[0044] In an embodiment of the present application, when deploying in the current time period, all nodes are traversed, all nodes are screened based on preset screening rules (such as normal network function, normal storage function, etc.), and then the files on the screened nodes are cleared to obtain multiple nodes to be deployed corresponding to the current time period. That is to say, before each deployment starts, the files on the corresponding multiple nodes to be deployed will be deleted, which is equivalent to the storage space of the nodes to be deployed each time being changed to the pre-set initial storage space.
[0045] S303: predicting an initial quota corresponding to each node to be deployed in the current period based on the number of accesses and the file size of the hot file to be deployed corresponding to the current period in the previous period and the bandwidth of each node to be deployed in the current period.
[0046] In an embodiment of the present application, the initial quota corresponding to each node to be deployed in the current period represents the total amount of data transmitted by the bandwidth of each node to be deployed in the current period. Specifically:
[0047] Based on the bandwidth of each node to be deployed in the current period, the total bandwidth corresponding to the current period is determined. For example, the bandwidth of each node to be deployed in the current period is summed to obtain the total bandwidth corresponding to the current period; and based on the number of accesses and the file size of the hot file to be deployed corresponding to the current period in the previous period, the total quota corresponding to the current period is predicted, wherein the total quota corresponding to the current period represents the total amount of data transmitted by the total bandwidth in the current period. For example, the number of accesses and the file size of the hot file to be deployed corresponding to the current period in the previous period are multiplied to obtain the total quota corresponding to the current period, that is, the total amount of data required to be transmitted by the total bandwidth of multiple nodes to be deployed corresponding to the current period in the current period; then, based on the total quota corresponding to the current period, the total bandwidth corresponding to the current period and the bandwidth of each node to be deployed in the current period, the initial quota corresponding to each node to be deployed in the current period is predicted, wherein the initial quota corresponding to each node to be deployed in the current period can be obtained by formula (1):
[0048]
[0049] Among them, init_quota represents the initial quota corresponding to each node to be deployed in the current period, hot_quota represents the total quota corresponding to the current period, node_bandwith represents the bandwidth of each node to be deployed in the current period, and all_bandwith represents the total bandwidth corresponding to the current period.
[0050] It can be seen that the product of the number of accesses to the hot file to be deployed in the previous period and the file size, that is, the total amount of data corresponding to the hot file to be deployed transmitted by the node in the previous period, is determined as the total quota corresponding to the current period, that is, the total amount of data that needs to be transmitted by the total bandwidth in the current period; then the ratio of the bandwidth of each node to be deployed in the current period to the total bandwidth of the current period, and the total quota corresponding to the current period are determined to determine the total data transmission amount that can be allocated to each node to be deployed in the current period, that is, the initial quota. For example, the larger the ratio, the larger the bandwidth of the node to be deployed, the stronger the corresponding data transmission capacity, and the larger the total amount of data that can be transmitted in the current period, that is, the larger the initial quota.
[0051] S304: Based on the initial quota corresponding to each to-be-deployed node in the current period, determine a target node corresponding to the to-be-deployed hot file among the multiple to-be-deployed nodes in the current period, so as to deploy the to-be-deployed hot file to the target node.
[0052] After determining the initial quota corresponding to each node to be deployed in the current time period, the target node corresponding to the hot file to be deployed can be determined based on the initial quota corresponding to each node to be deployed in the current time period. For example, the node with the largest initial quota among multiple nodes to be deployed can be used as the target node corresponding to the hot file to be deployed. Alternatively, in an optional embodiment, it can also be: obtaining the initial storage space of each node to be deployed in the current time period, wherein the initial storage space of each node to be deployed is pre-set, and the present application does not specifically limit the specific value; then, based on the initial storage space of each node to be deployed in the current time period and the initial quota corresponding to each node to be deployed in the current time period, determine the target node. For example, the target node is the node with the largest initial quota among the nodes whose initial storage space in the current time period is greater than the file size of the hot file to be deployed. That is to say, the node with the strongest data transmission capability among the nodes whose initial storage space among the multiple nodes to be deployed (when there is only one hot file to be deployed, the initial storage space can also be understood as the current remaining storage space of the node to be deployed, which is the pre-set initial storage space) is larger than the file size of the hot file to be deployed is determined as the target node for the hot file to be deployed, thereby improving the compatibility of the target node and the hot file to be deployed, ensuring the transmission quality of the deployed hot file, and reducing the possibility of access delay when the user accesses the hot file to be deployed at the target node.
[0053] It should be noted that the above embodiment is mainly described by taking one hot file to be deployed as an example. When the number of hot files to be deployed is only one, that is, the total number of hot files that need to be deployed in the current time period is only one, then the initial quota corresponding to each node to be deployed in the current time period can also be understood as the remaining quota or the available quota (indicating the total amount of data that can be transmitted by the bandwidth of each node to be deployed in the current time period), and the initial storage space corresponding to each node to be deployed in the current time period can also be understood as the remaining storage space.
[0054] Therefore, if the number of hot files to be deployed corresponding to the current period is multiple, that is, the total number of hot files to be deployed in the current period is multiple, based on the initial storage space of each node to be deployed in the current period and the initial quota corresponding to each node to be deployed in the current period, determining the target node may further specifically include steps S11-S12:
[0055] S11: Sort the multiple hot files to be deployed in the current time period based on the order of the heat value of each hot file to be deployed in the current time period from large to small, and obtain the sequence number of each hot file to be deployed.
[0056] Among them, the heat value can be part or all of the factors in the number of visits, downloads, forwards, favorites, comments, etc. of each hot file to be deployed, or it can also be a pre-set mapping relationship between each factor in the part or all of the factors and the heat value, and then the heat value corresponding to each factor is determined based on the mapping relationship between each factor corresponding to each file to be deployed and the heat value, and then the heat value corresponding to each factor corresponding to each file to be deployed is weighted to obtain the heat value of each file to be deployed, which is not specifically limited in this application; the sequence number of each hot file to be deployed is obtained by sorting in order from large to small according to the heat value, for example, it is set to 1, 2, 3... in sequence. The earlier the sequence number (or the smaller it is), the larger the heat value of the hot file to be deployed. Similarly, the later the sequence number (or the larger it is), the smaller the heat value of the hot file to be deployed.
[0057] S12: Determine a target node corresponding to each hot file to be deployed in the current period among multiple nodes to be deployed in the current period based on the sequence number of each hot file to be deployed in the current period, the initial quota corresponding to each node to be deployed in the current period, and the initial storage space of each node to be deployed in the current period.
[0058] Exemplarily, for the i-th hot file to be deployed in the current time period, first obtain the unaged files in each to-be-deployed node corresponding to the i-th hot file to be deployed in the current time period, wherein the unaged files in each to-be-deployed node corresponding to the i-th hot file to be deployed in the current time period are part or all of the hot files that have been deployed in the current time period, and the deployed hot files are files that have been deployed before the i-th hot file to be deployed in multiple hot files to be deployed. For example, when i=1, the number of hot files that have been deployed in the multiple hot files to be deployed in the current time period is 0, then each to-be-deployed node corresponding to the i-th hot file to be deployed in the current time period does not include unaged files, and when i>1, the number of hot files that have been deployed in the multiple hot files to be deployed in the current time period is i-1 (corresponding serial numbers are 1 to i-1), then the unaged files in each to-be-deployed node corresponding to the i-th hot file to be deployed in the current time period are part or all of the i-1 deployed hot files.
[0059] Then, based on the initial quota corresponding to each node to be deployed in the current period, the initial storage space of each node to be deployed in the current period, and the non-aged files in each node to be deployed corresponding to the i-th hot file to be deployed in the current period, the target node corresponding to the i-th hot file to be deployed in the current period is determined, wherein the i-th hot file to be deployed in the current period is the one with the first sequence number among the multiple hot files to be deployed in the current period that have not been deployed, and i represents the sequence number corresponding to the hot file to be deployed, that is, when there are multiple hot files to be deployed, they will be deployed in sequence from high to low according to the number of times each hot file to be deployed is accessed. Exemplary:
[0060] First, based on the non-aged files in each node to be deployed corresponding to the i-th hot file to be deployed in the current period and the initial quota corresponding to each node to be deployed in the current period, the remaining quota of each node to be deployed corresponding to the i-th hot file to be deployed in the current period is predicted, wherein the remaining quota of each node to be deployed corresponding to the i-th hot file to be deployed represents the total amount of data remaining to be transmitted by the bandwidth of each node to be deployed corresponding to the i-th hot file to be deployed in the current period when the i-th hot file to be deployed is deployed. For example, based on the number of accesses and the file size of the non-aged files in each node to be deployed corresponding to the i-th hot file to be deployed in the current period, the used quota of each node to be deployed corresponding to the i-th hot file to be deployed in the current period is determined, that is, the number of accesses and the file size of the non-aged files in each node to be deployed corresponding to the i-th hot file to be deployed in the current period are multiplied and then summed to obtain the used quota of each node to be deployed in the current period, wherein the used quota of each node to be deployed corresponding to the i-th hot file to be deployed is represented in part. When deploying the i-th hot file to be deployed, the amount of data that has been transmitted by the bandwidth of each node to be deployed corresponding to the i-th hot file to be deployed in the current time period; then based on the initial quota corresponding to each node to be deployed in the current time period and the used quota of each node to be deployed corresponding to the i-th hot file to be deployed in the current time period, determine the remaining quota of each node to be deployed corresponding to the i-th hot file to be deployed in the current time period, for example, subtract the initial quota corresponding to each node to be deployed in the current time period and the used quota of each node to be deployed in the current time period to obtain the remaining quota of each node to be deployed.
[0061] And, based on the initial storage space of each node to be deployed in the current period and the unaged files in each node to be deployed corresponding to the i-th hot file to be deployed in the current period, the remaining storage space of each node to be deployed corresponding to the i-th hot file to be deployed in the current period is determined. For example, firstly, based on the file size of the unaged files in each node to be deployed corresponding to the i-th hot file to be deployed in the current period, the used storage space of each node to be deployed corresponding to the i-th hot file to be deployed in the current period is determined, that is, the file size of the unaged files on each node to be deployed is summed to obtain the used storage space of each node to be deployed corresponding to the i-th hot file to be deployed in the current period; then, based on the initial storage space of each node to be deployed in the current period and the used storage space of each node to be deployed corresponding to the i-th hot file to be deployed in the current period, for example, the difference is taken to obtain the remaining storage space of each node to be deployed corresponding to the i-th hot file to be deployed in the current period.
[0062] Finally, based on the remaining quota of each node to be deployed corresponding to the i-th hot file to be deployed in the current period and the remaining storage space of each node to be deployed corresponding to the i-th hot file to be deployed in the current period, the target node corresponding to the i-th hot file to be deployed in the current period is determined to deploy the i-th hot file to be deployed in the current period to the corresponding target node, wherein the target node corresponding to the i-th hot file to be deployed in the current period is the node with the largest remaining quota among the nodes whose remaining storage space in the current period is greater than the file size of the i-th hot file to be deployed. Of course, if the remaining storage space of each node to be deployed corresponding to the i-th hot file to be deployed in the current period is 0, the deployment is stopped regardless of whether the hot file to be deployed is deployed.
[0063] Similarly, after determining the target node corresponding to each hot file to be deployed and deploying multiple hot files to be deployed to the corresponding target nodes, the scheduling module in the hot file deployment device can also receive a target access request from the user terminal, and the target access request is used to request access to the target hot file, wherein the target hot file is one of the multiple hot files to be deployed; then the scheduling module determines the node information (such as including the node address) of the target node corresponding to the target access request based on the target access request; then the scheduling module sends the node information of the target node corresponding to the target access request to the user terminal, so that the user terminal accesses the target node corresponding to the target access request based on the node information to obtain the target hot file.
[0064] It should be noted that when there are multiple hot files to be deployed, each hot file to be deployed is deployed in sequence from high to low according to the number of times each hot file to be deployed is accessed. For example, after the first hot file to be deployed is deployed to the corresponding target node, the second hot file to be deployed is deployed. When deploying the i-th hot file to be deployed, if i=1, it means that the multiple hot files to be deployed corresponding to the current period have not been deployed. At this time, the used quota and the used storage space corresponding to each node to be deployed are both 0, and the remaining quota and the remaining storage space corresponding to each node to be deployed correspond to the initial quota and the initial storage space, respectively. At this time, the node with the largest initial quota among the nodes whose initial storage space is larger than the file size of the first hot file to be deployed can be determined as the target node corresponding to the first hot file to be deployed. If i>1, it means that the multiple hot files to be deployed corresponding to the current period are There are i-1 hot files deployed to the corresponding target nodes. At this time, the used quota and used storage space corresponding to each node to be deployed depend on whether part or all of the i-1 hot files have been deployed on each node to be deployed. Then, the node with the largest remaining quota among the nodes whose remaining storage space is greater than the file size of the i-th hot file to be deployed can be determined as the target node corresponding to the i-th hot file to be deployed. And so on. This is equivalent to selecting the node with the largest remaining quota among the nodes whose remaining storage space at the current moment is greater than the size of each hot file to be deployed when deploying each hot file to be deployed. While ensuring sufficient storage space, the node with the largest remaining quota at the current moment, that is, the node with the strongest data transmission capability, is also selected, thereby improving the adaptability of each hot file to be deployed and the target node, ensuring the quality of file transmission, and reducing the possibility of access delay.
[0065] See also Figure 4 , Figure 4 A flowchart of another hot file deployment method provided in an embodiment of the present application. The method is applied to a hot file deployment device, and the method includes but is not limited to steps S401-S404:
[0066] S401: Obtain the file size of each hot file to be deployed among a plurality of hot files to be deployed corresponding to the current time period and the number of times the hot file was accessed in the previous time period.
[0067] S402: Obtain the bandwidth of each node to be deployed among multiple nodes to be deployed corresponding to the current time period.
[0068] S403: predicting an initial quota corresponding to each node to be deployed in the current period based on the file size of each hot file to be deployed in the current period and the number of accesses in the previous period, and the bandwidth of each node to be deployed in the current period.
[0069] S404: Based on the serial number of each hot file to be deployed in the current time period, the initial quota corresponding to each node to be deployed in the current time period, and the initial storage space of each node to be deployed in the current time period, determine the target node corresponding to each hot file to be deployed in the multiple nodes to be deployed in the current time period, so as to deploy each hot file to be deployed to the corresponding target node.
[0070] The order of each hot file to be deployed in the current period is obtained by sorting multiple hot files to be deployed in the current period based on the order of the number of accesses of each hot file to be deployed in the current period from large to small.
[0071] It should be noted that the relevant principles of steps S401-S404 can refer to the relevant explanations of the above embodiments, and can solve the same technical problems and achieve the same technical effects, and will not be repeated here.
[0072] It can be seen that the embodiment of the present application obtains the number of accesses and the file size of the hot file to be deployed corresponding to the current time period in the previous time period, and obtains the bandwidth of each node to be deployed among the multiple nodes to be deployed corresponding to the current time period; then, based on the number of accesses and the file size of the hot file to be deployed corresponding to the current time period in the previous time period, and the bandwidth of each node to be deployed in the current time period, predicts the initial quota corresponding to each node to be deployed in the current time period, wherein the initial quota corresponding to each node to be deployed in the current time period represents the total amount of data transmitted by the bandwidth of each node to be deployed in the current time period; then, based on the initial quota corresponding to each node to be deployed in the current time period, determines the target node corresponding to the hot file to be deployed among the multiple nodes to be deployed in the current time period, so as to deploy the hot file to be deployed to the target node; that is, the predicted initial quota can represent the data transmission capacity of each node to be deployed, and the data transmission capacity is crucial for hot files. For example, for hot files with more accesses, It means that it needs to be frequently accessed within the target time period, and each access requires a file to be downloaded from the node, and each download requires a certain amount of traffic, which is reflected in the required data transmission capacity. Based on the file size of the hot file to be deployed and the number of times it was accessed in the previous period, it can be known that the total amount of data corresponding to the transmission of the hot file to be deployed in the previous period, and the total amount of data is used as the total amount of data that can be transmitted by the bandwidth of multiple nodes to be deployed in the current period. Based on the bandwidth of each node to be deployed in the current period and the total amount of data, it can be predicted that the total amount of data that can be transmitted by the bandwidth of each node to be deployed in the current period, that is, the initial quota, is equivalent to considering the traffic and bandwidth factors at the same time, increasing the rationality of deployment, and then selecting the target node that matches the hot file to be deployed based on the initial quota, so that the data transmission capacity of the target node can match the access demand of the hot file to be deployed, reducing the possibility of delay when the target node accesses the hot file to be deployed.
[0073] See also Figure 5 , Figure 5 This is a functional unit composition block diagram of a hot file deployment device provided in an embodiment of the present application. The hot file deployment device 500 includes: an acquisition unit 501 and a processing unit 502;
[0074] The acquisition unit 501 is used to acquire the number of accesses and the file size of the hot file to be deployed corresponding to the current time period in the previous time period;
[0075] The acquisition unit 501 is further configured to acquire the bandwidth of each node to be deployed among the multiple nodes to be deployed corresponding to the current time period;
[0076] The processing unit 502 is used to predict the initial quota corresponding to each node to be deployed in the current period based on the number of accesses and the file size of the hot file to be deployed corresponding to the current period in the previous period and the bandwidth of each node to be deployed in the current period, wherein the initial quota corresponding to each node to be deployed in the current period represents the total amount of data transmitted by the bandwidth of each node to be deployed in the current period;
[0077] The processing unit 502 is further configured to determine a target node corresponding to the hot file to be deployed among multiple nodes to be deployed in the current period based on the initial quota corresponding to each node to be deployed in the current period, so as to deploy the hot file to be deployed to the target node.
[0078] In one embodiment of the present application, in predicting the initial quota corresponding to each node to be deployed in the current period based on the number of accesses and the file size of the hot file to be deployed corresponding to the current period in the previous period, and the bandwidth of each node to be deployed in the current period, the processing unit 502 is specifically used to:
[0079] Based on the bandwidth of each node to be deployed in the current period, determine the total bandwidth corresponding to the current period;
[0080] Based on the number of accesses and file size of the hot file to be deployed corresponding to the current period in the previous period, predict the total quota corresponding to the current period, where the total quota corresponding to the current period represents the total amount of data transmitted by the total bandwidth in the current period;
[0081] Based on the total quota corresponding to the current period, the total bandwidth corresponding to the current period, and the bandwidth of each node to be deployed in the current period, the initial quota corresponding to each node to be deployed in the current period is predicted.
[0082] In one embodiment of the present application, in terms of determining a target node corresponding to a hot file to be deployed among multiple nodes to be deployed in the current period based on an initial quota corresponding to each node to be deployed in the current period, the processing unit 502 is specifically configured to:
[0083] Get the initial storage space of each node to be deployed in the current period;
[0084] Based on the initial storage space of each node to be deployed in the current period and the initial quota corresponding to each node to be deployed in the current period, the target node is determined, and the target node is the node with the largest initial quota among the nodes whose initial storage space in the current period is greater than the file size of the hot file to be deployed.
[0085] In one embodiment of the present application, if the number of hot files to be deployed corresponding to the current period is multiple, in terms of determining the target node based on the initial storage space of each node to be deployed in the current period and the initial quota corresponding to each node to be deployed in the current period, the processing unit 502 is specifically used to:
[0086] Sorting the multiple hot files to be deployed in the current time period based on the order of the heat value of each hot file to be deployed in the current time period from large to small, and obtaining the sequence number of each hot file to be deployed;
[0087] Based on the sequence number of each hot file to be deployed in the current period, the initial quota corresponding to each node to be deployed in the current period, and the initial storage space of each node to be deployed in the current period, a target node corresponding to each hot file to be deployed in the multiple nodes to be deployed in the current period is determined.
[0088] In one embodiment of the present application, in determining a target node corresponding to each hot file to be deployed in a plurality of nodes to be deployed in the current period based on the sequence number of each hot file to be deployed in the current period, the initial quota corresponding to each node to be deployed in the current period, and the initial storage space of each node to be deployed in the current period, the processing unit 502 is specifically used to:
[0089] For the i-th hot file to be deployed in the current period, based on the initial quota corresponding to each node to be deployed in the current period, the initial storage space of each node to be deployed in the current period, and the unaged files in each node to be deployed corresponding to the i-th hot file to be deployed in the current period, determine the target node corresponding to the i-th hot file to be deployed in the current period;
[0090] Among them, the i-th hot file to be deployed in the current time period is the one with the largest order among the multiple hot files to be deployed in the current time period that have not been deployed, the non-aged files in each to-be-deployed node corresponding to the i-th hot file to be deployed in the current time period are part or all of the hot files that have been deployed in the current time period, and the deployed hot files are the files that have been deployed before the i-th hot file to be deployed is deployed among the multiple hot files to be deployed.
[0091] In one embodiment of the present application, in determining the target node corresponding to the i-th hot file to be deployed in the current period based on the initial quota corresponding to each node to be deployed in the current period, the initial storage space of each node to be deployed in the current period, and the unaged files in each node to be deployed corresponding to the i-th hot file to be deployed in the current period, the processing unit 502 is specifically used to:
[0092] Based on the non-aged files in each node to be deployed corresponding to the i-th hot file to be deployed in the current period and the initial quota corresponding to each node to be deployed in the current period, predict the remaining quota of each node to be deployed corresponding to the i-th hot file to be deployed in the current period, wherein the remaining quota of each node to be deployed corresponding to the i-th hot file to be deployed represents the total amount of data remaining to be transmitted by the bandwidth of each node to be deployed corresponding to the i-th hot file to be deployed in the current period when the i-th hot file to be deployed is deployed;
[0093] Determine the remaining storage space of each node to be deployed corresponding to the i-th hot file to be deployed in the current period based on the initial storage space of each node to be deployed in the current period and the non-aged files in each node to be deployed corresponding to the i-th hot file to be deployed in the current period;
[0094] Based on the remaining quota of each to-be-deployed node corresponding to the i-th hot file to be deployed in the current time period and the remaining storage space of each to-be-deployed node corresponding to the i-th hot file to be deployed in the current time period, the target node corresponding to the i-th hot file to be deployed in the current time period is determined, so as to deploy the i-th hot file to be deployed in the current time period to the target node corresponding to the i-th hot file to be deployed, wherein the target node corresponding to the i-th hot file to be deployed in the current time period is the node with the largest remaining quota among the nodes whose remaining storage space in the current time period is greater than the file size of the i-th hot file to be deployed.
[0095] In one embodiment of the present application, in terms of determining a remaining quota of each node to be deployed corresponding to the i-th hot file to be deployed in the current period based on the non-aged files in each node to be deployed corresponding to the i-th hot file to be deployed in the current period and the initial quota corresponding to each node to be deployed in the current period, the processing unit 502 is specifically used to:
[0096] Based on the number of accesses and the file size of the non-aged files in each node to be deployed corresponding to the i-th hot file to be deployed in the current period, determine the used quota of each node to be deployed corresponding to the i-th hot file to be deployed in the current period, wherein the used quota of each node to be deployed corresponding to the i-th hot file to be deployed represents the amount of data that has been transmitted by the bandwidth of each node to be deployed corresponding to the i-th hot file to be deployed in the current period when the i-th hot file to be deployed is deployed;
[0097] Based on the initial quota corresponding to each node to be deployed in the current period and the used quota of each node to be deployed corresponding to the i-th hot file to be deployed in the current period, the remaining quota of each node to be deployed corresponding to the i-th hot file to be deployed in the current period is determined.
[0098] In one embodiment of the present application, in terms of determining the remaining storage space of each node to be deployed corresponding to the i-th hot file to be deployed in the current period based on the initial storage space of each node to be deployed in the current period and the unaged files in each node to be deployed corresponding to the i-th hot file to be deployed in the current period, the processing unit 502 is specifically used to:
[0099] Determine the used storage space of each to-be-deployed node corresponding to the i-th to-be-deployed hot file in the current period based on the file size of the non-aged file in each to-be-deployed node corresponding to the i-th to-be-deployed hot file in the current period;
[0100] Based on the initial storage space of each node to be deployed in the current period and the used storage space of each node to be deployed corresponding to the i-th hot file to be deployed in the current period, the remaining storage space of each node to be deployed corresponding to the i-th hot file to be deployed in the current period is determined.
[0101] In one embodiment of the present application, after the hot file to be deployed is deployed to the target node, the processing unit 502 is specifically configured to:
[0102] receiving an access request from a user terminal, the access request being used to request access to a hot file to be deployed;
[0103] Based on the access request, determining node information of a target node corresponding to the access request;
[0104] The node information is sent to the user terminal so that the user terminal can obtain the hot file to be deployed by accessing the target node.
[0105] In a specific implementation, the acquisition unit 501 and the processing unit 502 described in the embodiment of the present invention can also execute the corresponding implementation methods in all embodiments of the hot file deployment method provided in the embodiment of the present invention, which will not be repeated here.
[0106] See also Figure 6 , Figure 6 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Figure 6 As shown, the electronic device 600 includes a transceiver 601, a processor 602 and a memory 603. They are connected via a bus 604. The memory 603 is used to store computer programs and data, and can transmit the data stored in the memory 603 to the processor 602.
[0107] The processor 602 is used to read the computer program in the memory 603 and perform the following operations:
[0108] Control transceiver 601 to obtain the number of accesses and the file size of the hot file to be deployed corresponding to the current time period in the previous time period;
[0109] Control the transceiver 601 to obtain the bandwidth of each of the multiple nodes to be deployed corresponding to the current time period;
[0110] Based on the number of accesses and file size of the hot files to be deployed corresponding to the current period in the previous period, and the bandwidth of each node to be deployed in the current period, predict the initial quota corresponding to each node to be deployed in the current period, where the initial quota corresponding to each node to be deployed in the current period represents the total amount of data transmitted by the bandwidth of each node to be deployed in the current period;
[0111] Based on the initial quota corresponding to each to-be-deployed node in the current period, a target node corresponding to the to-be-deployed hot file among the multiple to-be-deployed nodes in the current period is determined to deploy the to-be-deployed hot file to the target node.
[0112] In one embodiment of the present application, in terms of predicting the initial quota corresponding to each node to be deployed in the current period based on the number of accesses and the file size of the hot file to be deployed corresponding to the current period in the previous period, and the bandwidth of each node to be deployed in the current period, the processor 602 is specifically used to perform the following steps:
[0113] Based on the bandwidth of each node to be deployed in the current period, determine the total bandwidth corresponding to the current period;
[0114] Based on the number of accesses and file size of the hot file to be deployed corresponding to the current period in the previous period, predict the total quota corresponding to the current period, where the total quota corresponding to the current period represents the total amount of data transmitted by the total bandwidth in the current period;
[0115] Based on the total quota corresponding to the current period, the total bandwidth corresponding to the current period, and the bandwidth of each node to be deployed in the current period, the initial quota corresponding to each node to be deployed in the current period is predicted.
[0116] In one embodiment of the present application, in terms of determining a target node corresponding to a hot file to be deployed among multiple nodes to be deployed in the current period based on an initial quota corresponding to each node to be deployed in the current period, the processor 602 is specifically configured to perform the following steps:
[0117] Get the initial storage space of each node to be deployed in the current period;
[0118] Based on the initial storage space of each node to be deployed in the current period and the initial quota corresponding to each node to be deployed in the current period, the target node is determined, and the target node is the node with the largest initial quota among the nodes whose initial storage space in the current period is greater than the file size of the hot file to be deployed.
[0119] In one embodiment of the present application, if the number of hot files to be deployed corresponding to the current time period is multiple, in terms of determining the target node based on the initial storage space of each node to be deployed in the current time period and the initial quota corresponding to each node to be deployed in the current time period, the processor 602 is specifically used to perform the following steps:
[0120] Sorting the multiple hot files to be deployed in the current time period based on the order of the heat value of each hot file to be deployed in the current time period from large to small, and obtaining the sequence number of each hot file to be deployed;
[0121] Based on the sequence number of each hot file to be deployed in the current period, the initial quota corresponding to each node to be deployed in the current period, and the initial storage space of each node to be deployed in the current period, a target node corresponding to each hot file to be deployed in the multiple nodes to be deployed in the current period is determined.
[0122] In one embodiment of the present application, in terms of determining a target node corresponding to each hot file to be deployed in a plurality of nodes to be deployed in the current period based on the sequence number of each hot file to be deployed in the current period, the initial quota corresponding to each node to be deployed in the current period, and the initial storage space of each node to be deployed in the current period, the processor 602 is specifically configured to perform the following steps:
[0123] For the i-th hot file to be deployed in the current period, based on the initial quota corresponding to each node to be deployed in the current period, the initial storage space of each node to be deployed in the current period, and the unaged files in each node to be deployed corresponding to the i-th hot file to be deployed in the current period, determine the target node corresponding to the i-th hot file to be deployed in the current period;
[0124] Among them, the i-th hot file to be deployed in the current time period is the one with the largest order among the multiple hot files to be deployed in the current time period that have not been deployed, the non-aged files in each to-be-deployed node corresponding to the i-th hot file to be deployed in the current time period are part or all of the hot files that have been deployed in the current time period, and the deployed hot files are the files that have been deployed before the i-th hot file to be deployed is deployed among the multiple hot files to be deployed.
[0125] In one embodiment of the present application, in determining the target node corresponding to the i-th hot file to be deployed in the current period based on the initial quota corresponding to each node to be deployed in the current period, the initial storage space of each node to be deployed in the current period, and the unaged files in each node to be deployed corresponding to the i-th hot file to be deployed in the current period, the processor 602 is specifically used to perform the following steps:
[0126] Based on the non-aged files in each node to be deployed corresponding to the i-th hot file to be deployed in the current period and the initial quota corresponding to each node to be deployed in the current period, predict the remaining quota of each node to be deployed corresponding to the i-th hot file to be deployed in the current period, wherein the remaining quota of each node to be deployed corresponding to the i-th hot file to be deployed represents the total amount of data remaining to be transmitted by the bandwidth of each node to be deployed corresponding to the i-th hot file to be deployed in the current period when the i-th hot file to be deployed is deployed;
[0127] Determine the remaining storage space of each node to be deployed corresponding to the i-th hot file to be deployed in the current period based on the initial storage space of each node to be deployed in the current period and the non-aged files in each node to be deployed corresponding to the i-th hot file to be deployed in the current period;
[0128] Based on the remaining quota of each to-be-deployed node corresponding to the i-th hot file to be deployed in the current time period and the remaining storage space of each to-be-deployed node corresponding to the i-th hot file to be deployed in the current time period, the target node corresponding to the i-th hot file to be deployed in the current time period is determined, so as to deploy the i-th hot file to be deployed in the current time period to the target node corresponding to the i-th hot file to be deployed, wherein the target node corresponding to the i-th hot file to be deployed in the current time period is the node with the largest remaining quota among the nodes whose remaining storage space in the current time period is greater than the file size of the i-th hot file to be deployed.
[0129] In one embodiment of the present application, in terms of determining a remaining quota of each node to be deployed corresponding to the i-th hot file to be deployed in the current period based on the non-aged files in each node to be deployed corresponding to the i-th hot file to be deployed in the current period and the initial quota corresponding to each node to be deployed in the current period, the processor 602 is specifically used to perform the following steps:
[0130] Based on the number of accesses and the file size of the non-aged files in each node to be deployed corresponding to the i-th hot file to be deployed in the current period, determine the used quota of each node to be deployed corresponding to the i-th hot file to be deployed in the current period, wherein the used quota of each node to be deployed corresponding to the i-th hot file to be deployed represents the amount of data that has been transmitted by the bandwidth of each node to be deployed corresponding to the i-th hot file to be deployed in the current period when the i-th hot file to be deployed is deployed;
[0131] Based on the initial quota corresponding to each node to be deployed in the current period and the used quota of each node to be deployed corresponding to the i-th hot file to be deployed in the current period, the remaining quota of each node to be deployed corresponding to the i-th hot file to be deployed in the current period is determined.
[0132] In one embodiment of the present application, in terms of determining the remaining storage space of each node to be deployed corresponding to the i-th hot file to be deployed in the current period based on the initial storage space of each node to be deployed in the current period and the non-aged files in each node to be deployed corresponding to the i-th hot file to be deployed in the current period, the processor 602 is specifically used to perform the following steps:
[0133] Determine the used storage space of each to-be-deployed node corresponding to the i-th to-be-deployed hot file in the current period based on the file size of the non-aged file in each to-be-deployed node corresponding to the i-th to-be-deployed hot file in the current period;
[0134] Based on the initial storage space of each node to be deployed in the current period and the used storage space of each node to be deployed corresponding to the i-th hot file to be deployed in the current period, the remaining storage space of each node to be deployed corresponding to the i-th hot file to be deployed in the current period is determined.
[0135] In one embodiment of the present application, after the hot file to be deployed is deployed to the target node, the processor 602 is specifically configured to perform the following steps:
[0136] receiving an access request from a user terminal, the access request being used to request access to a hot file to be deployed;
[0137] Based on the access request, determining node information of a target node corresponding to the access request;
[0138] The node information is sent to the user terminal so that the user terminal can obtain the hot file to be deployed by accessing the target node.
[0139] Specifically, the transceiver 601 may be Figure 5 The acquisition unit 501 of the hot file deployment device 500 of the embodiment, the processor 602 may be Figure 5 The processing unit 502 of the hot file deployment device 500 of the embodiment.
[0140] In a specific implementation, the transceiver 601, processor 602, and memory 603 described in the embodiment of the present invention may execute the corresponding implementation methods described in all embodiments of the hot file deployment method provided in the embodiment of the present invention, which will not be repeated here.
[0141] The electronic device of the present application may include a server, such as a cloud computing server, a content delivery network (CDN) server, a network time protocol (NTP), a domain name resolution system (DNS) server, and other various types of servers. The above servers are only examples, not exhaustive, and include but are not limited to the above servers.
[0142] An embodiment of the present application also provides a computer-readable storage medium, which stores a computer program. The computer program is executed by a processor to implement part or all of the steps of any hot file deployment method recorded in the above method embodiments.
[0143] An embodiment of the present application also provides a computer program product, which includes a non-transitory computer-readable storage medium storing a computer program, and the computer program is operable to cause a computer to execute part or all of the steps of any hot file deployment method recorded in the above method embodiments.
[0144] It should be noted that, for the aforementioned method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the described order of actions, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all optional embodiments, and the actions and modules involved are not necessarily required by the present application.
[0145] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0146] In the several embodiments provided in the present application, it should be understood that the disclosed devices can be implemented in other ways. For example, the device embodiments described above are only schematic, such as the division of units, which is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, and the indirect coupling or communication connection of devices or units can be electrical or other forms.
[0147] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0148] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above integrated unit may be implemented in the form of hardware or in the form of a software program module.
[0149] If the integrated unit is implemented in the form of a software program module and sold or used as an independent product, it can be stored in a computer-readable memory. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, which is stored in a memory and includes several instructions for a computer device (which can be a personal computer, server or network device, etc.) to perform all or part of the steps of each embodiment method of the present application. The aforementioned memory includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, disk or optical disk and other media that can store program codes.
[0150] A person skilled in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructing related hardware through a program, and the program can be stored in a computer-readable memory, and the memory can include: a flash drive, a read-only memory (English: Read-Only Memory, abbreviated as: ROM), a random access memory (English: Random Access Memory, abbreviated as: RAM), a magnetic disk or an optical disk, etc.
[0151] The embodiments of the present application are introduced in detail above. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea. At the same time, for those skilled in the art, according to the idea of the present application, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.
Claims
1. A hot file deployment method, characterized in that: The method comprises: Obtain the number of accesses and file size of the hot file to be deployed corresponding to the current period in the previous period; Obtaining the bandwidth of each of the multiple nodes to be deployed corresponding to the current time period; Based on the number of accesses and the file size of the hot file to be deployed in the previous time period, and the bandwidth of each node to be deployed, predict the initial quota corresponding to each node to be deployed in the current time period, wherein the initial quota corresponding to each node to be deployed in the current time period represents the total amount of data transmitted by the bandwidth of each node to be deployed in the current time period; including: determining the total bandwidth corresponding to the current time period based on the bandwidth of each node to be deployed; predicting the total quota corresponding to the current time period based on the number of accesses and the file size of the hot file to be deployed in the previous time period, wherein the total quota corresponding to the current time period represents the total amount of data transmitted by the total bandwidth in the current time period; predicting the initial quota corresponding to each node to be deployed based on the total quota and the ratio between the bandwidth of each node to be deployed and the total bandwidth; Based on the initial quota corresponding to each to-be-deployed node, a target node corresponding to the to-be-deployed hot file among the multiple to-be-deployed nodes is determined, so as to deploy the to-be-deployed hot file to the target node.
2. The method according to claim 1, characterized in that The determining, based on the initial quota corresponding to each node to be deployed, a target node corresponding to the hot file to be deployed among the multiple nodes to be deployed, comprises: Get the initial storage space of each node to be deployed in the current period; The target node is determined based on the initial storage space of each node to be deployed and the initial quota corresponding to each node to be deployed. The target node is the node with the largest initial quota among the nodes whose initial storage space is larger than the file size of the hot file to be deployed in the current period.
3. The method according to claim 2, characterized in that If the number of hot files to be deployed corresponding to the current time period is multiple, determining the target node based on the initial storage space of each node to be deployed and the initial quota corresponding to each node to be deployed includes: Sorting the multiple hot files to be deployed based on the order of the heat value of each hot file to be deployed in the current time period from large to small, and obtaining the sequence number of each hot file to be deployed; Based on the sequence number of each hot file to be deployed, the initial quota corresponding to each node to be deployed, and the initial storage space of each node to be deployed, a target node corresponding to each hot file to be deployed among the multiple nodes to be deployed is determined.
4. The method according to claim 3, characterized in that: The step of determining a target node corresponding to each hot file to be deployed among multiple nodes to be deployed based on the sequence number of each hot file to be deployed, the initial quota corresponding to each node to be deployed, and the initial storage space of each node to be deployed includes: For the i-th hot file to be deployed, based on the initial quota corresponding to each node to be deployed, the initial storage space of each node to be deployed, and the non-aged files in each node to be deployed corresponding to the i-th hot file to be deployed, determine the target node corresponding to the i-th hot file to be deployed; Among them, the non-aged files in each to-be-deployed node corresponding to the i-th to-be-deployed hot file are part or all of the hot files that have been deployed in the current time period, the deployed hot files are files that have been deployed before the i-th to-be-deployed hot file is deployed among the multiple hot files to be deployed, and the i-th to-be-deployed hot file is the one with the earliest sequence number among the multiple hot files that have not been deployed among the multiple hot files to be deployed.
5. The method according to claim 4, characterized in that The determining the target node corresponding to the i-th hot file to be deployed based on the initial quota corresponding to each node to be deployed, the initial storage space of each node to be deployed, and the non-aged files in each node to be deployed corresponding to the i-th hot file to be deployed, comprises: Based on the non-aged files in each node to be deployed corresponding to the i-th hot file to be deployed and the initial quota corresponding to each node to be deployed, predict the remaining quota of each node to be deployed corresponding to the i-th hot file to be deployed, wherein the remaining quota of each node to be deployed corresponding to the i-th hot file to be deployed represents the total amount of data remaining to be transmitted by the bandwidth of each node to be deployed corresponding to the i-th hot file to be deployed in the current time period when the i-th hot file to be deployed is deployed; Determine the remaining storage space of each node to be deployed corresponding to the i-th hot file to be deployed based on the initial storage space of each node to be deployed and the non-aged files in each node to be deployed corresponding to the i-th hot file to be deployed; Based on the remaining quota of each to-be-deployed node corresponding to the i-th hot file to be deployed and the remaining storage space of each to-be-deployed node corresponding to the i-th hot file to be deployed, the target node corresponding to the i-th hot file to be deployed is determined, so as to deploy the i-th hot file to be deployed to the target node corresponding to the i-th hot file to be deployed, wherein the target node corresponding to the i-th hot file to be deployed is the node with the largest remaining quota among the nodes whose remaining storage space is greater than the file size of the i-th hot file to be deployed.
6. The method according to claim 5, characterized in that The predicting the remaining quota of each node to be deployed corresponding to the i-th hot file to be deployed based on the non-aged files in each node to be deployed corresponding to the i-th hot file to be deployed and the initial quota corresponding to each node to be deployed includes: Determine the used quota of each node to be deployed corresponding to the i-th hot file to be deployed based on the number of accesses and the file size of the non-aged file in each node to be deployed corresponding to the i-th hot file to be deployed, wherein the used quota of each node to be deployed corresponding to the i-th hot file to be deployed represents the amount of data that has been transmitted by the bandwidth of each node to be deployed corresponding to the i-th hot file to be deployed in the current time period when the i-th hot file to be deployed is deployed; Based on the initial quota corresponding to each to-be-deployed node and the used quota of each to-be-deployed node corresponding to the i-th to-be-deployed hot file, the remaining quota of each to-be-deployed node corresponding to the i-th to-be-deployed hot file is determined.
7. The method according to claim 5 or 6, characterized in that: The determining, based on the initial storage space of each node to be deployed and the non-aged files in each node to be deployed corresponding to the i-th hot file to be deployed, the remaining storage space of each node to be deployed corresponding to the i-th hot file to be deployed comprises: Determine the used storage space of each to-be-deployed node corresponding to the i-th to-be-deployed hot file based on the file size of the non-aged file in each to-be-deployed node corresponding to the i-th to-be-deployed hot file; Based on the initial storage space of each node to be deployed and the used storage space of each node to be deployed corresponding to the i-th hot file to be deployed, the remaining storage space of each node to be deployed corresponding to the i-th hot file to be deployed is determined.
8. The method according to claim 1, characterized in that After deploying the hot file to be deployed to the target node, the method further includes: receiving an access request from a user terminal, the access request being used to request access to the hot file to be deployed; Based on the access request, determining node information of a target node corresponding to the access request; The node information is sent to the user terminal, so that the user terminal obtains the hot file to be deployed by accessing the target node.
9. A hot file deployment device, characterized in that: The device comprises: an acquisition unit and a processing unit; The acquisition unit is used to acquire the number of accesses and the file size of the hot file to be deployed corresponding to the current time period in the previous time period; The acquisition unit is further configured to acquire the bandwidth of each node to be deployed among the multiple nodes to be deployed corresponding to the current time period; The processing unit is used to predict the initial quota corresponding to each node to be deployed in the current period based on the number of times the hot file to be deployed was accessed and the file size in the previous period, and the bandwidth of each node to be deployed, wherein the initial quota corresponding to each node to be deployed in the current period represents the total amount of data transmitted by the bandwidth of each node to be deployed in the current period; including: determining the total bandwidth corresponding to the current period based on the bandwidth of each node to be deployed; predicting the total quota corresponding to the current period based on the number of times the hot file to be deployed was accessed and the file size in the previous period, wherein the total quota corresponding to the current period represents the total amount of data transmitted by the total bandwidth in the current period; predicting the initial quota corresponding to each node to be deployed based on the ratio between the bandwidth of each node to be deployed and the total bandwidth; The processing unit is further configured to determine a target node corresponding to the hot file to be deployed among the multiple nodes to be deployed based on an initial quota corresponding to each node to be deployed, so as to deploy the hot file to be deployed to the target node.
10. An electronic device, characterized in that: include: A processor and a memory, wherein the processor is connected to the memory, the memory is used to store a computer program, and the processor is used to execute the computer program stored in the memory, so that the electronic device executes the method as described in any one of claims 1 to 8.
11. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and the computer program is executed by a processor to implement the method according to any one of claims 1 to 8.
