CN113242301B - Method, device, computer equipment and storage medium for selecting true server - Google Patents
Method, device, computer equipment and storage medium for selecting true server Download PDFInfo
- Publication number
- CN113242301B CN113242301B CN202110511114.2A CN202110511114A CN113242301B CN 113242301 B CN113242301 B CN 113242301B CN 202110511114 A CN202110511114 A CN 202110511114A CN 113242301 B CN113242301 B CN 113242301B
- Authority
- CN
- China
- Prior art keywords
- server
- real
- real server
- taking
- target
- 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.)
- Active
Links
- 238000000034 method Methods 0.000 title claims abstract description 38
- 238000012545 processing Methods 0.000 claims abstract description 48
- 230000005540 biological transmission Effects 0.000 claims abstract description 44
- 230000004044 response Effects 0.000 claims description 25
- 238000012795 verification Methods 0.000 claims description 19
- 238000012360 testing method Methods 0.000 claims description 8
- 238000010187 selection method Methods 0.000 claims 1
- 241000700605 Viruses Species 0.000 description 4
- 238000004364 calculation method Methods 0.000 description 4
- 238000004891 communication Methods 0.000 description 4
- 238000010586 diagram Methods 0.000 description 4
- 230000003287 optical effect Effects 0.000 description 3
- 230000006835 compression Effects 0.000 description 2
- 238000007906 compression Methods 0.000 description 2
- 238000012216 screening Methods 0.000 description 2
- 238000012163 sequencing technique Methods 0.000 description 2
- 238000003491 array Methods 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 235000019800 disodium phosphate Nutrition 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 239000000835 fiber Substances 0.000 description 1
- 230000010365 information processing Effects 0.000 description 1
- 230000003993 interaction Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000011084 recovery Methods 0.000 description 1
- 230000003068 static effect Effects 0.000 description 1
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/10—Protocols in which an application is distributed across nodes in the network
- H04L67/1001—Protocols in which an application is distributed across nodes in the network for accessing one among a plurality of replicated servers
- H04L67/1004—Server selection for load balancing
- H04L67/1008—Server selection for load balancing based on parameters of servers, e.g. available memory or workload
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L63/00—Network architectures or network communication protocols for network security
- H04L63/08—Network architectures or network communication protocols for network security for authentication of entities
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/10—Protocols in which an application is distributed across nodes in the network
- H04L67/1001—Protocols in which an application is distributed across nodes in the network for accessing one among a plurality of replicated servers
- H04L67/1004—Server selection for load balancing
- H04L67/1021—Server selection for load balancing based on client or server locations
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/10—Protocols in which an application is distributed across nodes in the network
- H04L67/1001—Protocols in which an application is distributed across nodes in the network for accessing one among a plurality of replicated servers
- H04L67/1004—Server selection for load balancing
- H04L67/1025—Dynamic adaptation of the criteria on which the server selection is based
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Computer Hardware Design (AREA)
- General Engineering & Computer Science (AREA)
- Computer Security & Cryptography (AREA)
- Computing Systems (AREA)
- Computer And Data Communications (AREA)
Abstract
The embodiment of the application belongs to the technical field of computers, and relates to a method for selecting a real server, which comprises the steps of receiving parameters of the real server input by a user on a front-end page, and creating a real server instance based on the parameters, wherein the real server comprises a local server and a remote server; when receiving a data transmission request sent by a user, calculating the state of each real server, taking the real server meeting the preset state condition as a target server, carrying out identity authentication on the user through the target server, and transmitting the data transmission request of the user to the server after the authentication is passed. The application also provides a selection device, computer equipment and storage medium of the real server. According to the method and the device, the better server is selected, and the quick processing of the request is achieved.
Description
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a method and apparatus for selecting a real server, a computer device, and a storage medium.
Background
Currently, when a client initiates a request, for a company deploying a server cluster, there is a certain difference between different servers, so that the response time and the running speed of the servers are different. For processing the request of the client, only one server is configured correspondingly for one client, which results in the situation that the effective and rapid processing is not required when the server is down, or the response speed and the running speed of the server are slower, so that the request of the client cannot be received and processed in time.
Disclosure of Invention
The embodiment of the application aims to provide a method, a device, computer equipment and a storage medium for selecting a real server, selecting a better server and realizing quick processing of a request.
In order to solve the above technical problems, the embodiments of the present application provide a method for selecting a real server, which adopts the following technical scheme:
a method of selecting a real server, comprising the steps of:
receiving server parameters of a real server, and establishing connection with the real server based on the server parameters;
when a data transmission request sent by a user is received, carrying out identity authentication on the user;
and after the verification is passed, determining the state of each real server, taking the real server meeting the preset state condition as a target server, and transmitting a data transmission request of the user to the target server.
Further, the step of determining the state of each real server and taking the real server meeting the preset state condition as the target server includes:
acquiring preset weight values of all real servers, and sorting the real servers in descending order of the weight values based on the weight values to obtain a list;
taking the real server at the first position in the list as an initial server;
identifying whether the initial server normally operates, and taking the initial server as the target server when the initial server normally operates;
and when the initial server does not normally operate, identifying whether the second real server in the list normally operates or not until the normal operating real server is identified, and taking the second real server as the target server.
Further, the step of determining the state of each real server and taking the real server meeting the preset state condition as the target server includes:
and respectively calculating the states of the real servers based on a weight algorithm, and taking the real servers meeting the preset state conditions as target servers.
Further, after the step of receiving the parameters of the real server and establishing connection with the real server based on the parameters, the method further includes:
respectively sending test signals to the real servers through preset time intervals in a circulating way;
receiving response signals sent by the real servers;
calculating the time interval between the test signal and the response signal to obtain the response time of each real server;
the step of calculating the state of each real server based on the weight algorithm and taking the real server meeting the preset state condition as the target server comprises the following steps:
respectively calculating the average value of response time of each real server as a first parameter, and respectively determining the number of received requests of each real server in a preset time period as a second parameter;
carrying out weighted summation on the first parameter and the second parameter to obtain a target state value;
and taking the real server corresponding to the minimum target state value as the target server.
Further, the step of calculating the state of each real server based on the weight algorithm and taking the real server meeting the preset state condition as the target server includes:
and acquiring the data volume which is being processed by each real server, taking the reciprocal of the data volume as the server weight of the corresponding real server, and taking the real server with the largest server weight as the target server.
Further, the step of calculating the state of each real server and taking the real server meeting the preset state condition as the target server includes:
determining the geographic position of each real server and the geographic position of the client;
and selecting a real server closest to the geographic position of the client as the target server.
Further, the step of determining the state of each real server and taking the real server meeting the preset state condition as the target server includes:
acquiring historical data of each real server, wherein the historical data comprises a historical request, a historical processing data amount and a historical request processing time length, and the historical request, the historical processing data amount and the historical request processing time length are in one-to-one corresponding association relation;
calculating the processing time length of single data based on the historical processing data quantity and the historical processing time length, and taking the real server corresponding to the processing time length of the single data smaller than a time length threshold as a candidate server;
and acquiring the number of the history requests of the candidate server, and taking the candidate server corresponding to the minimum number of the history requests as the target server.
In order to solve the above technical problems, the embodiments of the present application further provide a device for selecting a real server, which adopts the following technical scheme:
a selection device of a real server, comprising:
the receiving module is used for receiving server parameters of a real server and establishing connection with the real server based on the server parameters;
the verification module is used for carrying out identity verification on the user when receiving a data transmission request sent by the user;
and the transmission module is used for determining the state of each real server after the verification is passed, taking the real server meeting the preset state condition as a target server, and transmitting the data transmission request of the user to the target server.
In order to solve the above technical problems, the embodiments of the present application further provide a computer device, which adopts the following technical schemes:
a computer device comprising a memory having stored therein computer readable instructions which when executed by a processor implement the steps of the above-described method of selecting a real server.
In order to solve the above technical problems, embodiments of the present application further provide a computer readable storage medium, which adopts the following technical solutions:
a computer readable storage medium having stored thereon computer readable instructions which when executed by a processor perform the steps of the method of selecting a real server as described above.
Compared with the prior art, the embodiment of the application has the following main beneficial effects:
according to the method and the device, before the selection of the real server, the identity of the user is verified, so that the safety of data transmission is improved, and the user who maliciously transmits the data carrying viruses is prevented from participating in. The state of each real server is determined, the real server which accords with the preset state condition is selected for data transmission, the transmitted real server is determined according to the state of the real server, a more suitable real server can be selected, successful data transmission is realized, and the subsequent rapid data processing is facilitated.
Drawings
For a clearer description of the solution in the present application, a brief description will be given below of the drawings that are needed in the description of the embodiments of the present application, it being obvious that the drawings in the following description are some embodiments of the present application, and that other drawings may be obtained from these drawings without inventive effort for a person of ordinary skill in the art.
FIG. 1 is an exemplary system architecture diagram in which the present application may be applied;
FIG. 2 is a flow chart of one embodiment of a method of selecting a real server according to the present application;
FIG. 3 is a schematic structural diagram of one embodiment of selected devices of a real server according to the present application;
FIG. 4 is a schematic structural diagram of one embodiment of a computer device according to the present application.
Reference numerals: 200. a computer device; 201. a memory; 202. a processor; 203. a network interface; 300. a selection device of a real server; 301. a receiving module; 302. a verification module; 303. and a transmission module.
Detailed Description
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs; the terminology used in the description of the applications herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the application; the terms "comprising" and "having" and any variations thereof in the description and claims of the present application and in the description of the figures above are intended to cover non-exclusive inclusions. The terms first, second and the like in the description and in the claims or in the above-described figures, are used for distinguishing between different objects and not necessarily for describing a sequential or chronological order.
Reference herein to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment may be included in at least one embodiment of the present application. The appearances of such phrases in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. Those of skill in the art will explicitly and implicitly appreciate that the embodiments described herein may be combined with other embodiments.
In order to better understand the technical solutions of the present application, the following description will clearly and completely describe the technical solutions in the embodiments of the present application with reference to the accompanying drawings.
As shown in fig. 1, a system architecture 100 may include terminal devices 101, 102, 103, a network 104, and a server 105. The network 104 is used as a medium to provide communication links between the terminal devices 101, 102, 103 and the server 105. The network 104 may include various connection types, such as wired, wireless communication links, or fiber optic cables, among others.
The user may interact with the server 105 via the network 104 using the terminal devices 101, 102, 103 to receive or send messages or the like. Various communication client applications, such as a web browser application, a shopping class application, a search class application, an instant messaging tool, a mailbox client, social platform software, etc., may be installed on the terminal devices 101, 102, 103.
The terminal devices 101, 102, 103 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smartphones, tablet computers, electronic book readers, MP3 players (Moving Picture Experts Group Audio Layer III, dynamic video expert compression standard audio plane 3), MP4 (Moving Picture Experts Group Audio Layer IV, dynamic video expert compression standard audio plane 4) players, laptop and desktop computers, and the like.
The server 105 may be a server providing various services, such as a background server providing support for pages displayed on the terminal devices 101, 102, 103.
It should be noted that, the method for selecting a real server provided in the embodiments of the present application is generally performed by a server/terminal device, and accordingly, the apparatus for selecting a real server is generally disposed in the server/terminal device.
It should be understood that the number of terminal devices, networks and servers in fig. 1 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
With continued reference to fig. 2, a flow chart of one embodiment of a method of selecting a real server according to the present application is shown. The method for selecting the real server comprises the following steps:
s1: receiving server parameters of a real server, and establishing connection with the real server based on the server parameters;
when a data transmission request sent by a user is received, carrying out identity verification on the user, after the verification is passed, calculating the state of each real server, taking the real server meeting the preset state condition as a target server, and transmitting the data transmission request of the user to the target server.
In this embodiment, users deploy a server cluster in different cities, the server cluster including each Real Server (RS) of the present application. The parameters of the real server can be input by a user on a front-end page, or can be a received parameter table, and the parameters are obtained from the parameter table. And the received server parameters of the real server are used for establishing a connection relationship with the real server, so that subsequent data transmission is facilitated.
In this embodiment, the electronic device (e.g., the server/terminal device shown in fig. 1) on which the method for selecting the real server operates may receive, through a wired connection or a wireless connection, parameters of the real server and a data transmission request sent by the user. It should be noted that the wireless connection may include, but is not limited to, 3G/4G connections, wiFi connections, bluetooth connections, wiMAX connections, zigbee connections, UWB (ultra wideband) connections, and other now known or later developed wireless connection means.
S2: and when receiving a data transmission request sent by the user, carrying out identity authentication on the user.
In this embodiment, when a data transmission request sent by a user is received, authentication is performed on the user. The security of data transmission is improved, and users who maliciously transmit data carrying viruses are prevented from participating in the data transmission. The specific verification mode comprises short message verification and security problem verification.
S3: and after the verification is passed, determining the state of each real server, taking the real server meeting the preset state condition as a target server, and transmitting a data transmission request of the user to the target server.
In this embodiment, the transmitted real server is determined by the state of the real server, so that a more suitable real server can be selected, successful data transmission can be realized, and subsequent rapid processing of the data is facilitated.
Specifically, the step of determining the state of each real server and taking the real server meeting the preset state condition as the target server includes:
acquiring preset weight values of all real servers, and sorting the real servers in descending order of the weight values based on the weight values to obtain a list;
taking the real server at the first position in the list as an initial server;
identifying whether the initial server normally operates, and taking the initial server as the target server when the initial server normally operates;
and when the initial server does not normally operate, identifying whether the second real server in the list normally operates or not until the normal operating real server is identified, and taking the second real server as the target server.
In this embodiment, the client request is always sent to the true server with the highest weight. When the highest weighted real server is identified as down for various reasons, the system will send the client connection to the next highest weighted real server, and so on. The method is suitable for disaster recovery environments, the real server with the highest weight always processes client connection, and only the real server is down, namely the backup server takes over the real server with the second weight, so that the normal operation of data processing is ensured.
In addition, the step of determining the state of each real server and taking the real server meeting the preset state condition as the target server comprises the following steps:
and respectively calculating the states of the real servers based on a weight algorithm, and taking the real servers meeting the preset state conditions as target servers.
In this embodiment, the state of the real server is calculated by a weight algorithm, where the weight algorithm includes obtaining some index values of the real server, such as the data volume being processed, and weighting the obtained index values by different weights, so that the obtained index values are used as the state of the real server, and selection of the real server is facilitated.
Further, the step of calculating the state of each real server based on the weight algorithm and taking the real server meeting the preset state condition as the target server includes:
and acquiring the data volume which is being processed by each real server, taking the reciprocal of the data volume as the server weight of the corresponding real server, and taking the real server with the largest server weight as the target server.
In this embodiment, the weight of the server is determined according to the data volume being processed by each real server, the inverse of the data volume is used as the server weight of the corresponding real server, and the real server with the largest server weight is used as the target server, so that the selected target server is the real server with the smallest data volume being processed, and compared with other real servers, the real server is idle, and the real server is selected, so that the situation that the load of a single real server is too heavy due to blind selection is avoided.
The method further includes the step of calculating the state of each real server and taking the real server meeting the preset state condition as the target server, wherein the step of calculating the state of each real server includes:
determining the geographic position of each real server and the geographic position of the client;
and selecting a real server closest to the geographic position of the client as the target server.
In this embodiment, the real server with the nearest position is selected as the target server according to the distance of the geographic position, so that the data in a short distance can be quickly transmitted, and the data delay is reduced. The specific geographic position is determined as the IP address, and the positioning is carried out according to the IP address.
As another embodiment of the present application, the step of determining the state of each real server, and taking the real server meeting the preset state condition as the target server includes:
acquiring historical data of each real server, wherein the historical data comprises a historical request, a historical processing data amount and a historical request processing time length, and the historical request, the historical processing data amount and the historical request processing time length are in one-to-one corresponding association relation;
calculating the processing time length of single data based on the historical processing data quantity and the historical processing time length, and taking the real server corresponding to the processing time length of the single data smaller than a time length threshold as a candidate server;
and acquiring the number of the history requests of the candidate server, and taking the candidate server corresponding to the minimum number of the history requests as the target server.
In this embodiment, the real server is initially screened based on the calculated processing duration of the single data, a candidate server is selected, and further screening is performed on the candidate server through the data of the history request, so that the target server is determined. The target server is determined through comprehensive screening, the history situation of the real server is comprehensively considered to serve as the service situation of the real server, and therefore the real server with low service frequency is selected to serve as the target server.
In some optional implementations of this embodiment, after step S1, that is, the step of receiving the parameter of the real server and establishing a connection with the real server based on the parameter, step S2, that is, before performing identity verification on the user when receiving the data transmission request sent by the user, the electronic device may further perform the following steps:
respectively sending test signals to the real servers through preset time intervals in a circulating way;
receiving response signals sent by the real servers;
calculating the time interval between the test signal and the response signal to obtain the response time of each real server;
the step of calculating the state of each real server based on the weight algorithm and taking the real server meeting the preset state condition as the target server comprises the following steps:
respectively calculating the average value of response time of each real server as a first parameter, and respectively determining the number of received requests of each real server in a preset time period as a second parameter;
carrying out weighted summation on the first parameter and the second parameter to obtain a target state value;
and taking the real server corresponding to the minimum target state value as the target server.
In this embodiment, the response speed of the real server is determined based on the response time, so as to determine the operation efficiency of the real server. And comprehensively calculating a target state value through weighted summation according to the average value of the response time of the current real server and the received data of the request, comprehensively and fully considering the real server, and determining the target server with the optimal state so as to improve the data processing efficiency.
According to the method and the device, before the selection of the real server, the identity of the user is verified, so that the safety of data transmission is improved, and the user who maliciously transmits the data carrying viruses is prevented from participating in. The state of each real server is determined, the real server which accords with the preset state condition is selected for data transmission, the transmitted real server is determined according to the state of the real server, a more suitable real server can be selected, successful data transmission is realized, and the subsequent rapid data processing is facilitated.
Those skilled in the art will appreciate that implementing all or part of the processes of the methods of the embodiments described above may be accomplished by way of computer readable instructions, stored on a computer readable storage medium, which when executed may comprise processes of embodiments of the methods described above. The storage medium may be a nonvolatile storage medium such as a magnetic disk, an optical disk, a Read-Only Memory (ROM), or a random access Memory (Random Access Memory, RAM).
It should be understood that, although the steps in the flowcharts of the figures are shown in order as indicated by the arrows, these steps are not necessarily performed in order as indicated by the arrows. The steps are not strictly limited in order and may be performed in other orders, unless explicitly stated herein. Moreover, at least some of the steps in the flowcharts of the figures may include a plurality of sub-steps or stages that are not necessarily performed at the same time, but may be performed at different times, the order of their execution not necessarily being sequential, but may be performed in turn or alternately with other steps or at least a portion of the other steps or stages.
With further reference to fig. 3, as an implementation of the method shown in fig. 2, the present application provides an embodiment of a selected apparatus of a real server, where the embodiment of the apparatus corresponds to the embodiment of the method shown in fig. 2, and the apparatus is particularly applicable to various electronic devices.
As shown in fig. 3, the selection device 300 of the real server according to the present embodiment includes: a receiving module 301, a verifying module 302 and a transmitting module 303. Wherein: a receiving module 301, configured to receive a server parameter of a real server, and establish a connection with the real server based on the server parameter; the verification module 302 is configured to perform identity verification on a user when receiving a data transmission request sent by the user; and the transmission module 303 is configured to determine the state of each real server after the verification is passed, take the real server that meets the preset state condition as a target server, and transmit the data transmission request of the user to the target server.
In the embodiment, before the selection of the real server, the authentication is performed on the user, so that the safety of data transmission is improved, and the user who maliciously transmits the data carrying the virus is prevented from participating in. The state of each real server is determined, the real server which accords with the preset state condition is selected for data transmission, the transmitted real server is determined according to the state of the real server, a more suitable real server can be selected, successful data transmission is realized, and the subsequent rapid data processing is facilitated.
The transmission module 303 comprises a sorting sub-module, a determination sub-module, a first identification sub-module and a second identification sub-module. The sequencing sub-module is used for acquiring preset weight values of all real servers, and sequencing the real servers in descending order of the weight values based on the weight values to obtain a list; the determining submodule is used for taking a real server at the first position in the list as an initial server; the first identification submodule is used for identifying whether the initial server normally operates or not, and when the initial server normally operates, the initial server is used as the target server; and the second identification sub-module is used for identifying whether the second real server in the list runs normally or not when the initial server does not run normally until the normal real server is identified as the target server.
In some optional implementations of this embodiment, the transmission module 303 is further configured to: and respectively calculating the states of the real servers based on a weight algorithm, and taking the real servers meeting the preset state conditions as target servers.
In some optional implementations of this embodiment, the apparatus 300 further includes: the system comprises a circulation module, a response signal receiving module and a response time calculating module, wherein the circulation module is used for respectively sending test signals to each real server through a preset time interval in a circulating way; the response signal receiving module is used for receiving response signals sent by the real servers; and the response time calculation module is used for calculating the time interval between the test signal and the response signal to obtain the response time of each real server.
The transmission module 303 includes an average value calculating sub-module, a weighted summation sub-module, and a target server determining sub-module, where the average value calculating sub-module is configured to calculate an average value of response times of each real server as a first parameter, and determine, as a second parameter, a number of received requests of each real server in a preset time period; the weighted summation submodule is used for carrying out weighted summation on the first parameter and the second parameter to obtain a target state value; and the target server determining submodule is used for taking the real server corresponding to the minimum target state value as the target server.
The transmission module 303 is further configured to obtain an amount of data being processed by each real server, take an inverse of the amount of data as a server weight of a corresponding real server, and take a real server with the largest server weight as the target server.
In some optional implementations of this embodiment, the transmission module 303 further includes a geographic location determination sub-module and a selection sub-module. The geographic position determining submodule is used for determining the geographic position of each real server and the geographic position of the client; the selecting sub-module is used for selecting a real server closest to the geographic position of the client as the target server.
In some optional implementations of this embodiment, the transmission module 303 further includes a history data acquisition sub-module, a calculation sub-module, and a quantity acquisition sub-module. The history data acquisition sub-module is used for acquiring history data of each real server, wherein the history data comprises a history request, a history processing data amount and a history request processing time length, and the history request, the history processing data amount and the history request processing time length are in one-to-one corresponding association relation; the calculation submodule is used for calculating the processing time length of the single data based on the historical processing data quantity and the historical processing time length, and taking the real server corresponding to the processing time length of the single data smaller than a time length threshold as a candidate server; the number acquisition sub-module is used for acquiring the number of the history requests of the candidate servers, and taking the candidate server corresponding to the minimum number of the history requests as the target server.
In order to solve the technical problems, the embodiment of the application also provides computer equipment. Referring specifically to fig. 4, fig. 4 is a basic structural block diagram of a computer device according to the present embodiment.
The computer device 200 includes a memory 201, a processor 202, and a network interface 203 communicatively coupled to each other via a system bus. It should be noted that only computer device 200 having components 201-203 is shown in the figures, but it should be understood that not all of the illustrated components are required to be implemented and that more or fewer components may be implemented instead. It will be appreciated by those skilled in the art that the computer device herein is a device capable of automatically performing numerical calculations and/or information processing in accordance with predetermined or stored instructions, the hardware of which includes, but is not limited to, microprocessors, application specific integrated circuits (Application Specific Integrated Circuit, ASICs), programmable gate arrays (fields-Programmable Gate Array, FPGAs), digital processors (Digital Signal Processor, DSPs), embedded devices, etc.
The computer equipment can be a desktop computer, a notebook computer, a palm computer, a cloud server and other computing equipment. The computer equipment can perform man-machine interaction with a user through a keyboard, a mouse, a remote controller, a touch pad or voice control equipment and the like.
The memory 201 includes at least one type of readable storage medium including flash memory, hard disk, multimedia card, card memory (e.g., SD or DX memory, etc.), random Access Memory (RAM), static Random Access Memory (SRAM), read Only Memory (ROM), electrically Erasable Programmable Read Only Memory (EEPROM), programmable Read Only Memory (PROM), magnetic memory, magnetic disk, optical disk, etc. In some embodiments, the storage 201 may be an internal storage unit of the computer device 200, such as a hard disk or a memory of the computer device 200. In other embodiments, the memory 201 may also be an external storage device of the computer device 200, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash Card (Flash Card) or the like, which are provided on the computer device 200. Of course, the memory 201 may also include both internal storage units of the computer device 200 and external storage devices. In this embodiment, the memory 201 is typically used to store an operating system and various application software installed on the computer device 200, such as computer readable instructions of a selected method of a real server, and the like. In addition, the memory 201 may be used to temporarily store various types of data that have been output or are to be output.
The processor 202 may be a central processing unit (Central Processing Unit, CPU), controller, microcontroller, microprocessor, or other data processing chip in some embodiments. The processor 202 is generally used to control the overall operation of the computer device 200. In this embodiment, the processor 202 is configured to execute computer readable instructions stored in the memory 201 or process data, such as computer readable instructions for executing a selected method of the real server.
The network interface 203 may comprise a wireless network interface or a wired network interface, which network interface 203 is typically used to establish communication connections between the computer device 200 and other electronic devices.
In this embodiment, the transmitted real server is determined by the state of the real server, so that a more suitable real server can be selected, successful data transmission can be realized, and subsequent rapid processing of the data is facilitated.
The present application also provides another embodiment, namely, a computer-readable storage medium storing computer-readable instructions executable by at least one processor to cause the at least one processor to perform the steps of a method of selecting a real server as described above.
In this embodiment, the transmitted real server is determined by the state of the real server, so that a more suitable real server can be selected, successful data transmission can be realized, and subsequent rapid processing of the data is facilitated.
From the above description of the embodiments, it will be clear to those skilled in the art that the above-described embodiment method may be implemented by means of software plus a necessary general hardware platform, but of course may also be implemented by means of hardware, but in many cases the former is a preferred embodiment. Based on such understanding, the technical solution of the present application may be embodied essentially or in a part contributing to the prior art in the form of a software product stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk), comprising several instructions for causing a terminal device (which may be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to perform the method described in the embodiments of the present application.
It is apparent that the embodiments described above are only some embodiments of the present application, but not all embodiments, the preferred embodiments of the present application are given in the drawings, but not limiting the patent scope of the present application. This application may be embodied in many different forms, but rather, embodiments are provided in order to provide a more thorough understanding of the present disclosure. Although the present application has been described in detail with reference to the foregoing embodiments, it will be apparent to those skilled in the art that modifications may be made to the embodiments described in the foregoing, or equivalents may be substituted for elements thereof. All equivalent structures made by the specification and the drawings of the application are directly or indirectly applied to other related technical fields, and are also within the protection scope of the application.
Claims (6)
1. A method of selecting a real server, comprising the steps of:
receiving server parameters of a real server, and establishing connection with the real server based on the server parameters;
when a data transmission request sent by a user is received, carrying out identity authentication on the user, wherein the identity authentication mode comprises short message authentication or/and security problem authentication;
after verification is passed, determining the state of each real server, taking the real server meeting the preset state condition as a target server, and transmitting a data transmission request of a user to the target server;
the step of determining the state of each real server and taking the real server meeting the preset state condition as the target server comprises the following steps: respectively calculating the states of all real servers based on a weight algorithm, and taking the real servers meeting the preset state conditions as target servers;
specifically, the step of calculating the state of each real server based on the weight algorithm and taking the real server meeting the preset state condition as the target server includes: acquiring the data volume being processed by each real server, taking the reciprocal of the data volume as the server weight of the corresponding real server, and taking the real server with the largest server weight as the target server;
the step of determining the state of each real server, taking the real server meeting the preset state condition as the target server, further comprises the following steps: determining the geographic position of each real server and the geographic position of the client; selecting a real server closest to the geographic position of the client as the target server;
the step of determining the state of each real server, taking the real server meeting the preset state condition as the target server, further comprises the following steps: acquiring historical data of each real server, wherein the historical data comprises a historical request, a historical processing data amount and a historical request processing time length, and the historical request, the historical processing data amount and the historical request processing time length are in one-to-one corresponding association relation; calculating the processing time length of single data based on the historical processing data quantity and the historical processing time length, and taking the real server corresponding to the processing time length of the single data smaller than a time length threshold as a candidate server; and acquiring the number of the history requests of the candidate server, and taking the candidate server corresponding to the minimum number of the history requests as the target server.
2. The method for selecting a real server according to claim 1, wherein the step of determining the status of each real server and taking the real server meeting the preset status condition as the target server further comprises:
acquiring preset weight values of all real servers, and sorting the real servers in descending order of the weight values based on the weight values to obtain a list;
taking the real server at the first position in the list as an initial server;
identifying whether the initial server normally operates, and taking the initial server as the target server when the initial server normally operates;
and when the initial server does not normally operate, identifying whether the second real server in the list normally operates or not until the normal operating real server is identified, and taking the second real server as the target server.
3. The method for selecting a real server according to claim 1, further comprising, after the step of receiving parameters of a real server and establishing a connection with the real server based on the parameters:
respectively sending test signals to the real servers through preset time intervals in a circulating way;
receiving response signals sent by the real servers;
calculating the time interval between the test signal and the response signal to obtain the response time of each real server;
the step of calculating the state of each real server based on the weight algorithm and taking the real server meeting the preset state condition as the target server comprises the following steps:
respectively calculating the average value of response time of each real server as a first parameter, and respectively determining the number of received requests of each real server in a preset time period as a second parameter;
carrying out weighted summation on the first parameter and the second parameter to obtain a target state value;
and taking the real server corresponding to the minimum target state value as the target server.
4. A selection device of a real server, characterized in that it implements the steps of the selection method of a real server according to any one of claims 1 to 3, comprising:
the receiving module is used for receiving server parameters of a real server and establishing connection with the real server based on the server parameters;
the verification module is used for carrying out identity verification on the user when receiving a data transmission request sent by the user;
and the transmission module is used for determining the state of each real server after the verification is passed, taking the real server meeting the preset state condition as a target server, and transmitting the data transmission request of the user to the target server.
5. A computer device comprising a memory and a processor, the memory having stored therein computer readable instructions which when executed by the processor implement the steps of the method of selecting a real server as claimed in any one of claims 1 to 3.
6. A computer readable storage medium having stored thereon computer readable instructions which when executed by a processor implement the steps of the method of selecting a real server according to any of claims 1 to 3.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202110511114.2A CN113242301B (en) | 2021-05-11 | 2021-05-11 | Method, device, computer equipment and storage medium for selecting true server |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202110511114.2A CN113242301B (en) | 2021-05-11 | 2021-05-11 | Method, device, computer equipment and storage medium for selecting true server |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| CN113242301A CN113242301A (en) | 2021-08-10 |
| CN113242301B true CN113242301B (en) | 2024-03-26 |
Family
ID=77133299
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202110511114.2A Active CN113242301B (en) | 2021-05-11 | 2021-05-11 | Method, device, computer equipment and storage medium for selecting true server |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN113242301B (en) |
Families Citing this family (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN114157666B (en) * | 2021-10-25 | 2024-06-14 | 北京千方科技股份有限公司 | Load balancing system, method, medium and device based on intelligent cloud platform |
| CN117201502B (en) * | 2023-09-12 | 2024-02-20 | 广州云硕科技发展有限公司 | Intelligent cloud server access method and system based on artificial intelligence |
Citations (8)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN102281190A (en) * | 2011-07-01 | 2011-12-14 | 杭州斯凯网络科技有限公司 | Networking method for load balancing apparatus, server and client access method |
| CN102611735A (en) * | 2011-12-21 | 2012-07-25 | 奇智软件(北京)有限公司 | Load balancing method and system of application services |
| CN105471760A (en) * | 2014-09-12 | 2016-04-06 | 华为技术有限公司 | Routing method, load balancing device and data communication system |
| CN108234319A (en) * | 2017-12-29 | 2018-06-29 | 北京奇虎科技有限公司 | The transmission method and device of a kind of data |
| CN108681484A (en) * | 2018-04-04 | 2018-10-19 | 阿里巴巴集团控股有限公司 | A kind of distribution method of task, device and equipment |
| CN109375872A (en) * | 2018-09-27 | 2019-02-22 | 腾讯科技(深圳)有限公司 | Processing method, device and the equipment and storage medium of data access request |
| CN110389841A (en) * | 2019-07-25 | 2019-10-29 | 中南民族大学 | A kind of server load balancing method, apparatus and storage medium |
| CN112565327A (en) * | 2019-09-26 | 2021-03-26 | 广州虎牙科技有限公司 | Access flow forwarding method, cluster management method and related device |
-
2021
- 2021-05-11 CN CN202110511114.2A patent/CN113242301B/en active Active
Patent Citations (8)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN102281190A (en) * | 2011-07-01 | 2011-12-14 | 杭州斯凯网络科技有限公司 | Networking method for load balancing apparatus, server and client access method |
| CN102611735A (en) * | 2011-12-21 | 2012-07-25 | 奇智软件(北京)有限公司 | Load balancing method and system of application services |
| CN105471760A (en) * | 2014-09-12 | 2016-04-06 | 华为技术有限公司 | Routing method, load balancing device and data communication system |
| CN108234319A (en) * | 2017-12-29 | 2018-06-29 | 北京奇虎科技有限公司 | The transmission method and device of a kind of data |
| CN108681484A (en) * | 2018-04-04 | 2018-10-19 | 阿里巴巴集团控股有限公司 | A kind of distribution method of task, device and equipment |
| CN109375872A (en) * | 2018-09-27 | 2019-02-22 | 腾讯科技(深圳)有限公司 | Processing method, device and the equipment and storage medium of data access request |
| CN110389841A (en) * | 2019-07-25 | 2019-10-29 | 中南民族大学 | A kind of server load balancing method, apparatus and storage medium |
| CN112565327A (en) * | 2019-09-26 | 2021-03-26 | 广州虎牙科技有限公司 | Access flow forwarding method, cluster management method and related device |
Non-Patent Citations (3)
| Title |
|---|
| "Online Dispatching and Fair Scheduling of Edge Computing Tasks: A Learning-Based Approach";Hao Yuan;《IEEE》;20210413;全文 * |
| 一种分布式实时数据系统中的基于动态索引策略的存取定位机制;李德文;贾士博;谭彰;姚罕琦;;工业控制计算机;20131125(第11期);全文 * |
| 面向服务可靠性的云资源调度方法;周平;殷波;邱雪松;郭少勇;孟洛明;;电子学报;20190515(第05期);全文 * |
Also Published As
| Publication number | Publication date |
|---|---|
| CN113242301A (en) | 2021-08-10 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN109040316B (en) | HTTP service processing method and device | |
| US10547618B2 (en) | Method and apparatus for setting access privilege, server and storage medium | |
| CN111800462B (en) | Micro service instance processing method, micro service instance processing device, computer equipment and storage medium | |
| CN114095567B (en) | Data access request processing method and device, computer equipment and medium | |
| CN105577602A (en) | Data pushing method and data pushing device based on open application programming interface | |
| CN114048059B (en) | Method, device, computer equipment and storage medium for adjusting interface timeout | |
| CN113242301B (en) | Method, device, computer equipment and storage medium for selecting true server | |
| CN112468409A (en) | Access control method, device, computer equipment and storage medium | |
| CN106161356B (en) | Method and system for rapidly logging in website through client | |
| CN112491974B (en) | Remote browsing method, device, storage medium, terminal equipment and server | |
| CN117707737A (en) | Task scheduling optimization method, device, equipment and storage medium thereof | |
| CN111580882B (en) | Application program starting method, device, computer system and medium | |
| CN117319400A (en) | Service processing node adjustment method, device, equipment and storage medium thereof | |
| CN114036551B (en) | Data processing method, device, computer equipment and medium for privacy data | |
| CN113055199A (en) | Gateway access method and device and gateway equipment | |
| CN114221964B (en) | Access request processing method, device, computer equipment and storage medium | |
| CN117408794A (en) | Request processing method, device, equipment and storage medium thereof | |
| CN116661936A (en) | Page data processing method and device, computer equipment and storage medium | |
| CN110597682B (en) | Application deployment method and device, computer equipment and storage medium | |
| CN111327513B (en) | Message data pushing method and device, computer equipment and storage medium | |
| CN115378806A (en) | Flow distribution method and device, computer equipment and storage medium | |
| CN114449002A (en) | Rendering node-based distributed deployment management method and device | |
| CN119312301B (en) | Advanced user resource access operation guarantee method, device, equipment and medium | |
| CN114599110B (en) | Request processing method and device | |
| CN115134405B (en) | Data processing method and device, electronic equipment and computer readable storage medium |
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 | ||
| GR01 | Patent grant | ||
| GR01 | Patent grant |