Server access method, apparatus, storage medium, and electronic device
Patent Information
- Application Number
- CN202310231381.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-10
- Publication Date
- 2026-09-15
- Estimated Expiration
- 2043-03-10
AI Technical Summary
[0006]本申请提供一种服务器访问方法、装置、存储介质以及电子设备,以解决相关技术中通过距离确定用户使用的网关以及访问路径的方法无法保证访问效率的问题
[0015] According to another aspect of the present invention, a computer storage medium is also provided for storing a program, wherein the program, when running, controls the device where the computer storage medium is located to execute a server access method.
Smart Images

Figure CN116389597B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the Internet field, and more specifically, to a server access method, apparatus, storage medium, and electronic device. Background Technology
[0002] A company often has multiple office locations, and IT administrators will deploy server rooms in these locations. Servers providing different application services on the internal network may be located in two different locations. The company's IT administrator will deploy relevant configurations on the gateways of office locations A and B for SSL VPN or other remote access technologies.
[0003] For employees working remotely, SSL VPN or other remote technologies are needed to access the corporate intranet. Because multiple gateways exist, and each gateway connects to different servers, employees working remotely can access a server through various access paths.
[0004] Currently, when determining the access path, the common method is to identify the gateway closest to the user and access the server through that gateway. However, this method cannot guarantee that the selected gateway and the access path used are the optimal path, thus reducing the efficiency of the user's access to the server.
[0005] There is currently no effective solution to the problem that methods for determining the gateway and access path used by a user based on distance in related technologies cannot guarantee access efficiency. Summary of the Invention
[0006] This application provides a server access method, apparatus, storage medium, and electronic device to solve the problem that methods in related technologies that determine the gateway and access path used by the user based on distance cannot guarantee access efficiency.
[0007] According to one aspect of this application, a server access method is provided. The method includes: acquiring access information sent by a client and parsing the access information to obtain the destination IP address of the access information, wherein the target initial gateway is any initial gateway among a plurality of initial gateways, and there are connections between the plurality of initial gateways; determining the initial gateway to which the server is connected from the plurality of initial gateways with the IP address of the destination IP address, thus obtaining the destination gateway; sequentially determining the information transmission performance value between the client and each initial gateway to obtain a plurality of first performance values; sequentially determining the information transmission performance value between each initial gateway and the destination gateway to obtain a plurality of second performance values; sequentially adding each first performance value to each second performance value to obtain a plurality of third performance values; and determining the initial gateway corresponding to the largest transmission performance value among the plurality of third performance values as the target gateway; connecting the client to the target gateway, receiving the access information through the target gateway, and sending the access information to the server.
[0008] Optionally, determining the information transmission performance value between each initial gateway and the destination gateway sequentially includes: obtaining the information transmission delay value and packet loss rate between the initial gateway and the destination gateway; obtaining the weight values of the transmission delay value and the packet loss rate respectively to obtain the first weight value and the second weight value; and weighting and summing the transmission delay value and the packet loss rate using the first weight value and the second weight value to obtain the information transmission performance value between the initial gateway and the destination gateway.
[0009] Optionally, determining the information transmission performance value between each initial gateway and the destination gateway sequentially includes: obtaining multiple connection paths between each initial gateway and the destination gateway to obtain multiple sets of connection paths, wherein the initial gateways of the multiple connection paths in each set of connection paths are the same; calculating the transmission performance value of each connection path in each set of connection paths to obtain multiple second performance values.
[0010] Optionally, after calculating the transmission performance value of each connected path in each group of connected paths to obtain multiple second performance values, the method further includes: detecting whether there are abnormal connected paths in the multiple connected paths according to a preset period; if there are abnormal connected paths in the multiple connected paths, determining the abnormal initial gateway in the abnormal connected path, deleting the abnormal initial gateway, regenerating multiple connected paths according to the remaining initial gateways, and performing the steps of calculating the transmission performance value of each connected path in each group of connected paths to obtain multiple second performance values.
[0011] Optionally, after parsing the access information and obtaining the destination IP of the access information, the method further includes: determining whether there is a preset connection path in the database that is associated with both the destination IP and the client, wherein the preset connection path includes at least one initial gateway; if the preset connection path exists, sending the access information to the server according to the preset connection path; if the preset connection path does not exist, performing the step of determining the initial gateway connected to the server whose IP address is the destination IP from multiple initial gateways to obtain the destination gateway.
[0012] Optionally, after determining whether a preset connection path exists in the database that is commonly associated with the destination IP and the client, the method further includes: if a preset connection path exists, performing the following steps according to a preset period: sequentially determining the information transmission performance value between the client and each initial gateway to obtain multiple first performance values; sequentially determining the information transmission performance value between each initial gateway and the destination gateway to obtain multiple second performance values; sequentially adding each first performance value to each second performance value to obtain multiple third performance values; obtaining multiple third performance values in each preset period; determining the maximum third performance value in each preset period to obtain multiple candidate transmission performance values; determining whether there is a candidate transmission performance value greater than the maximum transmission performance value; if there is a candidate transmission performance value greater than the maximum transmission performance value, determining the candidate transmission performance value greater than the maximum transmission performance value as the updated maximum transmission performance value, and determining the connection path where the updated maximum transmission performance value is located as the updated preset connection path.
[0013] Optionally, after determining the initial gateway corresponding to the maximum transmission performance value among multiple third performance values as the target gateway, the method further includes: obtaining the transmission performance value between the client and the target gateway to obtain the target transmission performance value, and determining whether the target transmission performance value is greater than or equal to the maximum transmission performance value among multiple third performance values; if the target transmission performance value is greater than or equal to the maximum transmission performance value among multiple third performance values, connecting the client to the target gateway, receiving access information through the target gateway, and sending the access information to the server; if the target transmission performance value is less than the maximum transmission performance value among multiple third performance values, performing the steps of connecting the client to the target gateway, receiving access information through the target gateway, and sending the access information to the server.
[0014] According to another aspect of this application, a server access apparatus is provided. The apparatus includes: a first acquisition unit, configured to acquire access information sent by a client received by a target initial gateway, and parse the access information to obtain the destination IP address of the access information, wherein the target initial gateway is any initial gateway among a plurality of initial gateways, and there is a connection relationship between the plurality of initial gateways; a first determination unit, configured to determine, from the plurality of initial gateways, the initial gateway to which the server is connected with the destination IP address, thereby obtaining the destination gateway; a second determination unit, configured to sequentially determine the information transmission performance value between the client and each initial gateway to obtain a plurality of first performance values, sequentially determine the information transmission performance value between each initial gateway and the destination gateway to obtain a plurality of second performance values, sequentially add each first performance value to each second performance value to obtain a plurality of third performance values, and determine the initial gateway corresponding to the largest transmission performance value among the plurality of third performance values as the target gateway; and a first connection unit, configured to connect the client to the target gateway, receive the access information through the target gateway, and send the access information to the server.
[0015] According to another aspect of the present invention, a computer storage medium is also provided for storing a program, wherein the program, when running, controls the device where the computer storage medium is located to execute a server access method.
[0016] According to another aspect of the present invention, an electronic device is also provided, comprising one or more processors and a memory; the memory stores computer-readable instructions, and the processor is configured to execute the computer-readable instructions, wherein the computer-readable instructions execute a server access method when executed.
[0017] This application employs the following steps: First, it obtains access information sent by the client from the target initial gateway and parses the access information to obtain the destination IP address. The target initial gateway can be any initial gateway from a plurality of initial gateways, and all initial gateways are interconnected. Second, it determines the initial gateway to which the server connected has the IP address matching the destination IP address, thus obtaining the destination gateway. Third, it sequentially determines the information transmission performance value between the client and each initial gateway, obtaining multiple first performance values. Finally, it sequentially determines the information transmission performance value between each initial gateway and the destination gateway, obtaining multiple second performance values. Each first performance value is then added to each second performance value to obtain multiple third performance values. The initial gateway corresponding to the highest transmission performance value among the multiple third performance values is determined as the target gateway. Finally, it connects the client to the target gateway, receives the access information through the target gateway, and sends the access information to the server. This solves the problem in related technologies where methods determining the user's gateway and access path based on distance cannot guarantee access efficiency. By randomly assigning a gateway to each user and determining the gateway the user needs to connect to based on the address of the server the user wants to access, the optimal access route can be determined based on the transmission performance between each gateway and the server. The user then connects to the gateway in the optimal access route, thereby improving the efficiency of the user's access to the server. Attached Figure Description
[0018] The accompanying drawings, which form part of this application, are used to provide a further understanding of this application. The illustrative embodiments and descriptions of this application are used to explain this application and do not constitute an undue limitation of this application. In the drawings:
[0019] Figure 1 This is a flowchart of a server access method provided according to an embodiment of this application;
[0020] Figure 2 This is a schematic diagram illustrating the optional gateway and server connection relationship provided according to an embodiment of this application;
[0021] Figure 3 This is a schematic diagram of a server access device provided according to an embodiment of this application;
[0022] Figure 4 This is a schematic diagram of an electronic device provided according to an embodiment of this application. Detailed Implementation
[0023] It should be noted that, unless otherwise specified, the embodiments and features described in this application can be combined with each other. This application will now be described in detail with reference to the accompanying drawings and embodiments.
[0024] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the scope of protection of the present application.
[0025] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate for the embodiments of this application described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0026] It should be noted that all information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for display, data used for analysis, etc.) involved in this disclosure are information and data authorized by the user or fully authorized by all parties. For example, this system has an interface with relevant users or organizations. Before obtaining relevant information, it is necessary to send an acquisition request to the aforementioned user or organization through the interface, and obtain the relevant information after receiving consent information from the aforementioned user or organization.
[0027] According to an embodiment of this application, a server access method is provided.
[0028] Figure 1 This is a flowchart of a server access method provided according to an embodiment of this application. For example... Figure 1 As shown, the method includes the following steps:
[0029] Step S101: Obtain the access information sent by the client received by the target initial gateway, and parse the access information to obtain the destination IP of the access information. The target initial gateway is any initial gateway among multiple initial gateways, and there is a connection relationship between the multiple initial gateways.
[0030] It should be noted that multiple gateways can be pre-configured, each connecting to one or more servers. These gateways can form a consortium and periodically perform availability checks to determine the transmission performance between them. Each gateway in the consortium possesses the remote access service addresses of all member gateways in the consortium.
[0031] Specifically, the access information sent by the client can be received through any target initial gateway in the alliance, and the access information can be parsed to determine the information of the client that sent the access information and the destination IP of the server that the access information wants to access.
[0032] Step S102: Determine the initial gateway from multiple initial gateways whose IP address is the destination IP address of the server to which it connects, and obtain the destination gateway.
[0033] Specifically, after determining the destination IP, the IP address that is the same as the destination IP can be determined from the IP addresses of the servers connected to each initial gateway in the alliance. This allows us to determine the initial gateway corresponding to the server that the client wants to access, thus obtaining the destination gateway.
[0034] Step S103: Sequentially determine the information transmission performance value between the client and each initial gateway to obtain multiple first performance values; sequentially determine the information transmission performance value between each initial gateway and the destination gateway to obtain multiple second performance values; sequentially add each first performance value to each second performance value to obtain multiple third performance values; and determine the initial gateway corresponding to the maximum transmission performance value among the multiple third performance values as the target gateway.
[0035] Specifically, when determining the optimal performance link between the client and the target gateway, we can first determine the information transmission performance value between the client and each initial gateway to obtain multiple first performance values. Then, within the alliance of gateways, we determine the performance value of each path between each initial gateway and the destination gateway to obtain multiple second performance values. Finally, we add each first performance value and each second performance value together to obtain the third performance value of multiple links from the client to the destination gateway.
[0036] Furthermore, after obtaining multiple third performance values, the maximum transmission performance value can be determined from these values, and the initial gateway corresponding to the maximum transmission performance value can be determined as the target gateway.
[0037] It should be noted that when determining the transmission performance of each link between the client and the destination gateway, the transmission performance can also be determined by performing multiple data transmissions on each link and statistically analyzing the information return rate. For example, if the client sends 10 messages to the destination gateway through link A and receives feedback messages from the destination gateway through that link, the number of feedback messages can be counted. If the number of feedback messages is 5, the transmission performance of link A is 0.5. This allows for the determination of the transmission performance of multiple links and comparison of their performance.
[0038] Step S104: Connect the client to the target gateway, receive access information through the target gateway, and send the access information to the server.
[0039] Specifically, after determining the target gateway and the maximum transmission performance value, the client can connect to the target gateway. After the connection is established, the client sends subsequent access information to the target gateway and then sends the access information to the server via the transmission path corresponding to the maximum transmission performance value.
[0040] For example, Figure 2 This is a schematic diagram illustrating the optional gateway and server connection relationship provided according to an embodiment of this application, such as... Figure 2 As shown, when a client accesses server 1, there are two available access paths: one is for the client to access server 1 through gateway 1, and the other is for the client to access server 1 through the path of gateway 2-gateway 1-server 1. At this time, the transmission performance values of the two access paths can be determined, and the transmission path with the higher performance value can be selected to access server 1.
[0041] The server access method provided in this application embodiment obtains access information sent by a client to a target initial gateway, parses the access information to obtain the destination IP of the access information, wherein the target initial gateway is any initial gateway among multiple initial gateways, and there are connections between multiple initial gateways; the initial gateway to which the server is connected is determined from the multiple initial gateways, thus obtaining the destination gateway; the information transmission performance value between the client and each initial gateway is determined sequentially, resulting in multiple first performance values; the information transmission performance value between each initial gateway and the destination gateway is determined sequentially, resulting in multiple second performance values; each first performance value is added to each second performance value sequentially, resulting in multiple third performance values; and the initial gateway corresponding to the largest transmission performance value among the multiple third performance values is determined as the target gateway; the client is connected to the target gateway, the access information is received through the target gateway, and the access information is sent to the server. This solves the problem in related technologies where the method of determining the gateway used by the user and the access path based on distance cannot guarantee access efficiency. By randomly assigning a gateway to each user and determining the gateway the user needs to connect to based on the address of the server the user wants to access, the optimal access route can be determined based on the transmission performance between each gateway and the server. The user then connects to the gateway in the optimal access route, thereby improving the efficiency of the user's access to the server.
[0042] Optionally, in the server access method provided in this application embodiment, determining the information transmission performance value between each initial gateway and the destination gateway sequentially includes: obtaining the information transmission delay value and packet loss rate between the initial gateway and the destination gateway; obtaining the weight values of the transmission delay value and the packet loss rate respectively to obtain a first weight value and a second weight value; and weighting and summing the transmission delay value and the packet loss rate using the first weight value and the second weight value to obtain the information transmission performance value between the initial gateway and the destination gateway.
[0043] Specifically, when calculating transmission performance values, the information transmission delay and packet loss rate between any two gateways can be determined, and the corresponding levels for the transmission delay and packet loss rates can be established. For example, if the packet loss rate is 20%, the level is level 4. After determining the levels, the transmission performance value between any two gateways is determined by weighted summation of the delay and packet loss rate levels and their respective weights.
[0044] It should be noted that when calculating the transmission performance value of a link, the average transmission performance value of the links can be taken as the transmission performance value of that link. For example, if the transmission performance value between gateway A and gateway B is 10, and the transmission performance value between gateway B and gateway C is 100, then the transmission performance value of the link A-B-C can be 55.
[0045] Optionally, in the server access method provided in this application embodiment, after parsing the access information and obtaining the destination IP of the access information, the method further includes: determining whether there is a preset connection path in the database that is associated with both the destination IP and the client, wherein the preset connection path includes at least one initial gateway; if the preset connection path exists, sending the access information to the server according to the preset connection path; if the preset connection path does not exist, performing the step of determining the initial gateway connected to the server whose IP address is the destination IP from multiple initial gateways to obtain the destination gateway.
[0046] Specifically, after obtaining the destination IP and client information through access information, it can first determine from the database whether there is a preset connection path between the client and the destination IP. If a preset connection path exists, the client can directly access the server through the preset connection path, thus eliminating the need to re-determine the path.
[0047] Optionally, in the server access method provided in this application embodiment, after determining whether a preset connection path exists in the database that is commonly associated with the destination IP and the client, the method further includes: if a preset connection path exists, performing the following steps according to a preset period: sequentially determining the information transmission performance value between the client and each initial gateway to obtain multiple first performance values; sequentially determining the information transmission performance value between each initial gateway and the destination gateway to obtain multiple second performance values; sequentially adding each first performance value to each second performance value to obtain multiple third performance values; obtaining multiple third performance values in each preset period; determining the maximum third performance value in each preset period to obtain multiple candidate transmission performance values; determining whether there is a candidate transmission performance value greater than the maximum transmission performance value; if there is a candidate transmission performance value greater than the maximum transmission performance value, determining the candidate transmission performance value greater than the maximum transmission performance value as the updated maximum transmission performance value, and determining the connection path where the updated maximum transmission performance value is located as the updated preset connection path.
[0048] Specifically, when a preset connected path exists, the transmission performance value of each connected path in each group of connected paths needs to be calculated according to a preset period to obtain multiple candidate transmission performance values. Each candidate transmission performance value is the maximum transmission performance value in each period. It is then determined whether there is a candidate transmission performance value greater than the maximum transmission performance value among the multiple candidate transmission performance values. If there is a candidate transmission performance value greater than the maximum transmission performance value, it indicates that the preset connected path is no longer the optimal connected path. In this case, the preset connected path needs to be adjusted, and the transmission path corresponding to the maximum transmission performance value among the multiple candidate transmission performance values is determined as the new preset connected path, thereby completing the update of the preset connected path.
[0049] Optionally, in the server access method provided in this application embodiment, determining the information transmission performance value between each initial gateway and the destination gateway sequentially includes: obtaining multiple connection paths between each initial gateway and the destination gateway to obtain multiple sets of connection paths, wherein the initial gateways at the starting points of multiple connection paths in each set of connection paths are the same; calculating the transmission performance value of each connection path in each set of connection paths to obtain multiple second performance values.
[0050] Specifically, when determining the information transmission performance value between each initial gateway and the destination gateway and obtaining multiple transmission performance values, multiple connected paths between each initial gateway and the destination gateway can be determined, resulting in multiple sets of transmission performance values for the connected paths. The calculation method can be as follows: obtain the transmission performance value between every two connected gateways in the connected path, obtain multiple transmission performance values, calculate the average of the multiple transmission performance values, and determine the average value as the transmission performance value of the connected path. This allows for the comparison of the transmission performance values of multiple connected paths, and the calculation and comparison results are not affected by the different orders of magnitude of the transmission performance values due to the length of the path.
[0051] Optionally, in the server access method provided in this application embodiment, after calculating the transmission performance value of each connected path in each group of connected paths to obtain multiple second performance values, the method further includes: detecting whether there are abnormal connected paths in the multiple connected paths according to a preset period; if there are abnormal connected paths in the multiple connected paths, determining the abnormal initial gateway in the abnormal connected path, deleting the abnormal initial gateway, regenerating multiple connected paths according to the remaining initial gateways, and performing the step of calculating the transmission performance value of each connected path in each group of connected paths to obtain multiple second performance values.
[0052] Specifically, after obtaining multiple connectivity paths, it is necessary to periodically determine whether there are any abnormal connectivity paths. That is, to determine whether there are any abnormal gateways or whether data transmission between two gateways is not possible. In this case, the abnormal gateways need to be removed from the alliance so that they can be excluded when determining the path again in the future, thus ensuring the usability of the path.
[0053] Optionally, in the server access method provided in this application embodiment, after determining the initial gateway corresponding to the maximum transmission performance value among multiple third performance values as the target gateway, the method further includes: obtaining the transmission performance value between the client and the destination gateway to obtain the target transmission performance value, and determining whether the target transmission performance value is greater than or equal to the maximum transmission performance value among multiple third performance values; if the target transmission performance value is greater than or equal to the maximum transmission performance value among multiple third performance values, connecting the client to the destination gateway, receiving access information through the destination gateway, and sending the access information to the server; if the target transmission performance value is less than the maximum transmission performance value among multiple third performance values, performing the step of connecting the client to the target gateway, receiving access information through the target gateway, and sending the access information to the server.
[0054] Specifically, after determining the target gateway, we can first determine whether the client can connect directly to the target gateway. If the client cannot connect to the target gateway, we can connect the client to the target gateway through the connection path corresponding to the maximum transmission performance value among multiple third performance values. If the client can connect to the target gateway, we can first determine the transmission performance value between the client and the target gateway. If this performance value is greater than the maximum transmission performance value, the client can directly connect to the target gateway. However, if there are many clients connected to the target gateway, new clients will not be able to connect to the target gateway and can only transmit data through the connection path corresponding to the maximum transmission performance.
[0055] It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and although a logical order is shown in the flowchart, in some cases the steps shown or described may be executed in a different order than that shown here.
[0056] This application also provides a server access device. It should be noted that the server access device of this application can be used to execute the server access method provided in this application. The server access device provided in this application is described below.
[0057] Figure 3 This is a schematic diagram of a server access device provided according to an embodiment of this application. For example... Figure 3 As shown, the device includes: a first acquisition unit 31, a first determination unit 32, a second determination unit 33, and a first connection unit 34.
[0058] The first acquisition unit 31 is used to acquire access information sent by the client received by the target initial gateway, and parse the access information to obtain the destination IP of the access information. The target initial gateway is any initial gateway among multiple initial gateways, and there is a connection relationship between the multiple initial gateways.
[0059] It should be noted that multiple gateways can be pre-configured, each connecting to one or more servers. These gateways can form a consortium and periodically perform availability checks to determine the transmission performance between them. Each gateway in the consortium possesses the remote access service addresses of all member gateways in the consortium.
[0060] Specifically, the access information sent by the client can be received through any target initial gateway in the alliance, and the access information can be parsed to determine the information of the client that sent the access information and the destination IP of the server that the access information wants to access.
[0061] The first determining unit 32 is used to determine the initial gateway for the server connection whose IP address is the destination IP from multiple initial gateways, and obtain the destination gateway.
[0062] Specifically, after determining the destination IP, the IP address that is the same as the destination IP can be determined from the IP addresses of the servers connected to each initial gateway in the alliance. This allows us to determine the initial gateway corresponding to the server that the client wants to access, thus obtaining the destination gateway.
[0063] The second determining unit 33 is used to sequentially determine the information transmission performance value between the client and each initial gateway to obtain multiple first performance values, sequentially determine the information transmission performance value between each initial gateway and the destination gateway to obtain multiple second performance values, sequentially add each first performance value to each second performance value to obtain multiple third performance values, and determine the initial gateway corresponding to the maximum transmission performance value among the multiple third performance values as the target gateway.
[0064] Specifically, when determining the optimal performance link between the client and the target gateway, we can first determine the information transmission performance value between the client and each initial gateway to obtain multiple first performance values. Then, within the alliance of gateways, we determine the performance value of each path between each initial gateway and the destination gateway to obtain multiple second performance values. Finally, we add each first performance value and each second performance value together to obtain the third performance value of multiple links from the client to the destination gateway.
[0065] Furthermore, after obtaining multiple third performance values, the maximum transmission performance value can be determined from these values, and the initial gateway corresponding to the maximum transmission performance value can be determined as the target gateway.
[0066] It should be noted that when determining the transmission performance of each link between the client and the destination gateway, the transmission performance can also be determined by performing multiple data transmissions on each link and statistically analyzing the information return rate. For example, if the client sends 10 messages to the destination gateway through link A and receives feedback messages from the destination gateway through that link, the number of feedback messages can be counted. If the number of feedback messages is 5, the transmission performance of link A is 0.5. This allows for the determination of the transmission performance of multiple links and comparison of their performance.
[0067] The first connection unit 34 is used to connect the client to the target gateway, receive access information through the target gateway, and send the access information to the server.
[0068] Specifically, after determining the target gateway and the maximum transmission performance value, the client can connect to the target gateway. After the connection is established, the client sends subsequent access information to the target gateway and then sends the access information to the server via the transmission path corresponding to the maximum transmission performance value.
[0069] For example, Figure 2 This is a schematic diagram illustrating the optional gateway and server connection relationship provided according to an embodiment of this application, such as... Figure 2 As shown, when a client accesses server 1, there are two available access paths: one is for the client to access server 1 through gateway 1, and the other is for the client to access server 1 through the path of gateway 2-gateway 1-server 1. At this time, the transmission performance values of the two access paths can be determined, and the transmission path with the higher performance value can be selected to access server 1.
[0070] The server access device provided in this application embodiment acquires access information sent by a client received by a target initial gateway through a first acquisition unit 31, and parses the access information to obtain the destination IP of the access information. The target initial gateway is any initial gateway among multiple initial gateways, and there are connections between the multiple initial gateways. A first determination unit 32 determines the initial gateway connected to the server whose IP address is the destination IP from among the multiple initial gateways, thus obtaining the destination gateway. A second determination unit 33 sequentially determines the information transmission performance value between the client and each initial gateway, obtaining multiple first performance values; sequentially determines the information transmission performance value between each initial gateway and the destination gateway, obtaining multiple second performance values; and sequentially adds each first performance value to each second performance value to obtain multiple third performance values. The initial gateway corresponding to the largest transmission performance value among the multiple third performance values is determined as the target gateway. A first connection unit 34 connects the client to the target gateway, receives the access information through the target gateway, and sends the access information to the server. This solves the problem in related technologies where methods for determining the user's gateway and access path based on distance cannot guarantee access efficiency. By randomly assigning a gateway to each user and determining the gateway the user needs to connect to based on the address of the server the user wants to access, the optimal access route can be determined based on the transmission performance between each gateway and the server. The user then connects to the gateway in the optimal access route, thereby improving the efficiency of the user's access to the server.
[0071] Optionally, in the server access device provided in this application embodiment, the second determining unit 33 includes: a first obtaining module, used to obtain the information transmission delay value and packet loss rate between the initial gateway and the destination gateway; a second obtaining module, used to obtain the weight values of the transmission delay value and the packet loss rate respectively, to obtain a first weight value and a second weight value; and a first calculating module, used to perform a weighted summation of the transmission delay value and the packet loss rate using the first weight value and the second weight value to obtain the information transmission performance value between the initial gateway and the destination gateway.
[0072] Specifically, when calculating transmission performance values, the information transmission delay and packet loss rate between any two gateways can be determined, and the corresponding levels for the transmission delay and packet loss rates can be established. For example, if the packet loss rate is 20%, the level is level 4. After determining the levels, the transmission performance value between any two gateways is determined by weighted summation of the delay and packet loss rate levels and their respective weights.
[0073] It should be noted that when calculating the transmission performance value of a link, the average transmission performance value of the links can be taken as the transmission performance value of that link. For example, if the transmission performance value between gateway A and gateway B is 10, and the transmission performance value between gateway B and gateway C is 100, then the transmission performance value of the link A-B-C can be 55.
[0074] Optionally, in the server access device provided in the embodiments of this application, the device further includes: a first determining unit, used to determine whether there is a preset connection path in the database that is associated with both the destination IP and the client, wherein the preset connection path includes at least one initial gateway; a sending unit, used to send access information to the server according to the preset connection path if the preset connection path exists; and a first executing unit, used to execute the step of determining the initial gateway of the server connection whose IP address is the destination IP from multiple initial gateways and obtaining the destination gateway if the preset connection path does not exist.
[0075] Specifically, after obtaining the destination IP and client information through access information, it can first determine from the database whether there is a preset connection path between the client and the destination IP. If a preset connection path exists, the client can directly access the server through the preset connection path, thus eliminating the need to re-determine the path.
[0076] Optionally, in the server access device provided in the embodiments of this application, the device further includes: a second execution unit, configured to, in the presence of a preset connection path, execute according to a preset cycle the steps of sequentially determining the information transmission performance value between the client and each initial gateway to obtain a plurality of first performance values, sequentially determining the information transmission performance value between each initial gateway and the destination gateway to obtain a plurality of second performance values, sequentially adding each first performance value to each second performance value to obtain a plurality of third performance values, obtaining a plurality of third performance values in each preset cycle, and determining the maximum third performance value in each preset cycle to obtain a plurality of candidate transmission performance values; a second judgment unit, configured to determine whether there is a candidate transmission performance value greater than the maximum transmission performance value; and a third determination unit, configured to, in the presence of a candidate transmission performance value greater than the maximum transmission performance value, determine the candidate transmission performance value greater than the maximum transmission performance value as the updated maximum transmission performance value, and determine the connection path where the updated maximum transmission performance value is located as the updated preset connection path.
[0077] Specifically, when a preset connected path exists, the transmission performance value of each connected path in each group of connected paths needs to be calculated according to a preset period to obtain multiple candidate transmission performance values. Each candidate transmission performance value is the maximum transmission performance value in each period. It is then determined whether there is a candidate transmission performance value greater than the maximum transmission performance value among the multiple candidate transmission performance values. If there is a candidate transmission performance value greater than the maximum transmission performance value, it indicates that the preset connected path is no longer the optimal connected path. In this case, the preset connected path needs to be adjusted, and the transmission path corresponding to the maximum transmission performance value among the multiple candidate transmission performance values is determined as the new preset connected path, thereby completing the update of the preset connected path.
[0078] Optionally, in the server access device provided in the embodiments of this application, the second determining unit 33 includes: a third obtaining module, used to obtain multiple connection paths between each initial gateway and the destination gateway to obtain multiple sets of connection paths, wherein the initial gateways of the multiple connection paths in each set of connection paths are the same; and a second calculating module, used to calculate the transmission performance value of each connection path in each set of connection paths to obtain multiple second performance values.
[0079] Specifically, when determining the information transmission performance value between each initial gateway and the destination gateway and obtaining multiple transmission performance values, multiple connected paths between each initial gateway and the destination gateway can be determined, resulting in multiple sets of transmission performance values for the connected paths. The calculation method can be as follows: obtain the transmission performance value between every two connected gateways in the connected path, obtain multiple transmission performance values, calculate the average of the multiple transmission performance values, and determine the average value as the transmission performance value of the connected path. This allows for the comparison of the transmission performance values of multiple connected paths, and the calculation and comparison results are not affected by the different orders of magnitude of the transmission performance values due to the length of the path.
[0080] Optionally, in the server access device provided in the embodiments of this application, the device further includes: a detection unit, configured to detect whether there is an abnormal connection path among multiple connection paths according to a preset period; and a deletion unit, configured to, when there is an abnormal connection path among multiple connection paths, determine the abnormal initial gateway in the abnormal connection path, delete the abnormal initial gateway, regenerate multiple connection paths according to the remaining initial gateways, and perform the step of calculating the transmission performance value of each connection path in each group of connection paths to obtain multiple second performance values.
[0081] Specifically, after obtaining multiple connectivity paths, it is necessary to periodically determine whether there are any abnormal connectivity paths. That is, to determine whether there are any abnormal gateways or whether data transmission between two gateways is not possible. In this case, the abnormal gateways need to be removed from the alliance so that they can be excluded when determining the path again in the future, thus ensuring the usability of the path.
[0082] Optionally, in the server access device provided in the embodiments of this application, the device further includes: a second acquisition unit, configured to acquire the transmission performance value between the client and the destination gateway, obtain a target transmission performance value, and determine whether the target transmission performance value is greater than or equal to the maximum transmission performance value among a plurality of third performance values; a second connection unit, configured to connect the client to the destination gateway, receive access information through the destination gateway, and send the access information to the server when the target transmission performance value is greater than or equal to the maximum transmission performance value among a plurality of third performance values; and a third execution unit, configured to execute the steps of connecting the client to the target gateway, receiving access information through the target gateway, and sending the access information to the server when the target transmission performance value is less than the maximum transmission performance value among a plurality of third performance values.
[0083] Specifically, after determining the target gateway, we can first determine whether the client can connect directly to the target gateway. If the client cannot connect to the target gateway, we can connect the client to the target gateway through the connection path corresponding to the maximum transmission performance value among multiple third performance values. If the client can connect to the target gateway, we can first determine the transmission performance value between the client and the target gateway. If this performance value is greater than the maximum transmission performance value, the client can directly connect to the target gateway. However, if there are many clients connected to the target gateway, new clients will not be able to connect to the target gateway and can only transmit data through the connection path corresponding to the maximum transmission performance.
[0084] The aforementioned server access device includes a processor and a memory. The first acquisition unit 31, the first determination unit 32, the second determination unit 33, the first connection unit 34, etc., are all stored in the memory as program units. The processor executes the aforementioned program units stored in the memory to realize the corresponding functions.
[0085] The processor contains a kernel, which retrieves the corresponding program units from memory. One or more kernels can be configured, and adjusting kernel parameters can address the issue that methods using distance to determine the user's gateway and access path in related technologies cannot guarantee access efficiency.
[0086] The memory may include non-permanent memory in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM, and the memory includes at least one memory chip.
[0087] This invention provides a computer-readable storage medium storing a program thereon, which, when executed by a processor, implements the server access method.
[0088] This invention provides a processor for running a program, wherein the program executes the server access method during runtime.
[0089] like Figure 4As shown, this embodiment of the invention provides an electronic device 40, which includes a processor, a memory, and a program stored in the memory and executable on the processor. When the processor executes the program, it performs the following steps: acquiring access information sent by a client and parsing the access information to obtain the destination IP address, wherein the target initial gateway is any initial gateway among multiple initial gateways, and there are connections between the multiple initial gateways; determining the initial gateway connected to the server whose IP address is the destination IP address from among the multiple initial gateways, thus obtaining the destination gateway; sequentially determining the information transmission performance value between the client and each initial gateway to obtain multiple first performance values; sequentially determining the information transmission performance value between each initial gateway and the destination gateway to obtain multiple second performance values; sequentially adding each first performance value to each second performance value to obtain multiple third performance values; and determining the initial gateway corresponding to the largest transmission performance value among the multiple third performance values as the target gateway; connecting the client to the target gateway, receiving the access information through the target gateway, and sending the access information to the server. The device in this document can be a server, PC, PAD, mobile phone, etc.
[0090] This application also provides a computer program product, which, when executed on a data processing device, is suitable for executing an initialization program with the following method steps: obtaining access information sent by a client received by a target initial gateway, parsing the access information to obtain the destination IP of the access information, wherein the target initial gateway is any initial gateway among multiple initial gateways, and there are connections between the multiple initial gateways; determining the initial gateway connected to the server whose IP address is the destination IP from among the multiple initial gateways, thus obtaining the destination gateway; sequentially determining the information transmission performance value between the client and each initial gateway to obtain multiple first performance values, sequentially determining the information transmission performance value between each initial gateway and the destination gateway to obtain multiple second performance values, sequentially adding each first performance value to each second performance value to obtain multiple third performance values, and determining the initial gateway corresponding to the largest transmission performance value among the multiple third performance values as the target gateway; connecting the client to the target gateway, receiving access information through the target gateway, and sending the access information to the server.
[0091] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0092] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0093] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0094] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0095] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0096] Memory may include non-persistent memory in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.
[0097] Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can store information using any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.
[0098] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.
[0099] The above are merely embodiments of this application and are not intended to limit the scope of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of the claims of this application.
Claims
1. A server access method, characterized in that, include: The system obtains access information sent by a client to the target initial gateway, parses the access information, and obtains the destination IP of the access information. The target initial gateway is any initial gateway among multiple initial gateways, and there is a connection relationship between the multiple initial gateways. The destination IP is the IP address of the target server corresponding to the access information. The multiple initial gateways are used to form an alliance, and each initial gateway in the alliance has the remote access service address of all initial gateways in the alliance. The initial gateway to which the server connected is connected is determined from the plurality of initial gateways, and the destination gateway is obtained, wherein the IP address of the server connected to the destination gateway is the destination IP. The information transmission performance value between the client and each initial gateway is determined sequentially to obtain multiple first performance values. The information transmission performance value between each initial gateway and the destination gateway is determined sequentially to obtain multiple second performance values. Each first performance value is added to each second performance value to obtain multiple third performance values. The initial gateway corresponding to the maximum transmission performance value among the multiple third performance values is determined as the target gateway. The client connects to the target gateway, receives the access information through the target gateway, and sends the access information to the server; The information transmission performance values between each initial gateway and the destination gateway are determined sequentially, including: Multiple connection paths between each initial gateway and the destination gateway are obtained to obtain multiple sets of connection paths, wherein the initial gateways of multiple connection paths in each set of connection paths are the same. Calculate the transmission performance value of each connected path in each group of connected paths to obtain the plurality of second performance values; After determining the initial gateway corresponding to the largest transmission performance value among the plurality of third performance values as the target gateway, the method further includes: Obtain the transmission performance value between the client and the destination gateway to get the target transmission performance value, and determine whether the target transmission performance value is greater than or equal to the maximum transmission performance value among the plurality of third performance values; If the target transmission performance value is greater than or equal to the maximum transmission performance value among the plurality of third performance values, the client is connected to the destination gateway, the access information is received through the destination gateway, and the access information is sent to the server. If the target transmission performance value is less than the maximum transmission performance value among the plurality of third performance values, the steps of connecting the client to the target gateway, receiving the access information through the target gateway, and sending the access information to the server are performed.
2. The method according to claim 1, characterized in that, The information transmission performance values between each initial gateway and the destination gateway are determined sequentially, including: Obtain the information transmission delay value and packet loss rate between the initial gateway and the destination gateway; The weight values of the transmission delay value and the packet loss rate are obtained respectively to obtain the first weight value and the second weight value; The transmission delay value and the packet loss rate are weighted and summed using the first weight and the second weight to obtain the information transmission performance value between the initial gateway and the destination gateway.
3. The method according to claim 1, characterized in that, After calculating the transmission performance value of each connected path in each group of connected paths to obtain the plurality of second performance values, the method further includes: Detect whether there are abnormal connected paths among multiple connected paths according to a preset cycle; If an abnormal connected path exists among the multiple connected paths, the abnormal initial gateway in the abnormal connected path is determined, the abnormal initial gateway is deleted, and multiple connected paths are regenerated based on the remaining initial gateways. The step of calculating the transmission performance value of each connected path in each group of connected paths is then performed to obtain the multiple second performance values.
4. The method according to claim 1, characterized in that, After parsing the access information to obtain the destination IP address, the method further includes: Determine whether a preset connection path exists in the database that is associated with both the destination IP and the client, wherein the preset connection path includes at least one initial gateway; If the preset connection path exists, the access information is sent to the server according to the preset connection path; If the preset connection path does not exist, the step of determining the initial gateway from the plurality of initial gateways that the server with the IP address of the destination IP is connected to is executed to obtain the destination gateway.
5. The method according to claim 4, characterized in that, After determining whether a preset connection path exists in the database that is associated with both the destination IP and the client, the method further includes: In the case of the existence of the preset connection path, the following steps are performed according to the preset period: sequentially determining the information transmission performance value between the client and each initial gateway to obtain multiple first performance values; sequentially determining the information transmission performance value between each initial gateway and the destination gateway to obtain multiple second performance values; sequentially adding each first performance value to each second performance value to obtain multiple third performance values; obtaining multiple third performance values in each preset period; and determining the maximum third performance value in each preset period to obtain multiple candidate transmission performance values. Determine whether there is a candidate transmission performance value that is greater than the maximum transmission performance value; If there is a candidate transmission performance value that is greater than the maximum transmission performance value, the candidate transmission performance value that is greater than the maximum transmission performance value is determined as the updated maximum transmission performance value, and the connection path where the updated maximum transmission performance value is located is determined as the updated preset connection path.
6. A server access device, characterized in that, include: The first acquisition unit is used to acquire access information sent by a client received by the target initial gateway, and parse the access information to obtain the destination IP of the access information. The target initial gateway is any initial gateway among multiple initial gateways, and there is a connection relationship between the multiple initial gateways. The destination IP is the IP address of the target server corresponding to the access information. The multiple initial gateways are used to form an alliance, and each initial gateway in the alliance has the remote access service address of all initial gateways in the alliance. The first determining unit is configured to determine, from the plurality of initial gateways, the initial gateway to which the server connected has an IP address equal to the destination IP address, thereby obtaining the destination gateway, wherein the IP address of the server connected to the destination gateway is the destination IP address; The second determining unit is used to sequentially determine the information transmission performance value between the client and each initial gateway to obtain multiple first performance values, sequentially determine the information transmission performance value between each initial gateway and the destination gateway to obtain multiple second performance values, sequentially add each first performance value to each second performance value to obtain multiple third performance values, and determine the initial gateway corresponding to the maximum transmission performance value among the multiple third performance values as the target gateway. The first connection unit is used to connect the client to the target gateway, receive the access information through the target gateway, and send the access information to the server; The second determining unit includes: a third obtaining module, used to obtain multiple connected paths between each initial gateway and the destination gateway, to obtain multiple sets of connected paths, wherein the initial gateways of the multiple connected paths in each set of connected paths are the same; and a second calculating module, used to calculate the transmission performance value of each connected path in each set of connected paths, to obtain multiple second performance values. The second acquisition unit is used to acquire the transmission performance value between the client and the destination gateway, obtain the target transmission performance value, and determine whether the target transmission performance value is greater than or equal to the maximum transmission performance value among multiple third performance values; the second connection unit is used to connect the client to the destination gateway, receive access information through the destination gateway, and send the access information to the server when the target transmission performance value is greater than or equal to the maximum transmission performance value among multiple third performance values; the third execution unit is used to execute the steps of connecting the client to the target gateway, receiving access information through the target gateway, and sending the access information to the server when the target transmission performance value is less than the maximum transmission performance value among multiple third performance values.
7. A computer storage medium, characterized in that, The computer storage medium is used to store a program, wherein the program, when running, controls the device where the computer storage medium is located to execute the server access method according to any one of claims 1 to 5.
8. An electronic device, characterized in that, It includes one or more processors and a memory, the memory being used to store one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors cause the one or more processors to implement the server access method according to any one of claims 1 to 5.
Citation Information
Patent Citations
Gateway access method and device, computer equipment and storage medium
CN111935752A
System, Method and Software for Selecting Among Available Connections for Accessing Content from a Remote Server Using a Client Computing Device
US20090271352A1