Detailed Description
The present invention will be further described with reference to the accompanying drawings and the detailed description, and it should be noted that any combination of the embodiments or technical features described below can be used to form a new embodiment without conflict.
Referring to fig. 1, fig. 1 is a flowchart illustrating a TS server scheduling method according to an embodiment of the present invention.
The TS server scheduling method provided by the embodiment of the present invention specifically includes:
step S101, a network operator of a network where a network storage device is located and a geographic location where the network operator is located are obtained, the network operator is called a first network operator, and the geographic location is called a first geographic location.
Step S102, a network operator of a network where the terminal device is located and a geographic position where the network operator is located are obtained, the network operator is called a second network operator, and the geographic position is called a second geographic position.
Preferably, the network storage device provided by the implementation of the present invention may be, but is not limited to, a new generation of intelligent hardware, which may also be referred to as an "earnable mobile cloud disk," and specifically, the network storage device may be a guest playing cloud. The terminal device may be, but is not limited to, a mobile intelligent communication terminal, a PC terminal, or other intelligent terminals.
Specifically, the geographic regions in which the network operator of the network in which the network storage device is located and the network operator of the network in which the terminal device is located are respectively located may be the same or different, such as those of Shenzhen or those of Shenzhen and those of Beijing.
In step S103, all TS servers in the first geographical location and the second geographical location are queried, and the remaining load average weight of all TS servers is calculated.
Specifically, the first geographic location and the second geographic location may be in the same region, such as shenzhen, and all TS servers refer to all TS servers in the shenzhen region; the first geographic location and the second geographic location may also be different regions, such as shenzhen and mansion gate, and then all TS servers refer to all TS servers in south china including shenzhen and mansion gate.
Specifically, the factors affecting the average weight of the remaining load include network card capacity, CPU occupancy rate, and memory usage rate. The exact representation of the network card capability should be the real-time bandwidth of the network card, but at present, it is approximately represented by the number of connections. When any factor resource in the network card capacity, the CPU occupancy rate and the memory utilization rate is exhausted, the total weight of the TS server should be 0; similarly, when any one of the network card capability, the CPU occupancy rate, and the memory usage rate is sufficient in resources, the total weight of the TS server may be increased accordingly.
Further, when calculating the weight of a certain TS server in a specific address region (such as shenzhen and south China), finding the network card weight (if there are multiple network card weights) of the corresponding address region, and then finding the weight of the CPU + memory.
Specifically, the calculation formula of the residual load weight of a certain network card is as follows: 1-the number of connections the network card is serving/the total number of connections the network card can serve externally.
Further, the remaining load average weight formula may be: (a% + B% +. N. + N%)/M, where A, B, · B.., N denotes each single TS server, a%, B%,... and.n% denotes the remaining load ratio of the single TS server, and M denotes the total number of all TS servers (i.e., A, B,... and.n).
And step S104, when the average weight of the residual load exceeds a first threshold value, selecting the optimal TS server according to a hash algorithm.
Preferably, the first threshold may be 20% to 25%, and further may be 20%.
Preferably, the method for selecting the optimal TS server by the hash algorithm includes:
mapping the percentage of the average weight of the residual load of the alternative TS server to the total weight of the load into a hash value;
and comparing the hash value of the alternative TS server with a set value, and selecting the alternative TS server with the smallest difference between the hash value and the set value as the optimal TS server.
According to the TS server scheduling method provided by the embodiment of the invention, the optimal TS server is reasonably scheduled in different operators and different geographical areas, so that the network storage device and the terminal device can communicate more quickly and conveniently, and the user experience of a terminal client is improved.
Referring to fig. 2 and 3, fig. 2 and 3 are schematic flow charts of another embodiment of a TS server scheduling method according to the present invention.
In step S201, a network operator of a network where the network storage device is located and a geographic location where the network operator is located are obtained, and the network operator is referred to as a first network operator, and the geographic location is referred to as a first geographic location.
In step S202, a network operator of a network where the terminal device is located and a geographic location where the network operator is located are obtained, and the network operator is referred to as a second network operator, and the geographic location is referred to as a second geographic location.
Preferably, the network storage device provided by the implementation of the present invention may be, but is not limited to, a new generation of intelligent hardware, which may also be referred to as an "earnable mobile cloud disk," and specifically, the network storage device may be a guest playing cloud. The terminal device may be, but is not limited to, a mobile intelligent communication terminal, a PC terminal, or other intelligent terminals.
Specifically, the geographic regions in which the network operator of the network in which the network storage device is located and the network operator of the network in which the terminal device is located are respectively located may be the same or different, such as those of Shenzhen or those of Shenzhen and those of Beijing.
In step S203, it is determined whether the first operator and the second operator are the same operator.
Step S204 is performed when the first operator and the second operator are the same operator, and step S301 is performed by a when the first operator and the second operator are not the same operator.
Preferably, the operator may be a network communication operator such as a mobile, universal, or telecom operator, but is not limited to the above three.
Next, the first operator and the second operator are the same operator.
For clarity, the same operator is selected to move respectively, i.e. both the first operator and the second operator are mobile operators.
In step S204, when the first operator and the second operator are the same operator, the location relationship between the first geographic location and the second geographic location is queried.
Specifically, the positional relationship here means that the two geographic areas are the same, the two geographic areas belong to the same higher-level area, and the two geographic areas belong to the same higher-level area.
For example, if the first geographic location is the same and is Shenzhen, the corresponding network operators are Shenzhen move and Shenzhen telecom respectively; if the first geographic position is different, but belongs to the upper-level region, such as Shenzhen and Xiamen respectively, and both belong to the south China, the corresponding network operators are Shenzhen mobile and Xiamen telecommunication respectively; if the first geographic location is different, but the same country belongs to a higher-level region, such as Shenzhen and Beijing, and the two regions belong to the same China region, the corresponding network operators are Shenzhen mobile and Beijing telecom, respectively.
It should be noted that the position relationship between the first geographic location and the second geographic location can be further described, such as the geographic relationship between china and the united states, and the geographic relationship between china and japan, which are not described herein again.
In step S205, when the first geographical location and the second geographical location are in the same geographical area, it is determined whether the average remaining load weight of all TS servers in the same geographical area exceeds a first threshold.
When the average weight of the remaining loads of all the TS servers in the same geographic area exceeds the first threshold, executing step S208; otherwise, step S206 is executed.
Preferably, the first threshold may be the number of TS servers/remaining responsible proportion, and specifically may be the number of TS servers/20%.
Specifically, when selecting the TS server, at least three selection dimensions, such as the geographical relationship that the two geographical areas are the same, the two geographical areas belong to the higher-level area, and the two geographical areas belong to the higher-level area, are required to be selected.
In step S206, when the average remaining load weight of all TS servers in the same geographic area does not exceed the first threshold, all TS servers in the upper-level area of the same geographic area are queried.
Specifically, the remaining load average weight does not exceed the first threshold, which means that the load capability of the selected TS server is not enough at this time, and the selected TS server cannot be selected to serve other devices.
In step S207, it is determined whether the average remaining load weights of all TS servers in the same geographical area and the upper-level area of the same geographical area exceed a first threshold.
When the average weight of the remaining loads of all the TS servers in the same geographical area and the upper-level area of the same geographical area exceeds the first threshold, performing step S208; otherwise, step S206 is executed.
Specifically, when the average weight of the remaining loads does not exceed the first threshold, S304 is continuously executed to indicate that the load capacities of all TS servers in the selected area are insufficient, and further the online primary area needs to be continuously queried until the TS server in the area meeting the load capacity is selected or the selection range is exceeded, which is generally selected in the range of china.
Next, it is assumed that the first carrier and the second carrier are not the same carrier.
For clarity, the different operators are chosen to be mobile and telecom, respectively, and it is assumed that the first operator is mobile and the second operator is telecom.
In step S301, a location relationship between the first geographic location and the second geographic location is queried.
Specifically, the positional relationship here means that the two geographic areas are the same, the two geographic areas belong to the same higher-level area, and the two geographic areas belong to the same higher-level area.
For example, if the first geographic location is the same and is Shenzhen, the corresponding network operators are Shenzhen move and Shenzhen telecom respectively; if the first geographic position is different, but belongs to the upper-level region, such as Shenzhen and Xiamen respectively, and both belong to the south China, the corresponding network operators are Shenzhen mobile and Xiamen telecommunication respectively; if the first geographic location is different, but the same country belongs to a higher-level region, such as Shenzhen and Beijing, and the two regions belong to the same China region, the corresponding network operators are Shenzhen mobile and Beijing telecom, respectively.
It should be noted that the position relationship between the first geographic location and the second geographic location can be further described, such as the geographic relationship between china and the united states, and the geographic relationship between china and japan, which are not described herein again.
In step S302, a TS server covering both the first operator and the second operator in the first geographic location and the second geographic location is queried.
Specifically, the TS server which indicates that the query is required covers both the mobile operator and the telecommunication operator.
Further, the TS server to be queried may be a three-wire overlay TS server, that is, a TS server that overlays mobile, internet and telecommunication.
In step S303, when the first geographical location and the second geographical location are in the same geographical area, it is determined whether the average remaining load weight covering the TS servers of the first operator and the second operator in the same geographical area exceeds a first threshold.
When the average weight of the remaining loads of the TS servers covering both the first operator and the second operator in the same geographic area exceeds a first threshold, executing step S208 by B; when the average weight of the remaining loads of the TS servers covering both the first operator and the second operator in the same geographic area does not exceed the first threshold, step S304 is executed.
Preferably, the first threshold may be 20% to 25%, and further may be 20%.
Specifically, when selecting the TS server, at least three selection dimensions, such as the geographical relationship that the two geographical areas are the same, the two geographical areas belong to the higher-level area, and the two geographical areas belong to the higher-level area, are required to be selected.
In step S304, when the remaining load average weight of the TS servers covering both the first operator and the second operator in the same geographic area does not exceed the first threshold, all TS servers in the upper-level area of the same geographic area are queried.
Specifically, the remaining load average weight does not exceed the first threshold, which means that the load capability of the selected TS server is not enough at this time, and the selected TS server cannot be selected to serve other devices.
In step S305, it is determined whether the remaining load average weight of the TS servers covering both the first operator and the second operator in the same geographical area and the upper level area of the same geographical area exceeds a first threshold.
When the average weight of the remaining loads of the TS servers covering both the first operator and the second operator in the same geographic area and the upper-level area of the same geographic area exceeds the first threshold, step S208 is executed; when the remaining average load weight of the TS servers covering both the first operator and the second operator in the same geographical area and the upper level area of the same geographical area does not exceed the first threshold, S304 is continuously performed.
Specifically, when the average weight of the remaining loads does not exceed the first threshold, S304 is continuously executed to indicate that the load capacities of all TS servers in the selected area are insufficient, and further the online primary area needs to be continuously queried until the TS server in the area meeting the load capacity is selected or the selection range is exceeded, which is generally selected in the range of china.
In step S208, an optimal TS server is selected according to the hash algorithm.
Specifically, the factors affecting the average weight of the remaining load include network card capacity, CPU occupancy rate, and memory usage rate. The exact representation of the network card capability should be the real-time bandwidth of the network card, but at present, it is approximately represented by the number of connections. When any factor resource in the network card capacity, the CPU occupancy rate and the memory utilization rate is exhausted, the total weight of the TS server should be 0; similarly, when any one of the network card capability, the CPU occupancy rate, and the memory usage rate is sufficient in resources, the total weight of the TS server may be increased accordingly.
Further, when calculating the weight of a certain TS server in a specific address region (such as shenzhen and south China), finding the network card weight (if there are multiple network card weights) of the corresponding address region, and then finding the weight of the CPU + memory.
Specifically, the calculation formula of the residual load weight of a certain network card is as follows: 1-the number of connections the network card is serving/the total number of connections the network card can serve externally.
Mapping the percentage of the average weight of the residual load of the alternative TS server to the total weight of the load into a hash value;
and comparing the hash value of the alternative TS server with a set value, and selecting the alternative TS server with the smallest difference between the hash value and the set value as the optimal TS server.
For a further understanding of the embodiments of the present invention, reference will now be made to the examples.
The scheduling requirement is met first, which means that the load remaining average weight of the currently selected TS server is greater than a first threshold (for example, 20%, the stand-alone load is controlled within 80%).
First, if the first geographic location and the second geographic location are the same operator in the same province, for example, both are Cantonese Shenzhen telecommunications, the scheduling rule is as follows:
1) node TS server covering the Guangdong telecom: TS server A, TS server B;
2) node TS server covering south china telecommunications (covering the Guangdong telecommunications): TS server C, TS server D;
3) node TS server covering china telecommunications (covering south china telecommunications): a TS server E;
4) firstly, selecting a node TS server covering Guangdong telecommunication: A. b;
5) if the total weight of the load residuals of A, B is greater than 40% (2 x 20%), i.e. the average weight of the load residuals of A, B is greater than 20% (40%/2), then one of A, B is selected according to a hashing algorithm;
6) if the total weight of the load residue of A, B is less than or equal to 40% (2 x 20%), that is, the average weight of the load residue of A, B is less than or equal to 20%, adding the south China telecom node TS server into an alternative list, wherein the current scheduling list is: A. b, C, D, respectively;
7) if the total weight of the load residuals of A, B, C, D is greater than 80% (4 x 20%), i.e. the average weight of the load residuals of A, B, C, D is greater than 20% (80%/4), then one of A, B, C, D is selected according to a hashing algorithm;
8) if the residual average weight of the load of A, B, C, D is less than or equal to 20%, adding the TS server of the China telecom node into a to-be-selected list, wherein the current scheduling list is as follows: A. b, C, D, E, respectively;
9) at this time, whether the total weight of the load remaining at A, B, C, D, E is greater than 100% (5 × 20%), that is, whether the average weight of the load remaining at A, B, C, D, E is greater than 20% (100%/5), one of A, B, C, D, E is selected based on the hash, and in the case where the total weight is insufficient, it is indicated that the TS server cannot be selected, and an alarm is given.
Secondly, if the first geographic location and the second geographic location are the same operator across provinces, for example, the operator corresponding to the IP address of the network storage device is Guangdong Shenzhen telecom, and the operator corresponding to the IP address of the terminal device is Fujian Xiamen telecom, both belong to south China telecom, the scheduling rule is as follows:
1) node TS server covering south china telecommunications (covering the Guangdong telecommunications): TS server A, TS server B;
2) node TS server covering china telecommunications (covering south china telecommunications): a TS server C;
3) firstly, selecting a node TS server covering south China telecommunication: A. b;
4) if the total weight of load remaining of A, B is greater than 40% (2 x 20%), i.e. the average weight of load remaining of A, B is greater than 20% (40%/2), then one of A, B is selected according to a hashing algorithm;
5) if the total load remaining weight of A, B is less than or equal to 40%, that is, the average load remaining weight of A, B is less than or equal to 20% (40%/2), adding the TS server of the chinese telecom node into the candidate list, where the current scheduling list is: A. b, C, respectively;
6) at this time, whether the total remaining weight of the load of A, B, C is greater than 60% (3 × 20%), that is, whether the average remaining weight of the load of A, B is greater than 20% (60%/3), one of A, B, C is selected according to the hash algorithm to return, and if the total weight is not sufficient, it is indicated that the TS server cannot be selected, and an alarm is given.
Thirdly, if the first geographic location and the second geographic location are the same operator across the large district, for example, the operator corresponding to the IP address of the network storage device is Guangdong Shenzhen telecom, the operator corresponding to the IP address of the terminal device is Beijing telecom, and the large district all belong to China telecom, the scheduling rule is as follows:
1) node TS server covering china telecommunications (covering south china telecommunications): TS server A, TS server B;
2) at this time, whether the total remaining weight of the load of A, B is greater than 40% (2 × 20%), that is, whether the average remaining weight of the load of A, B is greater than 20% (40%/4), one of A, B is selected according to the hash algorithm, and in the case where the total weight is insufficient, it is indicated that the TS server cannot be selected, and an alarm is given.
And if the first geographic location and the second geographic location are operators across provinces, for example, the operator corresponding to the IP address of the network storage device is Guangdong Shenzhen mobile, and the operator corresponding to the IP address of the terminal device is Guangdong Guangzhou telecommunication, the scheduling rule is as follows:
1) three-wire machine room node TS server covering Guangdong: TS server A, TS server B;
2) three-wire machine room node TS server covering south china (covering the guangdong): TS server C, TS server D;
3) three-wire machine room node TS server covering china (covering south china): a TS server E;
4) firstly, selecting a three-wire machine room TS server covering the Guangdong: A. b;
5) if the total weight of the load residuals of A, B is greater than 40% (2 x 20%), i.e. the average weight of the load residuals of A, B is greater than 20% (40%/2), then one of A, B is selected according to a hashing algorithm;
6) if the total load remaining weight of A, B is less than or equal to 40% (2 x 20%), that is, the average load remaining weight of A, B is less than or equal to 20%, adding the three-wire machine room node TS server into a candidate list, where the current scheduling list is: A. b, C, D, respectively;
7) if the total weight of the load residuals of A, B, C, D is greater than 80% (4 x 20%), i.e. the average weight of the load residuals of A, B, C, D is greater than 20% (80%/4), then one of A, B, C, D is selected according to a hashing algorithm;
8) if the residual average weight of the load of A, B, C, D is less than or equal to 20%, adding a three-wire machine room node TS server into a list to be selected, wherein the current scheduling list is as follows: A. b, C, D, E, respectively;
9) at this time, whether the total weight of the load remaining at A, B, C, D, E is greater than 100% (5 × 20%), that is, whether the average weight of the load remaining at A, B, C, D, E is greater than 20% (100%/5), one of A, B, C, D, E is selected based on the hash, and in the case where the total weight is insufficient, it is indicated that the TS server cannot be selected, and an alarm is given.
And if the first geographic position and the second geographic position are trans-operators across provinces in the same region, for example, the operator corresponding to the IP address of the network storage device is Guangdong Shenzhen telecom, and the operator corresponding to the IP address of the terminal device is Fujian Xiamen Unicom, and both belong to the south China region, the scheduling rule is as follows:
1) three-wire machine room node TS server covering south china (covering the guangdong): TS server A, TS server B;
2) three-wire machine room node TS server covering china (covering south china): a TS server C;
3) firstly, selecting a three-wire machine room node TS server covering south China: A. b;
4) if the total weight of load remaining of A, B is greater than 40% (2 x 20%), i.e. the average weight of load remaining of A, B is greater than 20% (40%/2), then one of A, B is selected according to a hashing algorithm;
5) if the total load remaining weight of A, B is less than or equal to 40%, that is, the average load remaining weight of A, B is less than or equal to 20% (40%/2), adding the three-wire machine room node TS server into a candidate list, wherein the current scheduling list is: A. b, C, respectively;
6) at this time, whether the total remaining weight of the load of A, B, C is greater than 60% (3 × 20%), that is, whether the average remaining weight of the load of A, B is greater than 20% (60%/3), one of A, B, C is selected according to the hash algorithm to return, and if the total weight is not sufficient, it is indicated that the TS server cannot be selected, and an alarm is given.
Sixth, if the first geographic location and the second geographic location are different operators across the large region, for example, the operator corresponding to the IP address of the network storage device is Guangdong Shenzhen telecom, the operator corresponding to the IP address of the terminal device is Beijing Unicom, and the operator also spans the large region, the scheduling rule is as follows:
1) three-wire machine room node TS server covering china (covering south china): TS server A, TS server B;
2) at this time, whether the total remaining weight of the load of A, B is greater than 40% (2 × 20%), that is, whether the average remaining weight of the load of A, B is greater than 20% (40%/4), one of A, B is selected according to the hash algorithm, and in the case where the total weight is insufficient, it is indicated that the TS server cannot be selected, and an alarm is given.
By the above example, the optimal TS server is reasonably scheduled in different operators and different geographic areas, so that scheduling is efficient and reasonable.
According to the TS server scheduling method provided by the embodiment of the invention, the optimal TS server is reasonably scheduled in different operators and different geographical areas, so that the network storage device and the terminal device can communicate more quickly and conveniently, and the user experience of a terminal client is improved.
Referring to fig. 4, fig. 4 shows a block diagram of an embodiment of a scheduling apparatus suitable for implementing an embodiment of the present invention.
The scheduling apparatus includes: a processor (processor)41, a memory (memory)42, a communication Interface (Communications Interface)43, and a bus 44; wherein:
the processor 41, the memory 42 and the communication interface 43 complete mutual communication through the bus 44;
the communication interface 43 is used for information transmission between other devices.
The processor 41 is configured to call a computer program in the memory 42 to execute the TS server scheduling method provided in the foregoing method embodiment, and specifically includes:
acquiring a first network operator of a network where a network storage device is located and a first geographical position where the first network operator is located;
acquiring a second network operator of a network where terminal equipment is located and a second geographic position where the second network operator is located;
inquiring all TS servers in the first geographical position and the second geographical position, and calculating the average weight of the residual load of all the TS servers;
and when the average weight of the residual load exceeds a first threshold value, selecting the optimal TS server according to a hash algorithm.
Further, the processor 41 is configured to call a computer program in the memory 42 to execute the TS server scheduling provided by the foregoing method embodiment, and specifically includes:
and judging whether the first operator and the second operator are the same operator.
Further, the processor 41 is configured to invoke a computer program in the memory 42 to execute the method provided by the foregoing method embodiment, when the first operator and the second operator are the same operator, the querying all TS servers in the first geographic location and the second geographic location, and calculating an average remaining load weight of all TS servers, and when the average remaining load weight exceeds a first threshold, selecting an optimal TS server according to a hash algorithm, specifically including:
inquiring the position relation between the first geographical position and the second geographical position;
when the first geographical position and the second geographical position belong to the same geographical area, inquiring all TS servers covering the same operator in the same geographical area, and calculating the average weight of the residual load of all TS servers;
and when the average weight of the residual load exceeds the first threshold value, selecting the optimal TS server according to a hash algorithm.
Further, the processor 41 is configured to call a computer program in the memory 42 to execute the TS server scheduling method provided in the foregoing method embodiment, and specifically further includes:
when the average weight of the residual load does not exceed the first threshold value, inquiring all TS servers covering the same operator in the upper-level area of the same geographic area;
judging whether the average weight of the residual load of all TS servers covering the same operator in the same geographic area and the upper-level area exceeds the first threshold value or not;
and when the average weight of the residual loads of all TS servers covering the same operator in the same geographic area and the upper-level area exceeds the first threshold value, selecting the optimal TS server according to a Hash algorithm.
Further, the processor 41 is configured to invoke the computer program in the memory 42 to execute the method provided by the foregoing method embodiment, when the first operator and the second operator are not the same operator, the querying all TS servers in the first geographic location and the second geographic location specifically includes:
and inquiring the position relation between the first geographical position and the second geographical position, and inquiring a TS server covering the first operator and the second operator in the first geographical position and the second geographical position.
Further, the processor 41 is configured to call a computer program in the memory 42 to execute the method provided by the foregoing method embodiment, when the first geographic location and the second geographic location are in the same geographic area, the calculating a remaining load average weight of all TS servers, and when the remaining load average weight exceeds a first threshold, selecting an optimal TS server according to a hash algorithm, specifically including:
judging whether the average weight of the residual load of TS servers covering the first operator and the second operator in the same geographic area at the same time exceeds the first threshold value;
and when the average weight of the residual load of the TS servers covering the first operator and the second operator in the same geographic area exceeds the first threshold value, selecting the optimal TS server according to a hash algorithm.
Further, the processor 41 is configured to call a computer program in the memory 42 to execute the TS server scheduling method provided in the foregoing method embodiment, and specifically further includes:
when the average weight of the residual load of the TS servers covering the first operator and the second operator in the same geographic area does not exceed the first threshold, inquiring all the TS servers covering the first operator and the second operator in the upper-level area of the same geographic area;
judging whether the average weight of the residual load of the TS servers covering the first operator and the TS servers covering the second operator simultaneously in the same geographic area and the upper-level area of the same geographic area exceeds the first threshold value or not;
and when the average weight of the residual loads of the TS servers of the first operator and the TS servers of the second operator which are simultaneously covered by the same geographic area and the upper-level area of the same geographic area exceeds the first threshold value, selecting the optimal TS server according to a hash algorithm.
Further, the processor 41 is configured to call a computer program in the memory 42 to execute the method for selecting an optimal TS server according to the hash algorithm, which includes:
mapping the percentage of the average weight of the residual load of the alternative TS server to the total weight of the load into a hash value;
and comparing the hash value of the alternative TS server with a set value, and selecting the alternative TS server with the smallest difference between the hash value and the set value as the optimal TS server.
Further, the processor 41 is configured to call a computer program in the memory 42 to execute the TS server scheduling method provided in the foregoing method embodiment, and specifically further includes:
the factors influencing the average weight of the residual load comprise network card capacity, CPU occupancy rate and memory utilization rate.
The scheduling device provided by the embodiment of the invention reasonably schedules the optimal TS server in different operators and different geographic areas, so that the network storage device and the terminal device can communicate more quickly and conveniently, and the user experience of terminal customers is improved.
In addition, an embodiment of the present invention further provides a storage medium, where a TS server scheduler is stored on the storage medium, and when executed by a processor, the TS server scheduler implements the following operations:
acquiring a first network operator of a network where a network storage device is located and a first geographical position where the first network operator is located;
acquiring a second network operator of a network where terminal equipment is located and a second geographic position where the second network operator is located;
inquiring all TS servers in the first geographical position and the second geographical position, and calculating the average weight of the residual load of all the TS servers;
and when the average weight of the residual load exceeds a first threshold value, selecting the optimal TS server according to a hash algorithm.
Further, the TS server scheduler, when executed by the processor, further performs the following operations:
and judging whether the first operator and the second operator are the same operator.
Further, the TS server scheduler, when executed by the processor, further performs the following operations:
inquiring the position relation between the first geographical position and the second geographical position;
when the first geographical position and the second geographical position belong to the same geographical area, inquiring all TS servers covering the same operator in the same geographical area, and calculating the average weight of the residual load of all TS servers;
and when the average weight of the residual load exceeds the first threshold value, selecting the optimal TS server according to a hash algorithm.
Further, the TS server scheduler, when executed by the processor, further performs the following operations:
when the average weight of the residual load does not exceed the first threshold value, inquiring all TS servers covering the same operator in the upper-level area of the same geographic area;
judging whether the average weight of the residual load of all TS servers covering the same operator in the same geographic area and the upper-level area exceeds the first threshold value or not;
and when the average weight of the residual loads of all TS servers covering the same operator in the same geographic area and the upper-level area exceeds the first threshold value, selecting the optimal TS server according to a Hash algorithm.
Further, the TS server scheduler, when executed by the processor, further performs the following operations:
and inquiring the position relation between the first geographical position and the second geographical position, and inquiring a TS server covering the first operator and the second operator in the first geographical position and the second geographical position.
Further, the TS server scheduler, when executed by the processor, further performs the following operations:
judging whether the average weight of the residual load of TS servers covering the first operator and the second operator in the same geographic area at the same time exceeds the first threshold value;
and when the average weight of the residual load of the TS servers covering the first operator and the second operator in the same geographic area exceeds the first threshold value, selecting the optimal TS server according to a hash algorithm.
Further, the TS server scheduler, when executed by the processor, further performs the following operations:
when the average weight of the residual load of the TS servers covering the first operator and the second operator in the same geographic area does not exceed the first threshold, inquiring all the TS servers covering the first operator and the second operator in the upper-level area of the same geographic area;
judging whether the average weight of the residual load of the TS servers covering the first operator and the TS servers covering the second operator simultaneously in the same geographic area and the upper-level area of the same geographic area exceeds the first threshold value or not;
and when the average weight of the residual loads of the TS servers of the first operator and the TS servers of the second operator which are simultaneously covered by the same geographic area and the upper-level area of the same geographic area exceeds the first threshold value, selecting the optimal TS server according to a hash algorithm.
Further, the TS server scheduler, when executed by the processor, further performs the following operations:
mapping the percentage of the average weight of the residual load of the alternative TS server to the total weight of the load into a hash value;
and comparing the hash value of the alternative TS server with a set value, and selecting the alternative TS server with the smallest difference between the hash value and the set value as the optimal TS server.
Further, the TS server scheduler, when executed by the processor, further performs the following operations:
the factors influencing the average weight of the residual load comprise network card capacity, CPU occupancy rate and memory utilization rate.
The storage medium provided by the embodiment of the invention reasonably schedules the optimal TS server in different operators and different geographic areas, so that the network storage equipment and the terminal equipment can communicate more quickly and conveniently, and the user experience of terminal customers is improved.
With the development of technology, the propagation path of computer programs is no longer limited to tangible media, and the computer programs can be directly downloaded from a network or acquired by other methods. Accordingly, the computer-readable medium in the present embodiment may include not only tangible media but also intangible media.
The computer storage media of the present embodiments may take any combination of one or more computer-readable media. The computer readable medium may be a computer readable signal medium or a computer readable storage medium. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the computer readable storage medium would include the following: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
A computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Computer program code for carrying out operations for aspects of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
In the embodiments provided in the present invention, it should be understood that the disclosed system, apparatus and method may be implemented in other ways. For example, the above-described device embodiments are merely illustrative, and for example, the division of the units is only one logical functional division, and other divisions may be realized in practice.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, the functional units in the embodiments of the present invention may be integrated into one processing unit, or may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, or in a form of hardware plus a software functional unit.
The integrated unit implemented in the form of a software functional unit may be stored in a computer readable storage medium. The software functional unit is stored in a storage medium and includes several instructions to enable a computer device (which may be a personal computer, a server, or a network device) or a processor (processor) to execute some steps of the method according to the embodiment of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, etc. that can store program codes.
The above embodiments are only preferred embodiments of the present invention, and the protection scope of the present invention is not limited thereby, and any insubstantial changes and substitutions made by those skilled in the art based on the present invention are within the protection scope of the present invention.