Remote procedure calling method and related equipment
By using the computer room mark to select the server side of the same computer room in remote procedure calls, the problems of network delay and high traffic costs caused by cross-computer room calls are solved, and more efficient cross-computer room calls are achieved.
Patent Information
- Application Number
- CN202510104049.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-22
- Publication Date
- 2025-05-09
AI Technical Summary
Cross-computer room calls lead to problems such as high network latency and high traffic costs.
By obtaining the IP address information of the client and server, setting up the computer room mark, and selecting the server of the same computer room according to the computer room mark to perform remote process calls, establishing a communication connection to optimize cross-computer room calls.
Priority is given to the server side of the same computer room for remote process calls, reducing network delay and traffic costs, and improving cross-computer room call efficiency.
Smart Images

Figure CN119967044A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of communication technology, and in particular to a remote procedure call method and related equipment. Background Art
[0002] The client (Consumer) of the existing Remote Procedure Call (RPC) solution can obtain real-time information from the server (Provider). Generally, the Consumer will randomly call multiple Provider processes and try to ensure that the number of calls to all processes is roughly balanced to avoid overloading or idling of a single process.
[0003] However, the existing remote procedure call solution ignores the cross-computer room call scenario. Generally, for remote disaster recovery, the provider's services are published in different computer rooms, so that even if a single computer room has a power outage or fire, the services in other computer rooms are still available. However, there are several problems when calling across computer rooms: the first problem is that the physical links between multiple computer rooms are long, usually need to pass through multiple layers of switches and routers, and the network delay is relatively high; the second problem is that the network communication between multiple computer rooms requires paying high traffic fees to the network operator. Summary of the invention
[0004] In view of the above, it is necessary to provide a remote procedure call method, electronic device and storage medium to solve the technical problems of relatively high network delay and high traffic costs caused by cross-computer room calls.
[0005] In a first aspect, the present application provides a remote procedure call method, which is applied to a client, and the method includes: obtaining information of the client and the server, the information including an IP address; obtaining computer room network segment information, setting the client's computer room mark according to the computer room network segment information and the IP address of the client, and setting the server's computer room mark according to the computer room network segment information and the IP address of the server; responding to a remote procedure call request, selecting a first target server according to the client's computer room mark and the server's computer room mark, establishing a communication connection with the first target server, and sending the remote procedure call request to the first target server, so that the first target server executes the remote procedure call request, wherein the computer room mark of the first target server is the same as the computer room mark of the client.
[0006] In some embodiments of the present application, selecting the first target server according to the computer room mark of the client and the computer room mark of the server includes: arbitrarily selecting a server with the same computer room mark as the client from the first connection pool according to the computer room mark of the client as the first target server, the first connection pool recording first connection information between the client and the server, the first connection information including the computer room mark of the client, the computer room mark of the server, and the connection status of the client and the server at the transport layer, wherein the computer room mark of any server in the first connection pool that establishes a connection relationship with the client is the same as the computer room mark of the client.
[0007] In some embodiments of the present application, establishing a communication connection with the first target server includes: determining the connection status between the client and the first target server; if the connection status between the client and the first target server is an available connection status, establishing a communication connection with the application layer of the first target server at the application layer of the client.
[0008] In some embodiments of the present application, the method also includes: if the connection status between the client and the first target server is an unavailable connection state, selecting a server with a different computer room mark from the client as a second target server according to the computer room mark of the client, and establishing a communication connection with the application layer of the second target server at the application layer of the client.
[0009] In some embodiments of the present application, selecting a server with a computer room mark different from that of the client as a second target server according to the computer room mark of the client includes: arbitrarily selecting a server with a computer room mark different from that of the client from a second connection pool as the second target server according to the computer room mark of the client, the second connection pool recording second connection information between the client and the server, the second connection information including the computer room mark of the client, the computer room mark of the server, and the connection status between the client and the server at the transport layer, wherein the computer room mark of any server in the second connection pool that establishes a connection relationship with the client is different from the computer room mark of the client.
[0010] In some embodiments of the present application, after establishing a communication connection with the first target server and sending the remote procedure call request to the first target server, the method further includes: if it is detected that the first target server is disconnected from the client or no reply information sent by the first target server is received within a preset time period, re-establishing the connection with the first target server; recording the number of times the first target server is disconnected from the client; when the number reaches a preset number, setting the connection status between the client and the first target server to an unavailable connection status.
[0011] In some embodiments of the present application, the acquiring the information of the client and the server includes: acquiring the information of the client and the server from a registration center.
[0012] In some embodiments of the present application, the method further includes: when the client is started, sending a heartbeat packet to the registration center at a preset time interval, wherein the heartbeat packet includes the IP address and port of the client.
[0013] In a second aspect, the present application provides an electronic device, comprising a memory and a processor: the memory is used to store program instructions; the processor is used to read and execute the program instructions stored in the memory, and when the program instructions are executed by the processor, the electronic device executes the above-mentioned remote procedure call method.
[0014] In a third aspect, the present application provides a computer storage medium storing program instructions, which, when executed on an electronic device, enables the electronic device to execute the above-mentioned remote procedure call method.
[0015] In the present application, the client can set the client's computer room mark according to the computer room network segment information and the client's IP address, set the server's computer room mark according to the computer room network segment information and the server's IP address, and respond to the remote procedure call request according to the client's computer room mark and the server's computer room mark, select the first target server, establish a communication connection with the first target server, and send the remote procedure call request to the first target server, so that the first target server executes the remote procedure call request. In this way, the client can give priority to remote procedure calls to the server in the same computer room, thereby solving the technical problems of relatively high network delays and high traffic costs caused by cross-computer room calls. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] Figure 1 A schematic diagram of the system architecture of the remote procedure call method provided in an embodiment of the present application.
[0017] Figure 2A schematic diagram of the system architecture of a remote procedure call method provided in another embodiment of the present application.
[0018] Figure 3 A flowchart of a remote procedure call method provided in an embodiment of the present application.
[0019] Figure 4 A schematic diagram of the structure of an electronic device provided for some embodiments of the present application. DETAILED DESCRIPTION
[0020] In order to more clearly understand the above-mentioned objects, features and advantages of the present application, the present application is described in detail below with reference to the accompanying drawings and specific embodiments.
[0021] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein in the specification of this application are only for the purpose of describing the embodiments in one embodiment and are not intended to limit this application.
[0022] It should be noted that the terms "first", "second", "third", "fourth", etc. (if any) in the specification, claims and drawings of the present application are used to distinguish similar objects, rather than to describe a specific order or sequence. In the embodiments of the present application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a concrete way.
[0023] It should also be noted that the method disclosed in the embodiments of the present application or the method shown in the flowchart includes one or more steps for implementing the method. Without departing from the scope of the claims, the execution order of multiple steps can be interchanged with each other, and some steps can also be deleted. Some embodiments will be described below in conjunction with the accompanying drawings. The following embodiments and features in the embodiments can be combined with each other without conflict.
[0024] Remote Procedure Call (RPC) refers to a process calling the function of another process. Unlike function calls within a process, there is strong isolation between multiple processes. In particular, for processes located on different hosts, method parameters cannot be passed through shared memory. The current common way to pass parameters is to communicate over the network and pass method parameters through preset application layer protocols. The preset protocols include grpc protocol, thrift protocol, dubbo protocol, http protocol, etc.
[0025] The client (Consumer) of the existing RPC solution can obtain real-time information from the server (Provider). Generally, the Consumer will randomly call multiple Provider processes and try to ensure that the number of calls to all processes is roughly balanced to avoid overloading or idling a single process.
[0026] However, the existing RPC solution ignores the scenario of cross-computer room calls. Generally, for remote disaster recovery, the Provider's services are published in different computer rooms, so that even if a single computer room has a power outage or fire, the services in other computer rooms are still available. However, there are several problems when calling across computer rooms: the first problem is that the physical links between multiple computer rooms are long, usually need to pass through multiple layers of switches and routers, and the network latency is relatively high; the second problem is that network communication between multiple computer rooms requires paying high traffic fees to network operators.
[0027] In order to solve the above technical problems, an embodiment of the present application provides a remote procedure call method to solve the technical problems of relatively high network delay and high traffic costs caused by cross-computer room calls.
[0028] refer to Figure 1 As shown, it is a schematic diagram of the system architecture of the remote procedure call method provided in the embodiment of the present application. The system architecture includes a client 20, a server 30 and a registration center 40. The client 20 can be connected to the server 30 and the registration center 40 through a network (not shown in the figure). The network can be a wired communication network or a wireless communication network.
[0029] The client 20 can be various electronic devices, including but not limited to mobile phones, laptop computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), and other mobile terminals, as well as digital TVs, desktop computers, and other fixed terminals.
[0030] The server 30 may be a server that provides services. For example, the server 30 may be a remote service execution server that executes a corresponding instance of the service requested by the client 20. The server 30 may execute a corresponding instance of the service requested by the client 20, obtain a call result, and feed the call result back to the client.
[0031] In some embodiments of the present application, the registration center 40 may be a single server or a server cluster. In other embodiments of the present application, the registration center 40 may be a nacos console.
[0032] It should be noted that Figure 1The number of clients, networks, servers, and registries in the example is only illustrative. Any number of clients, networks, servers, and registries may be used as required. Figure 2 FIG. 1 is a schematic diagram of a system architecture of a remote procedure call method provided by another embodiment of the present application. The system architecture includes two clients and three servers.
[0033] refer to Figure 3 As shown, it is a flowchart of the remote procedure call method provided by the embodiment of the present application. The method is applied to the client (such as Figure 1 According to different requirements, the order of the steps in the flowchart can be changed, and some steps can be omitted.
[0034] Step S301, obtaining information of the client and the server, wherein the information includes the IP address.
[0035] In some embodiments of the present application, the server sends the information of the server to the registration center when it is powered on. The information of the server includes metadata of the service. The metadata of the service includes, but is not limited to, the address, port and service type of the server, where the address includes the IP address. The service type may include order services and user function services. For example, when powered on, the server sends a first heartbeat packet to the registration center at intervals of a first preset period (e.g., 5s), and the first heartbeat packet includes the address, port and service type of the server. The registration center receives and records the first heartbeat packet sent by the server. If the registration center does not receive the first heartbeat packet within a first preset time period (e.g., 20s), the service of the server is deregistered.
[0036] In some embodiments of the present application, when the client is powered on, the client sends the information of the client to the registration center. The information of the client includes, but is not limited to, the address and port of the client. In some embodiments of the present application, when the client is powered on, the client sends a second heartbeat packet to the registration center at intervals of a second preset period, and the second heartbeat packet includes the address and port of the client. The registration center receives and records the second heartbeat packet sent by the client.
[0037] In some embodiments of the present application, the client obtains information of all clients and servers from the registration center, thereby obtaining the IP address and port of each client.
[0038] Step S302, obtaining the network segment information of the computer room, setting the computer room mark of the client according to the network segment information of the computer room and the IP address of the client, and setting the computer room mark of the server according to the network segment information of the computer room and the IP address of the server.
[0039] In some embodiments of the present application, the client obtains the network segment information of the computer room from the registration center. Each network segment information of the computer room corresponds to a computer room. For example, refer to Figure 2 As shown in the figure, the network segment information of the computer room A is 10.86.0.0 / 16, the network segment information of the computer room B is 10.87.0.0 / 16, and the network segment information of the computer room C is 10.88.0.0 / 16. The network segment information of the computer room is 10.86.0.0 / 16, which means that the network segment information of the computer room includes all IP addresses from 10.86.0.0 to 10.86.255.255. The network segment information of the computer room is 10.87.0.0 / 16, which means that the network segment information of the computer room includes all IP addresses from 10.87.0.0 to 10.87.255.255. The network segment information of the computer room is 10.88.0.0 / 16, which means that the network segment information of the computer room includes all IP addresses from 10.88.0.0 to 10.88.255.255.
[0040] In some embodiments of the present application, setting the client's computer room tag according to the computer room network segment information and the client's IP address includes: determining the computer room network segment information to which the client's IP address belongs as the first target network segment information according to the computer room network segment information and the client's IP address; and setting the client's computer room tag to the computer room corresponding to the first target network segment information. For example, if the client's IP address is 10.87.20.100, then determine that the first target network segment information corresponding to the client of 10.87.20.100 is 10.87.0.0 / 16, and set the client's computer room tag to the computer room corresponding to 10.87.0.0 / 16, that is, computer room B.
[0041] In some embodiments of the present application, the server's computer room tag is set according to the computer room network segment information and the server's IP address: the computer room network segment information to which the server's IP address belongs is determined as the second target network segment information according to the computer room network segment information and the server's IP address; the server's computer room tag is set to the computer room corresponding to the second target network segment information. For example, if the server's IP address is 10.86.20.55, the second target network segment information corresponding to the server with an IP address of 10.86.20.55 is determined to be 10.86.0.0 / 16, and the server's computer room tag is set to the computer room corresponding to 10.86.0.0 / 16, that is, computer room A.
[0042] Step S303, respond to the remote procedure call request, select the first target server according to the computer room mark of the client and the computer room mark of the server, establish a communication connection with the first target server, and send the remote procedure call request to the first target server, so that the first target server executes the remote procedure call request, wherein the computer room mark of the first server is the same as the computer room mark of the client.
[0043] In some embodiments of the present application, after power-on, the client and the first target server may establish a communication connection through the Transmission Control Protocol (TCP). For example, the client may establish a communication connection with the transport layer of the first target server through the TCP protocol on the transport layer of the client.
[0044] In some embodiments of the present application, a first connection pool and a second connection pool are set in the client. The first connection pool records the first connection information between the client and the server, and the first connection information includes the computer room mark and IP address of the client, the computer room mark and IP address of the server, and the connection status of the client and the server at the transport layer, wherein any server in the first connection pool that establishes a connection relationship with the client has the same computer room mark as the corresponding client. In some embodiments of the present application, the connection status between the client and the server includes an available connection status and an unavailable connection status.
[0045] In some embodiments of the present application, an application or process of a client may trigger a remote procedure call request. The client responds to the remote procedure call request and selects a server having the same server room mark as the first target server from the first connection pool according to the server room mark of the client. The client determines the connection status between the client and the first target server. If the connection status between the client and the first target server is an available connection status, the client establishes a communication connection with the application layer of the first target server at the application layer.
[0046] If the connection status between the client and the first target server is unavailable, a server with a different server room mark from the client is selected as the second target server according to the client's server room mark, and a communication connection is established on the client's application layer with the application layer of the second target server.
[0047] In some embodiments of the present application, the client sets a second connection pool. The second connection pool records the second connection information between the client and the server, and the second connection information includes the computer room mark and IP address of the client, the computer room mark and IP address of the server, and the connection status of the client and the server at the transport layer, wherein the computer room mark of any client in the second connection pool and the server with which the client establishes a connection relationship is different. If the connection status between the client and the first target server is an unavailable connection state, the client selects a server with a different computer room mark from the second connection pool as the second target server according to the computer room mark of the client, and establishes a communication connection with the application layer of the second target server at the application layer of the client.
[0048] In some embodiments of the present application, the size of the first connection pool can be determined according to the number of first target IP addresses and the number of first processes. The number of first target IP addresses represents the number of servers with the same computer room identifier as the client, and the number of first processes represents the number of processes in each server for parallel processing of remote procedure call requests. In some embodiments of the present application, the size of the first connection pool can be the product of the number of first target IP addresses and the number of first processes.
[0049] In some embodiments of the present application, the size of the second connection pool can be determined according to the number of second target IP addresses and the number of second processes. The number of second target IP addresses indicates the number of servers with the same computer room identifier as the client, and the number of second processes indicates the number of processes in each server for parallel processing of remote procedure call requests. In some embodiments of the present application, the size of the second connection pool can be the product of the number of first target IP addresses and the number of first processes.
[0050] In some embodiments of the present application, when the first target server receives a remote procedure call request sent by the client, it executes the remote procedure call request and sends a processing result of the remote procedure call request to the client.
[0051] In some embodiments of the present application, after the client sends the remote procedure call request to the first target server, the method further includes: if it is detected that the client is disconnected from the first target server or no reply information sent by the first target server is received within a preset time period, re-establishing the connection with the first target server; recording the number of times the client is disconnected from the first target server; when the number of disconnections reaches a preset number, setting the connection state between the client and the first target server to an unavailable connection state. In some embodiments of the present application, setting the connection state between the client and the first target server to an unavailable connection state means setting the connection state of all processes on the first target server that are connected to the client to an unavailable connection state. In an embodiment of the present application, when the number of disconnections reaches a preset number, the connection state between the client and the first target server is set to an unavailable connection state, and when the connection process between the client and the server is re-established, the first target server can be selected again to connect to the client, resulting in consumption of computing resources.
[0052] In some embodiments of the present application, after the connection state between the client and the first target server is set to an unavailable connection state, the method further includes: detecting whether the client and the first target server can be successfully connected at every preset period, and if it is determined that the client and the first target server can be successfully connected, setting the connection state between the client and the first target server to an available connection state. In the embodiment of the present application, the preset period can be set as needed, for example, the preset period can be set to 30s.
[0053] In an embodiment of the present application, it is detected at preset intervals whether the client and the first target server can be successfully connected. If it is determined that the client and the first target server can be successfully connected, the connection status between the client and the first target server is set to an available connection status. In this way, the connection between the client and the first target server can be restored, thereby increasing the service resources of the RPC.
[0054] In the present application, the client can set the client's computer room mark according to the computer room network segment information and the client's IP address, set the server's computer room mark according to the computer room network segment information and the server's IP address, and respond to the remote procedure call request according to the client's computer room mark and the server's computer room mark, select the first target server, establish a communication connection with the first target server, and send the remote procedure call request to the first target server, so that the first target server executes the remote procedure call request. In this way, the client can give priority to remote procedure calls to the server in the same computer room, thereby solving the technical problems of relatively high network delays and high traffic costs caused by cross-computer room calls.
[0055] Please refer to Figure 4 FIG. 4 is a schematic diagram of the structure of an electronic device provided in some embodiments of the present application. The electronic device 40 may be Figure 1 The client 20 is shown.
[0056] The electronic device 40 may include at least one memory 41, a processor 42, and a communication unit 43. The memory 41 includes a computer-readable storage medium, which is used to store multiple logic instructions. The communication unit 43 is used to communicate with the electronic device 40 or the server. The processor 42 can run the logic instructions to execute the above-mentioned remote procedure call method. Specifically, the electronic device 40 can be the client or server described above, and this application does not limit this.
[0057] It can be understood that in some embodiments, the communication unit 43 includes a module with communication function such as a network module, and the present application does not limit this.
[0058] The logic instructions in the above-mentioned computer-readable storage medium can be implemented in the form of software functional units and can be stored in a computer-readable storage medium when sold or used as an independent product.
[0059] The computer-readable storage medium may be configured to store software programs, computer executable programs, such as program instructions corresponding to the remote procedure call method in the embodiment of the present application. The processor 42 executes the functional application and image processing by running the software program, instructions or modules stored in the computer-readable storage medium, that is, implementing the remote procedure call method in the above embodiment.
[0060] In the implementation mode of the present application, the computer-readable storage medium includes a non-volatile computer-readable memory, such as a disk, a memory, etc. It is understood that the computer-readable storage medium may also include other non-volatile computer-readable memories, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), at least one flash memory device and / or other non-volatile solid-state storage devices.
[0061] In the implementation manner of the present application, the processor 42 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The processor 42 is the control center of the electronic device 40, and may use various interfaces and lines to connect to other external devices and / or systems / modules / units to provide remote procedure call functions to applications of other external devices and / or systems / modules / units.
[0062] This embodiment also provides a computer program product. When the computer program product is run on a computer, the computer is caused to execute the above-mentioned related steps to implement the remote procedure call method in the above-mentioned embodiment.
[0063] Among them, the system, electronic device, computer storage medium, computer program product or chip provided in this embodiment is used to execute the corresponding method provided above. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding method provided above, and will not be repeated here.
[0064] Through the description of the above implementation methods, technical personnel in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.
[0065] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0066] The unit described as a separate component may or may not be physically separated, and the component shown as a unit may be one physical unit or multiple physical units, that is, it may be located in one place or distributed in multiple different places. Some or all of the units may be selected according to actual needs to achieve the purpose of the embodiment.
[0067] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0068] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions to enable a device (which can be a single-chip microcomputer, chip, etc.) or a processor (processor) to execute all or part of the steps of the various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), disk or optical disk and other media that can store program code.
[0069] The above implementation modes are only used to illustrate the technical solutions of the present application and are not intended to limit the present application. Although the present application has been described in detail with reference to the above preferred implementation modes, a person skilled in the art should understand that the technical solutions of the present application may be modified or replaced by equivalents without departing from the spirit and scope of the technical solutions of the present application.
Claims
1. A remote procedure call method, applied to a client, characterized in that: The method comprises: Obtain information about the client and the server, including IP addresses; Acquire the network segment information of the computer room, set the computer room mark of the client according to the network segment information of the computer room and the IP address of the client, and set the computer room mark of the server according to the network segment information of the computer room and the IP address of the server; In response to a remote procedure call request, a first target server is selected according to a computer room mark of the client and a computer room mark of the server, a communication connection with the first target server is established, and the remote procedure call request is sent to the first target server, so that the first target server executes the remote procedure call request, wherein the computer room mark of the first target server is the same as the computer room mark of the client.
2. The remote procedure call method according to claim 1, characterized in that: The selecting the first target server according to the computer room mark of the client and the computer room mark of the server comprises: According to the computer room tag of the client, a server with the same computer room tag as the client is arbitrarily selected from the first connection pool as the first target server, and the first connection pool records the first connection information between the client and the server, and the first connection information includes the computer room tag of the client, the computer room tag of the server, and the connection status of the client and the server at the transport layer, wherein the computer room tag of any server in the first connection pool that establishes a connection relationship with the client is the same as the computer room tag of the client.
3. The remote procedure call method according to claim 2, characterized in that: The establishing of a communication connection with the first target server includes: Determine the connection status between the client and the first target server; If the connection state between the client and the first target server is an available connection state, a communication connection is established between the application layer of the client and the application layer of the first target server.
4. The remote procedure call method according to claim 2, characterized in that: The method further comprises: If the connection status between the client and the first target server is an unavailable connection status, a server with a different computer room mark from the client is selected as a second target server according to the computer room mark of the client, and a communication connection is established at the application layer of the client with the application layer of the second target server.
5. The remote procedure call method according to claim 4, characterized in that: The selecting, according to the computer room mark of the client, a server end having a different computer room mark from that of the client end as a second target server end comprises: According to the computer room mark of the client, a server with a different computer room mark from the client is arbitrarily selected from the second connection pool as the second target server, and the second connection pool records the second connection information between the client and the server, and the second connection information includes the computer room mark of the client, the computer room mark of the server, and the connection status of the client and the server at the transport layer, wherein the computer room mark of any server in the second connection pool that establishes a connection relationship with the client is different from the computer room mark of the client.
6. The remote procedure call method according to claim 1, characterized in that: After establishing a communication connection with the first target server and sending the remote procedure call request to the first target server, the method further includes: If it is detected that the first target server is disconnected from the client or no reply information sent by the first target server is received within a preset time period, re-establishing a connection with the first target server; Record the number of times the first target server is disconnected from the client; When the number of times reaches a preset number of times, the connection state between the client and the first target server is set to an unavailable connection state.
7. The remote procedure call method according to claim 1, characterized in that: The obtaining of the information of the client and the server includes: The client and server information is obtained from the registration center.
8. The remote procedure call method according to claim 7, characterized in that: The method further comprises: When the client is started, a heartbeat packet is sent to the registration center at a preset time interval, and the heartbeat packet includes the IP address and port of the client.
9. An electronic device, characterized in that: The electronic device comprises a memory and a processor: The memory is used to store program instructions; The processor is used to read and execute the program instructions stored in the memory. When the program instructions are executed by the processor, the electronic device executes the remote procedure call method as described in any one of claims 1 to 8.
10. A computer storage medium, characterized in that: The computer storage medium stores program instructions, and when the program instructions are executed on an electronic device, the electronic device executes the remote procedure call method according to any one of claims 1 to 8.