CN118018588A - Server connection method, device, apparatus, storage medium, and program product - Google Patents

Server connection method, device, apparatus, storage medium, and program product Download PDF

Info

Publication number
CN118018588A
CN118018588A CN202211400687.9A CN202211400687A CN118018588A CN 118018588 A CN118018588 A CN 118018588A CN 202211400687 A CN202211400687 A CN 202211400687A CN 118018588 A CN118018588 A CN 118018588A
Authority
CN
China
Prior art keywords
server
candidate
target
servers
target terminal
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211400687.9A
Other languages
Chinese (zh)
Inventor
熊昆
张�杰
练建锋
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent 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 Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN202211400687.9A priority Critical patent/CN118018588A/en
Publication of CN118018588A publication Critical patent/CN118018588A/en
Pending legal-status Critical Current

Links

Landscapes

  • Computer And Data Communications (AREA)

Abstract

The application discloses a server connection method, a device, equipment, a storage medium and a program product, and relates to the technical field of networks. The method comprises the following steps: receiving a network connection request sent by a target terminal; determining n candidate servers corresponding to the target terminal; acquiring a plurality of history detection results corresponding to an ith candidate server in the n candidate servers; weighting and integrating a plurality of historical detection results corresponding to the ith candidate server based on the weight value corresponding to the historical moment to obtain a first network delay result corresponding to the ith candidate server; and determining the target server based on the first network delay results respectively corresponding to the n candidate servers. That is, the target server is finally determined by weighting and integrating the plurality of history detection results of the candidate server by giving different weight values to the plurality of history detection results according to the corresponding history time, so that the network environment can be improved.

Description

Server connection method, device, apparatus, storage medium, and program product
Technical Field
The present application relates to the field of network technologies, and in particular, to a server connection method, apparatus, device, storage medium, and program product.
Background
In order to enable a user to have a better network environment in the game process using the terminal, a plurality of machine rooms are usually set up, wherein a plurality of servers are arranged in the machine rooms, so that the user terminal can select to connect with a target server therein, and a stable network environment with lower delay is obtained.
In the related art, the selection manner of the target server is generally implemented as a nearby access principle, that is, by acquiring physical addressing corresponding to the terminal, and determining, according to the physical addressing corresponding to the terminal, a target area to which the terminal belongs from a geographic location database, so as to connect the terminal to the server in the target area.
However, in the related art, the problem that the geographic location database is not fully stored in the data can result in poor connection accuracy of the servers, and if the network environment of the target area to which the terminal belongs is poor, the terminal can cause network turbulence no matter being connected to any server in the target area, resulting in lower connection efficiency.
Disclosure of Invention
The embodiment of the application provides a server connection method, a device, equipment, a storage medium and a computer program product, which can improve the server connection efficiency. The technical scheme is as follows:
in one aspect, a server connection method is provided, the method including:
Receiving a network connection request sent by a target terminal;
determining n candidate servers corresponding to the target terminal, wherein n is a positive integer;
acquiring a plurality of history detection results corresponding to an ith candidate server in the n candidate servers, wherein the history detection results are used for indicating network delay data of the ith candidate server at a plurality of different history moments, the network delay data are used for indicating response time length of receiving a feedback result after the target terminal sends a data request to the ith candidate server, and i is less than or equal to n and is a positive integer;
weighting and integrating a plurality of historical detection results corresponding to the ith candidate server based on the weight value corresponding to the historical moment to obtain a first network delay result corresponding to the ith candidate server;
And determining a target server based on first network delay results respectively corresponding to the n candidate servers, wherein the target server is used for carrying out network connection with the target terminal.
In another aspect, there is provided a server connection apparatus, the apparatus including:
the receiving module is used for receiving a network connection request sent by the target terminal;
the determining module is used for determining n candidate servers corresponding to the target terminal, wherein n is a positive integer;
the system comprises an acquisition module, a feedback module and a feedback module, wherein the acquisition module is used for acquiring a plurality of historical detection results corresponding to an ith candidate server in the n candidate servers, the historical detection results are used for indicating network delay data of the ith candidate server at a plurality of different historical moments, the network delay data are used for indicating response time length of receiving a feedback result after the target terminal sends a data request to the ith candidate server, and i is less than or equal to n and is a positive integer;
The integration module is used for carrying out weighted integration on a plurality of historical detection results corresponding to the ith candidate server based on the weight value corresponding to the historical moment to obtain a first network delay result corresponding to the ith candidate server;
The determining module is further configured to determine a target server, based on first network delay results corresponding to the n candidate servers, where the target server is used to perform network connection with the target terminal.
In another aspect, a computer device is provided, where the computer device includes a processor and a memory, where the memory stores at least one instruction, at least one program, a set of codes, or a set of instructions, where the at least one instruction, the at least one program, the set of codes, or the set of instructions are loaded and executed by the processor to implement a server connection method according to any one of the embodiments of the present application.
In another aspect, a computer readable storage medium is provided, where at least one instruction, at least one program, a set of codes, or a set of instructions is stored, where the at least one instruction, the at least one program, the set of codes, or the set of instructions are loaded and executed by a processor to implement a server connection method according to any one of the embodiments of the present application.
In another aspect, a computer program product or computer program is provided, the computer program product or computer program comprising computer instructions stored in a computer readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device performs the server connection method described in any one of the above embodiments.
The technical scheme provided by the embodiment of the application has the beneficial effects that at least:
And after the n candidate servers corresponding to the n candidate servers are obtained, a plurality of history detection results corresponding to the i candidate server at different history moments are obtained from the n candidate servers, so that the plurality of history detection results corresponding to the i candidate server are weighted and integrated according to the weight value corresponding to the history moment to obtain a first network delay result corresponding to the candidate server, and finally, a target server which is finally connected with the target terminal in a network mode is determined according to the first network delay results respectively corresponding to the candidate servers. That is, different weight values are given to the plurality of history detection results of the candidate server according to the corresponding history moments, so that the target server is finally determined in a weighted integration mode for the plurality of history detection results, and the situation that the player terminal can select the optimal server to be connected with the optimal server under the condition that network signals are poor and network delay data cannot be detected can be well avoided, so that the efficiency and the accuracy of network connection are improved, and the network environment is improved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for the description of the embodiments will be briefly described below, and it is apparent that the drawings in the following description are only some embodiments of the present application, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a schematic diagram of a related art server connection method according to an exemplary embodiment of the present application;
FIG. 2 is a schematic diagram of a server connection method according to an exemplary embodiment of the present application;
FIG. 3 is a schematic illustration of an implementation environment provided by an exemplary embodiment of the present application;
FIG. 4 is a flowchart of a method for server connection provided by an exemplary embodiment of the present application;
FIG. 5 is a flowchart of a server connection method provided by another exemplary embodiment of the present application;
FIG. 6 is a physical addressing delivery schematic provided by an exemplary embodiment of the present application;
FIG. 7 is a schematic representation of the generation of a test result provided by an exemplary embodiment of the present application;
FIG. 8 is a flowchart of a server connection method provided by another exemplary embodiment of the present application;
FIG. 9 is a flowchart of a server connection method provided by another exemplary embodiment of the present application;
FIG. 10 is a schematic diagram of a server selection method provided by another exemplary embodiment of the present application;
FIG. 11 is a block diagram of a server connection device provided in an exemplary embodiment of the present application;
fig. 12 is a block diagram of a server connection device according to another exemplary embodiment of the present application;
Fig. 13 is a schematic diagram of a server according to an exemplary embodiment of the present application.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the present application more apparent, the embodiments of the present application will be described in further detail with reference to the accompanying drawings.
In the related art, for a method for connecting servers, a manner of real-time statistics of delay data is generally adopted, and referring to fig. 1, a schematic diagram of a related art of a method for connecting servers according to an exemplary embodiment of the present application is shown, as shown in fig. 1, where a plurality of different servers including a server a110 (belonging to a region a), a server b120 (belonging to a region b), a server c130 (belonging to a region c), and a server d140 (belonging to a region d) are currently deployed, where the server a110, the server b120, the server c130, and the server d140 belong to servers erected in different geographic regions. In the process of running the target application program by the target terminal 100, the geographic position of the current target terminal 100 is determined to belong to the region c from the geographic position database according to the physical address (IP address) corresponding to the target terminal, and therefore, the server c130 in the region c is connected with the target terminal 100 through the network.
However, in the above related art, if the geographic location to which the target terminal belongs is located in an area with a poor network environment, the connection between the target terminal and any server in the area to which the target terminal belongs may generate a situation with a poor network environment, resulting in a poor network connection effect.
Referring to fig. 2, a schematic diagram of a server connection method according to an exemplary embodiment of the present application is shown, and as shown in fig. 2, when a network connection request sent by a target terminal 210 is received, a candidate server set 220 corresponding to the target terminal 210 is determined, where the server set 220 includes n candidate servers.
A plurality of history detection results 230 corresponding to the ith candidate server 221 in the n candidate servers are obtained, where the plurality of history detection results 230 represent network delay data of the ith candidate server 221 at different history moments, such as: the network delay data of the i-th candidate server 221 before 3 minutes is 60 ms, and the network delay data of the i-th candidate server 221 before 6 minutes is 78 ms. The multiple historical detection results 230 corresponding to the ith candidate server 221 are weighted and integrated according to the weight value corresponding to the historical moment, so as to obtain a first network delay result 240 corresponding to the ith candidate server 221, for example: the weight value corresponding to the network delay data before 3 minutes is 0.7,6 minutes and the weight value corresponding to the network delay data before 0.3 minutes, and the first network delay result 240 after weighted integration is 60×0.6+78×0.3=59.4.
And determining a target server 250 according to the first network delay results corresponding to the n candidate servers respectively, and connecting the target terminal 210 with the target server 250 in a network manner.
The plurality of historical detection results of the candidate server are endowed with different weight values according to the corresponding historical moments, so that the target server is finally determined in a weighted integration mode of the plurality of historical detection results, and the situation that the player terminal can select the optimal server to be connected with the network delay data under the condition that the network signal is poor and the network delay data cannot be detected can be well avoided, the efficiency and the accuracy of network connection are improved, and the network environment is improved.
The implementation environment related to the embodiment of the present application is described with respect to the noun introduction and the application scenario, where the implementation environment includes a terminal, and a target application program is installed in the terminal, where the target application program may be implemented as an online application program.
Referring to fig. 3, a schematic diagram of an implementation environment provided by an exemplary embodiment of the present application is shown, where a terminal 310 and a server 320 are involved, and the terminal 310 and the server 320 are connected through a communication network 330.
Taking the target application 311 as an example of a game application, during the running process of the target application 311 installed in the terminal 310, the terminal 310 sends a network connection request to the server 320, where the network connection request is used to request to determine that the target game server and the terminal 310 are connected to each other through a network.
The server 320 is implemented as an intermediate server, and is configured to receive a request sent by the terminal 310 and related information reported by the game server, for example: the game server corresponds to an internet protocol (Internet Protocol, IP). In this embodiment, a game server set is stored in the server 320, where the game server set includes IP addresses and corresponding history detection results corresponding to a plurality of candidate servers respectively. After the server 320 receives the network connection request sent by the terminal 310, n candidate servers are determined from the game server set, and a plurality of history detection results corresponding to each candidate server in the n candidate servers are obtained. The method comprises the steps of aiming at a plurality of historical detection results corresponding to an ith candidate server, wherein the plurality of historical detection results are used for representing network delay data of the ith candidate server at a plurality of different historical moments, and the plurality of historical detection results corresponding to the ith candidate server are weighted and integrated according to a weight value corresponding to a historical moment, so that a first network delay result corresponding to the ith candidate server is obtained. And finally, determining a target game server according to the first network delay results respectively corresponding to the n candidate servers, and feeding back the IP address corresponding to the target game server to the terminal 310 as a connection result to enable the terminal 310 to be connected with the target game server in a network.
The terminal 310 includes at least one of a smart phone, a tablet computer, a portable laptop, a desktop computer, an intelligent sound box, an intelligent wearable device, an intelligent voice interaction device, an intelligent home appliance, a vehicle-mounted terminal, and the like.
It should be noted that, the server 320 may be an independent physical server, a server cluster or a distributed system formed by a plurality of physical servers, or may be a cloud server that provides cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, a content delivery network (Content Delivery Network, CDN), and basic cloud computing services such as big data and an artificial intelligence platform. Cloud technology (Cloud technology) refers to a hosting technology that unifies serial resources such as hardware, software, networks and the like in a wide area network or a local area network to realize calculation, storage, processing and sharing of data.
In some embodiments, the server 320 described above may also be implemented as a node in a blockchain system.
It should be noted that, the information (including but not limited to user equipment information, user personal information, etc.), data (including but not limited to data for analysis, stored data, presented data, etc.), and signals related to the present application are all authorized by the user or are fully authorized by the parties, and the collection, use, and processing of the related data is required to comply with the relevant laws and regulations and standards of the relevant countries and regions. For example, the network connection request referred to in the present application is acquired with sufficient authorization.
For a schematic illustration of the server connection method provided by the present application, please refer to fig. 4, which shows a flowchart of the server connection method provided by an exemplary embodiment of the present application, as shown in fig. 4, and the method is applied to a server for illustration, and the method includes the following steps.
Step 410, a network connection request sent by a target terminal is received.
Illustratively, the network connection request is used to indicate that the current target terminal requests network connection with the server.
Illustratively, the network connection request includes a terminal identification number corresponding to the target terminal.
In some embodiments, the terminal identification number refers to an identity code specific to the target terminal, such as: identification number (Identity Document, ID). In this embodiment, one terminal corresponds to one terminal identification number.
In some embodiments, the target terminal sends the network connection request every specified time when the target application is running in the target terminal.
Step 420, determining n candidate servers corresponding to the target terminal.
Wherein n is a positive integer.
Illustratively, the candidate server is configured to make a network connection with the terminal, and a communication channel is established between the terminal and the candidate server for transmitting data therebetween. Such as: when the candidate server is realized as a game server, the target terminal is connected with the game server in the process of running the appointed game program, and is used for transmitting game data between the target terminal and the game server, so that the running function of the game program is realized. Wherein the proposed communication channel between the terminal and the server is called "link".
In an optional case, a plurality of different servers are currently set up, each server can receive a network connection request sent by a target terminal, and if a terminal identification number corresponding to the target terminal is stored in the current server, the server is determined to be a candidate server.
In an optional case, a plurality of different servers and an intermediate server are currently set up, where the intermediate server is configured to receive a network connection request sent by a target terminal, and store data information corresponding to the plurality of servers respectively, where the data information includes a connection relationship between the server and the terminal, such as: the server a may be used for network connection with the terminals 1 and 2, and the server b may be used for network connection with the terminals 1 and 3. After the intermediate server receives the network connection request of the target terminal, n candidate servers corresponding to the target terminal are determined according to the terminal identification number corresponding to the target terminal included in the network connection request, for example: when receiving the network connection request sent by the terminal 1, the server a and the server b are determined as two candidate servers corresponding to the terminal 1 according to the terminal identification number of the terminal 1. Under the condition of setting up the intermediate server, the target server corresponding to the target terminal can be rapidly determined through the related information of the candidate servers stored in the intermediate server, so that the network connection efficiency is improved, the related information of a plurality of candidate servers is uniformly stored in the intermediate server, the data storage order can be improved, the problem of data transmission when the plurality of servers interact with the target terminal at the same time is avoided, and the accuracy of network connection is improved.
Step 430, obtaining a plurality of history detection results corresponding to the ith candidate server in the n candidate servers.
The history detection result is used for indicating network delay data of the ith candidate server at a plurality of different history moments, the network delay data is used for indicating response time length of receiving a feedback result after the target terminal sends a data request to the ith candidate server, and i is less than or equal to n and is a positive integer.
Illustratively, the history detection result corresponding to the ith candidate server refers to network delay data corresponding to the ith candidate server at the specified history time for the target terminal. The network delay data refers to a response time length corresponding to a data result fed back to the target terminal after the target terminal sends a data request to the ith candidate server at a specified historical moment, for example: the terminal 1 sends a data request to the server a three minutes before the current time, and the server a receives the data request and sends a feedback result to the terminal 1 in 59 milliseconds, so that the network delay data corresponding to the server a three minutes before the current time is 59 milliseconds. That is, when the network delay data value is larger, the longer the response time between the server and the terminal is, the slower the network response time of the server is, the higher the delay is, which is unfavorable for network connection with the terminal, and will cause the operation of the target application program running in the terminal to be blocked.
Optionally, the method for representing the historical time includes at least one of the following methods:
1. and determining the interval duration between the historical detection result acquisition time and the current time as the historical time by taking the current time as a reference, for example: the current time is 9:35, and the history detection result is 9.32, so that the history time corresponding to the history detection result is 3 minutes before the current time, that is, the history time corresponding to the history detection result changes along with the change of the current time in the case;
2. The historical time is expressed as the actual time, such as: when the history detection result is 9.32, the history time corresponding to the history detection result is 9.32, that is, the history time corresponding to the history detection result in this case does not change.
It should be noted that the above-mentioned representation method about the historical time is only an illustrative example, and the embodiment of the present application is not limited thereto.
Optionally, the plurality of history detection results corresponding to each candidate server in the n candidate servers are all history detection results corresponding to the same history time, for example: the server a, the server b and the server c are respectively corresponding to three historical detection results, namely, the historical detection results corresponding to three historical moments which are 3 minutes away from the current moment, 6 minutes away from the current moment and 9 minutes away from the current moment; or, in the n candidate servers, the plurality of history detection results corresponding to each candidate server are the history detection results corresponding to different history moments, for example: the server a, the server b and the server c are respectively corresponding to three history detection results, wherein the server a is corresponding to the history detection results respectively corresponding to three history moments before 1 minute from the current moment, before 2 minutes from the current moment and before 3 minutes from the current moment, the server b is corresponding to the history detection results respectively corresponding to three history moments before 1 minute from the current moment, before 3 minutes from the current moment and before 5 minutes from the current moment, and the server c is corresponding to the history detection results respectively corresponding to three history moments before 5 minutes from the current moment, before 8 minutes from the current moment and before 10 minutes from the current moment, which is not limited.
In an optional case, for the case that a plurality of different servers are set up in the above steps but no intermediate server is set up, each server stores a detection result set corresponding to the server, where the detection result set includes network delay data of different terminals at different historical moments, such as: the server a stores the information of the terminal 1 at 9:31, at 9:33, at 9:35, and terminal 2 at 9:31, at 9:32, and in the case where the server a is the candidate server for the terminal 1 after receiving the network connection request sent by the terminal 1, the data 2, and the data 3 related to the terminal 1 are acquired from the server a, that is, in this case, the history detection results for the different candidate servers are individually acquired from the detection result set stored in each candidate server.
In an optional case, in the case of setting up the intermediate server in the above step, the history detection results corresponding to each server and the terminal are stored in the intermediate server, where the storage manner is stored according to the terminal identification number corresponding to the terminal, for example: if the ID corresponding to the terminal 1 is 00001, the file corresponding to "00001" in the intermediate server stores the server a, the server b, and the server c in 3: 23. 3:25 and 3: three history detection results under 27 (three history detection results exist for each server), that is, in this case, a plurality of history detection results corresponding to the candidate server are acquired from the intermediate server in accordance with the terminal identification number corresponding to the target terminal.
Illustratively, in an alternative scheme, if there is no history detection result between the current target terminal and the i candidate server at the specified history time, network delay data existing between the other terminals, which are similar to the location of the target terminal, and the i candidate server at the specified history time, that is, a plurality of history detection results corresponding to the i candidate server, may be used, where the network delay data not only includes network delay data related to the target terminal, but also includes network delay data related to other terminals at the specified time, where the other terminals may be implemented as target terminals similar to the geographic location of the target terminal. Therefore, the first network delay result corresponding to the ith candidate server can be obtained under the condition that a history detection result does not exist between the target terminal and the ith candidate server, and the network connection efficiency is improved.
In another alternative, if a history detection result exists between the current target terminal and the i candidate server at the specified history time, the network delay data of other terminals at the same specified history time and the history detection data may be integrated to serve as the network delay data of the target terminal at the specified history time, where the other terminals may be implemented as target terminals close to the geographic location of the target terminal. Therefore, the accuracy of the first network delay result of the i candidate server is improved by combining the network delay data corresponding to other terminals close to the geographic position of the target terminal, and the accuracy of network connection is further improved.
In some embodiments, when the network connection request includes a terminal identification number corresponding to the target terminal, a plurality of history detection results corresponding to the terminal identification number and the n candidate servers respectively are stored correspondingly, for example: the intermediate server comprises a folder corresponding to the terminal identification number, and a plurality of history detection results corresponding to each candidate server in the n candidate servers corresponding to the target terminal are stored in the folder; another example is: each candidate server stores a history detection result with a terminal identification number corresponding to the target terminal as a history detection result corresponding to the target terminal.
And step 440, weighting and integrating a plurality of historical detection results corresponding to the ith candidate server based on the weight value corresponding to the historical moment to obtain a first network delay result corresponding to the ith candidate server.
Illustratively, for the ith candidate server, since the plurality of history detection results corresponding to the ith candidate server respectively belong to different history moments, the plurality of history detection results are respectively given different weight values according to the history moments, for example: the weight value corresponding to the history detection result a1 minute before the current time is 0.8, and the weight value corresponding to the history detection result b 3 minutes before the current time is 0.5.
Optionally, the weight value of each historical detection result is different; or the weight values corresponding to at least two historical detection results in the plurality of historical detection results are the same, which is not limited.
Optionally, the weighted integration of the plurality of historical detection results includes at least one integration manner including weighted summation, weighted average, and the like, which is not limited.
Illustratively, the result obtained by weighting and integrating the plurality of historical detection results corresponding to the ith candidate server is used as a first network delay result corresponding to the ith candidate server.
Optionally, weighting and integrating all the historical detection results corresponding to the ith candidate server to obtain a first network delay result; or selecting a part of the historical detection results corresponding to the ith candidate server to perform weighted integration so as to obtain a first network delay result, which is not limited.
Step 450, determining the target server based on the first network delay results corresponding to the n candidate servers respectively.
The target server is used for carrying out network connection with the target terminal.
Illustratively, for the first network delay result corresponding to the ith candidate server, a first network delay result corresponding to each of the n servers is calculated.
Optionally, the first network delay results respectively corresponding to the n servers are acquired simultaneously; or the first network delay results corresponding to the n servers respectively are acquired sequentially.
In an alternative scheme, when each candidate server determines a corresponding first network delay result, the first network delay result is fed back to the target terminal, so that the target terminal determines that the target server performs network connection from the received multiple first network delay results.
In an alternative scheme, under the condition of setting up the intermediate server, after the intermediate server determines the first network delay results corresponding to the n candidate servers respectively, the target server is determined according to the plurality of first network delay results and is used for carrying out network connection with the target terminal.
Optionally, the determining manner of the target server includes at least one of the following determining manners:
1. Selecting a candidate server corresponding to the first network delay result with the smallest value as a target server according to the first network delay result corresponding to each server;
2. And presetting a delay threshold, and taking a candidate server corresponding to the first network delay result which does not reach the delay threshold as a target server.
It should be noted that the above determination of the target server is merely illustrative, and the embodiments of the present application are not limited thereto.
Wherein, if a plurality of target servers are determined, one of the target servers is randomly selected to be connected with the target terminal.
In some alternative schemes, in the first mode of determining the target server, if the connection between the target server and the target terminal fails after the target server is determined, a new target server is redetermined to connect with the target terminal according to the first network delay results corresponding to the remaining candidate servers respectively.
In some alternative schemes, in the second mode of determining the target servers, if a plurality of target servers are determined, after the connection between the first target server and the target terminal fails, the remaining target server is randomly selected to connect with the target terminal.
In summary, in the server connection method provided by the embodiment of the present application, after n candidate servers corresponding to the n candidate servers are obtained, a plurality of history detection results corresponding to the i candidate server at different history moments are obtained from the n candidate servers, so that the plurality of history detection results corresponding to the i candidate server are weighted and integrated according to the weight value corresponding to the history moment, a first network delay result corresponding to the candidate server is obtained, and finally, a target server which is finally connected with the target terminal in a network is determined according to the first network delay results respectively corresponding to each candidate server. That is, different weight values are given to the plurality of history detection results of the candidate server according to the corresponding history moments, so that the target server is finally determined in a weighted integration mode for the plurality of history detection results, and the situation that the player terminal can select the optimal server to be connected with the optimal server under the condition that network signals are poor and network delay data cannot be detected can be well avoided, so that the efficiency and the accuracy of network connection are improved, and the network environment is improved.
In an alternative embodiment, the weight value of the history detection result is determined by the history time corresponding to the history detection result, and referring to fig. 5, a flowchart of a server connection method according to an exemplary embodiment of the present application is shown, and as shown in fig. 5, the method is implemented by a server as an example, and the method includes the following steps.
Step 510, obtaining n candidate servers.
The n candidate servers respectively belong to different areas obtained by dividing according to the specified dividing rule, and the distances between the n candidate servers and the target terminal accord with the delay condition.
First, before receiving a network connection request sent by a target terminal, a process of detecting an internet packet explorer (PACKET INTERNET Groper, ping) is further included. The internet packet explorer (PACKET INTERNET Groper, ping) is an application for testing network connectivity.
Next, a description will be given of a Ping detection process.
Illustratively, an intermediate server is set up for storing data information corresponding to each of the plurality of servers, where the data information includes physical addresses (IP addresses) corresponding to the servers, a plurality of history detection results corresponding to the servers, and an operation status (in operation/stop operation/start operation) of the servers.
Optionally, the specified partitioning rule includes at least one of the following:
1. The method comprises the steps of dividing according to different geographic areas, namely, n candidate servers respectively belong to servers in different geographic areas, such as: server a belongs to the area a server and server B belongs to the area B server;
2. The server is divided according to the distribution position of the server, that is, the areas where the servers are located are divided according to different setting positions of the servers, for example: and dividing the 20 servers evenly according to the distribution positions to ensure that the number of the servers existing in each area is equal, wherein at least one server in each area is taken as a candidate server.
It should be noted that the above description of the specified partitioning rules is merely illustrative, and embodiments of the present application are not limited in this regard.
Optionally, the n candidate servers are all servers belonging to different areas; or, there are at least two servers belonging to the same area among the n candidate servers, which is not limited.
In some embodiments, the delay condition means that the distance between the candidate server and the target terminal is within a range where network connection is possible, such as: when the delay condition is that the physical distance is not more than 500 km, the server a is in the geographic area A, the physical distance from the target terminal is 480 km, the server B is in the geographic area B, and the physical distance from the target terminal is 600 km, then the server a belongs to the candidate server, and the server B does not belong to the candidate server.
In some embodiments, a plurality of server sets are acquired, wherein servers in a jth server set in the plurality of server sets belong to the same area, and the plurality of server sets respectively correspond to different areas; at least one server is randomly selected from the plurality of server sets as a candidate server, respectively.
In this embodiment, the specific division rule is implemented as different geographical areas, at least one machine room is set up in each geographical area, multiple servers are set up in one machine room, and the physical distances between the multiple servers in the same machine room are smaller, so that for the target terminal, the multiple servers in the same machine room are equivalent to being set up at the same site, and the connectivity of the target terminal for physical addressing of any one server in the machine room can be regarded as the same.
Therefore, the servers in each geographic area are regarded as a server set, the servers in the same server set belong to the same geographic area, and physical addresses (IP addresses) respectively corresponding to a plurality of servers in the same geographic area are stored in a target management module of an intermediate server, wherein the plurality of servers in each geographic area correspondingly generate an IP list, that is, the target management module stores a plurality of IP lists respectively corresponding to the geographic areas.
And step 520, obtaining physical addresses corresponding to the n candidate servers respectively from the target management module.
The n candidate servers are respectively and correspondingly stored in the target management module in a physical addressing mode.
Illustratively, the target management module randomly selects two servers from different geographic areas as candidate servers corresponding to the target terminal.
And 530, respectively transmitting the physical addressing corresponding to the n candidate servers to the target terminal.
In this embodiment, after the target management module determines n candidate servers corresponding to the target terminal, the n candidate servers are issued to the target terminal with physical addresses (IP addresses) and port numbers respectively corresponding to the n candidate servers, so that the target terminal performs Ping test on the n candidate servers (subsequent steps are described in detail). Such as: for the terminal a, obtaining an IP address (1.1.1.1:6666) of a server a and an IP address (1.1.1.2:6666) of a server b corresponding to the area a from a target management module; the IP address (2.1.1.2:6666) of the server c corresponding to the area b and the IP address (2.1.1.3:6666) corresponding to the server d are used as a server addressing list corresponding to the terminal a; for the terminal b, the IP address (1.1.1.3:6666) of the server a corresponding to the area a and the IP address (1.1.1.5:6666) of the server b are obtained from the target management module, and the IP address (2.1.1.1:6666) of the server c corresponding to the area b and the IP address (2.1.1.3:6666) of the server d corresponding to the area b are used as a server addressing list corresponding to the terminal b. Therefore, the servers for selecting the Ping test are different from each other for the same server set, so that the problem of single-point failure of the servers is avoided, and the servers are randomly issued to different terminals, so that each server can uniformly spread the load of Ping test requests sent by different terminals.
Referring to fig. 6, a physical addressing issuing schematic provided by an exemplary embodiment of the present application is shown, and as shown in fig. 6, the intermediate server includes a target management module 620, configured to issue physical addresses corresponding to candidate servers to the terminal a611, the terminal B612, and the terminal C613, respectively. The target management module stores a plurality of server sets including a region a server set 631, a region b server set 632, a region c server set 633 and a region d server set 634, wherein the region a, the region b, the region c and the region d belong to different geographical regions. Each regional server set includes a physical addressing set corresponding to a plurality of servers, and thus, the object management module 620 is configured to store the physical addressing sets corresponding to the servers included in the plurality of server sets.
After the target terminal sends a Ping test request to the intermediate server, the intermediate server randomly selects two servers from each server set in the target management module to serve as n candidate servers corresponding to the target terminal, determines physical addressing corresponding to the n servers respectively from the target management module to be sent to the target terminal, and further, the port numbers corresponding to the n servers respectively are also sent to the target terminal together.
In some embodiments, in response to the ith candidate server being taken off shelf, updating the target management module to obtain an updated management module; and sending a server off-shelf notification corresponding to the ith candidate server to the target terminal based on the update management module.
The server is put down to stand, which means that the server stops operating under some specified conditions, wherein the specified conditions include at least one of the conditions that the server fails, an instruction for stopping operating is received, and the operating duration reaches a termination operation threshold.
In this embodiment, after the ith candidate server corresponding to the target terminal is taken off the shelf, the IP list corresponding to the server set where the ith candidate server is located in the target management module is updated, so as to obtain the update management module. The updating method can be implemented by deleting the physical addressing corresponding to the ith candidate server from the IP list corresponding to the server set; or the updating method can be realized by taking off-shelf labeling of the physical addressing corresponding to the ith candidate server.
And after the update management module is obtained, issuing the taking-off condition of the ith candidate server to the target i terminal in real time, so that the target terminal does not test the ith candidate server and the retrograde Ping later.
In an optional case, the off-shelf notification includes not only the stop operation message of the ith candidate server, but also physical addressing corresponding to a new server in a server set belonging to the ith candidate server, and the physical addressing is issued to the target terminal together, so that the target terminal can directly perform Ping test on the new server.
In addition, besides the server off-shelf condition, the server off-shelf condition also includes a server off-shelf condition, wherein the server off-shelf condition refers to that a new server exists in a certain designated server set to start operation, at this time, physical addressing corresponding to the new server is sent to a target management module, an IP list corresponding to the designated server set is updated, and an off-shelf notification about the new server is sent to a target terminal.
And step 540, receiving a detection result corresponding to the ith candidate server reported by the target terminal at the target moment.
Schematically, after the target terminal receives the physical addresses and port numbers corresponding to the n candidate servers respectively issued by the target management module, performing Ping test on the physical addresses and port numbers of the n candidate servers.
The Ping test refers to that after a target terminal sends a data request to an ith candidate server, the ith candidate server sends response time between feedback results to the target terminal, and a Ping result, namely a detection result, is generated. And after the Ping program in the target terminal generates a Ping result, the Ping result is sent to the intermediate server at the target moment. The intermediate server is provided with a target management module for receiving Ping results respectively corresponding to different moments reported by the target terminal. And the routing pipeline module receives the Ping result sent by the target terminal at the target moment and takes the Ping result as a detection result corresponding to the target moment.
Step 550, the detection result corresponding to the target time is stored as the history detection result corresponding to the history time in the database.
In this embodiment, the target management module performs Ping result statistics every 3 minutes, updates the Ping result received from the target terminal at this time, and stores the update data in a database in the intermediate server.
In this embodiment, two servers are randomly selected as candidate servers of the target terminal in each geographic area, so when the Ping result is counted, taking each geographic area as a statistical standard, and taking the average value of the Ping results of two candidate servers in the same geographic area as the Ping result of the geographic area. For illustration, please refer to table 1 below.
TABLE 1
Region a Region b Region c
Before 3 minutes 190 Ms 60 Ms of 231 Ms
Before 6 minutes 196 Milliseconds 55 Ms of 250 Ms
Before 9 minutes 185 Ms of 61 Ms 238 Ms
As can be seen from table 1, the candidate servers in the area b belong to the servers with better network quality for the target terminal.
It should be noted that, in an example, if the detection result before 3 minutes and the detection result before 3 minutes are obtained currently, after 3 minutes have elapsed, the target management module counts the Ping result again, updates the Ping result obtained at this time to the detection result before 3 minutes, updates the detection result before the original 3 minutes to the detection result before 6 minutes, updates the detection result before the original 6 minutes to the detection result before 9 minutes, and stores the updated Ping result as a history detection result in the database, that is, the detection result and the target time corresponding to the detection result are continuously changed according to the time transition and the statistics result of the target management module, and all belong to the history detection result in the database.
Schematically, the target terminal reports the detection results respectively corresponding to the n candidate servers to the intermediate server at the target moment.
Referring to fig. 7, a schematic diagram of the generation of a detection result provided by an exemplary embodiment of the present application is shown, as shown in fig. 7, an intermediate server includes a target management module 710 and a database 720, where, after the target management module receives the detection result reported by the terminal 730 at a target time, a historical detection result set is pulled from the database, and the historical detection result is updated according to the detection result obtained by the latest acquisition (for example, the detection result before 9 minutes is deleted, the detection result obtained by the latest acquisition is updated to the detection result before 3 minutes, the detection result before 3 minutes is updated to the detection result before 6 minutes, the detection result before 6 minutes is updated to the detection result before 9 minutes), and the updated detection result is stored as the historical detection result in the database 720.
The server selection process is described in detail below.
Step 560, receiving a network connection request sent by the target terminal.
The network connection request comprises a terminal identification number corresponding to the target terminal.
Next, two cases corresponding to the network connection request will be described.
First, the network connection request includes the target detection result.
In some embodiments, the network connection request includes a target detection result corresponding to the i-th candidate server, where the target detection result is used to indicate a detection result corresponding to the i-th candidate server that is not reported by the target terminal.
Illustratively, since the target terminal reports the detection result to the intermediate server at the target time (e.g., every three minutes), when the target terminal sends the network connection request to the intermediate server, there may be a case where the target terminal includes a detection request corresponding to the i-th candidate server that has not been reported to the intermediate server, and at this time, the detection result is regarded as a target detection result, and the network connection request includes the terminal identification number and the target detection result. In this embodiment, the target detection result is used as the real-time Ping result.
Second, the network connection request does not include the target detection result.
In some embodiments, when the target terminal sends the network connection request to the intermediate server, there is no case that the target terminal includes a detection request corresponding to the i candidate server that has not been reported to the intermediate server, and therefore, the network connection request includes only the terminal identification number.
In step 570, n candidate servers corresponding to the target terminal are determined.
Wherein n is a positive integer.
Illustratively, the routing pipeline module in the intermediate server determines n candidate servers corresponding to the target terminal from the database according to the terminal identification number of the target terminal.
In step 580, a plurality of history detection results corresponding to the ith candidate server in the n candidate servers are obtained.
The history detection result is used for indicating network delay data of the ith candidate server at a plurality of different history moments, the network delay data is used for indicating response time length of receiving a feedback result after the target terminal sends a data request to the ith candidate server, and i is less than or equal to n and is a positive integer.
Illustratively, the routing pipeline module in the intermediate server determines n candidate servers corresponding to the target terminal from the database according to the terminal representation number of the target terminal, and pulls a plurality of history detection results corresponding to the target terminal from the n candidate servers.
And 590, determining weight values respectively corresponding to the plurality of history detection results based on different history moments.
In the first case, when there is a target detection result, a weight value corresponding to each of the target detection result and the plurality of history detection results is determined. The timeliness of the target detection result is better than that of the plurality of historical detection results, so that the weight value corresponding to the target detection result is higher than that corresponding to the plurality of historical detection results respectively.
In some embodiments, weight values respectively corresponding to the plurality of historical detection results are obtained based on a time interval between the historical time and the current time, wherein the weight values are inversely related to the time interval.
And determining the weight values corresponding to the plurality of history detection results according to the time interval lengths between the history time and the current time corresponding to the plurality of history detection results, wherein the weight value corresponding to the history detection result with the longer time interval length from the current time is lower, which is schematically shown in table 2.
TABLE 2
As can be seen from table 2, for the i candidate server implemented as the area server a, the weight value corresponding to the target detection result (real-time Ping) is highest, and the weight values corresponding to the plurality of historical detection results (including 3 minutes ago, 6 minutes ago and 9 minutes ago) are related to the time interval length corresponding to the current time and the historical time respectively.
For the second case, if the network connection request does not have the target detection result, determining the weight values corresponding to the plurality of history detection results according to the time interval length between the history time and the current time corresponding to the plurality of history detection results, where the weight value corresponding to the history detection result with the longer time interval length from the current time is lower, for illustration, please refer to table 3.
TABLE 3 Table 3
Weighting of Region a Region b Region c
Before 3 minutes 50 190 Ms 60 Ms of 231 Ms
Before 6 minutes 20 196 Milliseconds 55 Ms of 250 Ms
Before 9 minutes 10 185 Ms of 61 Ms 238 Ms
As can be seen from table 3, for the i-th candidate server implemented as the area server a, the weight values corresponding to the plurality of history detection results (including 3 minutes ago, 6 minutes ago, and 9 minutes ago) are related to the time interval length corresponding to the current time at the history time.
In step 5100, a weighted average is performed on the plurality of historical detection results based on the weight value, so as to obtain a first network delay result corresponding to the ith candidate server.
And under the condition that the target detection result exists in the first condition, aiming at the ith candidate server, carrying out weighted integration on the target detection result and a plurality of historical detection results to obtain a second network delay result corresponding to the ith candidate server, wherein the weight value corresponding to the target detection result is higher than the weight value corresponding to the historical detection result.
In this embodiment, according to the weight value corresponding to the target detection result corresponding to the ith candidate server and the weight values corresponding to the plurality of history detection results, weighted average is performed to obtain a weighted average result corresponding to the ith candidate server, which is used as the second network delay result corresponding to the ith candidate server.
Schematically, referring to table 2 above, the second network delay result of the target terminal corresponding to the server in the area a= (200×100+50×190+20×196+10×185)/(100+50+20+10) =35270/180= 195.9.
Second network delay result=55.06 of the target terminal corresponding area b server; the target terminal corresponds to the second network delay result= 249.61 of the zone c server.
In the second case, if the network connection request does not have the target detection result, weighting average is performed on the weighting values corresponding to the plurality of historical detection results for the ith candidate server, so as to obtain a weighted average result corresponding to the ith candidate server, and the weighted average result is used as a first network delay result corresponding to the ith candidate server.
Illustratively, referring to table 3 above, the target terminal corresponds to the first network delay result of the zone a server= (50×190+20×196+10×185)/(50+20+10) =15270/180= 190.88.
Second network delay result=58.88 for the target terminal corresponding zone b server; the target terminal corresponds to the second network delay result= 236.63 of the zone c server.
In step 5110, the candidate servers meeting the delay condition in the first network delay results corresponding to the n candidate servers are used as target servers.
For the first case, after the second delay results corresponding to the n candidate servers are obtained, the candidate server with the smallest value result of the second delay result is selected as the target server.
In the second case, after the first delay results corresponding to the n candidate servers are obtained, the candidate server with the smallest value result of the first delay result is selected as the target server.
As can be seen from the contents of tables 2 and 3, the zone b server belongs to the target server corresponding to the target terminal in both cases.
And under the achievable condition, after the candidate server with the minimum value of the first delay result/the second delay result is determined, taking the geographic area of the candidate server as a target geographic area, taking all servers in the target geographic area as servers meeting the delay condition, and finally, randomly selecting one server from the target geographic area as a target server to be connected with the target terminal.
In summary, in the server connection method provided by the embodiment of the present application, after n candidate servers corresponding to the n candidate servers are obtained, a plurality of history detection results corresponding to the i candidate server at different history moments are obtained from the n candidate servers, so that the plurality of history detection results corresponding to the i candidate server are weighted and integrated according to the weight value corresponding to the history moment, a first network delay result corresponding to the candidate server is obtained, and finally, a target server which is finally connected with the target terminal in a network is determined according to the first network delay results respectively corresponding to each candidate server. That is, different weight values are given to the plurality of history detection results of the candidate server according to the corresponding history moments, so that the target server is finally determined in a weighted integration mode for the plurality of history detection results, and the situation that the player terminal can select the optimal server to be connected with the optimal server under the condition that network signals are poor and network delay data cannot be detected can be well avoided, so that the efficiency and the accuracy of network connection are improved, and the network environment is improved.
In this embodiment, the weight values corresponding to the plurality of historical detection results are determined according to the time intervals between different historical moments and the current moment, so that the weight value corresponding to the historical detection result with higher timeliness is higher, and the accuracy of the delay result is ensured.
In this embodiment, the server is randomly selected from the plurality of server sets as the candidate server of the target terminal, so that the plurality of terminals can be prevented from performing delay detection on the same server, and the load pressure of the server is relieved.
In this embodiment, the target management module is updated in real time according to the on-shelf and off-shelf conditions of the server, so that the on-shelf notification/off-shelf notification is sent to the target terminal, and the target terminal can be timely informed about the operation condition of the candidate server, thereby improving the network connection efficiency.
Referring to fig. 8, a flowchart of a network connection method according to an exemplary embodiment of the present application is shown, and as shown in fig. 8, a method applied to a game scene is illustrated as an example, and the method includes the following steps.
Step 800, beginning.
In this embodiment, step 810 is executed when the terminal logs in the target account during the process of running the game program.
Step 810, summarizing detection results of all machine rooms.
In this embodiment, the intermediate server is a game server, one machine room corresponds to different geographical areas, and multiple servers are set in each machine room for network connection, so that one machine room serves as a server set, and the target management module in the game server stores physical addresses corresponding to multiple servers in each machine room and serves as an IP list corresponding to the machine room.
The terminal sends a Ping test request to the game server, after the game server receives the Ping test request, two servers are randomly selected from the machine rooms in different geographic areas to serve as candidate servers corresponding to the terminal, and physical addressing and port numbers corresponding to the candidate servers are issued to the terminal from an IP list corresponding to each machine room.
After receiving the physical addressing and port numbers corresponding to the n candidate servers, the terminal continuously detects the Ping values of the n candidate servers, and reports the Ping value detection result corresponding to each candidate server to the game server every 3 minutes. And the game server receives the Ping value detection result corresponding to each candidate server every time and gathers the Ping value detection results. And averaging the Ping value detection results corresponding to the two servers in the same machine room to serve as the Ping value detection result corresponding to the machine room. Therefore, the candidate server according to the present application may be regarded as a candidate machine room, and is not limited thereto.
Step 820, report to the target management module.
And the game server gathers and obtains the Ping value detection result corresponding to each machine room at the current moment and reports the Ping value detection result to a target management module in the game server.
In step 830, the history detection result is obtained from the database.
And the target management module acquires a historical detection result from a database in the game server after receiving the Ping value detection result corresponding to each machine room which is recently reported by the current terminal.
In step 840, the historical detection results are updated based on the detection results.
And the target management module adds the latest Ping value detection result to the historical detection result, and deletes the historical detection result with the longest time interval from the current moment to serve as the update of the historical detection result.
Step 850, updating the database.
And saving the updated historical detection result in the database again.
Step 860, ends.
After the history detection result is stored in the database, ending the detection of the present Ping detection process until a new Ping value detection result reported by the terminal is received next time.
In summary, in the server connection method provided by the embodiment of the present application, after n candidate servers corresponding to the n candidate servers are obtained, a plurality of history detection results corresponding to the i candidate server at different history moments are obtained from the n candidate servers, so that the plurality of history detection results corresponding to the i candidate server are weighted and integrated according to the weight value corresponding to the history moment, a first network delay result corresponding to the candidate server is obtained, and finally, a target server which is finally connected with the target terminal in a network is determined according to the first network delay results respectively corresponding to each candidate server. That is, different weight values are given to the plurality of history detection results of the candidate server according to the corresponding history moments, so that the target server is finally determined in a weighted integration mode for the plurality of history detection results, and the situation that the player terminal can select the optimal server to be connected with the optimal server under the condition that network signals are poor and network delay data cannot be detected can be well avoided, so that the efficiency and the accuracy of network connection are improved, and the network environment is improved.
Referring to fig. 9, a flowchart of a network connection method according to an exemplary embodiment of the present application is shown, and as shown in fig. 9, a method applied to a game scene is illustrated as an example, and the method includes the following steps.
Step 900, start the game.
When the terminal is running the game, if the target account registered in the current terminal starts to play the game, step 910 is executed.
Step 910, obtain the history detection result from the database.
Referring to fig. 10, a schematic diagram of a server selection method according to an exemplary embodiment of the present application is shown, where, as shown in fig. 10, a game server includes a target management module 1010, and after the target management module 1010 receives a network connection request sent by a terminal 1020, a plurality of history detection results corresponding to n candidate rooms corresponding to the terminal 1020 are obtained from a database 1030 according to a terminal identification number corresponding to the terminal 1020 in the network connection request (each candidate room corresponds to a plurality of history detection results, and each history detection result corresponding to each candidate room is obtained by average evaluation of history detection results corresponding to two servers randomly selected in fig. 8).
At this time, it is determined whether the network connection request includes the target detection result that the terminal 1020 has not reported.
Step 920, performing weighted average on the history detection result.
And if the target detection result does not exist in the network connection request, carrying out weighted average on the weight values respectively corresponding to the multiple historical detection results corresponding to the ith candidate machine room, which are acquired from the database, aiming at the ith candidate machine room, so as to obtain a first delay result corresponding to the ith candidate machine room, and finally determining the first delay results respectively corresponding to the n candidate machine rooms.
Step 930, performing weighted average in combination with the target detection result and the history detection result.
And if the target detection result exists in the network connection request, aiming at the ith candidate machine room, carrying out weighted average on the weight value corresponding to the target detection result and the weight values corresponding to the plurality of historical detection results corresponding to the ith candidate machine room respectively to obtain a second delay result corresponding to the ith candidate machine room, and finally determining the second delay results corresponding to the n candidate machine rooms respectively. The weight value corresponding to the target detection result is higher than the weight values corresponding to the plurality of historical detection results respectively.
Step 940, determining the target server according to the weighted average result.
If the target detection result does not exist in the network connection request, selecting the candidate machine room with the smallest value of the first delay result as the target machine room according to the first delay results respectively corresponding to the n candidate machine rooms, and connecting any one server in the target machine room with the terminal in a network manner, thereby providing game service.
If the target detection result exists in the network connection request, selecting the candidate machine room with the smallest value of the second delay result as the target machine room according to the second delay results respectively corresponding to the n candidate machine rooms, and connecting any one server in the target machine room with the terminal in a network manner, thereby providing game service.
As shown in fig. 10, the objective management module 1010 includes a plurality of machine room sets, and determines an objective machine room 1011 according to a weighted average result, and is configured to connect any one server in the objective machine room 1011 with a terminal via a network, and start game play.
In summary, in the server connection method provided by the embodiment of the present application, after n candidate servers corresponding to the n candidate servers are obtained, a plurality of history detection results corresponding to the i candidate server at different history moments are obtained from the n candidate servers, so that the plurality of history detection results corresponding to the i candidate server are weighted and integrated according to the weight value corresponding to the history moment, a first network delay result corresponding to the candidate server is obtained, and finally, a target server which is finally connected with the target terminal in a network is determined according to the first network delay results respectively corresponding to each candidate server. That is, different weight values are given to the plurality of history detection results of the candidate server according to the corresponding history moments, so that the target server is finally determined in a weighted integration mode for the plurality of history detection results, and the situation that the player terminal can select the optimal server to be connected with the optimal server under the condition that network signals are poor and network delay data cannot be detected can be well avoided, so that the efficiency and the accuracy of network connection are improved, and the network environment is improved.
The application provides a target detection result and a method for combining a historical detection result, which are used for evaluating terminal link selection in real time. According to the scheme, the weight of the standard detection result is high, the weight of the historical detection result is low, and the mode of using the weight is used for confirming which server should be selected to be connected at present. If the target detection result is not obtained, the historical detection result is used, and according to statistics, the geographic position of the terminal is changed less frequently, so that the historical detection result has great significance. This can cope with the case where the real-time ping value transmitted by the terminal cannot be obtained by the game server in a short time.
Fig. 11 is a block diagram of a server connection device according to an exemplary embodiment of the present application, and as shown in fig. 11, the device includes the following parts:
a receiving module 1110, configured to receive a network connection request sent by a target terminal;
A determining module 1120, configured to determine n candidate servers corresponding to the target terminal, where n is a positive integer;
The acquiring module 1130 is configured to acquire a plurality of history detection results corresponding to an ith candidate server in the n candidate servers, where the history detection results are used to indicate network delay data of the ith candidate server at a plurality of different history moments, the network delay data are used to indicate response time length of receiving a feedback result after the target terminal sends a data request to the ith candidate server, and i is less than or equal to n and is a positive integer;
An integrating module 1140, configured to weight integrate a plurality of historical detection results corresponding to the ith candidate server based on the weight value corresponding to the historical moment, so as to obtain a first network delay result corresponding to the ith candidate server;
The determining module 1120 is further configured to determine a target server, based on the first network delay results corresponding to the n candidate servers, where the target server is used to perform network connection with the target terminal.
In some embodiments, as shown in fig. 12, the integration module 1140 includes:
a determining unit 1141, configured to determine weight values respectively corresponding to the plurality of history detection results based on the different history moments;
and an averaging unit 1142, configured to perform weighted average on the plurality of historical detection results based on the weight value, to obtain a first network delay result corresponding to the i candidate server.
In some embodiments, the determining unit 1141 is further configured to obtain weight values respectively corresponding to the plurality of historical detection results based on a time interval between the historical time and the current time, where the weight values are inversely related to the time interval.
In some embodiments, the apparatus further comprises:
the obtaining module 1130 is further configured to obtain n candidate servers, where the n candidate servers respectively belong to different areas obtained by dividing according to a specified dividing rule, and distances between the n candidate servers and the target terminal meet a delay condition;
An issuing module 1150, configured to issue physical addresses corresponding to the n candidate servers respectively to the target terminal;
the receiving module 1110 is further configured to receive, at a target time, a detection result corresponding to the i candidate server reported by the target terminal;
The storage module 1160 is further configured to store the detection result corresponding to the target time as a history detection result corresponding to the history time to a database.
In some embodiments, the physical addresses respectively corresponding to the n candidate servers are stored in a target management module;
The obtaining module 1130 is further configured to obtain physical addresses corresponding to the n candidate servers from the target management module, where the physical addresses correspond to the n candidate servers respectively;
The apparatus further comprises:
An updating module 1170, configured to update the target management module in response to the i-th candidate server being down, to obtain an updated management module;
and a sending module 1180, configured to send a server off-shelf notification corresponding to the ith candidate server to the target terminal based on the update management module.
In some embodiments, the obtaining module 1130 is further configured to obtain a plurality of server sets, where servers in a jth server set in the plurality of server sets belong to a same area, and the plurality of server sets respectively correspond to different areas; at least one server is randomly selected from the plurality of server sets as the candidate server, respectively.
In some embodiments, the network connection request includes a target detection result corresponding to the i-th candidate server, where the target detection result is used to indicate a detection result corresponding to the i-th candidate server that is not reported temporarily by the target terminal;
The integrating module 1140 is further configured to perform weighted integration on the target detection result and the plurality of historical detection results to obtain a second network delay result corresponding to the ith candidate server, where a weight value corresponding to the target detection result is higher than a weight value corresponding to the historical detection result.
In some embodiments, the determining module 1120 is further configured to use, as the target server, a candidate server that meets a delay condition in the first network delay results respectively corresponding to the n candidate servers.
In summary, in the server connection device provided in the embodiment of the present application, after n candidate servers corresponding to the n candidate servers are obtained, a plurality of history detection results corresponding to the i candidate server at different history moments are obtained from the n candidate servers, so that the plurality of history detection results corresponding to the i candidate server are weighted and integrated according to the weight value corresponding to the history moment, a first network delay result corresponding to the candidate server is obtained, and finally, a target server which is finally connected with a target terminal in a network is determined according to the first network delay results respectively corresponding to each candidate server. That is, different weight values are given to the plurality of history detection results of the candidate server according to the corresponding history moments, so that the target server is finally determined in a weighted integration mode for the plurality of history detection results, and the situation that the player terminal can select the optimal server to be connected with the optimal server under the condition that network signals are poor and network delay data cannot be detected can be well avoided, so that the efficiency and the accuracy of network connection are improved, and the network environment is improved.
It should be noted that: the server connection device provided in the above embodiment is only exemplified by the division of the above functional modules, and in practical application, the above functional allocation may be performed by different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules, so as to perform all or part of the functions described above. In addition, the embodiments of the server connection device and the server connection method provided in the foregoing embodiments belong to the same concept, and specific implementation processes thereof are detailed in the method embodiments and are not described herein again.
Fig. 13 is a schematic diagram showing a structure of a server according to an exemplary embodiment of the present application. Specifically, the present application relates to a method for manufacturing a semiconductor device.
The server 1300 includes a central processing unit (Central Processing Unit, CPU) 1301, a system Memory 1304 including a random access Memory (Random Access Memory, RAM) 1302 and a Read Only Memory (ROM) 1303, and a system bus 1305 connecting the system Memory 1304 and the central processing unit 1301. The server 1300 also includes a mass storage device 1306 for storing an operating system 1313, application programs 1314, and other program modules 1315.
The mass storage device 1306 is connected to the central processing unit 1301 through a mass storage controller (not shown) connected to the system bus 1305. The mass storage device 1306 and its associated computer-readable media provide non-volatile storage for the server 1300. That is, the mass storage device 1306 may include a computer readable medium (not shown) such as a hard disk or compact disc read only memory (Compact Disc Read Only Memory, CD-ROM) drive.
Computer readable media may include computer storage media and communication media without loss of generality. Computer storage media includes volatile and nonvolatile, removable and non-removable media implemented in any method or technology for storage of information such as computer readable instructions, data structures, program modules or other data. Computer storage media includes RAM, ROM, erasable programmable read-only memory (Erasable Programmable Read Only Memory, EPROM), electrically erasable programmable read-only memory (ELECTRICALLY ERASABLE PROGRAMMABLE READ ONLY MEMORY, EEPROM), flash memory or other solid state memory technology, CD-ROM, digital versatile disks (DIGITAL VERSATILE DISC, DVD) or other optical storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices. Of course, those skilled in the art will recognize that computer storage media are not limited to the ones described above. The system memory 1304 and mass storage device 1306 described above may be collectively referred to as memory.
According to various embodiments of the application, the server 1300 may also operate by a remote computer connected to the network through a network, such as the Internet. I.e., the server 1300 may be connected to the network 1312 via a network interface unit 1311 coupled to the system bus 1305, or the network interface unit 1311 may be used to connect to other types of networks or remote computer systems (not shown).
The memory also includes one or more programs, one or more programs stored in the memory and configured to be executed by the CPU.
Embodiments of the present application also provide a computer device including a processor and a memory, where at least one instruction, at least one program, a code set, or an instruction set is stored in the memory, where at least one instruction, at least one program, a code set, or an instruction set is loaded and executed by the processor to implement the server connection method provided in the above method embodiments.
Embodiments of the present application also provide a computer readable storage medium having at least one instruction, at least one program, a code set, or an instruction set stored thereon, where the at least one instruction, the at least one program, the code set, or the instruction set is loaded and executed by a processor to implement the server connection method provided by the above method embodiments.
Embodiments of the present application also provide a computer program product or computer program comprising computer instructions stored in a computer readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device performs the server connection method described in any one of the above embodiments.
Alternatively, the computer-readable storage medium may include: read Only Memory (ROM), random access Memory (RAM, random Access Memory), solid state disk (SSD, solid STATE DRIVES), or optical disk, etc. The random access memory may include resistive random access memory (ReRAM, RESISTANCE RANDOM ACCESS MEMORY) and dynamic random access memory (DRAM, dynamic Random Access Memory), among others. The foregoing embodiment numbers of the present application are merely for the purpose of description, and do not represent the advantages or disadvantages of the embodiments.
It will be understood by those skilled in the art that all or part of the steps for implementing the above embodiments may be implemented by hardware, or may be implemented by a program for instructing relevant hardware, where the program may be stored in a computer readable storage medium, and the storage medium may be a read-only memory, a magnetic disk or an optical disk, etc.
The foregoing description of the preferred embodiments of the present application is not intended to limit the application, but rather, the application is to be construed as limited to the appended claims.

Claims (12)

1. A method for connecting a server, the method comprising:
Receiving a network connection request sent by a target terminal;
determining n candidate servers corresponding to the target terminal, wherein n is a positive integer;
acquiring a plurality of history detection results corresponding to an ith candidate server in the n candidate servers, wherein the history detection results are used for indicating network delay data of the ith candidate server at a plurality of different history moments, the network delay data are used for indicating response time length of receiving a feedback result after the target terminal sends a data request to the ith candidate server, and i is less than or equal to n and is a positive integer;
weighting and integrating a plurality of historical detection results corresponding to the ith candidate server based on the weight value corresponding to the historical moment to obtain a first network delay result corresponding to the ith candidate server;
And determining a target server based on first network delay results respectively corresponding to the n candidate servers, wherein the target server is used for carrying out network connection with the target terminal.
2. The method of claim 1, wherein the weighting and integrating the plurality of historical detection results corresponding to the ith candidate server based on the weight value corresponding to the historical moment to obtain a first network delay result corresponding to the ith candidate server comprises:
determining weight values respectively corresponding to the plurality of historical detection results based on the different historical moments;
And carrying out weighted average on the plurality of historical detection results based on the weight value to obtain a first network delay result corresponding to the ith candidate server.
3. The method of claim 2, wherein determining the weight values for each of the plurality of historical detection results based on the different historical time instants comprises:
And acquiring weight values respectively corresponding to the plurality of historical detection results based on the time interval between the historical time and the current time, wherein the weight values are in negative correlation with the time interval.
4. A method according to any one of claims 1 to 3, wherein before receiving the network connection request sent by the target terminal, the method further comprises:
obtaining n candidate servers, wherein the n candidate servers respectively belong to different areas obtained by dividing according to a specified dividing rule, and the distances between the n candidate servers and the target terminal accord with a delay condition;
the physical addressing corresponding to the n candidate servers is issued to the target terminal;
receiving a detection result corresponding to the ith candidate server reported by the target terminal at a target moment;
And storing the detection result corresponding to the target moment as a history detection result corresponding to the history moment into a database.
5. The method of claim 4, wherein the physical addresses corresponding to the n candidate servers are stored in a target management module;
Before the physical addressing corresponding to each of the n candidate servers is issued to the target terminal, the method further includes:
Acquiring physical addresses respectively corresponding to the n candidate servers from the target management module;
the method further comprises the steps of:
Responding to the i candidate server to be taken off the shelf, updating the target management module, and obtaining an update management module;
and sending a server off-shelf notification corresponding to the ith candidate server to the target terminal based on the update management module.
6. The method of claim 4, wherein the obtaining n candidate servers comprises:
Acquiring a plurality of server sets, wherein servers in a j-th server set in the plurality of server sets belong to the same area, and the plurality of server sets respectively correspond to different areas;
at least one server is randomly selected from the plurality of server sets as the candidate server, respectively.
7. A method according to any one of claims 1 to 3, wherein the network connection request includes a target detection result corresponding to the i-th candidate server, where the target detection result is used to indicate a detection result corresponding to the i-th candidate server that is not reported by the target terminal;
the method further comprises the steps of:
And carrying out weighted integration on the target detection result and the plurality of historical detection results to obtain a second network delay result corresponding to the ith candidate server, wherein the weight value corresponding to the target detection result is higher than the weight value corresponding to the historical detection result.
8. A method according to any one of claims 1 to 3, wherein determining the target server based on the first network delay results respectively corresponding to the n candidate servers includes:
and taking the candidate servers which meet the delay condition in the first network delay results respectively corresponding to the n candidate servers as the target servers.
9. A server connection device, the device comprising:
the receiving module is used for receiving a network connection request sent by the target terminal;
the determining module is used for determining n candidate servers corresponding to the target terminal, wherein n is a positive integer;
the system comprises an acquisition module, a feedback module and a feedback module, wherein the acquisition module is used for acquiring a plurality of historical detection results corresponding to an ith candidate server in the n candidate servers, the historical detection results are used for indicating network delay data of the ith candidate server at a plurality of different historical moments, the network delay data are used for indicating response time length of receiving a feedback result after the target terminal sends a data request to the ith candidate server, and i is less than or equal to n and is a positive integer;
The integration module is used for carrying out weighted integration on a plurality of historical detection results corresponding to the ith candidate server based on the weight value corresponding to the historical moment to obtain a first network delay result corresponding to the ith candidate server;
The determining module is further configured to determine a target server, based on first network delay results corresponding to the n candidate servers, where the target server is used to perform network connection with the target terminal.
10. A computer device comprising a processor and a memory, wherein the memory has stored therein at least one program that is loaded and executed by the processor to implement the server connection method of any of claims 1 to 8.
11. A computer-readable storage medium, characterized in that at least one program is stored in the storage medium, the at least one program being loaded and executed by a processor to implement the server connection method according to any one of claims 1 to 10.
12. A computer program product comprising computer instructions which, when executed by a processor, implement a server connection method as claimed in any one of claims 1 to 10.
CN202211400687.9A 2022-11-09 2022-11-09 Server connection method, device, apparatus, storage medium, and program product Pending CN118018588A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211400687.9A CN118018588A (en) 2022-11-09 2022-11-09 Server connection method, device, apparatus, storage medium, and program product

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211400687.9A CN118018588A (en) 2022-11-09 2022-11-09 Server connection method, device, apparatus, storage medium, and program product

Publications (1)

Publication Number Publication Date
CN118018588A true CN118018588A (en) 2024-05-10

Family

ID=90941687

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211400687.9A Pending CN118018588A (en) 2022-11-09 2022-11-09 Server connection method, device, apparatus, storage medium, and program product

Country Status (1)

Country Link
CN (1) CN118018588A (en)

Similar Documents

Publication Publication Date Title
CN109660607B (en) Service request distribution method, service request receiving method, service request distribution device, service request receiving device and server cluster
CN109302346B (en) Method and device for transmitting data flow
CN109117275B (en) Account checking method and device based on data slicing, computer equipment and storage medium
CN109768879B (en) Method and device for determining target service server and server
CN105516347A (en) Method and device for load balance allocation of streaming media server
CN112016030B (en) Message pushing method, device, server and computer storage medium
WO2021169294A1 (en) Application recognition model updating method and apparatus, and storage medium
CN110311812B (en) Network analysis method, device and storage medium
CN109921925B (en) Dial testing method and device
CN110784355A (en) Fault identification method and device
CN105991412A (en) Method and device for pushing message
CN106888277A (en) A kind of domain name inquiry method and device
CN110661673B (en) Heartbeat detection method and device
CN111556135A (en) Request scheduling method, system and device and electronic equipment
CN112261133A (en) CDN node control method, device, server and storage medium
CN104426881A (en) Method and device for detecting malicious behavior
CN109981795B (en) Resource request scheduling method and device
CN108093428B (en) Server for authenticating real traffic
CN106790610B (en) Cloud system message distribution method, device and system
CN110380981B (en) Flow distribution method and equipment
CN118018588A (en) Server connection method, device, apparatus, storage medium, and program product
CN115378841B (en) Method and device for detecting state of equipment accessing cloud platform, storage medium and terminal
CN116821215A (en) OPC UA server searching method based on port inquiry
KR20190004970A (en) System and Method for Real-Time Trouble Cause Analysis based on Network Quality Data
CN114697266A (en) Virtual machine access method, terminal and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication