Service calling method and device, electronic equipment and computer storage medium
By storing and utilizing the server's geographical location information in the service registration center and selecting the nearest server for service calls, the problem of large network delay of service calls is solved, and more efficient and stable service calls are achieved.
Patent Information
- Application Number
- CN202510520818.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-24
- Publication Date
- 2025-07-08
AI Technical Summary
During the existing service call process, the network delay is large, especially due to the large network delay caused by the geographical distance between the service caller and the service provider.
When the service registration center receives the registration request for the target service, the geographical location information of N servers is obtained and stored. After receiving the service call request, the second server closest to the first server is selected from the N-1 server based on these location information, and the traffic of the first server is scheduled to the second server.
By selecting the nearest server to make service calls, network latency is reduced and service call efficiency and stability is improved.
Smart Images

Figure CN120281811A_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of computer technology, and specifically relates to a service calling method, device, electronic device and computer storage medium. Background Art
[0002] Remote Procedure Call (RPC) is a technology that allows one computer program to call another computer program over a network. RPC generally requires a registration center to register and discover services. The service provider registers itself with the registration center, and the service caller finds the service to be called from the registration center and calls it.
[0003] In the related technology, the service call logic is a random call, that is, when the service caller initiates a service call request, there may be multiple servers that can provide the service. The registration center will randomly select one server from the multiple servers as the service provider. In this case, the service call may be delayed in the network because the service caller and the service provider are too far apart. Summary of the invention
[0004] The purpose of the embodiments of the present application is to provide a service calling method, device, electronic device and computer storage medium, which can solve the problem of large network delay in existing service calling.
[0005] In a first aspect, an embodiment of the present application provides a method, the method comprising:
[0006] When receiving a registration request for a target service, sending a location acquisition request to N servers corresponding to the target service, where N is an integer greater than 1;
[0007] Receiving N pieces of location information sent by the N servers, where the location information is used to indicate the geographic locations of corresponding servers;
[0008] Storing registration information of the target service, the registration information including the N location information;
[0009] receiving first information from a first server, the first information including a service call request and first location information, the first location information being used to indicate a geographic location of the first server, the service call request being used to request the target service, and the N servers including the first server;
[0010] Based on the first information and the registration information, determine a second server closest to the first server from N-1 servers, where the N-1 servers are other servers from the N servers excluding the first server;
[0011] Dispatch the traffic in the first server to the second server.
[0012] In a second aspect, an embodiment of the present application provides an apparatus, the apparatus includes:
[0013] A first sending module, configured to send a location acquisition request to N servers corresponding to the target service when receiving a registration request for the target service, where N is an integer greater than 1;
[0014] A first receiving module, configured to receive N location information sent by the N servers, where the location information is used to indicate the geographical location of the corresponding server;
[0015] A storage module, configured to store registration information of the target service, where the registration information includes the N location information;
[0016] A second receiving module, configured to receive first information from a first server, where the first information includes a service call request and first location information, the first location information is used to indicate the geographical location of the first server, the service call request is used to request the target service, and the N servers include the first server;
[0017] A determination module, configured to determine, based on the first information from the registration information, a second server that is the closest to the first server from N - 1 servers, where the N - 1 servers are the other servers among the N servers excluding the first server;
[0018] A scheduling module, configured to dispatch the traffic in the first server to the second server.
[0019] In a third aspect, an embodiment of the present application provides an electronic device, the electronic device includes a processor and a memory, the memory stores a program or instruction that can run on the processor, and when the program or instruction is executed by the processor, the steps of the service call method described in the first aspect are implemented.
[0020] In a fourth aspect, an embodiment of the present application provides a readable storage medium, where a program or instruction is stored on the readable storage medium, and when the program or instruction is executed by a processor, the steps of the service call method described in the first aspect are implemented.
[0021] In a fifth aspect, a computer program product is provided, including computer instructions, and when the computer instructions are executed by a processor, the steps of the service call method described in the first aspect are implemented.
[0022] In the embodiments of the present application, after the registration of the target service is completed, the registration information stored in the service registration center includes the N location information of N servers that can provide the target service. Receive the first information sent by the first server, and based on the first information and the registration information, select the second server closest to the first server from the N - 1 servers, and schedule the traffic of the first server to the second server. Through the method of the embodiments of the present application, since the called second server is the one closest to the first server among the N - 1 servers, the distance between the called server and the first server can be minimized as much as possible, thereby reducing the network latency of service calls. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] Figure 1 It is a schematic flow chart of the service call method provided by the embodiments of the present application;
[0024] Figure 2 It is a schematic diagram of the network architecture applied to the service call method of the embodiments of the present application;
[0025] Figure 3 It is a schematic diagram of the structure of the service call device provided by the embodiments of the present application;
[0026] Figure 4 It is a schematic diagram of the structure of the electronic device provided by the embodiments of the present application. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0027] Next, the technical solutions in the embodiments of the present application will be clearly described in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are some, but not all, of the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art belong to the scope of protection of the present application.
[0028] The terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, rather than to describe a specific order or sequence. It should be understood that such data can be interchanged under appropriate circumstances so that the embodiments of the present application can be implemented in an order other than those illustrated or described herein, and the objects distinguished by "first", "second", etc. generally belong to the same category, and the number of objects is not limited. For example, the first object can be one or more. In addition, "and / or" in the specification and claims means at least one of the connected objects, and the character " / " generally represents an "or" relationship between the associated objects before and after.
[0029] Next, the service call method provided by the embodiments of the present application will be described in detail in conjunction with the accompanying drawings, through specific embodiments and their application scenarios.
[0030] Figure 1It is a schematic flowchart of the service call method according to an embodiment of the present application. Figure 2 It is a schematic diagram of the network architecture applied to the service call method according to an embodiment of the present application.
[0031] The execution subject of the service call method provided by the embodiment of the present application can be a service registry. The service registry is mainly used for service discovery and configuration management. In the Figure 2 illustrated embodiment, the functions of the service registry can be implemented by Nacos.
[0032] As Figure 1 illustrated, the embodiment of the present application provides a service call method, including the following steps:
[0033] Step 101, when receiving a registration request for a target service, send a location acquisition request to N servers corresponding to the target service, where N is an integer greater than 1.
[0034] Step 102, receive N location information sent by the N servers, where the location information is used to indicate the geographical location of the corresponding server.
[0035] Step 103, store the registration information of the target service, where the registration information includes the N location information.
[0036] Step 104, receive first information from a first server, where the first information includes a service call request and first location information. The first location information is used to indicate the geographical location of the first server, and the service call request is used to request the target service. The N servers include the first server.
[0037] Step 105, based on the first information and the registration information, determine a second server closest to the first server from N - 1 servers, where the N - 1 servers are the other servers among the N servers excluding the first server.
[0038] Step 106, schedule the traffic in the first server to the second server.
[0039] In steps 101 to 103, during the registration process of the target service in the service registry, the N location information of the N servers that can provide the target service is stored in the registration information, realizing the association between the target service and the N location information. In the subsequent service call process, the stored location information can be directly obtained from the service registry without sending a location acquisition request to the servers that can provide the target service again, which can improve the efficiency of service call.
[0040] In an optional embodiment, the location information may include a first tag and a second tag, which are respectively used to indicate the area where the server is located and the computer room where the server is located. For example, the first tag may be a region tag "region=cnhb1", which is used to indicate that the server is located in the first region; the second tag may be an az tag "zone=iqiyi-cnhb1-az4", which is used to indicate that the server is located in the fourth computer room in the first region.
[0041] In step 104, the first server (such as Figure 2 the Consumer shown) is the service call requester. The first server sends a service call request to the service registry to find a service provider (such as Figure 2 the Provider shown) to replace the first server to process traffic and provide services, so as to realize service calls between different servers.
[0042] In step 105, based on the stored registration information, the service registry can know the geographical locations of all servers that can provide the target service, and then combined with the geographical location of the first server indicated by the first information, it can determine the second server closest to the first server from the N-1 servers.
[0043] It should be noted that in the case where N is 2, it means that except for the first server, there is only one server that can provide the target service. Then this unique server is the second server closest to the first server. In the case where N is greater than 2, the second server closest to the first server is determined from the N-1 servers. It can be understood that, under other unchanged conditions, the farther the server as the service provider is from the first server, the higher the network latency. On the contrary, the closer the distance, the lower the network latency.
[0044] Regarding step 106, the traffic scheduling process is described as follows in combination with Figure 2 :
[0045] The service registry passes through the first server (such as Figure 2The software development kit (SDK) of the Consumer pulls the traffic governance configuration information of the target service provided by the first server (i.e., the routing information of the traffic, which is used to indicate the traffic scheduling rules, such as including the location information of the server processing the traffic). After determining the second server, the service registry modifies the traffic governance configuration information (i.e., generates new routing information for the traffic, and modifies the location information of the server processing the traffic from the location information of the first server to the location information of the second server), and distributes the modified traffic governance configuration information to the SDK of the first server. The rules corresponding to the new routing information of the traffic take effect (the first server executes the rules corresponding to the new routing information of the traffic), and the Provider (the second server) is called to process the traffic originally processed by the first server. Optionally, the routing information of the traffic may further include the source address information of the traffic, the service quality requirement information, etc.
[0046] In the service call method provided in the embodiments of the present application, after the registration of the target service is completed, the registration information stored in the service registry includes the N location information of N servers capable of providing the target service. Receive the first information sent by the first server, and based on the first information and the registration information, select the second server closest to the first server from the N - 1 servers, and schedule the traffic of the first server to the second server. Through the method of the embodiments of the present application, since the called second server is the one closest to the first server among the N - 1 servers, the distance between the called server and the first server can be minimized as much as possible, thereby reducing the network latency of the service call.
[0047] Optionally, step 105 includes:
[0048] In the case where there is a second location information identical to the first location information among the N - 1 location information, determine the server corresponding to the second location information as the second server, where the N - 1 location information is the location information corresponding to each of the N - 1 servers;
[0049] In the case where the second location information does not exist among the N - 1 location information, determine the server corresponding to the third location information as the second server, where the third location information is the location information among the N location information that indicates the geographical location closest to the geographical location of the first server.
[0050] The above embodiments are illustrated by the following examples:
[0051] For example, the first location information is "region=cnhb1, zone=iqiyi-cnhb1-az4". When there is a second location information "region=cnhb1, zone=iqiyi-cnhb1-az4" among the N-1 location information, it indicates that there is a server among the N-1 servers that is in the same region and the same computer room as the first server. At this time, the server corresponding to the second location information is determined as the second server; when there is no second location information among the N-1 location information, the N-1 location information is compared with the first location information respectively, the distances between the N-1 servers and the first server are determined respectively, and then the server with the closest distance is determined as the second server. Through the above method, the second server closest to the first server can be selected from the N-1 servers to reduce the network latency of service invocation.
[0052] Optionally, after step 106, the service invocation method of the embodiment of the present application further includes:
[0053] Display the location information of the second server on the scheduling interface;
[0054] When receiving user input, display the fourth location information input by the user on the scheduling interface, and the fourth location information is any location information among the N location information except the location information of the second server;
[0055] Dispatch the traffic in the first server to the server corresponding to the fourth location information.
[0056] In this embodiment, the scheduling interface displays the location information of the second server determined in step 105. For example:
[0057] "from:
[0058] region: "cnhb4"
[0059] zone: "all""
[0060] It means that the region where the second server is located is the region referred to by cnhb4, and the computer room where it is located is the computer room referred to by all.
[0061] When the second server determined in step 105 has a fault, is overloaded, etc. and is not convenient to provide services, the user can actively input the fourth location information, and the fourth location information displayed on the scheduling interface, for example:
[0062] "to:
[0063] region: "cnhz1"
[0064] zone: “all”
[0065] At this time, the traffic in the second server is scheduled to the server in the computer room referred to by all in the area referred to by cnhz1. It should be noted that if there are multiple servers in the same computer room in the same area that can provide the target service, any one of them can be selected as the second server.
[0066] In this embodiment, the service registry visually displays a scheduling interface. The user can independently input location information in the scheduling interface to achieve free call of the service, so as to ensure that the service can still be called quickly and in real time in the case where the second server fails, is overloaded, or is not convenient to provide services.
[0067] Combined with Figure 2 , the above embodiments are described as follows:
[0068] The service registry also has the function of displaying the scheduling interface, and realizes the visual display of the scheduling interface through QPaaS. Nacos pulls the traffic governance configuration information of the first server (i.e., the traffic routing information) through the first server (such as the Consumer SDK shown in Figure 2 ). After step 106, the location information of the server that processes the traffic indicated by the traffic routing information is the location information of the second server). QPaaS then pulls the traffic governance configuration information through Nacos and displays the traffic routing information in the scheduling interface (after step 106, the displayed content is the location information of the second server). The user inputs the fourth location information, and QPaaS modifies the traffic routing information based on the fourth location information (modifies the location information of the server that processes the traffic from the location information of the second server to the fourth location information), generates new traffic governance configuration information, and sends the new traffic governance configuration information to Nacos. Nacos stores the new traffic governance configuration information and sends it to the SDK of the first server. The rule corresponding to the new traffic routing information takes effect (the first server executes the rule corresponding to the new traffic routing information), and calls the Provider (the server corresponding to the fourth location information) to process the traffic originally processed by the first server.
[0069] Optionally, before displaying the fourth location information input by the user in the scheduling interface, the method of the embodiment of the present application further includes:
[0070] Display the server load data corresponding to each server in the scheduling interface, and the server load data is used to assist in determining the fourth location information.
[0071] In this embodiment, in addition to displaying the location information of the second server determined in step 105, the scheduling interface also displays the server load data of other servers that can provide the target service, so that the user can refer to the server load data to determine the fourth location information to be input. Understandably, the user can select the fourth location information that can better ensure the load balance among the servers according to the server load data, thereby improving the stability of the target service.
[0072] Optionally, after step 105, the method of the embodiment of the present application further includes:
[0073] In the case where the second server cannot provide the target service, obtain the server load data corresponding to each of the remaining servers in the N - 1 servers except the second server;
[0074] Based on the server load data and location information corresponding to each of the remaining servers, calculate the target value corresponding to each of the remaining servers, where the target value is used to characterize the stability of the corresponding server in providing the target service;
[0075] Schedule the traffic in the first server to the server with the largest target value among the remaining servers in the N - 1 servers except the second server.
[0076] In this embodiment, in the case where the second server determined in step 105 is faulty or overloaded and cannot provide the target service, obtain the server load data corresponding to each of the remaining servers except the second server.
[0077] The process of calculating the target value for any one of the remaining servers (hereinafter briefly referred to as the target server) in the N - 1 servers except the second server is as follows:
[0078] Obtain a preset first parameter and a second parameter, where the first parameter is associated with the server load data for the stability of the target server in providing the target service, and the second parameter is associated with the distance between the target server and the first server for the stability of the target server in providing the target service;
[0079] According to the first location information and the location information of the target server, determine the distance between the target server and the first server;
[0080] Calculate the target value of the target server according to the first parameter, the second parameter, the server load data, and the distance between the third server and the first server.
[0081] The target value of the target server: (m = k1p + k2l), where k1 is the first parameter, p is the server load data, k2 is the second parameter, and l is the distance between the target server and the first server.
[0082] In this embodiment, a target value for characterizing the stability of the server in providing the target service is calculated based on the server load data and the location information, and the traffic in the first server is scheduled to the server with the maximum corresponding target value among the remaining N - 1 servers except the second server, thereby improving the stability of the server in providing the target service.
[0083] As Figure 3 shown, an embodiment of the present application further provides a service invocation device 300, and the service invocation device 300 includes:
[0084] A first sending module 301, configured to send a location acquisition request to N servers corresponding to the target service when receiving a registration request for the target service, where N is an integer greater than 1;
[0085] A first receiving module 302, configured to receive N location information sent by the N servers, where the location information is used to indicate the geographical location of the corresponding server;
[0086] A storage module 303, configured to store the registration information of the target service, where the registration information includes the N location information;
[0087] A second receiving module 304, configured to receive first information from a first server, where the first information includes a service invocation request and first location information, the first location information is used to indicate the geographical location of the first server, and the service invocation request is used to request the target service, and the N servers include the first server;
[0088] A determination module 305, configured to determine, based on the first information, from the registration information, a second server that is the closest to the first server among N - 1 servers, where the N - 1 servers are other servers except the first server among the N servers;
[0089] A first scheduling module 306, configured to schedule the traffic in the first server to the second server.
[0090] Optionally, the determination module 305 includes:
[0091] A first determination sub-module, configured to determine the server corresponding to the second location information as the second server when there is second location information identical to the first location information among the N - 1 location information, where the N - 1 location information is the location information corresponding to the N - 1 servers respectively;
[0092] A second determination sub-module, configured to determine the server corresponding to the third location information as the second server when the second location information does not exist in the N-1 location information, where the third location information is the location information in the N location information that indicates the geographical location closest to the geographical location of the first server.
[0093] Optionally, the service invocation device 300 further includes a display module, configured to:
[0094] After scheduling the traffic in the first server to the second server, display the location information of the second server on the scheduling interface;
[0095] When receiving user input, display the fourth location information input by the user on the scheduling interface, where the fourth location information is any location information in the N location information other than the location information of the second server;
[0096] Schedule the traffic in the first server to the server corresponding to the fourth location information.
[0097] Optionally, the display module is further configured to:
[0098] Before displaying the fourth location information input by the user on the scheduling interface, display the server load data corresponding to each server on the scheduling interface, where the server load data is used to assist in determining the fourth location information.
[0099] Optionally, the service invocation device 300 further includes a second scheduling module, configured to:
[0100] After determining the second server closest to the first server from N-1 servers based on the first information and the registration information,
[0101] When the second server is unable to provide the target service, obtain the server load data corresponding to each of the remaining servers in the N-1 servers except the second server;
[0102] Based on the server load data and location information corresponding to each of the remaining servers, calculate the target value corresponding to each of the remaining servers, where the target value is used to characterize the stability of the corresponding server in providing the target service;
[0103] Schedule the traffic in the first server to the server with the largest target value among the remaining servers in the N-1 servers except the second server.
[0104] It should be noted that the service invocation device 300 provided in the embodiments of the present application can implement asFigure 1 The entire technical process of the service call method shown in the embodiments, and achieving the same technical effects. To avoid repetition, it will not be elaborated here.
[0105] The data sending device in the embodiments of the present application can be an electronic device or a component in an electronic device, such as an integrated circuit or a chip. The electronic device can be a terminal or other devices other than terminals. Exemplarily, the electronic device can be a mobile phone, a tablet computer, a laptop computer, a handheld computer, an in-vehicle electronic device, a Mobile Internet Device (MID), an augmented reality (AR) / virtual reality (VR) device, a robot, a wearable device, an ultra-mobile personal computer (UMPC), a netbook, or a personal digital assistant (PDA), etc. The non-mobile electronic device can also be a server, a Network Attached Storage (NAS), a personal computer (PC), a television (TV), a teller machine, or a self-service machine, etc. The embodiments of the present application do not make specific limitations.
[0106] Optionally, as Figure 4 shown, the embodiments of the present application further provide an electronic device 400, including a processor 401 and a memory 402. A program or instruction that can run on the processor 401 is stored on the memory 402. When the program or instruction is executed by the processor 401, each step of the above-mentioned service call method embodiment is implemented, and the same technical effects can be achieved. To avoid repetition, it will not be elaborated here.
[0107] It should be noted that the electronic devices in the embodiments of the present application include the above-mentioned mobile electronic devices and non-mobile electronic devices.
[0108] The embodiments of the present application further provide a readable storage medium. A program or instruction is stored on the readable storage medium. When the program or instruction is executed by a processor, each process of the above-mentioned service call method embodiment is implemented, and the same technical effects can be achieved. To avoid repetition, it will not be elaborated here.
[0109] Among them, the processor is the processor in the electronic device described in the above embodiments. The readable storage medium includes computer-readable storage media, such as computer read-only memory (ROM), random access memory (RAM), magnetic disks, or optical discs, etc.
[0110] The embodiments of the present application also provide a computer program product, including computer instructions, which when executed by the processor implement each process of the service call method embodiments shown above Figure 1 and can achieve the same technical effects. To avoid repetition, details are not described here again.
[0111] It should be noted that in this article, the terms "including", "comprising" or any other variant thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements not only includes those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. Without further limitation, an element defined by the statement "including a..." does not exclude the existence of additional identical elements in the process, method, article or device including the element. In addition, it should be pointed out that the methods and devices in the embodiments of the present application are not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in the reverse order according to the functions involved. For example, the described methods may be performed in an order different from that described, and various steps may be added, omitted, or combined. Additionally, the features described with reference to certain examples may be combined in other examples.
[0112] Through the description of the above embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus a necessary general hardware platform. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, in essence, or the part that contributes to the prior art, can be embodied in the form of a computer software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disc) and includes several instructions for causing a terminal (which can be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in the various embodiments of the present application.
[0113] The above is only the specific implementation manner of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed by the present application, and all should be covered by the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.
Claims
1. A service call method, characterized in that, The method includes: When receiving a registration request for a target service, sending a location acquisition request to N servers corresponding to the target service, where N is an integer greater than 1; Receiving N location information sent by the N servers, where the location information is used to indicate the geographical location of the corresponding server; Storing the registration information of the target service, where the registration information includes the N location information; Receiving first information from a first server, where the first information includes a service call request and first location information, the first location information is used to indicate the geographical location of the first server, and the service call request is used to request the target service, and the N servers include the first server; Based on the first information and the registration information, determining a second server closest to the first server from N-1 servers, where the N-1 servers are the other servers among the N servers excluding the first server; Scheduling the traffic in the first server to the second server.
2. The method according to claim 1, wherein The determining, based on the first information and the registration information, a second server closest to the first server from N-1 servers includes: In the case where there is second location information identical to the first location information among the N-1 location information, determining the server corresponding to the second location information as the second server, where the N-1 location information is the location information corresponding to each of the N-1 servers; In the case where the second location information does not exist among the N-1 location information, determining the server corresponding to third location information as the second server, where the third location information is the location information among the N location information that indicates the geographical location closest to the geographical location of the first server.
3. The method according to any one of claims 1 to 2, characterized in that, After scheduling the traffic in the first server to the second server, the method further includes: Displaying the location information of the second server on a scheduling interface; When receiving user input, displaying fourth location information input by the user on the scheduling interface, where the fourth location information is any location information among the N location information excluding the location information of the second server; Scheduling the traffic in the first server to the server corresponding to the fourth location information.
4. The method according to claim 3, characterized in that Before displaying the fourth location information input by the user on the scheduling interface, the method further includes: Displaying server load data corresponding to each server on the scheduling interface, where the server load data is used to assist in determining the fourth location information.
5. The method according to any one of claims 1 to 2, characterized in that, After determining, based on the first information and the registration information, a second server closest to the first server from N-1 servers, the method further includes: In the case where the second server cannot provide the target service, acquiring server load data corresponding to each of the remaining servers among the N-1 servers excluding the second server; Based on the server load data and location information corresponding to each of the remaining servers, calculate the target value corresponding to each of the remaining servers, where the target value is used to characterize the stability of the corresponding server in providing the target service; Schedule the traffic in the first server to the server with the maximum target value among the remaining servers other than the second server among the N - 1 servers.
6. A service call device, characterized in that, The device includes: A first sending module, configured to send a location acquisition request to N servers corresponding to the target service when receiving a registration request for the target service, where N is an integer greater than 1; A first receiving module, configured to receive N location information sent by the N servers, where the location information is used to indicate the geographical location of the corresponding server; A storage module, configured to store the registration information of the target service, where the registration information includes the N location information; A second receiving module, configured to receive first information from the first server, where the first information includes a service call request and first location information, the first location information is used to indicate the geographical location of the first server, and the service call request is used to request the target service, and the N servers include the first server; A determination module, configured to determine, based on the first information from the registration information, the second server that is the closest to the first server among the N - 1 servers, where the N - 1 servers are the other servers except the first server among the N servers; A scheduling module, configured to schedule the traffic in the first server to the second server.
7. The device according to claim 6, wherein The determination module includes: A first determination sub-module, configured to, when there is a second location information identical to the first location information among the N - 1 location information, determine the server corresponding to the second location information as the second server, where the N - 1 location information is the location information corresponding to each of the N - 1 servers; A second determination sub-module, configured to, when the second location information does not exist among the N - 1 location information, determine the server corresponding to the third location information as the second server, where the third location information is the location information among the N location information that indicates the geographical location closest to the geographical location of the first server.
8. An electronic device, characterized in that, The electronic device includes a processor and a memory, where the memory stores a program or instruction that can run on the processor, and when the program or instruction is executed by the processor, the steps of the service call method according to any one of claims 1 to 5 are implemented.
9. A computer-readable storage medium, characterized in that, A program or instruction is stored on the computer-readable storage medium, and when the program or instruction is executed by the processor, the steps of the service call method according to any one of claims 1 to 5 are implemented.
10. A computer program product, characterized in that, It includes computer instructions, and when the computer instructions are executed by the processor, the steps of the service call method according to any one of claims 1 to 5 are implemented.