CN111274029A - Cluster scheduling method and device - Google Patents
Cluster scheduling method and device Download PDFInfo
- Publication number
- CN111274029A CN111274029A CN202010043351.6A CN202010043351A CN111274029A CN 111274029 A CN111274029 A CN 111274029A CN 202010043351 A CN202010043351 A CN 202010043351A CN 111274029 A CN111274029 A CN 111274029A
- Authority
- CN
- China
- Prior art keywords
- address
- preset
- client
- information
- network operator
- 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
Links
- 238000000034 method Methods 0.000 title claims abstract description 36
- 238000012546 transfer Methods 0.000 claims abstract description 51
- 238000012545 processing Methods 0.000 claims description 18
- 238000012163 sequencing technique Methods 0.000 claims description 8
- 238000012216 screening Methods 0.000 claims description 7
- 230000008260 defense mechanism Effects 0.000 description 10
- 230000008569 process Effects 0.000 description 5
- 230000002159 abnormal effect Effects 0.000 description 3
- 230000009471 action Effects 0.000 description 3
- 238000010586 diagram Methods 0.000 description 3
- 238000005516 engineering process Methods 0.000 description 2
- 230000000977 initiatory effect Effects 0.000 description 2
- 206010033799 Paralysis Diseases 0.000 description 1
- 230000004888 barrier function Effects 0.000 description 1
- 230000006399 behavior Effects 0.000 description 1
- 238000004891 communication Methods 0.000 description 1
- 230000007123 defense Effects 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 230000036541 health Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000012544 monitoring process Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements 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/46—Multiprogramming arrangements
- G06F9/50—Allocation of resources, e.g. of the central processing unit [CPU]
- G06F9/5005—Allocation of resources, e.g. of the central processing unit [CPU] to service a request
- G06F9/5027—Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
- G06F9/505—Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals considering the load
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements 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/46—Multiprogramming arrangements
- G06F9/50—Allocation of resources, e.g. of the central processing unit [CPU]
- G06F9/5083—Techniques for rebalancing the load in a distributed system
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
The application discloses a cluster scheduling method and a device, wherein the method comprises the following steps: receiving an access request which is sent by a client and carries an IP address of the client; when the IP address meets the preset access condition, acquiring the operator information of the area where the client is located and the network operator according to the IP address; when the operator information of the region and the network operator does not accord with the preset IP address transfer condition, determining a target server corresponding to the client according to the acquired parameter information of the plurality of servers; acquiring a target IP address of a target server; and sending the target IP address to the client so that the client accesses the target server according to the received target IP address. According to the method and the device, the back-end server is dynamically scheduled according to the cluster load, the access of dangerous IP addresses is shielded, the high availability of the cluster is guaranteed, the network access of a specific region and a network operator is optimized, and the user experience is improved.
Description
Technical Field
The present application relates to the field of computers, and in particular, to a cluster scheduling method and apparatus.
Background
With the development of the internet, a Load Balance technology (Load Balance) is one of the indispensable architecture strategies for constructing a large website, and the purpose of the Load Balance technology is to distribute a user request to a plurality of back-end devices to Balance the Load of a Server, wherein a Linux Virtual Server (LVS for short) is a common implementation manner of Load Balance, and is a Virtual four-layer switch cluster system, which is used for forwarding the user request according to a target address and a target port, and does not generate traffic and only does the user request forwarding, so that the current cluster system has relatively good Load Balance performance.
Because the traditional LVS scheme is based on unidirectional connection, the traditional LVS scheme can only be used as a request transponder, and the scheduling algorithm is relatively simple, so that the situation that a machine which has too high load in a cluster and cannot normally provide service continuously receives a user request under extreme conditions can be caused, and the user experience is influenced; the cluster paralysis can be caused by the lack of a defense mechanism under the condition of network attack; for the access request of a special area or an operator, the network access delay is high, and the user experience is poor; and cannot meet the dynamic adjustment requirements of users on the clusters during running.
In view of the above technical problems, no effective solution has been proposed at present.
Disclosure of Invention
In order to solve the foregoing technical problem, embodiments of the present application provide a cluster scheduling method and apparatus, an electronic device, and a storage medium.
In a first aspect, the present application provides a cluster scheduling method, including:
receiving an access request which is sent by a client and carries an IP address of the client;
when the IP address of the client meets a preset access condition, acquiring operator information of a region and a network operator where the client is located according to the IP address;
when the region where the client is located and the operator information of the network operator do not accord with the preset IP address transfer condition, determining a target server corresponding to the region where the client is located and the network operator information according to the acquired parameter information of the plurality of servers;
acquiring a target IP address of the target server;
and sending the target IP address of the target server to the client so that the client accesses the target server according to the received target IP address.
Optionally, the method further includes:
matching the IP address of the client with an IP address database, wherein a plurality of preset IP addresses and preset IP segment address sets which are forbidden to access are stored in the IP address database;
when the IP address of the client is not matched with any preset IP address which is forbidden to be accessed in the IP address database and the preset IP section address set, determining that the IP address of the client meets a preset access condition;
and when the IP address of the client is matched with the preset IP address which is forbidden to be accessed and the preset IP segment address set in the IP address database, determining that the IP address of the client does not meet the preset access condition, and forbidding the processing of the access request of the client.
Optionally, the method further includes:
acquiring the access frequency of the IP address of the client in unit time;
when the access frequency does not exceed a preset access frequency threshold, determining that the IP address of the client meets a preset access condition;
and when the access frequency exceeds a preset access frequency threshold, determining that the IP address of the client does not meet a preset access condition, and prohibiting processing of the access request of the client.
Optionally, the method further includes:
matching the operator information of the area where the client is located and the network operator with an IP address transfer database, wherein the IP address transfer database stores a plurality of preset areas, the operator information of preset network operators and preset IP addresses of preset servers corresponding to the operator information of the preset areas and the preset network operators, and the preset servers comprise overseas servers;
and when the operator information of the network operator and the area where the client is located are not matched with the operator information of the preset network operator and the preset area of the preset IP address to be transferred in any one of the IP address transfer databases, determining that the operator information of the network operator and the area where the client is located do not accord with the preset IP address transfer condition.
Optionally, the method further includes:
when the operator information of the network operator and the area where the client is located are matched with the operator information of the preset network operator and the preset area of the preset IP address to be transferred in any one of the IP address transfer databases, determining that the operator information of the network operator and the area where the client is located accord with the preset IP address transfer condition;
acquiring a preset IP address of the overseas server corresponding to the region where the client is located and the operator information of the network operator;
and sending the preset IP address of the overseas server to the client so that the client accesses the overseas server according to the received preset IP address.
Optionally, the determining, according to the obtained parameter information of the multiple servers, a target server corresponding to the information of the area and the network operator where the client is located includes:
according to the parameter information of the servers, carrying out priority sequencing on the servers through a corresponding scheduling algorithm;
screening out the servers with the highest priority from the servers according to the sorting order;
and taking the server with the highest priority as the target server.
In a second aspect, an embodiment of the present application provides a cluster scheduling apparatus, where the apparatus includes:
the access request receiving unit is used for receiving an access request which is sent by a client and carries the IP address of the client;
the client information acquisition unit is used for acquiring the operator information of the area and the network operator where the client is located according to the IP address when the IP address of the client meets the preset access condition;
a target server determining unit, configured to determine, according to the obtained parameter information of the multiple servers, a target server corresponding to the information of the area and the network operator where the client is located when the information of the area and the network operator where the client is located does not conform to a preset IP address transfer condition;
a target IP address obtaining unit, configured to obtain a target IP address of the target server;
and the target IP address sending unit is used for sending the target IP address of the target server to the client so that the client accesses the target server according to the received target IP address.
Optionally, the apparatus further comprises:
the IP address matching unit is used for matching the IP address of the client with an IP address database, wherein a plurality of preset IP addresses and preset IP segment address sets which are forbidden to access are stored in the IP address database;
a first determining unit, configured to determine that an IP address of the client meets a preset access condition when the IP address of the client does not match any of the preset IP address and the preset IP segment address set prohibited from being accessed in the IP address database;
and the forbidding processing unit is used for determining that the IP address of the client does not meet the preset access condition and forbidding processing of the access request of the client when the IP address of the client is matched with any one of the preset IP address and the preset IP segment address set which is forbidden to access in the IP address database.
Optionally, the apparatus further comprises:
an access frequency acquiring unit, configured to acquire an access frequency of the IP address of the client in unit time;
a second determining unit, configured to determine that the IP address of the client meets a preset access condition when the access frequency does not exceed a preset access frequency threshold;
and the third determining unit is used for determining that the IP address of the client does not meet the preset access condition and forbidding processing of the access request of the client when the access frequency exceeds a preset access frequency threshold.
Optionally, the apparatus further comprises:
the system comprises a client information matching unit, a network operator information matching unit and an IP address transfer database, wherein the client information matching unit is used for matching the operator information of the area where the client is located and the network operator with the IP address transfer database, the IP address transfer database stores a plurality of preset areas and preset network operator information, and preset IP addresses of preset servers corresponding to the preset areas and the preset network operator information, and the preset servers comprise overseas servers;
and the first client information determining unit is used for determining that the area where the client is located and the operator information of the network operator do not accord with the preset IP address transfer condition when the area where the client is located and the operator information of the network operator are not matched with the preset area of any to-be-transferred preset IP address and the operator information of the preset network operator in the IP address transfer database.
Optionally, the apparatus further comprises:
a second client information determining unit, configured to determine that the area where the client is located and the operator information of the network operator meet a preset IP address transfer condition when the area where the client is located and the operator information of the network operator match a preset area of any one of the preset IP addresses to be transferred in the IP address transfer database and the operator information of the preset network operator;
a preset IP address obtaining unit configured to obtain a preset IP address of the overseas server corresponding to an area where the client is located and operator information of a network operator;
and the preset IP address sending unit is used for sending the preset IP address of the overseas server to the client so that the client accesses the overseas server according to the received preset IP address.
Optionally, the target server determining unit includes:
the sequencing subunit is used for carrying out priority sequencing on the servers through a corresponding scheduling algorithm according to the parameter information of the servers;
the screening subunit is used for screening the server with the highest priority from the servers according to the sorting order;
and the determining subunit is used for taking the server with the highest priority as the target server.
Compared with the prior art, the technical scheme provided by the embodiment of the application has the following advantages:
according to the cluster scheduling method, the cluster scheduling device, the electronic equipment and the storage medium, the cluster scheduling method receives an access request of a client, wherein the access request carries an IP address of the client; when the IP address of the client meets a preset access condition, acquiring operator information of a region and a network operator where the client is located according to the IP address; when the region where the client is located and the operator information of the network operator do not accord with the preset IP address transfer condition, determining a target server corresponding to the region where the client is located and the network operator information according to the acquired parameter information of the plurality of servers; acquiring a target IP address of the target server; and sending the target IP address of the target server to the client so that the client accesses the target server according to the received target IP address.
According to the embodiment of the application, the rear-end server can be dynamically scheduled according to the cluster load through a multi-level cluster scheduling scheme, a defense mechanism is established, access of dangerous IP addresses can be shielded, high availability of clusters is guaranteed, network access of specific regions and network operators is optimized, and user experience is improved.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and together with the description, serve to explain the principles of the invention.
FIG. 1 illustrates a schematic diagram of one implementation scenario in which embodiments of the present application may be applied;
fig. 2 is a schematic flowchart of a cluster scheduling method according to an embodiment of the present application;
fig. 3 is a schematic flowchart of another cluster scheduling method according to an embodiment of the present application;
fig. 4 is a schematic structural diagram of a cluster scheduling apparatus according to an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application.
Referring to fig. 1, fig. 1 is a schematic diagram illustrating an implementation scenario 100 to which an embodiment of the present application is applicable. As shown in fig. 1, the implementation scenario 100 includes: client 110, load balancer 120, and server 130, server 131, server 132, and server 133.
The client 110 may be a terminal device. For example, the client 110 may be a mobile phone, a tablet computer, a laptop portable computer, or a desktop computer. That is, the client 110 may select a specific type of the client 110 according to actual needs, and the embodiment of the present application is not limited thereto. The client 110 is provided with communication capabilities and may run a browser or other application capable of loading and displaying web pages. For example, the application program may be a conference management application, a social application, an office application, or the like.
In this embodiment of the present application, when the load balancer 120 receives an access request sent by a client 110 and carrying an IP address of the client 110, the load balancer 120 determines whether the IP address of the client 110 meets a preset access condition, if so, the load balancer 120 obtains operator information of a region and a network operator where the client 110 is located according to the IP address, and when the operator information of the region and the network operator where the client 110 is located do not meet a preset IP address transfer condition, the load balancer 120 determines a target server (that is, the server 130, the server 131, the server 132, and the server 133, and the number of servers may be set according to actual requirements) corresponding to the region and the network operator information where the client 110 is located according to the obtained parameter information of a plurality of servers (that is, the server 130, the server 132, and the server 133) according to actual requirements, Server 131, server 132, or server 133). The load balancer 120 obtains a target IP address of the target server (i.e. may be the server 130, the server 131, the server 132, or the server 133), and the load balancer 120 sends the target IP address of the target server (i.e. may be the server 130, the server 131, the server 132, or the server 133) to the client 110, so that the client 110 accesses the target server according to the received target IP address.
Fig. 1 is a schematic flowchart of a cluster scheduling method provided in an embodiment of the present application, where the method is applied to a load balancer, and specifically includes the following steps:
s101, receiving an access request which is sent by a client and carries an IP address of the client.
The embodiment of the application provides a multi-level and bidirectional-connection cluster scheduling scheme, which comprises the following three parts: 1. the dangerous IP addresses are shielded, and the load balancer can shield specific client access according to the IP addresses or IP sections by configuring a blacklist, so that the cluster is prevented from being attacked by external traffic; 2. according to the region where the client is located and the operator information of a network operator, a specific back-end server (for example, an overseas server arranged in an overseas machine room) is assigned to the client; 3. and dynamically scheduling, namely reporting parameter information of the server to the load balancer at regular time by a back-end server (namely an entity server), wherein the parameter information comprises indexes such as CPU (Central processing Unit) occupancy rate, memory occupancy rate, idle network bandwidth and the like, and the back-end server with the minimum load can be selected by the load balancer to perform scheduling according to a custom algorithm in the operation process.
S102, when the IP address of the client meets the preset access condition, acquiring the operator information of the area where the client is located and the network operator according to the IP address.
In the following, whether the IP address of the client meets the preset access condition is determined through the following two ways, and those skilled in the art should know that whether the IP address of the client meets the preset access condition may also be determined through other ways.
In a first way,
Matching the IP address of the client with an IP address database, wherein a plurality of preset IP addresses and preset IP segment address sets which are forbidden to access are stored in the IP address database;
when the IP address of the client is not matched with any preset IP address which is forbidden to be accessed in the IP address database and the preset IP section address set, determining that the IP address of the client meets a preset access condition;
and when the IP address of the client is matched with the preset IP address which is forbidden to be accessed and the preset IP segment address set in the IP address database, determining that the IP address of the client does not meet the preset access condition, and forbidding the processing of the access request of the client.
According to the embodiment of the application, the IP address blacklist, namely the multiple access-prohibited preset IP addresses and the preset IP section address set, is stored in the cache of the load balancer through the active defense mechanism, the active defense mechanism is configured by an operator, when the operator monitors that a client side has certain malicious behaviors, the operator can add a single IP address or a certain IP section into the blacklist, the IP address or the IP section in the blacklist is shielded when the client side accesses the front-end load balancer and cannot acquire a rear-end server, so that the server cluster is prevented from being attacked by external traffic, and high availability of the cluster is guaranteed.
The second way,
Acquiring the access frequency of the IP address of the client in unit time;
when the access frequency does not exceed a preset access frequency threshold, determining that the IP address of the client meets a preset access condition;
and when the access frequency exceeds a preset access frequency threshold, determining that the IP address of the client does not meet a preset access condition, and prohibiting processing of the access request of the client.
For example, the access frequency threshold is set to 30, the unit time is set to a single day, and when the access frequency of an IP address of a certain client in the single day is 35, the access frequency of the client exceeds the access frequency threshold, it is determined that the client does not satisfy the preset access condition, and the processing of the access request of the client is prohibited; if the access frequency of the IP address of a certain client in a single day is 20, the access frequency of the client does not exceed the access frequency threshold, and the preset access condition is met.
In the embodiment of the application, through the passive defense mechanism, a single IP address or a single-day access frequency of a certain IP segment is monitored and limited by a program, and in this type of monitoring mode, 1 counter is stored in a load balancer cache, so that when the single-day access count of the certain IP address or the certain IP segment reaches an access frequency threshold, the front-end load balancer shields the IP address or the IP segment and limits the IP address or the IP segment from accessing a back-end server again.
According to the cluster scheduling method and the cluster scheduling system, by combining two different defense modes, namely an active defense mechanism and a passive defense mechanism, a barrier can be arranged in a load balancer at the forefront end, a rear-end server is protected from flow attack, dangerous clients are shielded by an operator through a configuration mode through the active defense mechanism, the clients with too high access times are automatically subjected to frequency limitation through a program through the passive defense mechanism, cluster health can be guaranteed, and high availability of a cluster is guaranteed.
S103, when the region where the client is located and the operator information of the network operator do not accord with the preset IP address transfer condition, determining a target server corresponding to the region where the client is located and the network operator information according to the acquired parameter information of the plurality of servers.
Optionally, it is determined whether the operator information of the area where the client is located and the network operator meets a preset IP address transfer condition in the following manner:
matching the operator information of the area where the client is located and the network operator with an IP address transfer database, wherein the IP address transfer database stores a plurality of preset areas, the operator information of preset network operators and preset IP addresses of preset servers corresponding to the operator information of the preset areas and the preset network operators, and the preset servers comprise overseas servers;
when the operator information of the network operator and the preset region of the preset IP address to be transferred in the IP address transfer database are not matched with the operator information of the preset network operator and the preset region of the preset IP address to be transferred, determining that the operator information of the network operator and the region where the client is located do not accord with the preset IP address transfer condition;
when the operator information of the network operator and the area where the client is located are matched with the operator information of the preset network operator and the preset area of the preset IP address to be transferred in any one of the IP address transfer databases, determining that the operator information of the network operator and the area where the client is located accord with the preset IP address transfer condition;
acquiring a preset IP address of the overseas server corresponding to the region where the client is located and the operator information of the network operator;
and sending the preset IP address of the overseas server to the client so that the client accesses the overseas server according to the received preset IP address.
Optionally, because there are many overseas users of some clusters, when a cluster is deployed, because the speed of accessing an in-ground server by an overseas user is low, a part of servers often need to be deployed in an overseas machine room, and a client initiating access to the cluster from a certain region or an operator network is specified to be able to obtain an optimal server. The embodiment of the application specifies that a client initiating access to a cluster from a certain area or an operator network can acquire an optimal server, and the implementation principle is as follows:
an IP address forwarding list, i.e. the above-mentioned IP address forwarding database, is configured in the load scheduler, and for example, the IP address forwarding list is defined as: region/operator- [ IP address of server ], for example: taiwan- [49.0.0.1,49.0.0.2] or china mobile hong kong- [49.0.0.3,49.0.0.4 ]. When a client of a user needs to access a back-end server, the client carries an IP address of the client to access a load balancer, the load balancer acquires the IP address of the client, acquires the information of an area where the client is located and an operator of a network operator, checks whether the area where the client of the user is located or the operator is in a transfer list, if so, assigns a specific overseas server to the user, otherwise, enters a dynamic scheduling step, determines a target server corresponding to the information of the area where the client is located and the network operator, optimizes the network access of the specific area and the network operator, can configure a request initiated from the specific area or the specific operator, and when a certain area or the operator is slow to access some back-end servers in cluster operation, an operator can configure the transfer list to assign the back-end servers, the user experience is improved.
Optionally, the parameter information of the server includes one or more of the following: CPU occupancy, memory occupancy, and free network bandwidth.
After the cluster is started, operator information of a machine room where each server is located is stored in the load balancer; when the cluster runs, the server regularly reports the current state to the load balancer according to a fixed time interval (for example, set to 5 seconds), that is, parameter information of the server is sent, including but not limited to CPU occupancy, memory occupancy, idle network bandwidth, and the like. The load balancer receives and stores the parameter information reported by all the servers in the memory, and sorts the servers according to a certain scheduling algorithm, for example, according to the priority of the lowest CPU occupancy rate.
When a client of a user needs to access a back-end server, the client carries an IP address of the client to access the load balancer, and after the load balancer acquires the IP address of the client, the load balancer returns a server which is the same as an operator and is ranked the most front to the user according to the acquired operator information of a network operator where the client is located, so that the dynamic scheduling of the cluster can be realized.
In the embodiment of the application, the load balancer schedules the back-end server, and the back-end server reports the state to the load balancer, so that the client can be ensured to acquire the optimal server information, the servers with high load and the servers with abnormal states can be eliminated by the load balancer, and the servers with high load and the servers with abnormal states can not receive the access requests of the user; after the load of the server is reduced or recovered from the abnormal state, the parameter information of the server can be continuously reported to the load balancer to continuously provide service, so that the dynamic scheduling of the cluster can be ensured, and the fault-tolerant capability is strong.
S104, acquiring the target IP address of the target server.
S105, sending the target IP address of the target server to the client, so that the client accesses the target server according to the received target IP address.
According to the embodiment of the application, the rear-end server can be dynamically scheduled according to the cluster load through a multi-level cluster scheduling scheme, a defense mechanism is established, access of dangerous IP addresses can be shielded, high availability of clusters is guaranteed, network access of specific regions and network operators is optimized, and user experience is improved.
Fig. 2 is a schematic flowchart of another cluster scheduling method provided in the embodiment of the present application, where the method is applied to a load balancer, and specifically includes the following steps:
s201, receiving an access request which is sent by a client and carries an IP address of the client.
S202, when the IP address of the client meets the preset access condition, acquiring the operator information of the area and the network operator where the client is located according to the IP address.
S203, when the region where the client is located and the operator information of the network operator do not accord with the preset IP address transfer condition, the server is subjected to priority sequencing through a corresponding scheduling algorithm according to the parameter information of the server.
For example, the CPU occupancy rate of each server is obtained, and the server with the lowest CPU occupancy rate is selected as the server with the highest priority; for another example, the memory occupancy rate of each server is obtained, and the server with the lowest memory occupancy rate is selected as the server with the highest priority.
S204, according to the sequencing order, the server with the highest priority is screened out from the servers.
S205, taking the server with the highest priority as the target server.
S206, acquiring the target IP address of the target server.
S207, sending the target IP address of the target server to the client, so that the client accesses the target server according to the received target IP address.
According to the embodiment of the application, the servers are subjected to priority ranking according to the parameter information of the servers, and the server with the high priority is selected as the target server, so that the service processing speed can be increased, and the stable operation of the system can be guaranteed.
Fig. 3 is a cluster scheduling apparatus provided in an embodiment of the present application, where the apparatus includes:
an access request receiving unit 31, configured to receive an access request sent by a client and carrying an IP address of the client;
a client information obtaining unit 32, configured to obtain operator information of a region and a network operator where the client is located according to an IP address when the IP address of the client meets a preset access condition;
a target server determining unit 33, configured to determine, according to the obtained parameter information of the multiple servers, a target server corresponding to the information of the area and the network operator where the client is located when the information of the area and the network operator where the client is located do not meet a preset IP address transfer condition;
a target IP address obtaining unit 34, configured to obtain a target IP address of the target server;
a target IP address sending unit 35, configured to send a target IP address of the target server to the client, so that the client accesses the target server according to the received target IP address.
Optionally, the apparatus further comprises:
an IP address matching unit (not shown in the figure) configured to match an IP address of the client with an IP address database, where a plurality of preset IP addresses and preset IP segment address sets that are prohibited from being accessed are stored in the IP address database;
a first determining unit (not shown in the figure), configured to determine that the IP address of the client meets a preset access condition when the IP address of the client does not match any of the preset IP addresses prohibited from being accessed in the IP address database and the preset IP segment address set;
and a prohibition processing unit (not shown in the figure) configured to, when the IP address of the client matches with any one of the preset IP address and the preset IP segment address set prohibited from being accessed in the IP address database, determine that the IP address of the client does not satisfy a preset access condition, and prohibit processing of the access request of the client.
Optionally, the apparatus further comprises:
an access frequency acquiring unit (not shown in the figure) for acquiring an access frequency of the IP address of the client in a unit time;
a second determining unit (not shown in the figure) configured to determine that the IP address of the client satisfies a preset access condition when the access frequency does not exceed a preset access frequency threshold;
and a third determining unit (not shown in the figure) configured to determine that the IP address of the client does not satisfy the preset access condition and prohibit processing of the access request of the client when the access frequency exceeds a preset access frequency threshold.
Optionally, the apparatus further comprises:
a client information matching unit (not shown in the figure) for matching the operator information of the area where the client is located and the network operator with an IP address transfer database, wherein the IP address transfer database stores a plurality of preset area and preset network operator information, and preset IP addresses of preset servers corresponding to the preset area and preset network operator information, and the preset servers include overseas servers;
a first client information determining unit (not shown in the figure), configured to determine that neither the area where the client is located nor the operator information of the network operator matches with a preset area of the preset IP address to be transferred and operator information of a preset network operator in the IP address transfer database, where the area where the client is located and the operator information of the network operator do not meet a preset IP address transfer condition.
Optionally, the apparatus further comprises:
a second client information determining unit (not shown in the figure), configured to determine that the area where the client is located and the operator information of the network operator meet a preset IP address transfer condition when the area where the client is located and the operator information of the network operator match a preset area of any one of the preset IP addresses to be transferred in the IP address transfer database and the operator information of a preset network operator;
a preset IP address obtaining unit (not shown in the figure) for obtaining a preset IP address of the overseas server corresponding to operator information of an area and a network operator where the client is located;
a preset IP address sending unit (not shown in the figure) configured to send a preset IP address of the outbound server to the client, so that the client accesses the outbound server according to the received preset IP address.
Optionally, the target server determining unit 33 includes:
a sorting subunit (not shown in the figure), configured to perform priority sorting on the servers through corresponding scheduling algorithms according to the parameter information of the servers;
a screening subunit (not shown in the figure) configured to screen, in order of sorting, a server with the highest priority from the servers;
a determining subunit (not shown in the figure) configured to use the server with the highest priority as the target server.
It is noted that, in this document, relational terms such as "first" and "second," and the like, may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, 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 an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
The foregoing are merely exemplary embodiments of the present invention, which enable those skilled in the art to understand or practice the present invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the invention. Thus, the present invention is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims (12)
1. A method for cluster scheduling, the method comprising:
receiving an access request which is sent by a client and carries an IP address of the client;
when the IP address of the client meets a preset access condition, acquiring operator information of a region and a network operator where the client is located according to the IP address;
when the region where the client is located and the operator information of the network operator do not accord with the preset IP address transfer condition, determining a target server corresponding to the region where the client is located and the network operator information according to the acquired parameter information of the plurality of servers;
acquiring a target IP address of the target server;
and sending the target IP address of the target server to the client so that the client accesses the target server according to the received target IP address.
2. The method of claim 1, further comprising:
matching the IP address of the client with an IP address database, wherein a plurality of preset IP addresses and preset IP segment address sets which are forbidden to access are stored in the IP address database;
when the IP address of the client is not matched with any preset IP address which is forbidden to be accessed in the IP address database and the preset IP section address set, determining that the IP address of the client meets a preset access condition;
and when the IP address of the client is matched with the preset IP address which is forbidden to be accessed and the preset IP segment address set in the IP address database, determining that the IP address of the client does not meet the preset access condition, and forbidding the processing of the access request of the client.
3. The method of claim 1, further comprising:
acquiring the access frequency of the IP address of the client in unit time;
when the access frequency does not exceed a preset access frequency threshold, determining that the IP address of the client meets a preset access condition;
and when the access frequency exceeds a preset access frequency threshold, determining that the IP address of the client does not meet a preset access condition, and prohibiting processing of the access request of the client.
4. The method of claim 1, further comprising:
matching the operator information of the area where the client is located and the network operator with an IP address transfer database, wherein the IP address transfer database stores a plurality of preset areas, the operator information of preset network operators and preset IP addresses of preset servers corresponding to the operator information of the preset areas and the preset network operators, and the preset servers comprise overseas servers;
and when the operator information of the network operator and the area where the client is located are not matched with the operator information of the preset network operator and the preset area of the preset IP address to be transferred in any one of the IP address transfer databases, determining that the operator information of the network operator and the area where the client is located do not accord with the preset IP address transfer condition.
5. The method of claim 4, further comprising:
when the operator information of the network operator and the area where the client is located are matched with the operator information of the preset network operator and the preset area of the preset IP address to be transferred in any one of the IP address transfer databases, determining that the operator information of the network operator and the area where the client is located accord with the preset IP address transfer condition;
acquiring a preset IP address of the overseas server corresponding to the region where the client is located and the operator information of the network operator;
and sending the preset IP address of the overseas server to the client so that the client accesses the overseas server according to the received preset IP address.
6. The method according to claim 1, wherein the determining, according to the obtained parameter information of the plurality of servers, a target server corresponding to information of a region and a network operator where the client is located comprises:
according to the parameter information of the servers, carrying out priority sequencing on the servers through a corresponding scheduling algorithm;
screening out the servers with the highest priority from the servers according to the sorting order;
and taking the server with the highest priority as the target server.
7. An apparatus for cluster scheduling, the apparatus comprising:
the access request receiving unit is used for receiving an access request which is sent by a client and carries the IP address of the client;
the client information acquisition unit is used for acquiring the operator information of the area and the network operator where the client is located according to the IP address when the IP address of the client meets the preset access condition;
a target server determining unit, configured to determine, according to the obtained parameter information of the multiple servers, a target server corresponding to the information of the area and the network operator where the client is located when the information of the area and the network operator where the client is located does not conform to a preset IP address transfer condition;
a target IP address obtaining unit, configured to obtain a target IP address of the target server;
and the target IP address sending unit is used for sending the target IP address of the target server to the client so that the client accesses the target server according to the received target IP address.
8. The apparatus of claim 7, further comprising:
the IP address matching unit is used for matching the IP address of the client with an IP address database, wherein a plurality of preset IP addresses and preset IP segment address sets which are forbidden to access are stored in the IP address database;
a first determining unit, configured to determine that an IP address of the client meets a preset access condition when the IP address of the client does not match any of the preset IP address and the preset IP segment address set prohibited from being accessed in the IP address database;
and the forbidding processing unit is used for determining that the IP address of the client does not meet the preset access condition and forbidding processing of the access request of the client when the IP address of the client is matched with any one of the preset IP address and the preset IP segment address set which is forbidden to access in the IP address database.
9. The apparatus of claim 7, further comprising:
an access frequency acquiring unit, configured to acquire an access frequency of the IP address of the client in unit time;
a second determining unit, configured to determine that the IP address of the client meets a preset access condition when the access frequency does not exceed a preset access frequency threshold;
and the third determining unit is used for determining that the IP address of the client does not meet the preset access condition and forbidding processing of the access request of the client when the access frequency exceeds a preset access frequency threshold.
10. The apparatus of claim 7, further comprising:
the system comprises a client information matching unit, a network operator information matching unit and an IP address transfer database, wherein the client information matching unit is used for matching the operator information of the area where the client is located and the network operator with the IP address transfer database, the IP address transfer database stores a plurality of preset areas and preset network operator information, and preset IP addresses of preset servers corresponding to the preset areas and the preset network operator information, and the preset servers comprise overseas servers;
and the first client information determining unit is used for determining that the area where the client is located and the operator information of the network operator do not accord with the preset IP address transfer condition when the area where the client is located and the operator information of the network operator are not matched with the preset area of the preset IP address to be transferred and the operator information of the preset network operator in the IP address transfer database.
11. The apparatus of claim 10, further comprising:
a second client information determining unit, configured to determine that the area where the client is located and the operator information of the network operator meet a preset IP address transfer condition when the area where the client is located and the operator information of the network operator match a preset area of any one of the preset IP addresses to be transferred and the operator information of a preset network operator in the IP address transfer database;
a preset IP address obtaining unit configured to obtain a preset IP address of the overseas server corresponding to an area where the client is located and operator information of a network operator;
and the preset IP address sending unit is used for sending the preset IP address of the overseas server to the client so that the client accesses the overseas server according to the received preset IP address.
12. The apparatus of claim 7, wherein the target server determining unit comprises:
the sequencing subunit is used for carrying out priority sequencing on the servers through a corresponding scheduling algorithm according to the parameter information of the servers;
the screening subunit is used for screening the server with the highest priority from the servers according to the sorting order;
and the determining subunit is used for taking the server with the highest priority as the target server.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010043351.6A CN111274029A (en) | 2020-01-15 | 2020-01-15 | Cluster scheduling method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010043351.6A CN111274029A (en) | 2020-01-15 | 2020-01-15 | Cluster scheduling method and device |
Publications (1)
Publication Number | Publication Date |
---|---|
CN111274029A true CN111274029A (en) | 2020-06-12 |
Family
ID=71001577
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202010043351.6A Pending CN111274029A (en) | 2020-01-15 | 2020-01-15 | Cluster scheduling method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN111274029A (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112019650A (en) * | 2020-08-20 | 2020-12-01 | 北京达佳互联信息技术有限公司 | IP address recommendation method and device and server |
CN112448952A (en) * | 2020-11-13 | 2021-03-05 | 北京金和网络股份有限公司 | Method and device for remotely receiving and storing intelligent equipment parameters |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101938504A (en) * | 2009-06-30 | 2011-01-05 | 深圳市融创天下科技发展有限公司 | Cluster server intelligent dispatching method and system |
CN108400963A (en) * | 2017-10-23 | 2018-08-14 | 平安科技(深圳)有限公司 | Electronic device, access request control method and computer readable storage medium |
CN109995859A (en) * | 2019-03-26 | 2019-07-09 | 网宿科技股份有限公司 | A kind of dispatching method, dispatch server and computer readable storage medium |
-
2020
- 2020-01-15 CN CN202010043351.6A patent/CN111274029A/en active Pending
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101938504A (en) * | 2009-06-30 | 2011-01-05 | 深圳市融创天下科技发展有限公司 | Cluster server intelligent dispatching method and system |
CN108400963A (en) * | 2017-10-23 | 2018-08-14 | 平安科技(深圳)有限公司 | Electronic device, access request control method and computer readable storage medium |
CN109995859A (en) * | 2019-03-26 | 2019-07-09 | 网宿科技股份有限公司 | A kind of dispatching method, dispatch server and computer readable storage medium |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112019650A (en) * | 2020-08-20 | 2020-12-01 | 北京达佳互联信息技术有限公司 | IP address recommendation method and device and server |
CN112448952A (en) * | 2020-11-13 | 2021-03-05 | 北京金和网络股份有限公司 | Method and device for remotely receiving and storing intelligent equipment parameters |
CN112448952B (en) * | 2020-11-13 | 2023-04-21 | 北京金和网络股份有限公司 | Method and device for remotely receiving and storing intelligent equipment parameters |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US11997111B1 (en) | Attribute-controlled malware detection | |
CN109660607B (en) | Service request distribution method, service request receiving method, service request distribution device, service request receiving device and server cluster | |
US11863581B1 (en) | Subscription-based malware detection | |
CN110049130B (en) | Service deployment and task scheduling method and device based on edge computing | |
US7475108B2 (en) | Slow-dynamic load balancing method | |
US20020129127A1 (en) | Apparatus and method for routing a transaction to a partitioned server | |
CN110519183B (en) | Node speed limiting method and device, electronic equipment and storage medium | |
CN107819797B (en) | Access request processing method and device | |
CN112612618B (en) | Interface current limiting method and device, computer equipment and storage medium | |
CN103379040A (en) | Device and method for controlling concurrency number in high concurrency system | |
CN112437006B (en) | Request control method and device based on API gateway, electronic equipment and storage medium | |
CN110661815A (en) | Request processing method, device, system and medium based on frequency limitation microservice | |
US20110231934A1 (en) | Distributed Virus Detection | |
CN111274029A (en) | Cluster scheduling method and device | |
US20070265976A1 (en) | License distribution in a packet data network | |
CN107154915A (en) | The method of defending distributed refusal service DDoS attack, apparatus and system | |
CN110677475A (en) | Micro-service processing method, device, equipment and storage medium | |
CN113361913A (en) | Communication service arranging method, device, computer equipment and storage medium | |
CN109981779B (en) | Service providing method, server and computer storage medium | |
CN109951426B (en) | Abnormal domain name determining method, abnormal traffic processing method, device and system | |
CN113794650A (en) | Concurrent request processing method, computer device and computer-readable storage medium | |
CN110545336A (en) | IP address replacing method, device, computer equipment and storage medium | |
CN108882296B (en) | Method and device for processing message | |
CN114615073A (en) | Access flow control method, device, equipment and medium | |
JP4392330B2 (en) | Access control mechanism |
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 | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20200612 |
|
RJ01 | Rejection of invention patent application after publication |