CN116126527A - Distribution method and device for server cluster data migration tasks - Google Patents

Distribution method and device for server cluster data migration tasks Download PDF

Info

Publication number
CN116126527A
CN116126527A CN202211716346.2A CN202211716346A CN116126527A CN 116126527 A CN116126527 A CN 116126527A CN 202211716346 A CN202211716346 A CN 202211716346A CN 116126527 A CN116126527 A CN 116126527A
Authority
CN
China
Prior art keywords
server
data migration
preset
task
flow threshold
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211716346.2A
Other languages
Chinese (zh)
Inventor
黄琪璜
龙瑞明
黄鹄
林洁琬
黄润怀
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tianyi Cloud Technology Co Ltd
Original Assignee
Tianyi Cloud Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tianyi Cloud Technology Co Ltd filed Critical Tianyi Cloud Technology Co Ltd
Priority to CN202211716346.2A priority Critical patent/CN116126527A/en
Publication of CN116126527A publication Critical patent/CN116126527A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5083Techniques for rebalancing the load in a distributed system
    • G06F9/5088Techniques for rebalancing the load in a distributed system involving task migration
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5027Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5061Partitioning or combining of resources
    • G06F9/5072Grid computing
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Mathematical Physics (AREA)
  • Multi Processors (AREA)

Abstract

The application discloses a method and a device for distributing server cluster data migration tasks, wherein the method comprises the following steps: obtaining a target weight of each server according to the preset weight, data migration time, data migration quantity and the number of unfinished data migration tasks of each server of the server cluster in the obtained preset statistical time range; obtaining average data migration flow of each server according to the data migration quantity of each server and a preset statistical time range; obtaining a priority coefficient of each server according to the target weight and average data migration flow of each server; according to the priority coefficient, the target data migration task is distributed to the corresponding server, so that the target data migration task can be distributed to the servers in the server cluster without manual work, and the problem that the efficiency of manually distributing the data migration task to be distributed to the servers in the server cluster in the prior art is low is solved.

Description

Distribution method and device for server cluster data migration tasks
Technical Field
The application particularly relates to a method and a device for distributing server cluster data migration tasks.
Background
When a server cluster performs a data migration task, the data migration task to be allocated needs to be allocated to a server in the server cluster, which needs to be an allocation method of the data migration task of the server cluster.
In the prior art, a worker needs to query the data migration task condition on each server in the server cluster, and then manually distributes the data migration task to be distributed to the servers in the server cluster according to the data migration task condition on each server.
In implementing the present application, the inventors found that at least the following problems exist in the prior art: because staff needs to inquire the data migration task condition on each server in the server cluster, and then manually distributes the data migration task to be distributed to the servers in the server cluster according to the data migration task condition on each server, the efficiency of distributing the data migration task to be distributed to the servers in the server cluster is low.
Disclosure of Invention
The application aims to provide a method and a device for distributing data migration tasks of a server cluster, which at least solve the problem that in the prior art, because workers need to inquire the data migration task condition on each server in the server cluster, then manually distribute the data migration task to be distributed to the servers in the server cluster according to the data migration task condition on each server, so that the efficiency of distributing the data migration task to be distributed to the servers in the server cluster is low.
In order to solve the technical problems, the application is realized as follows:
in a first aspect, an embodiment of the present application provides a method for distributing a server cluster data migration task, where the method includes:
acquiring data migration time, data migration quantity and number of unfinished data migration tasks of each server of a server cluster in a preset statistical time range; the data migration time is smaller than or equal to a preset statistical time range;
calculating to obtain the target weight of each server according to the preset weight, the data migration time, the data migration quantity and the number of unfinished data migration tasks of each server;
calculating to obtain the average data migration flow of each server according to the data migration quantity of each server and the preset statistical time range;
according to the target weight and average data migration flow of each server, calculating to obtain a priority coefficient of each server;
distributing target data migration tasks to the corresponding servers according to the priority coefficients of the servers; the target data migration task is a task for indicating the server to perform data migration.
Optionally, the actual data migration traffic threshold of the server has a corresponding server token bucket; the server token bucket stores the first tokens added according to the first token generation time within a first preset storage time range; the first token generation time is set according to the actual data migration flow threshold of the server;
the step of obtaining the data migration quantity of the server in the preset statistical time range comprises the following steps:
acquiring an actual data migration flow threshold of the server;
generating the server token bucket according to the actual data migration flow threshold of the server;
acquiring the number of first tokens taken out from a server token bucket within the preset statistical time range;
and acquiring the data migration quantity of the server in the preset statistical time range according to the quantity of the first tokens extracted from the server token bucket in the preset statistical time range and the preset data quantity allowed to be transmitted by the first tokens.
Optionally, the obtaining the actual data migration flow threshold of the server includes:
calculating and obtaining an average data migration flow threshold of the server according to the obtained residual network bandwidth of the server cluster and the number of servers of the server cluster;
Taking the preset data migration flow threshold of the server as the actual data migration flow threshold of the server under the condition that the average data migration flow threshold of the server is larger than or equal to the preset data migration flow threshold of the server;
under the condition that the average data migration flow threshold of the server is smaller than the preset data migration flow threshold of the server, taking the newly set data migration flow threshold of the server as the actual data migration flow threshold of the server; and the newly set data migration flow threshold of the server is smaller than the average data migration flow threshold of the server.
Optionally, the relationship between the first token generation time and the actual data migration flow threshold of the server is inversely related; the relation between the first token generation time and the preset data quantity allowed to be transmitted by the first token is positive correlation;
the step of obtaining the first token generation time includes:
acquiring an actual data migration flow threshold of the server;
and obtaining the first token generation time according to the actual data migration flow threshold of the server and the preset data volume allowed to be transmitted by the first token.
Optionally, the allocating the target data migration task to the corresponding server according to the priority coefficient of the server includes:
comparing the magnitude of the priority coefficient of each server to obtain a comparison result;
and distributing the target data migration task to the server with the largest priority coefficient according to the comparison result.
Optionally, the preset data migration flow threshold of the data migration task has a corresponding task token bucket; the task token bucket stores the second tokens added according to the second token generation time within a second preset storage time range; the second token generation time is set according to a preset data migration flow threshold of the data migration task;
the step of obtaining the data migration quantity of the server in the preset statistical time range comprises the following steps:
generating a task token bucket corresponding to each data migration task according to a preset data migration flow threshold of each data migration task of the server;
acquiring the number of second tokens taken out from each task token bucket within the preset statistical time range;
acquiring the migrated data quantity of each data migration task of the server in the preset statistical time range according to the quantity of second tokens taken out from each task token bucket in the preset statistical time range and the data quantity allowed to be transmitted by the preset second tokens;
And summing the migrated data amounts of all the data migration tasks of the server to obtain the data migration amount of the server in the preset statistical time range.
Optionally, the relation between the target weight and the preset weight is positive correlation; the relation between the target weight and the data migration quantity is positive correlation; the relation between the target weight and the data migration time is in negative correlation; the relation between the target weight and the number of incomplete data migration tasks of the server is in negative correlation;
the relation between the priority coefficient and the target weight is positive correlation; the relationship between the priority coefficient and the average data migration flow is in negative correlation.
In a second aspect, an embodiment of the present application further provides an apparatus for distributing a server cluster data migration task, where the apparatus includes:
the acquisition module is used for acquiring the data migration time, the data migration quantity and the number of unfinished data migration tasks of each server of the server cluster in a preset statistical time range; the data migration time is smaller than or equal to a preset statistical time range;
the first calculation module is used for calculating and obtaining the target weight of each server according to the preset weight, the data migration time, the data migration quantity and the number of unfinished data migration tasks of each server;
The second calculation module is used for calculating and obtaining the average data migration flow of each server according to the data migration quantity of each server and the preset statistical time range;
the third calculation module is used for calculating and obtaining the priority coefficient of each server according to the target weight and average data migration flow of each server;
the allocation module is used for allocating the target data migration task to the corresponding server according to the priority coefficient of the server; the target data migration task is a task for indicating the server to perform data migration.
Optionally, the actual data migration traffic threshold of the server has a corresponding server token bucket; the server token bucket stores the first tokens added according to the first token generation time within a first preset storage time range; the first token generation time is set according to the actual data migration flow threshold of the server;
the acquisition module is specifically used for acquiring an actual data migration flow threshold of the server; generating the server token bucket according to the actual data migration flow threshold of the server; acquiring the number of first tokens taken out from a server token bucket within the preset statistical time range; and acquiring the data migration quantity of the server in the preset statistical time range according to the quantity of the first tokens extracted from the server token bucket in the preset statistical time range and the preset data quantity allowed to be transmitted by the first tokens.
Optionally, the obtaining module is specifically further configured to calculate, according to the obtained remaining network bandwidth of the server cluster and the number of servers of the server cluster, to obtain an average data migration flow threshold of the servers; taking the preset data migration flow threshold of the server as the actual data migration flow threshold of the server under the condition that the average data migration flow threshold of the server is larger than or equal to the preset data migration flow threshold of the server; under the condition that the average data migration flow threshold of the server is smaller than the preset data migration flow threshold of the server, taking the newly set data migration flow threshold of the server as the actual data migration flow threshold of the server; and the newly set data migration flow threshold of the server is smaller than the average data migration flow threshold of the server.
Optionally, the relationship between the first token generation time and the actual data migration flow threshold of the server is inversely related; the relation between the first token generation time and the preset data quantity allowed to be transmitted by the first token is positive correlation;
the acquisition module is specifically further configured to acquire an actual data migration flow threshold of the server; and obtaining the first token generation time according to the actual data migration flow threshold of the server and the preset data volume allowed to be transmitted by the first token.
Optionally, the distribution module specifically includes:
the comparison sub-module is used for comparing the magnitude of the priority coefficient of each server to obtain a comparison result;
and the allocation submodule is used for allocating the target data migration task to the server with the largest priority coefficient according to the comparison result.
Optionally, the preset data migration flow threshold of the data migration task has a corresponding task token bucket; the task token bucket stores the second tokens added according to the second token generation time within a second preset storage time range; the second token generation time is set according to a preset data migration flow threshold of the data migration task;
the acquisition module is specifically further configured to generate a task token bucket corresponding to each data migration task according to a preset data migration flow threshold of each data migration task of the server; acquiring the number of second tokens taken out from each task token bucket within the preset statistical time range; acquiring the migrated data quantity of each data migration task of the server in the preset statistical time range according to the quantity of second tokens taken out from each task token bucket in the preset statistical time range and the data quantity allowed to be transmitted by the preset second tokens; and summing the migrated data amounts of all the data migration tasks of the server to obtain the data migration amount of the server in the preset statistical time range.
In a third aspect, embodiments of the present application further provide an electronic device, including a processor, a memory, and a program or instruction stored on the memory and executable on the processor, the program or instruction implementing the steps of the method according to the first aspect when executed by the processor.
In a fourth aspect, embodiments of the present application also provide a readable storage medium having stored thereon a program or instructions which, when executed by a processor, implement the steps of the method according to the first aspect.
In the embodiment of the application, the data migration time, the data migration quantity and the number of unfinished data migration tasks of each server of the server cluster in a preset statistical time range are obtained; the data migration time is smaller than or equal to a preset statistical time range; calculating to obtain the target weight of each server according to the preset weight, the data migration time, the data migration quantity and the number of unfinished data migration tasks of each server; according to the data migration quantity of each server and a preset statistical time range, calculating to obtain the average data migration flow of each server; according to the target weight and average data migration flow of each server, calculating to obtain a priority coefficient of each server; distributing the target data migration task to a corresponding server according to the priority coefficient of the server; the target data migration task is a task for indicating the server to perform data migration, so that the target data migration task is allocated to the server in the server cluster, the data migration task to be allocated is not required to be manually inquired on each server, and the data migration task to be allocated is manually allocated to the server in the server cluster according to the data migration task condition on each server, so that the efficiency of allocating the data migration task to the server in the server cluster is improved, and the problem that in the prior art, the efficiency of allocating the data migration task to be allocated to the server in the server cluster is low because a worker needs to inquire the data migration task condition on each server in the server cluster first, and then the data migration task to be allocated is manually allocated to the server in the server cluster according to the data migration task condition on each server is solved.
Drawings
Fig. 1 is a flowchart of steps of a method for distributing server cluster data migration tasks according to an embodiment of the present application;
fig. 2 is a flowchart of specific steps of a method for distributing server cluster data migration tasks according to an embodiment of the present application;
FIG. 3 is a schematic diagram of a distribution system of server cluster data migration tasks according to an embodiment of the present application;
FIG. 4 is a flow chart of load balancing data migration traffic of a distribution system of server cluster data migration tasks according to an embodiment of the present application;
FIG. 5 is a flow chart of data migration flow control of a distribution system for server cluster data migration tasks according to an embodiment of the present application;
FIG. 6 is a block diagram of an allocation apparatus for server cluster data migration tasks according to an embodiment of the present application;
fig. 7 is a schematic hardware structure of an electronic device according to an embodiment of the present application.
Detailed Description
The following description of the embodiments of the present application will be made clearly and fully with reference to the accompanying drawings, in which it is evident that the embodiments described are some, but not all, of the embodiments of the present application. All other embodiments, which can be made by one of ordinary skill in the art based on the embodiments herein without making any inventive effort, are intended to be within the scope of the present application.
The terms first, second and the like in the description and in the claims, are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged, as appropriate, such that embodiments of the present application may be implemented in sequences other than those illustrated or described herein, and that the objects identified by "first," "second," etc. are generally of a type and not limited to the number of objects, e.g., the first object may be one or more. Furthermore, in the description and claims, "and/or" means at least one of the connected objects, and the character "/", generally means that the associated object is an "or" relationship.
It should be noted that, in the embodiment of the present application, the server cluster includes a plurality of servers, and the data migration may be to store the data migrated into the servers in the server cluster; the target initial data migration task is an initial task requiring the server cluster to execute data migration; the target initial data migration task may be divided into a plurality of target data migration tasks, i.e., tasks that need to be allocated to a server to perform data migration.
The following describes in detail, by means of specific embodiments and application scenarios thereof, a method for distributing server cluster data migration tasks provided in the embodiments of the present application with reference to the accompanying drawings.
Fig. 1 is a flowchart of steps of a method for distributing server cluster data migration tasks according to an embodiment of the present application, where, as shown in fig. 1, the method may include:
step 101, acquiring data migration time, data migration quantity and number of unfinished data migration tasks of each server of a server cluster in a preset statistical time range; the data migration time is smaller than or equal to a preset statistical time range.
In this step, the data migration time, the data migration volume, and the number of incomplete data migration tasks of each server of the server cluster within the preset statistical time range are obtained as a basis for performing "step 102".
Specifically, in some embodiments, the preset statistical time range may be preset, for example, the preset statistical time range may be 0.5 hours, 0.8 hours, 1 hour, 1.5 hours, 2 hours, or the like.
It should be noted that, the data migration time of each server is the accumulated time of the data migration task performed by each server within the preset statistical time range. For example, the preset statistical time range is 2 hours, and the statistics start from 9 am to 11 am; the method comprises the steps that 30 minutes in 9 am, a server A starts to execute a data migration task a1, a server B starts to execute a data migration task B1 and a data migration task B2, 00 minutes in 10 am, the server A finishes executing the data migration task a1, the server B finishes executing the data migration task B1, 30 minutes in 10 am, and the server B finishes executing the data migration task B2; the method comprises the steps that 40 minutes in 10 am, a server A starts to execute a data migration task a2 and starts to execute a data migration task a3, and 50 minutes in 10 am, the server A finishes executing the data migration task a2 and finishes executing the data migration task a3; at 10 am, 55 minutes, server B begins to perform data migration task B3; at 11.05 minutes in the morning, the server B finishes executing the data migration task B3; the method comprises the steps that 9.00 am is divided into 30 minutes to 9 am, no data migration task needs to be executed by a server A and a server B, 10.00 am is divided into 40 minutes to 10 am, 50 minutes to 11.00 am, and no data migration task needs to be executed by the server A; the method comprises the steps that 30 minutes in the morning are divided into 55 minutes in the morning, and a server B does not have a data migration task to be executed; the data migration time of server a is 40 minutes, which is obtained by subtracting the difference of 9 points from 00 points by 30 points (30 minutes), adding the difference of 10 points from 50 points by 40 points (10 minutes), i.e. adding the sum of 30 minutes and 10 minutes (40 minutes); the data migration time for server B was 65 minutes, with the difference of 10 points 30 minus 9 points 30 (60 minutes), plus the difference of 11 points 00 minus 10 points 55 (5 minutes), i.e., 60 minutes plus the sum of 5 minutes (65 minutes).
The number of incomplete data migration tasks is the sum of the number of data migration tasks being executed and the number of data migration tasks to be executed at the end time of the preset statistical time range, for example, the preset statistical time range is 1 hour, counting from 9.00 am to 10.00 am; at the time of 00 am, the number of data migration tasks being executed by the server a is 3, the number of data migration tasks to be executed is 2, and the number of incomplete data migration tasks of the server a is 5.
And 102, calculating to obtain the target weight of each server according to the preset weight, the data migration time, the data migration quantity and the number of unfinished data migration tasks of each server.
In this step, the target weight of each server is obtained by calculation from the preset weight, data migration time, data migration amount, and number of incomplete data migration tasks of each server, as one of the bases for performing "step 104".
It should be noted that the preset weight is a weight preset according to an initial state of each server.
Specifically, in some embodiments, the target weight for the server is obtained by calculation according to the following mathematical expression:
Figure BDA0004027845880000101
wherein w is r The target weight of the server is w is the preset weight of the server, and T m The data migration time of the server is given, S is the data migration volume of the server, and n is the number of incomplete data migration tasks of the server.
And 103, calculating and obtaining the average data migration flow of each server according to the data migration quantity of each server and the preset statistical time range.
In this step, the average data migration flow rate of each server is calculated and obtained by referring to the data migration amount of each server and the preset statistical time range, as one of the bases for performing "step 104".
Specifically, in some embodiments, the average data migration traffic for the server is calculated according to the following mathematical expression:
R t =S÷T
wherein R is t And S is the data migration volume of the server, and T is the preset statistical time range of the server.
And 104, calculating and obtaining the priority coefficient of each server according to the target weight and average data migration flow of each server.
In this step, the priority coefficient of each server is obtained by calculation from the target weight and average data migration traffic of each server, as a basis for performing "step 105".
Specifically, in some embodiments, the priority coefficient of the server is obtained by calculation according to the following mathematical expression:
P=w r ÷R t
wherein P is the priority coefficient of the server, w r R is the target weight of the server t And (5) migrating traffic for average data of the server.
And 105, distributing the target data migration task to the corresponding server according to the priority coefficient of the server.
The target data migration task is a task for indicating the server to perform data migration.
In the step, the target data migration task is distributed to the corresponding servers according to the priority coefficient of the servers, so that the target data migration task is distributed to the servers in the server cluster, the data migration task condition on each server does not need to be queried manually, the data migration task to be distributed is distributed to the servers in the server cluster manually according to the data migration task condition on each server, and the efficiency of distributing the data migration task to the servers in the server cluster is improved.
Specifically, in some embodiments, the priority coefficient of the server is obtained by calculating for the end time of the preset statistical time range, for example, the preset statistical time range is 1 hour, and the statistics start from 9 am to 10 am; the priority coefficient of the server is obtained by calculation at the time of 00 hours in the morning.
The method and the device can be used for obtaining the data migration time, the data migration quantity and the number of unfinished data migration tasks of each server of the server cluster in a preset statistical time range; the data migration time is smaller than or equal to a preset statistical time range; calculating to obtain the target weight of each server according to the preset weight, the data migration time, the data migration quantity and the number of unfinished data migration tasks of each server; according to the data migration quantity of each server and a preset statistical time range, calculating to obtain the average data migration flow of each server; according to the target weight and average data migration flow of each server, calculating to obtain a priority coefficient of each server; distributing the target data migration task to a corresponding server according to the priority coefficient of the server; the target data migration task is a task for indicating the server to perform data migration, so that the target data migration task is allocated to the server in the server cluster, the data migration task to be allocated is not required to be manually inquired on each server, and the data migration task to be allocated is manually allocated to the server in the server cluster according to the data migration task condition on each server, so that the efficiency of allocating the data migration task to the server in the server cluster is improved, and the problem that in the prior art, the efficiency of allocating the data migration task to be allocated to the server in the server cluster is low because a worker needs to inquire the data migration task condition on each server in the server cluster first, and then the data migration task to be allocated is manually allocated to the server in the server cluster according to the data migration task condition on each server is solved.
Fig. 2 is a flowchart of specific steps of a method for distributing server cluster data migration tasks according to an embodiment of the present application, and as shown in fig. 2, the method may include:
step 201, obtaining data migration time, data migration quantity and number of incomplete data migration tasks of each server of a server cluster in a preset statistical time range; the data migration time is smaller than or equal to a preset statistical time range.
The implementation of this step is similar to the implementation of the "step 101" described above, and will not be repeated here.
Optionally, in some embodiments, the actual data migration traffic threshold of the server has a corresponding server token bucket; the server token bucket stores the first tokens added according to the first token generation time within a first preset storage time range; the first token generation time is set according to the actual data migration flow threshold of the server; in step 201, the step of obtaining the data migration amount of the server within the preset statistical time range includes:
and 2011, acquiring an actual data migration flow threshold of the server.
In this step, the actual data migration traffic threshold of the server is obtained as a basis for performing "step 2012".
Optionally, in some embodiments, step 2011 specifically includes the following steps (step 2011a, step 2011b, step 2011 c):
and step 2011a, calculating to obtain an average data migration flow threshold of the servers according to the obtained residual network bandwidth of the server cluster and the number of the servers of the server cluster.
In this step, an average data migration flow threshold of the servers is calculated according to the acquired remaining network bandwidth of the server cluster and the number of servers of the server cluster, and the average data migration flow threshold is used as a basis for executing "step 2011b" or "step 2011 c".
Optionally, in some embodiments, the remaining network bandwidth of the server cluster is a difference of a total bandwidth of the server cluster minus a bandwidth required by a preset daily service, and a unit of the remaining network bandwidth of the server cluster is the same as a unit of the average data migration traffic threshold.
Specifically, in some embodiments, the average data migration traffic threshold for the server is calculated according to the following mathematical expression:
Y flat plate =Y÷F
Wherein Y is Flat plate And (3) the average data migration flow threshold of the servers, Y is the residual network bandwidth of the server cluster, and F is the number of servers of the server cluster.
And step 2011b, taking the preset data migration flow threshold of the server as the actual data migration flow threshold of the server under the condition that the average data migration flow threshold of the server is greater than or equal to the preset data migration flow threshold of the server.
In the step, the preset data migration flow threshold of the server is used as the actual data migration flow threshold of the server under the condition that the average data migration flow threshold of the server is larger than or equal to the preset data migration flow threshold of the server, so that the actual data migration flow threshold of the server is obtained.
Specifically, in some embodiments, the preset data migration flow threshold of the server is a preset initial data migration flow threshold of the server.
And step 2011c, taking the newly set data migration flow threshold of the server as the actual data migration flow threshold of the server under the condition that the average data migration flow threshold of the server is smaller than the preset data migration flow threshold of the server.
And the newly set data migration flow threshold of the server is smaller than the average data migration flow threshold of the server.
In the step, the new data migration flow threshold of the server is used as the actual data migration flow threshold of the server under the condition that the average data migration flow threshold of the server is smaller than the preset data migration flow threshold of the server.
Specifically, in some embodiments, the new data migration traffic threshold for the server may be 50% of the average data migration traffic threshold for the server; in other embodiments, the new data migration flow threshold for the server may also be 30%, 40%, 60%, 70%, etc. of the average data migration flow threshold for the server.
By executing step 2011a, step 2011b and step 2011c in the embodiment of the present application, an average data migration flow threshold of a server is calculated and obtained according to the obtained residual network bandwidth of the server cluster and the number of servers of the server cluster; under the condition that the average data migration flow threshold value of the server is larger than or equal to the preset data migration flow threshold value of the server, taking the preset data migration flow threshold value of the server as the actual data migration flow threshold value of the server; under the condition that the average data migration flow threshold value of the server is smaller than the preset data migration flow threshold value of the server, taking the newly set data migration flow threshold value of the server as the actual data migration flow threshold value of the server; the new data migration flow threshold of the server is smaller than the average data migration flow threshold of the server, so that the actual data migration flow threshold of the server is obtained.
Step 2012, generating the server token bucket according to the actual data migration flow threshold of the server.
In this step, a server token bucket is generated as a basis for performing "step 2013" by migrating traffic thresholds according to actual data of the server.
And 2013, acquiring the number of the first tokens taken out from the server token bucket within the preset statistical time range.
In this step, the number of first tokens taken from the server token bucket within a preset statistical time range is obtained as a basis for performing "step 2014".
And 2014, acquiring the data migration quantity of the server in the preset statistical time range according to the quantity of the first tokens extracted from the server token bucket in the preset statistical time range and the preset data quantity allowed to be transmitted by the first tokens.
In the step, the data migration quantity of the servers in the preset statistical time range is obtained through the quantity of the first tokens which are taken out from the server token bucket in the preset statistical time range and the data quantity which is allowed to be transmitted by the preset first tokens, and the data migration quantity of each server in the preset statistical time range is used as a basis for calculating to obtain the target weight of each server and calculating to obtain the average data migration flow of each server.
Alternatively, in some embodiments, the predetermined first token may allow the amount of data to be transferred may be 1 byte, 2 bytes, 3 bytes, 4 bytes, 5 bytes, etc.
Specifically, in some embodiments, the data migration volume of the server is calculated according to the following mathematical expression:
Figure BDA0004027845880000151
s is the data migration volume of the server, N 1 For the number of first tokens taken from the server token bucket within a preset statistical time frame,
Figure BDA0004027845880000161
the amount of data transferred is allowed for a preset first token.
The steps 2011 to 2014 can be implemented by executing the embodiment of the application, and the actual data migration flow threshold of the server is obtained; generating a server token bucket according to the actual data migration flow threshold of the server; acquiring the number of first tokens taken out from a server token bucket within a preset statistical time range; and acquiring the data migration quantity of the server in the preset statistical time range according to the quantity of the first tokens extracted from the server token bucket in the preset statistical time range and the data quantity allowed to be transmitted by the preset first tokens.
Alternatively, in some embodiments, the first preset storage time range may be 3 seconds; in other embodiments, the first predetermined storage time range may be 2 seconds, 4 seconds, 5 seconds, 6 seconds, etc.
Optionally, in some embodiments, the specific process of adding the first token generated according to the first token generation time to the server token bucket within the first preset deposit time range is: each time the first token generation time elapses, one first token is generated, and the generated first token is added to the server token bucket.
Optionally, in some embodiments, the relationship of the first token generation time and the actual data migration traffic threshold of the server is a negative correlation; the relation between the first token generation time and the preset data quantity allowed to be transmitted by the first token is positive correlation; the step of obtaining the first token generation time includes:
step 301, acquiring an actual data migration flow threshold of the server.
In this step, the actual data migration flow threshold of the server is obtained as a basis for performing "step 302".
Optionally, in some embodiments, the specific steps of obtaining the actual data migration flow threshold of the server are similar to the steps 2011a, 2011b, 2011c described above, and will not be repeated here.
And 302, obtaining the first token generation time according to the actual data migration flow threshold of the server and the preset data volume allowed to be transmitted by the first token.
In this step, the first token generation time is obtained by migrating the traffic threshold and the preset first token-allowed amount of data to be transmitted according to the actual data of the server.
Specifically, in some embodiments, the first token generation time is calculated according to the following mathematical expression:
Figure BDA0004027845880000171
wherein t is 1 Generating a time for the first token, Y Real world For the actual data migration traffic threshold of the server,
Figure BDA0004027845880000172
allowing transmission for a preset first tokenData amount.
The implementation of steps 301 to 302 can be realized by implementing the embodiment of the present application, and the actual data migration flow threshold of the server is obtained; and obtaining a first token generation time according to the actual data migration flow threshold of the server and the preset data quantity allowed to be transmitted by the first token.
Optionally, in some embodiments, the preset data migration flow threshold of the data migration task has a corresponding task token bucket; the task token bucket stores the second tokens added according to the second token generation time within a second preset storage time range; the second token generation time is set according to a preset data migration flow threshold of the data migration task; in step 201, the step of obtaining the data migration amount of the server within the preset statistical time range includes:
Step 2015, generating a task token bucket corresponding to each data migration task according to a preset data migration flow threshold of each data migration task of the server.
In this step, a task token bucket corresponding to each data migration task is generated as a basis for performing "step 2016" by the preset data migration flow threshold for each data migration task according to the server.
It should be noted that the preset data migration flow threshold of the data migration task is an initial threshold of the data migration flow of the data migration task, which is preset.
Step 2016, obtaining the number of second tokens extracted from each task token bucket within the preset statistical time range.
In this step, the number of second tokens taken from each task token bucket within a preset statistical time frame is obtained as the basis for performing "step 2017".
And 2017, obtaining the migrated data quantity of each data migration task of the server in the preset statistical time range according to the quantity of the second tokens extracted from each task token bucket in the preset statistical time range and the data quantity allowed to be transmitted by the preset second tokens.
In this step, the migrated data amount of each data migration task of the server in the preset statistical time range is obtained as a basis for executing the step 2018 according to the number of the second tokens extracted from each task token bucket in the preset statistical time range and the data amount allowed to be transmitted by the preset second tokens.
Alternatively, in some embodiments, the predetermined second token may allow the amount of data to be transferred may be 1 byte, 2 bytes, 3 bytes, 4 bytes, 5 bytes, etc.
Optionally, in some embodiments, the migrated data amount of the ith data migration task of the obtaining server is calculated according to the following mathematical expression:
Figure BDA0004027845880000181
wherein G data migration tasks are shared on the server within a preset statistical time range, S i I epsilon [1, G ] is the amount of migrated data for the ith data migration task of the server],N 2 For the number of second tokens taken from the task token bucket within a preset statistical time frame,
Figure BDA0004027845880000182
the amount of data transferred is allowed for the preset second token.
And 2018, summing the migrated data amounts of all the data migration tasks of the server, and obtaining the data migration amount of the server in the preset statistical time range.
In this step, the data migration amount of the server in the preset statistical time range is obtained by summing the migrated data amounts of all the data migration tasks of the server, which is one of the bases for executing the step 202.
Alternatively, in some embodiments, the target weight for the server is obtained by calculation according to the following mathematical expression:
Figure BDA0004027845880000191
wherein G data migration tasks are shared on the server within a preset statistical time range, S i I epsilon [1, G ] is the amount of migrated data for the ith data migration task of the server],w r The target weight of the server is w is the preset weight of the server, and T m Data migration time for server,
Figure BDA0004027845880000193
N is the number of outstanding data migration tasks for the server, which is the data migration volume of the server.
Specifically, in some embodiments, the second token generation time is calculated according to the following mathematical expression:
Figure BDA0004027845880000194
wherein t is 2 Generating a time for the second token, Y Pre-preparation A preset data migration flow threshold for the data migration task,
Figure BDA0004027845880000195
the amount of data transferred is allowed for a preset first token.
Alternatively, in some embodiments, the second preset storage time range may be 3 seconds; in other embodiments, the second predetermined storage time range may be 2 seconds, 4 seconds, 5 seconds, 6 seconds, etc.
Optionally, in some embodiments, the specific process of adding the second token generated according to the second token generation time to the task token bucket within the second preset deposit time range is: each time the second token generation time elapses, one second token is generated, and the generated second token is added to the task token bucket.
By executing steps 2015 to 2018 in the embodiment of the present application, a task token bucket corresponding to each data migration task is generated according to a preset data migration flow threshold of each data migration task of the server; acquiring the number of second tokens taken out from each task token bucket within a preset statistical time range; acquiring the migrated data quantity of each data migration task of the server in a preset statistical time range according to the quantity of second tokens taken out from each task token bucket in the preset statistical time range and the data quantity allowed to be transmitted by the preset second tokens; and summing the migrated data amounts of all the data migration tasks of the server, and acquiring the data migration amount of the server within a preset statistical time range as one of the bases for executing the step 202.
Step 202, calculating to obtain a target weight of each server according to the preset weight, the data migration time, the data migration quantity and the number of unfinished data migration tasks of each server.
The implementation of this step is similar to the implementation of "step 102" described above, and will not be repeated here.
And 203, calculating and obtaining the average data migration flow of each server according to the data migration volume of each server and the preset statistical time range.
The implementation of this step is similar to the implementation of the above-mentioned "step 103", and will not be repeated here.
And 204, calculating and obtaining the priority coefficient of each server according to the target weight and average data migration flow of each server.
The implementation of this step is similar to the implementation of "step 104" described above, and will not be repeated here.
And step 205, distributing the target data migration task to the corresponding server according to the priority coefficient of the server.
The target data migration task is a task for indicating the server to perform data migration.
In the step, the target data migration task is distributed to the corresponding servers according to the priority coefficient of the servers, so that the target data migration task is distributed to the servers in the server cluster, the data migration task condition on each server does not need to be queried manually, the data migration task to be distributed is distributed to the servers in the server cluster manually according to the data migration task condition on each server, and the efficiency of distributing the data migration task to the servers in the server cluster is improved.
Optionally, in some embodiments, the priority coefficient of the server is obtained by calculating for the end time of the preset statistical time range, for example, the preset statistical time range is 1 hour, counting from 9 am to 10 am; the priority coefficient of the server is obtained by calculation at the time of 00 hours in the morning.
Specifically, in some embodiments, step 205 specifically includes the steps of:
step 2051, comparing the magnitudes of the priority coefficients of each server to obtain a comparison result.
In this step, by comparing the magnitudes of the priority coefficients of each server, a comparison result is obtained as a basis for performing "step 2052".
And step 2052, distributing the target data migration task to the server with the largest priority coefficient according to the comparison result.
In the step, the efficiency of distributing the data migration task to the servers in the server cluster is improved by distributing the target data migration task to the server with the largest priority coefficient according to the comparison result so as to realize the distribution of the target data migration task to the servers in the server cluster.
According to the embodiment of the application, the steps 2051 to 2052 are executed to realize that the target data migration task is distributed to the servers in the server cluster, and the data migration task to be distributed is distributed to the servers in the server cluster without manually inquiring the data migration task condition on each server and according to the data migration task condition on each server, so that the efficiency of distributing the data migration task to the servers in the server cluster is improved.
Optionally, in some embodiments, the relationship between the target weight and the preset weight is positive correlation; the relation between the target weight and the data migration quantity is positive correlation; the relation between the target weight and the data migration time is in negative correlation; the relation between the target weight and the number of incomplete data migration tasks of the server is in negative correlation; the relation between the priority coefficient and the target weight is positive correlation; the relationship between the priority coefficient and the average data migration flow is in negative correlation.
The embodiment of the application can realize that the relation between the target weight and the preset weight is positive correlation; the relation between the target weight and the data migration quantity is positive correlation; the relationship between the target weight and the data migration time is in negative correlation; the relationship between the target weight and the number of data migration tasks which are not completed by the server is in negative correlation, and the relationship is used as one of the bases for obtaining the target weight; the relation between the priority coefficient and the target weight is positive correlation; the relationship between the priority coefficient and the average data migration traffic is inversely related, and is one of the bases for obtaining the priority coefficient.
Optionally, in some embodiments, the preset statistical time range is less than a time range in which the number of fetches of the first token is counted.
The method and the device can be used for obtaining the data migration time, the data migration quantity and the number of unfinished data migration tasks of each server of the server cluster in a preset statistical time range; the data migration time is smaller than or equal to a preset statistical time range; calculating to obtain the target weight of each server according to the preset weight, the data migration time, the data migration quantity and the number of unfinished data migration tasks of each server; according to the data migration quantity of each server and a preset statistical time range, calculating to obtain the average data migration flow of each server; according to the target weight and average data migration flow of each server, calculating to obtain a priority coefficient of each server; distributing the target data migration task to a corresponding server according to the priority coefficient of the server; the target data migration task is a task for indicating the server to perform data migration, so that the target data migration task is allocated to the server in the server cluster, the data migration task to be allocated is not required to be manually inquired on each server, and the data migration task to be allocated is manually allocated to the server in the server cluster according to the data migration task condition on each server, so that the efficiency of allocating the data migration task to the server in the server cluster is improved, and the problem that in the prior art, the efficiency of allocating the data migration task to be allocated to the server in the server cluster is low because a worker needs to inquire the data migration task condition on each server in the server cluster first, and then the data migration task to be allocated is manually allocated to the server in the server cluster according to the data migration task condition on each server is solved.
Optionally, in some embodiments, referring to fig. 3, a server cluster data migration task allocation system implementing the foregoing server cluster data migration task allocation method includes a task management center module, a migration module, a cluster monitoring module, and a traffic management module, where the task management center module is responsible for management and issuing of data migration tasks; the migration module is deployed on a server of the service cluster and is responsible for executing data migration tasks and supporting data migration flow control; the cluster monitoring module is an external module, is built based on Prometaus (a system monitoring and alarming tool kit developed in the form of open source software), and collects and records running state data of a server cluster in real time; the traffic management module is responsible for acquiring data migration traffic monitoring data of each storage pool (namely a server cluster) from the cluster monitoring module, issuing a migration module flow control rule, receiving data migration traffic records fed back by each migration module, calculating a priority coefficient of each migration module according to related parameters so as to realize the allocation of target data migration tasks to servers in the server cluster, and manually allocating data migration tasks to be allocated to servers in the server cluster without manually inquiring the data migration task conditions on each server and according to the data migration task conditions on each server, thereby improving the efficiency of allocating the data migration tasks to the servers in the server cluster, solving the problem that in the prior art, due to the fact that an operator needs to inquire the data migration task conditions on each server in the server cluster first, then manually allocating the data migration tasks to be allocated to the servers in the server cluster according to the data migration task conditions on each server, the efficiency of allocating the data migration tasks to be allocated to the servers in the server cluster is low.
Optionally, in some embodiments, referring to fig. 4, a data migration traffic load balancing procedure of a distribution system of server cluster data migration tasks includes: s1, when each migration module is started, registering in a task management center, and synchronizing an initially set weight coefficient (namely a preset weight of a server) to a flow management module; s2, the migration module updates the weight coefficient (namely the target weight of the server) and average flow data (namely the average data migration flow of the server) at regular time, and synchronizes to the flow management module; s3, the flow management module updates the priority coefficient of each migration module at regular time according to the fed-back data; and S4, when a task (namely a target data migration task) needs to be sent, the management center firstly inquires the priority coefficients of all the migration modules from the flow management module, then finds out available migration modules, and sends the task to the migration module with high priority coefficient preferentially.
Optionally, in some embodiments, referring to fig. 5, a data migration flow control flow of the distribution system of server cluster data migration tasks includes: x1, when each migration module is started, an initial maximum flow limit (namely a preset data migration flow threshold value of a server) can be manually set; x2, the flow management module regularly acquires cluster flow data from a cluster monitoring module built based on Prometaus; the flow management module calculates the settable upper limit of the flow (the actual data migration flow threshold of the server) of the migration module deployed in each cluster according to the monitoring data of the cluster at regular time; x4, if the flow control rule needs to be updated, the flow management module issues the obtained new flow control configuration to a migration module deployed in the corresponding cluster; and X5, the migration module receives the updated flow control configuration, and the purpose of modifying the flow control is achieved by changing the generation speed of the token (namely the first token) in the total token bucket (namely the server token bucket).
In summary, the method for distributing the server cluster data migration task provided in the embodiment of the present application includes: acquiring data migration time, data migration quantity and number of unfinished data migration tasks of each server of a server cluster in a preset statistical time range; the data migration time is smaller than or equal to a preset statistical time range; calculating to obtain the target weight of each server according to the preset weight, the data migration time, the data migration quantity and the number of unfinished data migration tasks of each server; according to the data migration quantity of each server and a preset statistical time range, calculating to obtain the average data migration flow of each server; according to the target weight and average data migration flow of each server, calculating to obtain a priority coefficient of each server; distributing the target data migration task to a corresponding server according to the priority coefficient of the server; the target data migration task is a task for indicating the server to perform data migration, so that the target data migration task is allocated to the server in the server cluster, the data migration task to be allocated is not required to be manually inquired on each server, and the data migration task to be allocated is manually allocated to the server in the server cluster according to the data migration task condition on each server, so that the efficiency of allocating the data migration task to the server in the server cluster is improved, and the problem that in the prior art, the efficiency of allocating the data migration task to be allocated to the server in the server cluster is low because a worker needs to inquire the data migration task condition on each server in the server cluster first, and then the data migration task to be allocated is manually allocated to the server in the server cluster according to the data migration task condition on each server is solved.
Fig. 6 is a block diagram of an allocation apparatus for server cluster data migration tasks according to an embodiment of the present application, as shown in fig. 6, the apparatus 400 includes:
the obtaining module 401 is configured to obtain a data migration time, a data migration amount, and the number of incomplete data migration tasks of each server of the server cluster within a preset statistical time range; the data migration time is smaller than or equal to a preset statistical time range;
a first calculation module 402, configured to calculate and obtain a target weight of each server according to a preset weight, a data migration time, a data migration amount, and a number of incomplete data migration tasks of each server;
a second calculation module 403, configured to calculate and obtain an average data migration flow of each server according to the data migration volume of each server and the preset statistical time range;
a third calculation module 404, configured to calculate and obtain a priority coefficient of each server according to the target weight and the average data migration flow of each server;
an allocation module 405, configured to allocate a target data migration task to a corresponding server according to a priority coefficient of the server; the target data migration task is a task for indicating the server to perform data migration.
Optionally, the actual data migration traffic threshold of the server has a corresponding server token bucket; the server token bucket stores the first tokens added according to the first token generation time within a first preset storage time range; the first token generation time is set according to the actual data migration flow threshold of the server;
the obtaining module 401 is specifically configured to obtain an actual data migration flow threshold of the server; generating the server token bucket according to the actual data migration flow threshold of the server; acquiring the number of first tokens taken out from a server token bucket within the preset statistical time range; and acquiring the data migration quantity of the server in the preset statistical time range according to the quantity of the first tokens extracted from the server token bucket in the preset statistical time range and the preset data quantity allowed to be transmitted by the first tokens.
Optionally, the obtaining module 401 is specifically further configured to calculate, according to the obtained remaining network bandwidth of the server cluster and the number of servers of the server cluster, to obtain an average data migration flow threshold of the servers; taking the preset data migration flow threshold of the server as the actual data migration flow threshold of the server under the condition that the average data migration flow threshold of the server is larger than or equal to the preset data migration flow threshold of the server; under the condition that the average data migration flow threshold of the server is smaller than the preset data migration flow threshold of the server, taking the newly set data migration flow threshold of the server as the actual data migration flow threshold of the server; and the newly set data migration flow threshold of the server is smaller than the average data migration flow threshold of the server.
Optionally, the relationship between the first token generation time and the actual data migration flow threshold of the server is inversely related; the relation between the first token generation time and the preset data quantity allowed to be transmitted by the first token is positive correlation;
the obtaining module 401 is specifically further configured to obtain an actual data migration flow threshold of the server; and obtaining the first token generation time according to the actual data migration flow threshold of the server and the preset data volume allowed to be transmitted by the first token.
Optionally, the allocation module 405 specifically includes:
the comparison sub-module is used for comparing the magnitude of the priority coefficient of each server to obtain a comparison result;
and the allocation submodule is used for allocating the target data migration task to the server with the largest priority coefficient according to the comparison result.
Optionally, the preset data migration flow threshold of the data migration task has a corresponding task token bucket; the task token bucket stores the second tokens added according to the second token generation time within a second preset storage time range; the second token generation time is set according to a preset data migration flow threshold of the data migration task;
The acquiring module 401 is specifically further configured to generate a task token bucket corresponding to each data migration task according to a preset data migration flow threshold of each data migration task of the server; acquiring the number of second tokens taken out from each task token bucket within the preset statistical time range; acquiring the migrated data quantity of each data migration task of the server in the preset statistical time range according to the quantity of second tokens taken out from each task token bucket in the preset statistical time range and the data quantity allowed to be transmitted by the preset second tokens; and summing the migrated data amounts of all the data migration tasks of the server to obtain the data migration amount of the server in the preset statistical time range.
Optionally, the relation between the target weight and the preset weight is positive correlation; the relation between the target weight and the data migration quantity is positive correlation; the relation between the target weight and the data migration time is in negative correlation; the relation between the target weight and the number of incomplete data migration tasks of the server is in negative correlation;
The relation between the priority coefficient and the target weight is positive correlation; the relationship between the priority coefficient and the average data migration flow is in negative correlation.
The allocation device of the server cluster data migration task in the embodiment of the application may be a device, or may be a component, an integrated circuit, or a chip in the terminal. The device may be a mobile electronic device or a non-mobile electronic device. By way of example, the mobile electronic device may be a cell phone, tablet computer, notebook computer, palm computer, vehicle-mounted electronic device, wearable device, ultra-mobile personal computer (ultra-mobile personal computer, UMPC), netbook or personal digital assistant (personal digital assistant, PDA), etc., and the non-mobile electronic device may be a server, network attached storage (Network Attached Storage, NAS), personal computer (personal computer, PC), television (TV), teller machine or self-service machine, etc., and the embodiments of the present application are not limited in particular.
The allocation device of the server cluster data migration task in the embodiment of the present application may be a device with an operating system. The operating system may be an Android operating system, an ios operating system, or other possible operating systems, which are not specifically limited in the embodiments of the present application.
The allocation device for server cluster data migration tasks provided in the embodiment of the present application can implement each process implemented by the allocation device for server cluster data migration tasks in the method embodiment of fig. 1, and in order to avoid repetition, details are not repeated here.
In summary, the allocation apparatus for server cluster data migration tasks provided in the embodiments of the present application includes: acquiring data migration time, data migration quantity and number of unfinished data migration tasks of each server of a server cluster in a preset statistical time range; the data migration time is smaller than or equal to a preset statistical time range; calculating to obtain the target weight of each server according to the preset weight, the data migration time, the data migration quantity and the number of unfinished data migration tasks of each server; according to the data migration quantity of each server and a preset statistical time range, calculating to obtain the average data migration flow of each server; according to the target weight and average data migration flow of each server, calculating to obtain a priority coefficient of each server; distributing the target data migration task to a corresponding server according to the priority coefficient of the server; the target data migration task is a task for indicating the server to perform data migration, so that the target data migration task is allocated to the server in the server cluster, the data migration task to be allocated is not required to be manually inquired on each server, and the data migration task to be allocated is manually allocated to the server in the server cluster according to the data migration task condition on each server, so that the efficiency of allocating the data migration task to the server in the server cluster is improved, and the problem that in the prior art, the efficiency of allocating the data migration task to be allocated to the server in the server cluster is low because a worker needs to inquire the data migration task condition on each server in the server cluster first, and then the data migration task to be allocated is manually allocated to the server in the server cluster according to the data migration task condition on each server is solved.
Optionally, the embodiment of the present application further provides an electronic device, including a processor, a memory, and a program or an instruction stored in the memory and capable of running on the processor, where the program or the instruction implements each process of the embodiment of the allocation method of the server cluster data migration task when executed by the processor, and the process can achieve the same technical effect, so that repetition is avoided, and no redundant description is given here.
The electronic device in the embodiment of the application includes the mobile electronic device and the non-mobile electronic device described above.
Fig. 7 is a schematic hardware structure of an electronic device implementing an embodiment of the present application.
The electronic device 500 includes, but is not limited to: radio frequency unit 501, network module 502, audio output unit 503, input unit 504, sensor 505, display unit 506, user input unit 507, interface unit 508, memory 509, and processor 510.
Those skilled in the art will appreciate that the electronic device 500 may further include a power source (e.g., a battery) for powering the various components, and that the power source may be logically coupled to the processor 510 via a power management system to perform functions such as managing charging, discharging, and power consumption via the power management system. The electronic device structure shown in fig. 7 does not constitute a limitation of the electronic device, and the electronic device may include more or less components than shown, or may combine certain components, or may be arranged in different components, which are not described in detail herein.
The processor 510 is configured to obtain a data migration time, a data migration amount, and the number of incomplete data migration tasks of each server of the server cluster within a preset statistical time range; the data migration time is smaller than or equal to a preset statistical time range;
calculating to obtain the target weight of each server according to the preset weight, the data migration time, the data migration quantity and the number of unfinished data migration tasks of each server;
calculating to obtain the average data migration flow of each server according to the data migration quantity of each server and the preset statistical time range;
according to the target weight and average data migration flow of each server, calculating to obtain a priority coefficient of each server;
distributing target data migration tasks to the corresponding servers according to the priority coefficients of the servers; the target data migration task is a task for indicating the server to perform data migration.
In the application, the data migration time, the data migration quantity and the number of unfinished data migration tasks of each server of the server cluster in a preset statistical time range are obtained; the data migration time is smaller than or equal to a preset statistical time range; calculating to obtain the target weight of each server according to the preset weight, the data migration time, the data migration quantity and the number of unfinished data migration tasks of each server; according to the data migration quantity of each server and a preset statistical time range, calculating to obtain the average data migration flow of each server; according to the target weight and average data migration flow of each server, calculating to obtain a priority coefficient of each server; distributing the target data migration task to a corresponding server according to the priority coefficient of the server; the target data migration task is a task for indicating the server to perform data migration, so that the target data migration task is allocated to the server in the server cluster, the data migration task to be allocated is not required to be manually inquired on each server, and the data migration task to be allocated is manually allocated to the server in the server cluster according to the data migration task condition on each server, so that the efficiency of allocating the data migration task to the server in the server cluster is improved, and the problem that in the prior art, the efficiency of allocating the data migration task to be allocated to the server in the server cluster is low because a worker needs to inquire the data migration task condition on each server in the server cluster first, and then the data migration task to be allocated is manually allocated to the server in the server cluster according to the data migration task condition on each server is solved.
Optionally, the processor 510 is further configured to obtain an actual data migration flow threshold of the server; generating the server token bucket according to the actual data migration flow threshold of the server; acquiring the number of first tokens taken out from a server token bucket within the preset statistical time range; acquiring the data migration quantity of a server in the preset statistical time range according to the quantity of first tokens taken out from a server token bucket in the preset statistical time range and the preset data quantity allowed to be transmitted by the first tokens;
the actual data migration flow threshold of the server is provided with a corresponding server token bucket; the server token bucket stores the first tokens added according to the first token generation time within a first preset storage time range; the first token generation time is set according to an actual data migration flow threshold of the server.
Optionally, the processor 510 is further configured to calculate, according to the obtained remaining network bandwidth of the server cluster and the number of servers of the server cluster, an average data migration flow threshold of the servers; taking the preset data migration flow threshold of the server as the actual data migration flow threshold of the server under the condition that the average data migration flow threshold of the server is larger than or equal to the preset data migration flow threshold of the server; under the condition that the average data migration flow threshold of the server is smaller than the preset data migration flow threshold of the server, taking the newly set data migration flow threshold of the server as the actual data migration flow threshold of the server; and the newly set data migration flow threshold of the server is smaller than the average data migration flow threshold of the server.
Optionally, the processor 510 is further configured to obtain an actual data migration flow threshold of the server; obtaining the first token generation time according to the actual data migration flow threshold of the server and the preset data volume allowed to be transmitted by the first token;
the relation between the first token generation time and the actual data migration flow threshold of the server is in negative correlation; the relation between the first token generation time and the preset data quantity allowed to be transmitted by the first token is positive correlation.
Optionally, the processor 510 is further configured to compare the magnitude of the priority coefficient of each server to obtain a comparison result; and distributing the target data migration task to the server with the largest priority coefficient according to the comparison result.
Optionally, the processor 510 is further configured to generate a task token bucket corresponding to each data migration task according to a preset data migration flow threshold of each data migration task of the server; acquiring the number of second tokens taken out from each task token bucket within the preset statistical time range; acquiring the migrated data quantity of each data migration task of the server in the preset statistical time range according to the quantity of second tokens taken out from each task token bucket in the preset statistical time range and the data quantity allowed to be transmitted by the preset second tokens; summing the migrated data amounts of all the data migration tasks of the server to obtain the data migration amount of the server in the preset statistical time range;
The preset data migration flow threshold of the data migration task is provided with a corresponding task token bucket; the task token bucket stores the second tokens added according to the second token generation time within a second preset storage time range; and the second token generation time is set according to a preset data migration flow threshold of the data migration task.
Optionally, the processor 510 is configured to be applied to allocation of a server cluster data migration task, where a relationship between the target weight and the preset weight is positive correlation; the relation between the target weight and the data migration quantity is positive correlation; the relation between the target weight and the data migration time is in negative correlation; the relation between the target weight and the number of incomplete data migration tasks of the server is in negative correlation; the relation between the priority coefficient and the target weight is positive correlation; the relationship between the priority coefficient and the average data migration flow is in negative correlation.
In the application, the data migration time, the data migration quantity and the number of unfinished data migration tasks of each server of the server cluster in a preset statistical time range are obtained; the data migration time is smaller than or equal to a preset statistical time range; calculating to obtain the target weight of each server according to the preset weight, the data migration time, the data migration quantity and the number of unfinished data migration tasks of each server; according to the data migration quantity of each server and a preset statistical time range, calculating to obtain the average data migration flow of each server; according to the target weight and average data migration flow of each server, calculating to obtain a priority coefficient of each server; distributing the target data migration task to a corresponding server according to the priority coefficient of the server; the target data migration task is a task for indicating the server to perform data migration, so that the target data migration task is allocated to the server in the server cluster, the data migration task to be allocated is not required to be manually inquired on each server, and the data migration task to be allocated is manually allocated to the server in the server cluster according to the data migration task condition on each server, so that the efficiency of allocating the data migration task to the server in the server cluster is improved, and the problem that in the prior art, the efficiency of allocating the data migration task to be allocated to the server in the server cluster is low because a worker needs to inquire the data migration task condition on each server in the server cluster first, and then the data migration task to be allocated is manually allocated to the server in the server cluster according to the data migration task condition on each server is solved.
The embodiment of the present application further provides a readable storage medium, where a program or an instruction is stored on the readable storage medium, and when the program or the instruction is executed by a processor, the program or the instruction implements each process of the embodiment of the allocation method of the server cluster data migration task, and the same technical effect can be achieved, so that repetition is avoided, and no redundant description is provided herein.
Wherein the processor is a processor in the electronic device described in the above embodiment. The readable storage medium includes a computer readable storage medium such as a Read-Only Memory (ROM), a random access Memory (Random Access Memory, RAM), a magnetic disk or an optical disk, and the like.
The embodiment of the application further provides a chip, the chip includes a processor and a communication interface, the communication interface is coupled with the processor, the processor is used for running a program or an instruction, implementing each process of the embodiment of the distribution method of the server cluster data migration task, and achieving the same technical effect, so that repetition is avoided, and no redundant description is provided here.
It should be understood that the chips referred to in the embodiments of the present application may also be referred to as system-on-chip chips, chip systems, or system-on-chip chips, etc.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element. Furthermore, it should be noted that the scope of the methods and apparatus in the embodiments of the present application is not limited to performing the functions in the order shown or discussed, but may also include performing the functions in a substantially simultaneous manner or in an opposite order depending on the functions involved, e.g., the described methods may be performed in an order different from that described, and various steps may also be added, omitted, or combined. Additionally, features described with reference to certain examples may be combined in other examples.
From the above description of the embodiments, it will be clear to those skilled in the art that the above-described embodiment method may be implemented by means of software plus a necessary general hardware platform, but of course may also be implemented by means of hardware, but in many cases the former is a preferred embodiment. Based on such understanding, the technical solution of the present application may be embodied essentially or in a part contributing to the prior art in the form of a software product stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk), including several instructions for causing a terminal (which may be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to perform the method described in the embodiments of the present application.
The embodiments of the present application have been described above with reference to the accompanying drawings, but the present application is not limited to the above-described embodiments, which are merely illustrative and not restrictive, and many forms may be made by those of ordinary skill in the art without departing from the spirit of the present application and the scope of the claims, which are also within the protection of the present application.

Claims (15)

1. A method for distributing server cluster data migration tasks, the method comprising:
acquiring data migration time, data migration quantity and number of unfinished data migration tasks of each server of a server cluster in a preset statistical time range; the data migration time is smaller than or equal to a preset statistical time range;
calculating to obtain the target weight of each server according to the preset weight, the data migration time, the data migration quantity and the number of unfinished data migration tasks of each server;
calculating to obtain the average data migration flow of each server according to the data migration quantity of each server and the preset statistical time range;
According to the target weight and average data migration flow of each server, calculating to obtain a priority coefficient of each server;
distributing target data migration tasks to the corresponding servers according to the priority coefficients of the servers; the target data migration task is a task for indicating the server to perform data migration.
2. The method of claim 1, wherein the actual data migration traffic threshold of the server has a corresponding server token bucket; the server token bucket stores the first tokens added according to the first token generation time within a first preset storage time range; the first token generation time is set according to the actual data migration flow threshold of the server;
the step of obtaining the data migration quantity of the server in the preset statistical time range comprises the following steps:
acquiring an actual data migration flow threshold of the server;
generating the server token bucket according to the actual data migration flow threshold of the server;
acquiring the number of first tokens taken out from a server token bucket within the preset statistical time range;
and acquiring the data migration quantity of the server in the preset statistical time range according to the quantity of the first tokens extracted from the server token bucket in the preset statistical time range and the preset data quantity allowed to be transmitted by the first tokens.
3. The method of claim 2, wherein the obtaining the actual data migration traffic threshold for the server comprises:
calculating and obtaining an average data migration flow threshold of the server according to the obtained residual network bandwidth of the server cluster and the number of servers of the server cluster;
taking the preset data migration flow threshold of the server as the actual data migration flow threshold of the server under the condition that the average data migration flow threshold of the server is larger than or equal to the preset data migration flow threshold of the server;
under the condition that the average data migration flow threshold of the server is smaller than the preset data migration flow threshold of the server, taking the newly set data migration flow threshold of the server as the actual data migration flow threshold of the server; and the newly set data migration flow threshold of the server is smaller than the average data migration flow threshold of the server.
4. The method of claim 2, wherein the relationship of the first token generation time and the actual data migration traffic threshold of the server is a negative correlation; the relation between the first token generation time and the preset data quantity allowed to be transmitted by the first token is positive correlation;
The step of obtaining the first token generation time includes:
acquiring an actual data migration flow threshold of the server;
and obtaining the first token generation time according to the actual data migration flow threshold of the server and the preset data volume allowed to be transmitted by the first token.
5. The method of claim 1, wherein assigning the target data migration task to the corresponding server according to the priority coefficient of the server comprises:
comparing the magnitude of the priority coefficient of each server to obtain a comparison result;
and distributing the target data migration task to the server with the largest priority coefficient according to the comparison result.
6. The method of claim 1, wherein the preset data migration traffic threshold for the data migration task has a corresponding task token bucket; the task token bucket stores the second tokens added according to the second token generation time within a second preset storage time range; the second token generation time is set according to a preset data migration flow threshold of the data migration task;
the step of obtaining the data migration quantity of the server in the preset statistical time range comprises the following steps:
Generating a task token bucket corresponding to each data migration task according to a preset data migration flow threshold of each data migration task of the server;
acquiring the number of second tokens taken out from each task token bucket within the preset statistical time range;
acquiring the migrated data quantity of each data migration task of the server in the preset statistical time range according to the quantity of second tokens taken out from each task token bucket in the preset statistical time range and the data quantity allowed to be transmitted by the preset second tokens;
and summing the migrated data amounts of all the data migration tasks of the server to obtain the data migration amount of the server in the preset statistical time range.
7. The method according to any one of claims 1 to 6, wherein the relation of the target weight and the preset weight is a positive correlation; the relation between the target weight and the data migration quantity is positive correlation; the relation between the target weight and the data migration time is in negative correlation; the relation between the target weight and the number of incomplete data migration tasks of the server is in negative correlation;
The relation between the priority coefficient and the target weight is positive correlation; the relationship between the priority coefficient and the average data migration flow is in negative correlation.
8. An apparatus for distributing server cluster data migration tasks, the apparatus comprising:
the acquisition module is used for acquiring the data migration time, the data migration quantity and the number of unfinished data migration tasks of each server of the server cluster in a preset statistical time range; the data migration time is smaller than or equal to a preset statistical time range;
the first calculation module is used for calculating and obtaining the target weight of each server according to the preset weight, the data migration time, the data migration quantity and the number of unfinished data migration tasks of each server;
the second calculation module is used for calculating and obtaining the average data migration flow of each server according to the data migration quantity of each server and the preset statistical time range;
the third calculation module is used for calculating and obtaining the priority coefficient of each server according to the target weight and average data migration flow of each server;
the allocation module is used for allocating the target data migration task to the corresponding server according to the priority coefficient of the server; the target data migration task is a task for indicating the server to perform data migration.
9. The apparatus of claim 8, wherein the actual data migration traffic threshold of the server has a corresponding server token bucket; the server token bucket stores the first tokens added according to the first token generation time within a first preset storage time range; the first token generation time is set according to the actual data migration flow threshold of the server;
the acquisition module is specifically used for acquiring an actual data migration flow threshold of the server; generating the server token bucket according to the actual data migration flow threshold of the server; acquiring the number of first tokens taken out from a server token bucket within the preset statistical time range; and acquiring the data migration quantity of the server in the preset statistical time range according to the quantity of the first tokens extracted from the server token bucket in the preset statistical time range and the preset data quantity allowed to be transmitted by the first tokens.
10. The apparatus according to claim 9, wherein the obtaining module is further specifically configured to calculate, according to the obtained remaining network bandwidth of the server cluster and the number of servers of the server cluster, an average data migration traffic threshold of the servers; taking the preset data migration flow threshold of the server as the actual data migration flow threshold of the server under the condition that the average data migration flow threshold of the server is larger than or equal to the preset data migration flow threshold of the server; under the condition that the average data migration flow threshold of the server is smaller than the preset data migration flow threshold of the server, taking the newly set data migration flow threshold of the server as the actual data migration flow threshold of the server; and the newly set data migration flow threshold of the server is smaller than the average data migration flow threshold of the server.
11. The apparatus of claim 9, wherein the relationship of the first token generation time and the actual data migration traffic threshold of the server is a negative correlation; the relation between the first token generation time and the preset data quantity allowed to be transmitted by the first token is positive correlation;
the acquisition module is specifically further configured to acquire an actual data migration flow threshold of the server; and obtaining the first token generation time according to the actual data migration flow threshold of the server and the preset data volume allowed to be transmitted by the first token.
12. The device according to claim 8, characterized in that said distribution module comprises in particular:
the comparison sub-module is used for comparing the magnitude of the priority coefficient of each server to obtain a comparison result;
and the allocation submodule is used for allocating the target data migration task to the server with the largest priority coefficient according to the comparison result.
13. The apparatus of claim 8, wherein the preset data migration traffic threshold for the data migration task has a corresponding task token bucket; the task token bucket stores the second tokens added according to the second token generation time within a second preset storage time range; the second token generation time is set according to a preset data migration flow threshold of the data migration task;
The acquisition module is specifically further configured to generate a task token bucket corresponding to each data migration task according to a preset data migration flow threshold of each data migration task of the server; acquiring the number of second tokens taken out from each task token bucket within the preset statistical time range; acquiring the migrated data quantity of each data migration task of the server in the preset statistical time range according to the quantity of second tokens taken out from each task token bucket in the preset statistical time range and the data quantity allowed to be transmitted by the preset second tokens; and summing the migrated data amounts of all the data migration tasks of the server to obtain the data migration amount of the server in the preset statistical time range.
14. An electronic device comprising a processor, a memory and a program or instruction stored on the memory and executable on the processor, the program or instruction when executed by the processor implementing the steps of the method for allocating server cluster data migration tasks according to any one of claims 1 to 7.
15. A readable storage medium, characterized in that the readable storage medium has stored thereon a program or instructions which, when executed by a processor, implement the steps of the allocation method of server cluster data migration tasks according to any of claims 1 to 7.
CN202211716346.2A 2022-12-29 2022-12-29 Distribution method and device for server cluster data migration tasks Pending CN116126527A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211716346.2A CN116126527A (en) 2022-12-29 2022-12-29 Distribution method and device for server cluster data migration tasks

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211716346.2A CN116126527A (en) 2022-12-29 2022-12-29 Distribution method and device for server cluster data migration tasks

Publications (1)

Publication Number Publication Date
CN116126527A true CN116126527A (en) 2023-05-16

Family

ID=86303948

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211716346.2A Pending CN116126527A (en) 2022-12-29 2022-12-29 Distribution method and device for server cluster data migration tasks

Country Status (1)

Country Link
CN (1) CN116126527A (en)

Similar Documents

Publication Publication Date Title
US20240259327A1 (en) Software load balancer to maximize utilization
CN107545338B (en) Service data processing method and service data processing system
CN106453146B (en) Method, system, device and readable storage medium for allocating private cloud computing resources
CN112165691A (en) Content delivery network scheduling method, device, server and medium
US8966086B2 (en) License redistributing method, moderator and license controlling system thereof
US10334070B2 (en) Method and system for real-time resource consumption control in a distributed computing environment
CN107205248B (en) Resource allocation method and system
CN112422440B (en) Flow control method applied to server and related device
US6918117B2 (en) Apparatus and method for dynamic load balancing of multiple cryptographic devices
CN106817432A (en) The method of virtual resource elastic stretch, system and equipment under cloud computing environment
CN115827788B (en) Data migration method and device, electronic equipment and readable storage medium
CN113608751B (en) Operation method, device and equipment of reasoning service platform and storage medium
CN109687485B (en) Power distribution method and system of energy storage system and terminal equipment
CN112862319B (en) Order scheduling method, device, equipment and storage medium
CN106407636B (en) Integration result statistical method and device
CN111897659B (en) Method, system and device for controlling service processing frequency and electronic equipment
CN117555913A (en) Object data updating method and device based on third party platform
CN116126527A (en) Distribution method and device for server cluster data migration tasks
CN115398399A (en) Method for determining memory, statistical server, physical machine and storage medium
US11782752B1 (en) System and method for assigning tasks
CN108765140A (en) Batch service abnormality monitoring method and the first electronic equipment
CN112104567B (en) Flow control method, device, equipment and medium
CN105591980B (en) A kind of bandwidth consumption management method and device
CN114896296A (en) Cloud service resource configuration method and device, electronic equipment and computer readable medium
CN108429704A (en) A kind of node resource distribution method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
CB02 Change of applicant information
CB02 Change of applicant information

Address after: 100007 room 205-32, floor 2, building 2, No. 1 and No. 3, qinglonghutong a, Dongcheng District, Beijing

Applicant after: Tianyiyun Technology Co.,Ltd.

Address before: 100093 Floor 4, Block E, Xishan Yingfu Business Center, Haidian District, Beijing

Applicant before: Tianyiyun Technology Co.,Ltd.