CN113242301A - Method and device for selecting real server, computer equipment and storage medium - Google Patents

Method and device for selecting real server, computer equipment and storage medium Download PDF

Info

Publication number
CN113242301A
CN113242301A CN202110511114.2A CN202110511114A CN113242301A CN 113242301 A CN113242301 A CN 113242301A CN 202110511114 A CN202110511114 A CN 202110511114A CN 113242301 A CN113242301 A CN 113242301A
Authority
CN
China
Prior art keywords
server
real
real server
target
taking
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.)
Granted
Application number
CN202110511114.2A
Other languages
Chinese (zh)
Other versions
CN113242301B (en
Inventor
陈旃
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Cormorant Technology Shenzhen Co ltd
Original Assignee
Cormorant Technology Shenzhen Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Cormorant Technology Shenzhen Co ltd filed Critical Cormorant Technology Shenzhen Co ltd
Priority to CN202110511114.2A priority Critical patent/CN113242301B/en
Publication of CN113242301A publication Critical patent/CN113242301A/en
Application granted granted Critical
Publication of CN113242301B publication Critical patent/CN113242301B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1001Protocols in which an application is distributed across nodes in the network for accessing one among a plurality of replicated servers
    • H04L67/1004Server selection for load balancing
    • H04L67/1008Server selection for load balancing based on parameters of servers, e.g. available memory or workload
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/08Network architectures or network communication protocols for network security for authentication of entities
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1001Protocols in which an application is distributed across nodes in the network for accessing one among a plurality of replicated servers
    • H04L67/1004Server selection for load balancing
    • H04L67/1021Server selection for load balancing based on client or server locations
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1001Protocols in which an application is distributed across nodes in the network for accessing one among a plurality of replicated servers
    • H04L67/1004Server selection for load balancing
    • H04L67/1025Dynamic 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 a data transmission request sent by a user is received, the state of each real server is calculated, the real servers meeting the preset state conditions are used as target servers, the user is authenticated through the target servers, and after the authentication is passed, the data transmission request of the user is transmitted to the servers. The application also provides a selection device of the real server, computer equipment and a storage medium. The application selects a better server to realize the quick processing of the request.

Description

Method and device for selecting real server, computer equipment and storage medium
Technical Field
The present application relates to the field of computer technologies, and in particular, to a method and an 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, which results in a difference between the response time and the operation speed of the server. For processing the request of the client, often, only one server is correspondingly configured for one client, which may cause a situation that the request cannot be processed effectively and quickly when the server is down, or cause that the request of the client cannot be received and processed in time because the response speed and the operation speed of the server are slow.
Disclosure of Invention
The embodiment of the application aims to provide a method and a device for selecting a real server, computer equipment and a storage medium, and a better server is selected to realize the quick processing of a request.
In order to solve the above technical problem, an embodiment of the present application provides a method for selecting a real server, which adopts the following technical solutions:
a method for 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 the 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 a weight value preset by each real server, and sorting the real servers in a 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 run, identifying whether the second real server in the list normally runs or not until the normally running real server is identified 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 state of each real server based on a weight algorithm, and taking the real server meeting the preset state condition as a target server.
Further, after the step of receiving the parameters of the real server and establishing a connection with the real server based on the parameters, the method further includes:
circularly sending test signals to each real server through a preset time interval;
receiving response signals sent by each real server;
calculating the time interval of the test signal and the response signal to obtain the response time of each real server;
the method comprises the following steps of respectively calculating the states of the real servers based on a weight algorithm, and taking the real servers meeting preset state conditions as target servers, wherein the steps comprise:
respectively calculating the average value of the 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 states of the real servers based on the weight algorithm, and using the real servers meeting the preset state conditions as target servers includes:
and 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 maximum 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;
selecting a real server closest to the geographic location 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 volume and a historical request processing time length, and the historical request, the historical processing data volume and the historical request processing time length are in a one-to-one corresponding incidence relation;
calculating the processing time length of single data based on the historical processing data amount 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 value as a candidate server;
and acquiring the quantity of the history requests of the candidate server, and taking the candidate server corresponding to the minimum quantity of the history requests as the target server.
In order to solve the above technical problem, an embodiment of the present application further provides a device for selecting a real server, which adopts the following technical solutions:
a selection apparatus 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 authentication module is used for authenticating the identity of 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 problem, an embodiment of the present application further provides a computer device, which adopts the following technical solutions:
a computer device comprising a memory having computer readable instructions stored therein and a processor that when executed implements the steps of the selected method of the real server described above.
In order to solve the above technical problem, an embodiment of the present application further provides a computer-readable storage medium, which adopts the following technical solutions:
a computer readable storage medium having computer readable instructions stored thereon which, when executed by a processor, implement the steps of the selected method of a real server described above.
Compared with the prior art, the embodiment of the application mainly has the following beneficial effects:
according to the method and the device, before the real server is selected, the user is subjected to identity verification, the safety of data transmission is improved, and the user who maliciously transmits data with viruses is prevented from participating in the data. The state of each real server is determined, the real server meeting the preset state condition is selected for data transmission, the transmitted real server is determined according to the state of the real server, the more suitable real server can be selected, the data can be successfully transmitted, and the subsequent rapid processing of the data is facilitated.
Drawings
In order to more clearly illustrate the solution of the present application, the drawings needed for describing the embodiments of the present application will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present application, and that other drawings can be obtained by those skilled in the art without inventive effort.
FIG. 1 is an exemplary system architecture diagram in which the present application may be applied;
FIG. 2 is a flow diagram of one embodiment of a selected method of a real server according to the present application;
FIG. 3 is a schematic block diagram illustrating one embodiment of selected devices of a real server according to the present application;
FIG. 4 is a schematic block 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 application herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the application; the terms "including" and "having," and any variations thereof, in the description and claims of this application and the description of the above figures are intended to cover non-exclusive inclusions. The terms "first," "second," and the like in the description and claims of this application or in the above-described drawings are used for distinguishing between different objects and not for describing a particular order.
Reference herein to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment can be included in at least one embodiment of the application. The appearances of the phrase 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. It is explicitly and implicitly understood by one skilled in the art that the embodiments described herein can be combined with other embodiments.
In order to make the technical solutions better understood by those skilled in the art, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings.
As shown in fig. 1, the system architecture 100 may include terminal devices 101, 102, 103, a network 104, and a server 105. The network 104 serves as a medium for providing communication links between the terminal devices 101, 102, 103 and the server 105. Network 104 may include various connection types, such as wired, wireless communication links, or fiber optic cables, to name a few.
The user may use the terminal devices 101, 102, 103 to interact with the server 105 via the network 104 to receive or send messages or the like. The terminal devices 101, 102, 103 may have various communication client applications installed thereon, such as a web browser application, a shopping application, a search application, an instant messaging tool, a mailbox client, social platform software, and the like.
The terminal devices 101, 102, 103 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, e-book readers, MP3 players (Moving Picture Experts Group Audio Layer III, mpeg compression standard Audio Layer 3), MP4 players (Moving Picture Experts Group Audio Layer IV, mpeg compression standard Audio Layer 4), laptop portable computers, 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 the real server provided in the embodiment of the present application is generally executed by the server/terminal device, and accordingly, the selecting device of the 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 continuing reference to FIG. 2, a flow diagram of one embodiment of a method for selection of a real server in accordance with 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, the user is subjected to identity verification, after the verification is passed, the state of each real server is calculated, the real servers meeting the preset state conditions are used as target servers, and the data transmission request of the user is transmitted to the target servers.
In this embodiment, a user deploys a server cluster in different cities, where the server cluster includes each Real Server (RS) in the present application. The parameters of the real server can be input by the user in the front-end page, or can be obtained from the received parameter table. And the server parameters of the real server are received, so that a connection relation is established with the real server, and subsequent data transmission is facilitated.
In this embodiment, the electronic device (for example, the server/terminal device shown in fig. 1) on which the selected method of the real server operates may receive the parameters of the real server and the data transmission request sent by the user through a wired connection manner or a wireless connection manner. It should be noted that the wireless connection means may include, but is not limited to, a 3G/4G connection, a WiFi connection, a bluetooth connection, a WiMAX connection, a Zigbee connection, a uwb (ultra wideband) connection, and other wireless connection means now known or developed in the future.
S2: and when a data transmission request sent by the user is received, carrying out identity authentication on the user.
In this embodiment, when a data transmission request sent by a user is received, the user is authenticated. The data transmission safety is improved, and the participation of a user carrying virus data in malicious transmission is avoided. The specific verification mode comprises short message verification and safety 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 the data transmission request of the user to the target server.
In this embodiment, the real server for transmission is determined according to the state of the real server, so that a more suitable real server can be selected, data can be successfully transmitted, 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 a weight value preset by each real server, and sorting the real servers in a 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 run, identifying whether the second real server in the list normally runs or not until the normally running real server is identified as the target server.
In this embodiment, the client request is always sent to the real server with the highest weight. When the real server with the highest weight is down due to various reasons, the system sends the client connection to the real server with the second highest weight, and so on. The method is suitable for disaster recovery environments, the real server with the highest weight always processes client connection, and only when the real server is down, the real server with the weight at the second position, namely the backup server, takes over so as to ensure normal operation of data processing.
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 includes:
and respectively calculating the state of each real server based on a weight algorithm, and taking the real server meeting the preset state condition as a target server.
In this embodiment, the state of the real server is calculated through a weighting algorithm, where the weighting algorithm includes obtaining some index values of the real server, such as the amount of data being processed, and weighting the index values through different weights, so that the obtained values are used as the state of the real server, and the selection of the real server is facilitated.
Further, the step of calculating the states of the real servers based on the weight algorithm, and using the real servers meeting the preset state conditions as target servers includes:
and 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 maximum 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 number of the data volume is used as the server weight corresponding to the 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, the real server is idle compared with other real servers, and the real server is selected, thereby avoiding the occurrence of the condition of overload of a single real server due to blind selection.
The method further comprises the steps of calculating the state of each real server, and taking the real server meeting the preset state condition as a target server, wherein the steps comprise:
determining the geographic position of each real server and the geographic position of the client;
selecting a real server closest to the geographic location of the client as the target server.
In the embodiment, the real server with the closest position is selected as the target server according to the distance of the geographic position, so that the short-distance data rapid transmission is realized, and the data delay is reduced. The specific geographic position is determined to be the acquired IP address, and positioning is carried out according to the IP address.
As another embodiment of the present application, the determining the state of each real server, and the step of using a real server meeting a preset state condition as a target server includes:
acquiring historical data of each real server, wherein the historical data comprises a historical request, a historical processing data volume and a historical request processing time length, and the historical request, the historical processing data volume and the historical request processing time length are in a one-to-one corresponding incidence relation;
calculating the processing time length of single data based on the historical processing data amount 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 value as a candidate server;
and acquiring the quantity of the history requests of the candidate server, and taking the candidate server corresponding to the minimum quantity of the history requests as the target server.
In this embodiment, the real server is preliminarily screened based on the calculated processing duration of a single data, a candidate server is selected, and the candidate server is further screened according to the data of the history request, so as to determine the target server. The target server is determined through comprehensive screening, and the historical condition of the real server is taken into comprehensive consideration to serve as the service condition of the real server, so that the real server with low service frequency is selected to serve as the target server.
In some optional implementations of this embodiment, after the step S1 of receiving the parameters of the real server and establishing a connection with the real server based on the parameters, and before the step S2 of authenticating the user when receiving the data transmission request sent by the user, the electronic device may further perform the following steps:
circularly sending test signals to each real server through a preset time interval;
receiving response signals sent by each real server;
calculating the time interval of the test signal and the response signal to obtain the response time of each real server;
the method comprises the following steps of respectively calculating the states of the real servers based on a weight algorithm, and taking the real servers meeting preset state conditions as target servers, wherein the steps comprise:
respectively calculating the average value of the 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 operating efficiency of the real server. According to the average value of the response time of the current real server and the received data of the request, a target state value is comprehensively calculated through weighted summation, so that comprehensive and sufficient consideration of the real server is realized, and the target server with the best state is determined, and the data processing efficiency is improved.
According to the method and the device, before the real server is selected, the user is subjected to identity verification, the safety of data transmission is improved, and the user who maliciously transmits data with viruses is prevented from participating in the data. The state of each real server is determined, the real server meeting the preset state condition is selected for data transmission, the transmitted real server is determined according to the state of the real server, the more suitable real server can be selected, the data can be successfully transmitted, and the subsequent rapid processing of the data is facilitated.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware associated with computer readable instructions, which can be stored in a computer readable storage medium, and when executed, can include processes of the embodiments of the methods described above. The storage medium may be a non-volatile storage medium such as a magnetic disk, an optical disk, a Read-Only Memory (ROM), or a 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, the steps are not necessarily performed in order as indicated by the arrows. The steps are not performed in the exact order shown and may be performed in other orders unless explicitly stated herein. Moreover, at least a portion of the steps in the flow chart of the figure may include multiple sub-steps or multiple stages, which are not necessarily performed at the same time, but may be performed at different times, which are not necessarily performed in sequence, but may be performed alternately or alternately with other steps or at least a portion of the sub-steps or stages of other steps.
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 may be applied to various electronic devices.
As shown in fig. 3, the selecting device 300 of the real server according to the embodiment includes: a receiving module 301, a verification module 302, and a transmission 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 authentication module 302 is configured to authenticate an identity of 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, use the real server meeting the preset state condition as a target server, and transmit the data transmission request of the user to the target server.
In the embodiment, the identity of the user is verified before the real server is selected, so that the safety of data transmission is improved, and the user carrying virus data in malicious transmission is prevented from participating. The state of each real server is determined, the real server meeting the preset state condition is selected for data transmission, the transmitted real server is determined according to the state of the real server, the more suitable real server can be selected, the data can be successfully transmitted, and the subsequent rapid processing of the data is facilitated.
The transmission module 303 includes a sorting sub-module, a determination sub-module, a first identification sub-module, and a second identification sub-module. The sorting submodule is used for obtaining a weight value preset by each real server, and sorting the real servers in a descending order of the weight values based on the weight values to obtain a list; the determining submodule is used for taking the real server with 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 submodule is used for identifying whether the second real server in the list normally operates or not when the initial server does not normally operate until the normally operating 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 state of each real server based on a weight algorithm, and taking the real server meeting the preset state condition as a target server.
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 circularly sending test signals to each real server through a preset time interval; the response signal receiving module is used for receiving response signals sent by each real server; and the response time calculation module is used for calculating the time interval between the test signal and the response signal and obtaining the response time of each real server.
The transmission module 303 comprises an average value calculation submodule, a weighted summation submodule and a target server determination submodule, wherein the average value calculation submodule is used for calculating an average value of response time of each real server as a first parameter, and determining the number of received requests of each real server in a preset time period as a second parameter; 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 determination 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 a data amount being processed by each real server, use a reciprocal of the data amount as a server weight of the corresponding real server, and use the 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 position determining sub-module and a selecting 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 selection submodule is used for selecting the real server closest to the geographic position of the client as the target server.
In some optional implementation manners of this embodiment, the transmission module 303 further includes a history data obtaining sub-module, a calculating sub-module, and a quantity obtaining sub-module. The historical data acquisition submodule is used for acquiring historical data of each real server, wherein the historical data comprises historical requests, historical processing data volume and historical request processing duration, and the historical requests, the historical processing data volume and the historical request processing duration are in one-to-one correspondence association; the calculation submodule is used for calculating the processing time length of single data based on the historical processing data volume 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 value as a candidate server; the quantity obtaining submodule is used for obtaining the quantity of the historical requests of the candidate server, and the candidate server corresponding to the minimum quantity of the historical requests is used as the target server.
In order to solve the technical problem, an embodiment of the present application further provides a computer device. Referring to fig. 4, fig. 4 is a block diagram of a basic structure of a computer device according to the present embodiment.
The computer device 200 comprises a memory 201, a processor 202, a network interface 203 communicatively connected to each other via a system bus. It is noted that only computer device 200 having components 201 and 203 is shown, but it is understood that not all of the illustrated components are required and that more or fewer components may alternatively be implemented. As will be understood by those skilled in the art, the computer device is a device capable of automatically performing numerical calculation and/or information processing according to a preset or stored instruction, and the hardware includes, but is not limited to, a microprocessor, an Application Specific Integrated Circuit (ASIC), a Programmable Gate Array (FPGA), a Digital Signal Processor (DSP), an embedded device, and the like.
The computer device can be a desktop computer, a notebook, a palm computer, a cloud server and other computing devices. The computer equipment can carry out man-machine interaction with a user through a keyboard, a mouse, a remote controller, a touch panel or voice control equipment and the like.
The memory 201 includes at least one type of readable storage medium including a flash memory, a hard disk, a multimedia card, a card type memory (e.g., SD or DX memory, etc.), a Random Access Memory (RAM), a Static Random Access Memory (SRAM), a Read Only Memory (ROM), an Electrically Erasable Programmable Read Only Memory (EEPROM), a Programmable Read Only Memory (PROM), a magnetic memory, a magnetic disk, an 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 memory Card (Flash Card), or the like, provided on the computer device 200. Of course, the memory 201 may also include both internal and external storage devices of the computer device 200. In this embodiment, the memory 201 is generally used for storing computer readable instructions of a selected method of an operating system and various types of application software installed on the computer device 200, such as a real server. Further, the memory 201 may also 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 (CPU), controller, microcontroller, microprocessor, or other data Processing chip in some embodiments. The processor 202 is generally operative to control 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, and the network interface 203 is generally used for establishing communication connection between the computer device 200 and other electronic devices.
In this embodiment, the real server for transmission is determined according to the state of the real server, so that a more suitable real server can be selected, data can be successfully transmitted, and subsequent rapid processing of the data is facilitated.
The present application further provides another embodiment, which is to provide 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 the selected method of the real server as described above.
In this embodiment, the real server for transmission is determined according to the state of the real server, so that a more suitable real server can be selected, data can be successfully transmitted, and subsequent rapid processing of the data is facilitated.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solutions of the present application may be embodied in the form of a software product, which is stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal device (such as a mobile phone, a computer, a server, an air conditioner, or a network device) to execute the method according to the embodiments of the present application.
It is to be understood that the above-described embodiments are merely illustrative of some, but not restrictive, of the broad invention, and that the appended drawings illustrate preferred embodiments of the invention and do not limit the scope of the invention. This application is capable of embodiments in many different forms and is provided for the purpose of enabling a thorough understanding of the disclosure of the application. Although the present application has been described in detail with reference to the foregoing embodiments, it will be apparent to one skilled in the art that the present application may be practiced without modification or with equivalents of some of the features described in the foregoing embodiments. All equivalent structures made by using the contents of the specification and the drawings of the present application are directly or indirectly applied to other related technical fields and are within the protection scope of the present application.

Claims (10)

1. A method for 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 the data transmission request of the user to the target server.
2. The method for selecting real servers according to claim 1, wherein the step of determining the status of each real server and using a real server meeting a preset status condition as a target server comprises:
acquiring a weight value preset by each real server, and sorting the real servers in a 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 run, identifying whether the second real server in the list normally runs or not until the normally running real server is identified as the target server.
3. The method for selecting real servers according to claim 1, wherein the step of determining the status of each real server and using a real server meeting a preset status condition as a target server comprises:
and respectively calculating the state of each real server based on a weight algorithm, and taking the real server meeting the preset state condition as a target server.
4. The method for selecting a real server according to claim 3, further comprising, after the step of receiving the parameter of the real server and establishing a connection with the real server based on the parameter:
circularly sending test signals to each real server through a preset time interval;
receiving response signals sent by each real server;
calculating the time interval of the test signal and the response signal to obtain the response time of each real server;
the method comprises the following steps of respectively calculating the states of the real servers based on a weight algorithm, and taking the real servers meeting preset state conditions as target servers, wherein the steps comprise:
respectively calculating the average value of the 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.
5. The method for selecting real servers according to claim 3, wherein the step of calculating the status of each real server based on a weight algorithm, and the step of using a real server meeting a preset status condition as a target server comprises:
and 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 maximum server weight as the target server.
6. The method for selecting real servers according to claim 1, wherein the step of calculating the status of each real server and using a real server meeting a preset status condition as a target server comprises:
determining the geographic position of each real server and the geographic position of the client;
selecting a real server closest to the geographic location of the client as the target server.
7. The method for selecting real servers according to claim 1, wherein the step of determining the status of each real server and using a real server meeting a preset status condition as a target server comprises:
acquiring historical data of each real server, wherein the historical data comprises a historical request, a historical processing data volume and a historical request processing time length, and the historical request, the historical processing data volume and the historical request processing time length are in a one-to-one corresponding incidence relation;
calculating the processing time length of single data based on the historical processing data amount 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 value as a candidate server;
and acquiring the quantity of the history requests of the candidate server, and taking the candidate server corresponding to the minimum quantity of the history requests as the target server.
8. A real server selection apparatus, 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 authentication module is used for authenticating the identity of 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.
9. A computer device comprising a memory having computer readable instructions stored therein and a processor which when executed performs the steps of the selected method of real server according to any one of claims 1 to 7.
10. A computer-readable storage medium, having computer-readable instructions stored thereon, which, when executed by a processor, implement the steps of the selected method of the real server according to any one of claims 1 to 7.
CN202110511114.2A 2021-05-11 2021-05-11 Method, device, computer equipment and storage medium for selecting true server Active CN113242301B (en)

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 true CN113242301A (en) 2021-08-10
CN113242301B 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)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114157666A (en) * 2021-10-25 2022-03-08 北京千方科技股份有限公司 Load balancing system, method, medium and device based on intelligent cloud platform
CN117201502A (en) * 2023-09-12 2023-12-08 广州云硕科技发展有限公司 Intelligent cloud server access method and system based on artificial intelligence

Citations (8)

* Cited by examiner, † Cited by third party
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

Patent Citations (8)

* Cited by examiner, † Cited by third party
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)

* Cited by examiner, † Cited by third party
Title
HAO YUAN: ""Online Dispatching and Fair Scheduling of Edge Computing Tasks: A Learning-Based Approach"", 《IEEE》, 13 April 2021 (2021-04-13) *
周平;殷波;邱雪松;郭少勇;孟洛明;: "面向服务可靠性的云资源调度方法", 电子学报, no. 05, 15 May 2019 (2019-05-15) *
李德文;贾士博;谭彰;姚罕琦;: "一种分布式实时数据系统中的基于动态索引策略的存取定位机制", 工业控制计算机, no. 11, 25 November 2013 (2013-11-25) *

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114157666A (en) * 2021-10-25 2022-03-08 北京千方科技股份有限公司 Load balancing system, method, medium and device based on intelligent cloud platform
CN117201502A (en) * 2023-09-12 2023-12-08 广州云硕科技发展有限公司 Intelligent cloud server access method and system based on artificial intelligence
CN117201502B (en) * 2023-09-12 2024-02-20 广州云硕科技发展有限公司 Intelligent cloud server access method and system based on artificial intelligence

Also Published As

Publication number Publication date
CN113242301B (en) 2024-03-26

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
EP3262552B1 (en) Methods, apparatus, and systems for identity authentication
CN105577602A (en) Data pushing method and data pushing device based on open application programming interface
CN106790291B (en) Intrusion detection prompting method and device
CN112650875A (en) House image verification method and device, computer equipment and storage medium
CN112463422A (en) Internet of things fault operation and maintenance method and device, computer equipment and storage medium
CN112468409A (en) Access control method, device, computer equipment and storage medium
CN113242301B (en) Method, device, computer equipment and storage medium for selecting true server
CN114095567A (en) Data access request processing method and device, computer equipment and medium
CN105530232B (en) Account login method and device
CN114070583A (en) Information access control method, information access control device, computer equipment and medium
CN113259429A (en) Session keeping control method, device, computer equipment and medium
CN106161356B (en) Method and system for rapidly logging in website through client
CN113038396A (en) Scheduling method, device and equipment of short message channel and storage medium
CN103067465B (en) Sharing files method and system
CN109688099B (en) Server-side database collision identification method, device, equipment and readable storage medium
CN112491974B (en) Remote browsing method, device, storage medium, terminal equipment and server
CN112910741A (en) Interface testing method and device, computer equipment and storage medium
CN114675845B (en) Information age optimization method, information age optimization device, computer equipment and storage medium
CN114221964B (en) Access request processing method, device, computer equipment and storage medium
CN110650014A (en) Signature authentication method, system, equipment and storage medium based on hessian protocol
WO2023066258A1 (en) Data processing method and apparatus for private data, computer device and medium
CN115396142A (en) Information access method and device based on zero trust, computer equipment and medium
CN106376096B (en) Wireless network connection method and equipment thereof

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