[go: up one dir, main page]

CN114911633A - Remote procedure call retry method, device and equipment - Google Patents

Remote procedure call retry method, device and equipment Download PDF

Info

Publication number
CN114911633A
CN114911633A CN202110177698.4A CN202110177698A CN114911633A CN 114911633 A CN114911633 A CN 114911633A CN 202110177698 A CN202110177698 A CN 202110177698A CN 114911633 A CN114911633 A CN 114911633A
Authority
CN
China
Prior art keywords
server
call
service
retry
calling
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202110177698.4A
Other languages
Chinese (zh)
Other versions
CN114911633B (en
Inventor
田京昆
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing ByteDance Network Technology Co Ltd
Original Assignee
Beijing ByteDance Network Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing ByteDance Network Technology Co Ltd filed Critical Beijing ByteDance Network Technology Co Ltd
Priority to CN202110177698.4A priority Critical patent/CN114911633B/en
Publication of CN114911633A publication Critical patent/CN114911633A/en
Application granted granted Critical
Publication of CN114911633B publication Critical patent/CN114911633B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/547Remote procedure calls [RPC]; Web services
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1415Saving, restoring, recovering or retrying at system level

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Quality & Reliability (AREA)
  • Telephonic Communication Services (AREA)
  • Communication Control (AREA)

Abstract

The embodiment of the disclosure provides a remote procedure call retry method, a device and equipment, wherein the method is applied to a first service end, the first service end is used for calling the service of a second service end, and the method comprises the following steps: sending a retry calling request message to the second server to retry to call the service of the second server; receiving calling response information sent by a second server; and if the calling response information contains the calling error code, stopping calling retry to the second server according to the calling error code, and transmitting the calling response information containing the calling error code to each upper-layer server of the first server so as to stop each upper-layer server from calling retry. Since the call retry only occurs between the first service end and the second service end, the call retry times can not be amplified on the link, so that exponential amplification of the call retry link is effectively prevented, the bearing load of each layer of service ends is ensured to meet the working requirement, and the normal and stable work of the whole service system is ensured.

Description

Remote procedure call retry method, device and equipment
Technical Field
The present disclosure relates to the field of communications and computer technologies, and in particular, to a remote procedure call retry method, apparatus, and device.
Background
Rpc (remote Procedure call), remote Procedure call. That is, two servers, such as a first server and a second server, where an application is deployed on the first server, and it is desired to call a function/method provided by the application on the second server, because the function/method is not in a memory space and cannot be directly called, it is necessary to express the semantics of the call and to communicate the called data through a network. The RPC call retry refers to re-executing the call after the RPC call fails. Due to temporary errors often occurring in a distributed system, such as temporary unavailability of services due to network jitter, storage resource access jitter, momentary large traffic, etc., these errors can usually be repaired by themselves. The access may be successful by repeating the RPC call retry, so that the reasonable configuration of the RPC call retry is beneficial to improving the stability of the system service.
At present, in a traditional RPC call retry process, a server of each layer has retry logic, and when a call between servers of any two layers fails, the call will respond to a server of an upper layer with the failure, and the server of the upper layer will continue to call a server of each layer of a lower layer. For example, if it is assumed that in a link of a- > B- > C (server a calls the application of server B, and server B calls the application of server C), if server B calls server C and retries for 3 times fail, then server B will return a failure response to server a. However, the server a also has retry logic, and will continue to retry corresponding to the lower layer server, so that the server C will be retried 9 times, and the number of call retries is exponentially expanded.
That is, in the conventional RPC call retry process, the number of call retries on the link is exponentially increased, so that the multi-layer server on the link cannot work beyond the load, and the whole service system is crashed.
Disclosure of Invention
The embodiment of the disclosure provides a remote procedure call retry method, a remote procedure call retry device and remote procedure call retry equipment, which can solve the problem that in the prior art, the number of call retry times on a link is exponentially increased, so that a multi-layer server on the link exceeds a load and cannot work, and further a whole service system is crashed.
In a first aspect, an embodiment of the present disclosure provides a remote procedure call retry method, where the method is applied to a first service end, where the first service end is used to invoke a service of a second service end, and the method includes:
sending a retry calling request message to the second server to retry to call the service of the second server;
receiving calling response information sent by a second server;
if the calling response information contains a calling error code, stopping retrying to call the service of the second server according to the calling error code, and sending the calling response information containing the calling error code to each upper-layer server of the first server, wherein the calling response information indicates each upper-layer server to stop retrying to call the service of the second server.
In a second aspect, an embodiment of the present disclosure further provides a remote procedure call retry method, where the method is applied to a second server, and a service of the second server is used for being called by a first server, where the method includes:
receiving call retry request information sent by the first service terminal;
if the service of the second server terminal is retried to be called according to the calling retry request information fails, a calling error code is generated;
and sending a calling response message containing the calling error code to the first service end, wherein the calling response message indicates that the first service end stops retrying to call the service of the second service end according to the calling error code, and also indicates that the first service end sends the calling response message to each upper layer service end of the first service end, and the calling response message indicates that each upper layer service end stops retrying to call the service of the second service end.
In a third aspect, an embodiment of the present disclosure provides a remote procedure call retry apparatus, where the apparatus is applied to a first service end, and the first service end is configured to invoke a service of a second service end, where the apparatus includes:
a first sending module, configured to send retry-calling request information to the second server to retry to call the service of the second server;
the first receiving module is used for receiving the calling response information sent by the second server;
and the first processing module is used for stopping retrying to call the service of the second server according to the calling error code if the calling response information contains the calling error code, and sending the calling response information containing the calling error code to each upper-layer server of the first server, wherein the calling response information indicates that each upper-layer server stops retrying to call the service of the second server.
In a fourth aspect, an embodiment of the present disclosure further provides a remote procedure call retry apparatus, where the apparatus is applied to a second server, and a service of the second server is used to be called by a first server, and the apparatus includes:
a second receiving module, configured to receive call retry request information sent by the first service end;
the second processing module is used for generating a calling error code if the service of the second server terminal is retried to be called according to the calling retry request information and fails;
and the second sending module is used for sending calling response information containing the calling error code to the first service terminal, wherein the calling response information indicates that the first service terminal stops retrying to call the service of the second service terminal according to the calling error code, and also indicates that the first service terminal sends the calling response information to each upper-layer service terminal of the first service terminal, and the calling response information indicates that each upper-layer service terminal stops retrying to call the service of the second service terminal.
In a fifth aspect, an embodiment of the present disclosure provides an electronic device, including: a processor and a memory;
the memory stores computer-executable instructions;
the processor executes the computer-executable instructions stored by the memory to cause the processor to perform the remote procedure call retry method as described in the first aspect and various possible designs of the first aspect, or the second aspect and various possible designs of the second aspect.
In a sixth aspect, an embodiment of the present disclosure provides a computer-readable storage medium, where a computer executable instruction is stored, and when the computer executable instruction is executed by a processor, the remote procedure call retry method according to the first aspect and the various possible designs of the first aspect, or the second aspect and the various possible designs of the second aspect is implemented.
In a seventh aspect, an embodiment of the present disclosure provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, the remote procedure call retry method as described in the first aspect and various possible designs of the first aspect, or the second aspect and various possible designs of the second aspect is implemented.
In the method, a retry calling request message is sent to a second server to retry to call the service of the second server; then receiving calling response information sent by a second server; and finally, if the calling response information contains a calling error code, stopping calling retry to the second server according to the calling error code, and transmitting the calling response information containing the calling error code to each upper-layer server of the first server so that each upper-layer server stops calling retry and the second server is only called retry once. Therefore, the call retry only occurs between the first service end and the second service end, the call retry times cannot be amplified on the link, the exponential amplification of the call retry link is effectively prevented, the bearing load of each layer of service end is ensured to meet the working requirement, and the normal and stable work of the whole service system is ensured.
Drawings
In order to more clearly illustrate the embodiments of the present disclosure or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present disclosure, and for those skilled in the art, other drawings can be obtained according to the drawings without inventive exercise.
Fig. 1 is a schematic view of a scenario of a remote procedure call retry method according to an embodiment of the present disclosure;
FIG. 2 is a first flowchart illustrating a remote procedure call retry method according to an embodiment of the present disclosure;
fig. 3 is a schematic diagram of a principle that a first server sends information of a retry request to a second server according to an embodiment of the present disclosure;
fig. 4 is a schematic diagram illustrating a principle that a first server receives call response information sent by a second server according to an embodiment of the present disclosure;
fig. 5 is a schematic diagram illustrating a principle that a first server sends information of a retry request to a second server according to another embodiment of the present disclosure;
FIG. 6 is a flowchart illustrating a remote procedure call retry method according to an embodiment of the disclosure;
FIG. 7 is a block diagram illustrating a remote procedure call retry apparatus according to an embodiment of the present disclosure;
FIG. 8 is a block diagram of a remote procedure call retry apparatus according to an embodiment of the present disclosure;
fig. 9 is a schematic diagram of a hardware structure of an electronic device according to an embodiment of the present disclosure.
Detailed Description
To make the objects, technical solutions and advantages of the embodiments of the present disclosure more clear, the technical solutions of the embodiments of the present disclosure will be described clearly and completely with reference to the drawings in the embodiments of the present disclosure, and it is obvious that the described embodiments are some, but not all embodiments of the present disclosure. All other embodiments, which can be derived by a person skilled in the art from the embodiments disclosed herein without making any creative effort, shall fall within the protection scope of the present disclosure.
At present, in a traditional RPC call retry process, a server of each layer has retry logic, and when a call between servers of any two layers fails, the call will respond to a higher-layer server with a failureThe service end, the service end of the upper layer can continue to call the service end of each layer of the lower layer. Assuming that the normal access amount is n, the link has m layers in total, the retry number of each layer is r, and the maximum access amount is n x r (m-1) . The number of call retries on the link is exponentially enlarged, so that a plurality of layers of service terminals on the link cannot work beyond the load, and the whole service system is crashed.
In order to solve the above technical problem, an embodiment of the present disclosure provides a remote procedure call retry method, where when an upper server fails to call a service of a current-layer server, a call error code is added to call response information returned by the upper server, the upper server transfers the call response information including the call error code to each higher-layer server layer by layer, and when the upper server and each higher-layer server recognize the call error code, call retry on each lower-layer server is not performed. Therefore, the call retry only occurs between the upper-layer server and the local-layer server, the call retry times cannot be amplified on the link, the exponential amplification of the call retry link is effectively prevented, the bearing load of each layer of server is ensured to meet the working requirement, and the normal and stable work of the whole service system is ensured.
Referring to fig. 1, fig. 1 is a schematic view of a scenario of a remote procedure call retry method according to an embodiment of the present disclosure. As shown in fig. 1, the system provided in this embodiment includes a service system link composed of service ends in different layers. The service system can be any form of service, for example, in a scene of completing the auditing of each order or completing each game item, application services on the service end of the different layers need to be called to complete the service of the whole system.
In a certain scenario, as shown in fig. 1, a first layer server invokes an application service of a second server, a second layer server invokes an application service of a third server, a third layer server invokes an application service of a fourth server, … … and so on, and an N-1 layer server invokes an application service of an nth layer server.
In the embodiment of the present disclosure, a server actively calling other servers is referred to as a first server. The called server is called a second server. The first service end is used for calling the service of the second service end.
As shown in fig. 1, the first server may be any one of the first layer server to the nth server, and the second server may also be any one of the first layer server to the nth server.
In some scenarios, the first server may be converted with the second server, which is not intended to limit the present disclosure in any way.
Referring to fig. 2, fig. 2 is a first flowchart of a remote procedure call retry method according to an embodiment of the present disclosure. The method of the embodiment is applied to a first service end, the first service end is used for calling the service of a second service end, and the remote procedure call retry method comprises the following steps:
s201: and sending a retry calling request message to the second server to retry to call the service of the second server.
In the embodiment of the present disclosure, the call retry request message is an RPC protocol message. The RPC protocol message may include a protocol header field, an extension field, and a request data field.
The retry request information is sent when the first server fails to make the RPC call to the second server and then re-executes the call.
The protocol header field is used for carrying the addresses of the first service end and the second service end. The request data field is used for carrying data information for calling the retry request information to request to call the service of the second server. The extension field is a null field. Referring to fig. 3, fig. 3 is a schematic diagram illustrating a principle that a first server sends information of a retry call request to a second server according to an embodiment of the present disclosure.
S202: and receiving the calling response information sent by the second server.
In the embodiment of the present disclosure, the second server retries to invoke the service of the second server according to the invocation retry request information, and generates the invocation response information according to the invocation process.
S203: if the calling response information contains a calling error code, the calling response information stops retrying to call the service of the second server according to the calling error code, and sends the calling response information containing the calling error code to each upper layer server of the first server, and the calling response information indicates each upper layer server to stop retrying to call the service of the second server.
In the embodiment of the present disclosure, if the call response information includes the call error code, it is determined that the service calling the second server fails. The first server does not call the second server again according to the calling error code, and transfers the calling error code to each upper-layer server layer by layer, the error codes are transferred layer by layer, the server receiving the error code in each layer can not call the server in the lower layer again, the first server can not repeatedly retry to call the service of the second server, and the second server can only be called and retried once.
In the embodiment of the present disclosure, the call response information is an RPC protocol packet. The RPC protocol message may include a protocol header field, an extension field, and a return data field.
The protocol header field is used for carrying the addresses of the first service end and the second service end. The return data field is used for carrying return data information for calling the retry request information to request for calling the service of the second service terminal. The extension field carries a call error code. Referring to fig. 4, fig. 4 is a schematic diagram illustrating a principle that a first service end receives call response information sent by a second service end according to an embodiment of the present disclosure.
It should be noted that: before step S201, the first server sends call request information to the second server, so as to call the service of the second server. If the service of the second server is invoked unsuccessfully, the step S201 is executed.
As can be seen from the above description, first sending a retry calling request message to a second server to retry calling the service of the second server; then receiving calling response information sent by a second server; and finally, if the calling response information contains the calling error code, the calling retry is not carried out on the second server according to the calling error code, and the calling response information containing the calling error code is transmitted to each upper-layer server of the first server, so that each upper-layer server does not carry out the calling retry, and the second server is only called to retry once. Therefore, the call retry only occurs between the first service end and the second service end, the call retry times cannot be amplified on the link, the exponential amplification of the call retry link is effectively prevented, the bearing load of each layer of service end is ensured to meet the working requirement, and the normal and stable work of the whole service system is ensured.
In an embodiment of the present disclosure, the information of the call retry request includes a retry identifier, and the step S201 further specifically includes: and sending a retry calling request message to the second server to call the service of the second server, wherein the retry calling request message indicates that the second server stops retrying to call the service of each lower layer server of the second server according to the retry identifier.
Specifically, call retry request information is sent to the second server, where the call retry request information includes a retry identifier, so as to call the service of the second server, and enable the second server not to perform call retry to each lower layer server of the second server according to the retry identifier, and further not to retry to call the service of each lower layer server of the second server.
In the embodiment of the present disclosure, the retry calling request message is an RPC protocol message. The RPC protocol message may include a protocol header field, an extension field, and a request data field. The protocol header field is used for carrying the addresses of the first service end and the second service end. The request data field is used for carrying data information for calling the retry request information to request to call the service of the second server. The extension field is used for carrying the retry identification. Referring to fig. 5, fig. 5 is a schematic diagram illustrating a principle that a first server sends information of a retry call request to a second server according to another embodiment of the present disclosure.
In the embodiment of the present disclosure, the second server does not perform call retry to the next-layer server of the second server according to the retry identifier; and sending retry information containing the retry identification to a next-layer server of the second server, so that the next-layer server of the second server does not call retry to the servers of the lower layers, and the retry information is transmitted to the servers of the lower layers, and further service of each lower-layer server of the second server is not called again.
As can be seen from the above description, by including the retry flag in the call retry request message, even when the first server cannot receive the call response message (e.g., timeout) of the second server and the servers in each layer cannot obtain the call error code, the call retry may not be performed on the servers in the respective lower layers according to the retry flag in the call retry request message. That is, the present embodiment can continue to prevent retry of link amplification as a solution to call error code failure.
In an embodiment of the present disclosure, in step S203, the sending, to each upper server of the first server, the call response information including the call error code, where the call response information indicates that each upper server stops retrying to call the service of the second server specifically includes:
and sending call response information containing the call error code to a previous-layer server of the first server, wherein the call response information indicates that the previous-layer server stops retrying to call the service of the second server, and also indicates that the call response information containing the call error code is transmitted to each upper-layer server of the previous-layer server, and the call response information indicates that each upper-layer server stops retrying to call the service of the second server.
Specifically, the call response information including the call error code is sent to the upper layer server of the first server, so that the upper layer server does not retry the call to the first server, and the call response information including the call error code is transmitted to the upper layer servers, so that the upper layers of the second server stop retrying the call to the service of the second server.
In the embodiment of the present disclosure, the call response information including the call error code is transmitted to the upper-layer servers layer by layer, and the server that has acquired the call error code in each layer does not perform call retry to the lower-layer server.
Referring to fig. 6, fig. 6 is a schematic flowchart of a remote procedure call retry method according to an embodiment of the disclosure. The method of the embodiment is applied to a second server, the service of the second server is used for being called by a first server, and the remote procedure call retry method comprises the following steps:
s601: and receiving the call retry request information sent by the first service terminal.
S602: and if the service of the second server terminal is retried to be invoked according to the invocation retry request information and fails, generating an invocation error code.
In this embodiment of the present disclosure, the failure in retrying the service of the second server by calling the retry request information may be a service failure calling the second server, which is caused by temporary unavailability of the service due to network jitter, storage resource access jitter, and instantaneous large flow.
S603: and sending a calling response message containing the calling error code to the first service end, wherein the calling response message indicates that the first service end stops retrying to call the service of the second service end according to the calling error code, and also indicates that the first service end sends the calling response message containing the calling error code to each upper-layer service end of the first service end, and the calling response message indicates that each upper-layer service end stops retrying to call the service of the second service end.
Specifically, the call response information including the call error code is sent to the first service end, so that the first service end does not perform call retry to the second service end according to the call error code, and the call response information including the call error code is transmitted to each upper layer service end of the first service end, so that each upper layer service end does not perform call retry.
It can be known from the above description that the call retry only occurs between the first service end and the second service end, and the call retry number is not amplified on the link, thereby effectively preventing the exponential amplification of the call retry link, ensuring that the load bearing of each layer of service end meets the working requirement, and ensuring the normal and stable working of the whole service system.
In an embodiment of the present disclosure, the information of the request for call retry includes a retry identifier; the method further comprises the following steps: and stopping retrying and calling the service of each lower layer server of the second server according to the retrying identifier.
Specifically, the service of the next layer server of the second server is called by stopping retrying according to the retrying identifier; and sending retry information containing the retry identification to a next-layer server of a second server, wherein the retry information indicates that the next-layer server of the second server stops calling retry to a lower-layer server, and also indicates that the retry information is transmitted to each lower-layer server of the next-layer server to stop retrying to call the service of each lower-layer server.
As can be seen from the above description, by including the retry flag in the call retry request message, even when the first server cannot receive the call response message (e.g., timeout) of the second server and the servers in each layer cannot obtain the call error code, the call retry may not be performed on the servers in the respective lower layers according to the retry flag in the call retry request message. That is, as a solution to call error code failure, it is possible to continue to prevent retry of link amplification.
Fig. 7 is a block diagram illustrating a remote procedure call retry apparatus according to an embodiment of the disclosure, which corresponds to the remote procedure call retry method in the embodiment of fig. 2. For ease of illustration, only portions relevant to embodiments of the present disclosure are shown. Referring to fig. 7, the apparatus is applied to a first service end, where the first service end is used to invoke a service of a second service end, and the apparatus includes:
a first sending module 701, configured to send a retry calling request message to the second server to retry to call the service of the second server;
a first receiving module 702, configured to receive call response information sent by the second server;
the first processing module 703 is configured to, if the call response information includes a call error code, stop retrying to call the service of the second server according to the call error code, and send the call response information including the call error code to each upper server of the first server, where the call response information indicates that each upper server stops retrying to call the service of the second server.
According to one or more embodiments of the present disclosure, the call retry request information includes a retry identifier; the first sending module 701 is specifically configured to send a retry calling request message to the second server to call the service of the second server, where the retry calling request message indicates that the second server stops retrying to call the service of each lower layer server of the second server according to the retry identifier.
According to one or more embodiments of the present disclosure, the first processing module 703 is specifically configured to send, to a higher-level server of the first server, a call response message including the call error code, where the call response message indicates that the higher-level server stops retrying to call the service of the second server, and further indicates that the call response message including the call error code is transmitted to each higher-level server of the higher-level server, and the call response message indicates that the each higher-level server stops retrying to call the service of the second server.
According to one or more embodiments of the present disclosure, the call response information includes an extension field, and the call error code is located in the extension field.
The apparatus provided in this embodiment may be used to implement the technical solutions of the above method embodiments, and the implementation principles and technical effects are similar, which are not described herein again.
Fig. 8 is a block diagram of a second structure of a remote procedure call retry apparatus according to an embodiment of the present disclosure, which corresponds to the remote procedure call retry method in the embodiment shown in fig. 6. For ease of illustration, only portions that are relevant to embodiments of the present disclosure are shown. Referring to fig. 8, the apparatus is applied to a second service end, where a service of the second service end is used to be called by a first service end, and the apparatus includes:
a second receiving module 801, configured to receive a retry calling request message sent by the first service end;
a second processing module 802, configured to generate a call error code if a service that retries to call the second server according to the call retry request information fails;
a second sending module 803, configured to send a call response message that includes the call error code to the first service end, where the call response message indicates that the first service end stops retrying to call the service of the second service end according to the call error code, and also indicates that the first service end sends the call response message to each upper layer service end of the first service end, where the call response message indicates that each upper layer service end stops retrying to call the service of the second service end.
According to one or more embodiments of the present disclosure, the call retry request information includes a retry identifier; the processing module 802 is further configured to: and stopping retrying and calling the service of each lower layer server of the second server according to the retrying identifier.
According to one or more embodiments of the present disclosure, the information of the call retry request includes a retry identifier; the processing module 802 is further specifically configured to: stopping retrying and calling the service of the next layer of service end of the second service end according to the retrying identifier; and sending retry information containing the retry identification to a next-layer server of a second server, wherein the retry information indicates that the next-layer server of the second server stops calling and retrying to a server of a lower layer, and also indicates that the retry information is transmitted to the server of each lower layer of the next-layer server to stop retrying and calling the service of the server of each lower layer.
According to one or more embodiments of the present disclosure, the call retry request information includes an extension field, and the retry identification is located in the extension field.
The apparatus provided in this embodiment may be configured to implement the technical solutions of the method embodiments, and the implementation principles and technical effects are similar, which are not described herein again.
In order to implement the above embodiments, an embodiment of the present disclosure further provides an electronic device.
Referring to fig. 9, a schematic diagram of an electronic device 900 suitable for implementing an embodiment of the present disclosure is shown, where the electronic device 900 may be a client device or a server. Among them, the client devices may include, but are not limited to, mobile clients such as mobile phones, notebook computers, Digital broadcast receivers, Personal Digital Assistants (PDAs), tablet computers (PADs), Portable Multimedia Players (PMPs), in-vehicle clients (e.g., car navigation clients), and the like, and fixed clients such as Digital TVs, desktop computers, and the like. The electronic device shown in fig. 9 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present disclosure.
As shown in fig. 9, the electronic device 900 may include a processing means (e.g., a central processing unit, a graphics processor, etc.) 901, which may perform various suitable actions and processes according to a program stored in a Read Only Memory (ROM) 902 or a program loaded from a storage device 908 into a Random Access Memory (RAM) 903. In the RAM 903, various programs and data necessary for the operation of the electronic apparatus 900 are also stored. The processing apparatus 901, the ROM902, and the RAM 903 are connected to each other through a bus 904. An input/output (I/O) interface 905 is also connected to bus 904.
Generally, the following devices may be connected to the I/O interface 905: input devices 906 including, for example, a touch screen, touch pad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; an output device 907 including, for example, a Liquid Crystal Display (LCD), a speaker, a vibrator, and the like; storage 908 including, for example, magnetic tape, hard disk, etc.; and a communication device 909. The communication means 909 may allow the electronic apparatus 900 to communicate with other apparatuses wirelessly or by wire to exchange data. While fig. 9 illustrates an electronic device 900 having various means, it is to be understood that not all illustrated means are required to be implemented or provided. More or fewer devices may alternatively be implemented or provided.
In particular, according to an embodiment of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network through the communication device 909, or installed from the storage device 908, or installed from the ROM 902. The computer program performs the above-described functions defined in the methods of the embodiments of the present disclosure when executed by the processing apparatus 901.
It should be noted that the computer readable medium of the present disclosure may be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present disclosure, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In contrast, in the present disclosure, a computer readable signal medium may comprise a propagated data signal with computer readable program code embodied therein, either in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, optical cables, RF (radio frequency), etc., or any suitable combination of the foregoing.
The computer readable medium may be embodied in the electronic device; or may exist separately without being assembled into the electronic device.
The computer readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to perform the methods shown in the above embodiments.
Computer program code for carrying out operations for aspects of the present disclosure may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + +, and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the latter scenario, the remote computer may be connected to the user's computer through any type of Network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units described in the embodiments of the present disclosure may be implemented by software or hardware. Where the name of a unit does not in some cases constitute a limitation of the unit itself, for example, the first retrieving unit may also be described as a "unit for retrieving at least two internet protocol addresses".
The functions described herein above may be performed, at least in part, by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field Programmable Gate Arrays (FPGAs), Application Specific Integrated Circuits (ASICs), Application Specific Standard Products (ASSPs), systems on a chip (SOCs), Complex Programmable Logic Devices (CPLDs), and the like.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
In a first aspect, according to one or more embodiments of the present disclosure, a remote procedure call retry method is provided, where the method is applied to a first service end, and the first service end is used to invoke a service of a second service end, and the method includes:
sending a retry calling request message to the second server to retry to call the service of the second server;
receiving calling response information sent by a second server;
if the calling response information contains a calling error code, the calling response information stops retrying to call the service of the second server according to the calling error code, and sends the calling response information containing the calling error code to each upper layer server of the first server, and the calling response information indicates each upper layer server to stop retrying to call the service of the second server.
According to one or more embodiments of the present disclosure, the call retry request information includes a retry identifier;
the sending a retry calling request message to the second server to retry calling the service of the second server includes:
and sending a retry calling request message to the second server to call the service of the second server, wherein the retry calling request message indicates that the second server stops retrying to call the service of each lower layer server of the second server according to the retry identifier.
According to one or more embodiments of the present disclosure, the sending, to each upper server of the first server, the call response information including the call error code, where the call response information indicates that each upper server stops retrying to call the service of the second server, includes:
and sending call response information containing the call error code to a previous-layer server of the first server, wherein the call response information indicates that the previous-layer server stops retrying to call the service of the second server, and also indicates that the call response information containing the call error code is transmitted to each upper-layer server of the previous-layer server, and the call response information indicates that each upper-layer server stops retrying to call the service of the second server.
According to one or more embodiments of the present disclosure, the call response information includes an extension field, and the call error code is located in the extension field.
In a second aspect, according to one or more embodiments of the present disclosure, there is provided a remote procedure call retry method, where the method is applied to a second server, and a service of the second server is used to be called by a first server, the method includes:
receiving call retry request information sent by the first service terminal;
if the service of the second server terminal is retried and called according to the calling retry request information fails, a calling error code is generated;
and sending a calling response message containing the calling error code to the first service end, wherein the calling response message indicates that the first service end stops retrying to call the service of the second service end according to the calling error code, and also indicates that the first service end sends the calling response message to each upper layer service end of the first service end, and the calling response message indicates that each upper layer service end stops retrying to call the service of the second service end.
According to one or more embodiments of the present disclosure, the call retry request information includes a retry identifier; the method further comprises the following steps:
and stopping retrying and calling the service of each lower layer server of the second server according to the retrying identifier.
According to one or more embodiments of the present disclosure, the stopping retrying to invoke the service of each lower layer server of the second server according to the retry identifier includes:
stopping retrying and calling the service of the next layer of service end of the second service end according to the retrying identifier;
and sending retry information containing the retry identification to a next-layer server of a second server, wherein the retry information indicates that the next-layer server of the second server stops calling retry to a lower-layer server, and also indicates that the retry information is transmitted to each lower-layer server of the next-layer server to stop retrying to call the service of each lower-layer server.
According to one or more embodiments of the present disclosure, the call retry request information includes an extension field, and the retry identification is located in the extension field.
In a third aspect, according to one or more embodiments of the present disclosure, there is provided a remote procedure call retry apparatus, where the apparatus is applied to a first service end, and the first service end is configured to invoke a service of a second service end, and the apparatus includes:
the first sending module is used for sending a retry calling request message to the second server so as to retry to call the service of the second server;
the first receiving module is used for receiving the calling response information sent by the second server;
and the first processing module is used for stopping retrying to call the service of the second server according to the calling error code if the calling response information contains the calling error code, and sending the calling response information containing the calling error code to each upper-layer server of the first server, wherein the calling response information indicates that each upper-layer server stops retrying to call the service of the second server.
According to one or more embodiments of the present disclosure, the information of the call retry request includes a retry identifier; the first sending module is specifically configured to send a retry calling request message to the second server to call the service of the second server, where the retry calling request message indicates that the second server stops retrying to call the service of each lower layer server of the second server according to the retry identifier.
According to one or more embodiments of the present disclosure, the first processing module is specifically configured to send a call response message including the call error code to a previous-layer server of the first server, where the call response message indicates that the previous-layer server stops retrying to call the service of the second server, and also indicates that the call response message including the call error code is transmitted to each upper-layer server of the previous-layer servers, and the call response message indicates that each upper-layer server stops retrying to call the service of the second server.
According to one or more embodiments of the present disclosure, the call response information includes an extension field, and the call error code is located in the extension field.
In a fourth aspect, according to one or more embodiments of the present disclosure, there is provided a remote procedure call retry apparatus, the apparatus being applied to a second service end, a service of the second service end being used for being called by a first service end, the apparatus including:
a second receiving module, configured to receive call retry request information sent by the first service end;
the second processing module is used for generating a calling error code if the service of the second server terminal is retried to be called according to the calling retry request information and fails;
and the second sending module is used for sending calling response information containing the calling error code to the first service terminal, wherein the calling response information indicates that the first service terminal stops retrying to call the service of the second service terminal according to the calling error code, and also indicates that the first service terminal sends the calling response information to each upper-layer service terminal of the first service terminal, and the calling response information indicates that each upper-layer service terminal stops retrying to call the service of the second service terminal.
According to one or more embodiments of the present disclosure, the information of the call retry request includes a retry identifier; the processing module is further configured to: and stopping retrying and calling the service of each lower layer service end of the second service end according to the retrying identifier.
According to one or more embodiments of the present disclosure, the information of the call retry request includes a retry identifier; the processing module is further specifically configured to: stopping retrying and calling the service of the next layer of service end of the second service end according to the retrying identifier; and sending retry information containing the retry identification to a next-layer server of a second server, wherein the retry information indicates that the next-layer server of the second server stops calling and retrying to a server of a lower layer, and also indicates that the retry information is transmitted to the server of each lower layer of the next-layer server to stop retrying and calling the service of the server of each lower layer.
According to one or more embodiments of the present disclosure, the call retry request information includes an extension field, and the retry identification is located in the extension field.
In a fifth aspect, according to one or more embodiments of the present disclosure, there is provided an electronic device including: a processor and a memory;
the memory stores computer-executable instructions;
the processor executes the computer-executable instructions stored by the memory to cause the processor to perform the remote procedure call retry method as described in the first aspect and various possible designs of the first aspect, or the second aspect and various possible designs of the second aspect.
In a sixth aspect, according to one or more embodiments of the present disclosure, there is provided a computer-readable storage medium having stored therein computer-executable instructions that, when executed by a processor, implement the remote procedure call retry method as set forth in the first aspect and various possible designs of the first aspect, or the second aspect and various possible designs of the second aspect.
In a seventh aspect, an embodiment of the present disclosure provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, the remote procedure call retry method as described in the first aspect and various possible designs of the first aspect, or the second aspect and various possible designs of the second aspect is implemented.
The foregoing description is only exemplary of the preferred embodiments of the disclosure and is illustrative of the principles of the technology employed. It will be appreciated by those skilled in the art that the scope of the disclosure herein is not limited to the particular combination of features described above, but also encompasses other combinations of features described above or equivalents thereof without departing from the spirit of the disclosure. For example, the above features and (but not limited to) the features disclosed in this disclosure having similar functions are replaced with each other to form the technical solution.
Further, while operations are depicted in a particular order, this should not be understood as requiring that such operations be performed in the particular order shown or in sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Likewise, while several specific implementation details are included in the above discussion, these should not be construed as limitations on the scope of the disclosure. Certain features that are described in the context of separate embodiments can also be implemented in combination in a single embodiment. Conversely, various features that are described in the context of a single embodiment can also be implemented in multiple embodiments separately or in any suitable subcombination.
Although the subject matter has been described in language specific to structural features and/or methodological acts, it is to be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are disclosed as example forms of implementing the claims.

Claims (12)

1. A remote procedure call retry method is applied to a first service end, wherein the first service end is used for calling a service of a second service end, and the method comprises the following steps:
sending a retry calling request message to the second server to retry to call the service of the second server;
receiving calling response information sent by the second server;
if the calling response information contains a calling error code, the calling response information stops retrying to call the service of the second server according to the calling error code, and sends the calling response information containing the calling error code to each upper layer server of the first server, and the calling response information indicates each upper layer server to stop retrying to call the service of the second server.
2. The method according to claim 1, wherein the call retry request information includes a retry identifier;
the sending of the call retry request information to the second server to retry to call the service of the second server includes:
and sending a retry calling request message to the second server to call the service of the second server, wherein the retry calling request message indicates that the second server stops retrying to call the service of each lower layer server of the second server according to the retry identifier.
3. The method of claim 1, wherein the sending, to each upper server of the first servers, the invocation response information including the invocation error code, where the invocation response information indicates that each upper server stops retrying to invoke the service of the second server, includes:
and sending call response information containing the call error code to a previous-layer server of the first server, wherein the call response information indicates that the previous-layer server stops retrying to call the service of the second server, and also indicates that the call response information containing the call error code is transmitted to each upper-layer server of the previous-layer server, and the call response information indicates that each upper-layer server stops retrying to call the service of the second server.
4. The method according to any of claims 1 to 3, the call response information comprising an extension field, the call error code being located in the extension field.
5. A remote procedure call retry method, which is applied to a second server, the service of the second server is used for being called by a first server, and the method comprises the following steps:
receiving call retry request information sent by the first service terminal;
if the service of the second server terminal is retried to be called according to the calling retry request information fails, a calling error code is generated;
and sending a calling response message containing the calling error code to the first service end, wherein the calling response message indicates that the first service end stops retrying to call the service of the second service end according to the calling error code, and also indicates that the first service end sends the calling response message to each upper layer service end of the first service end, and the calling response message indicates that each upper layer service end stops retrying to call the service of the second service end.
6. The method of claim 5, wherein the information of the request for call retry includes a retry identifier; the method further comprises the following steps:
and stopping retrying and calling the service of each lower layer service end of the second service end according to the retrying identifier.
7. The method of claim 6, wherein the stopping retry of the call to the service of each lower layer server of the second server according to the retry identifier comprises:
stopping retrying and calling the service of the next layer of service end of the second service end according to the retrying identifier;
and sending retry information containing the retry identification to a next-layer server of a second server, wherein the retry information indicates that the next-layer server of the second server stops calling retry to a lower-layer server, and also indicates that the retry information is transmitted to each lower-layer server of the next-layer server to stop retrying to call the service of each lower-layer server.
8. The method of claim 6, the invoke-retry-request information comprising an extension field, the retry identification being located in the extension field.
9. A remote procedure call retry apparatus, applied to a first service end, the first service end being configured to invoke a service of a second service end, the apparatus comprising:
a first sending module, configured to send retry-calling request information to the second server to retry to call the service of the second server;
the first receiving module is used for receiving the calling response information sent by the second server;
and the first processing module is used for stopping retrying to call the service of the second server according to the calling error code if the calling response information contains the calling error code, and sending the calling response information containing the calling error code to each upper-layer server of the first server, wherein the calling response information indicates that each upper-layer server stops retrying to call the service of the second server.
10. A remote procedure call retry apparatus, the apparatus being applied to a second server, a service of the second server being used to be called by a first server, the apparatus comprising:
a second receiving module, configured to receive call retry request information sent by the first service end;
the second processing module is used for generating a calling error code if the service of the second server terminal is retried to be called according to the calling retry request information and fails;
and the second sending module is used for sending calling response information containing the calling error code to the first service terminal, wherein the calling response information indicates that the first service terminal stops retrying to call the service of the second service terminal according to the calling error code, and also indicates that the first service terminal sends the calling response information containing the calling error code to each upper-layer service terminal of the first service terminal, and the calling response information indicates that each upper-layer service terminal stops retrying to call the service of the second service terminal.
11. An electronic device, comprising: a processor and a memory;
the memory stores computer-executable instructions;
the processor executes the memory-stored computer-executable instructions to cause the electronic device to implement the remote procedure call retry method of any of claims 1 to 4 or 5 to 8.
12. A computer readable storage medium having stored therein computer executable instructions which, when executed by a processor, implement the remote procedure call retry method of any of claims 1 to 4 or 5 to 8.
CN202110177698.4A 2021-02-07 2021-02-07 Remote procedure call retry method, device and equipment Active CN114911633B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110177698.4A CN114911633B (en) 2021-02-07 2021-02-07 Remote procedure call retry method, device and equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110177698.4A CN114911633B (en) 2021-02-07 2021-02-07 Remote procedure call retry method, device and equipment

Publications (2)

Publication Number Publication Date
CN114911633A true CN114911633A (en) 2022-08-16
CN114911633B CN114911633B (en) 2024-07-12

Family

ID=82761214

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110177698.4A Active CN114911633B (en) 2021-02-07 2021-02-07 Remote procedure call retry method, device and equipment

Country Status (1)

Country Link
CN (1) CN114911633B (en)

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060230305A1 (en) * 2005-04-07 2006-10-12 Microsoft Corporation Retry request overload protection
WO2011081931A2 (en) * 2009-12-14 2011-07-07 Citrix Systems, Inc. Systems and methods for service isolation
US20120005531A1 (en) * 2010-06-30 2012-01-05 International Business Machines Corporation Server throttled client debugging
CN106716966A (en) * 2014-09-30 2017-05-24 高通股份有限公司 Active TCP connections used for HTTP streaming content requests stopped recovering
CN107645476A (en) * 2016-07-22 2018-01-30 百度在线网络技术(北京)有限公司 Request processing method and device
CN110442432A (en) * 2019-08-22 2019-11-12 北京三快在线科技有限公司 Method for processing business, system, device, equipment and storage medium
CN110750371A (en) * 2019-10-17 2020-02-04 北京创鑫旅程网络技术有限公司 Flow execution method, device, equipment and storage medium
CN111131377A (en) * 2019-10-30 2020-05-08 苏州浪潮智能科技有限公司 HTTP retry method and device
CN111258776A (en) * 2020-01-09 2020-06-09 上海钧正网络科技有限公司 Disaster recovery method and device for remote service calling

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060230305A1 (en) * 2005-04-07 2006-10-12 Microsoft Corporation Retry request overload protection
WO2011081931A2 (en) * 2009-12-14 2011-07-07 Citrix Systems, Inc. Systems and methods for service isolation
US20120005531A1 (en) * 2010-06-30 2012-01-05 International Business Machines Corporation Server throttled client debugging
CN106716966A (en) * 2014-09-30 2017-05-24 高通股份有限公司 Active TCP connections used for HTTP streaming content requests stopped recovering
CN107645476A (en) * 2016-07-22 2018-01-30 百度在线网络技术(北京)有限公司 Request processing method and device
CN110442432A (en) * 2019-08-22 2019-11-12 北京三快在线科技有限公司 Method for processing business, system, device, equipment and storage medium
CN110750371A (en) * 2019-10-17 2020-02-04 北京创鑫旅程网络技术有限公司 Flow execution method, device, equipment and storage medium
CN111131377A (en) * 2019-10-30 2020-05-08 苏州浪潮智能科技有限公司 HTTP retry method and device
CN111258776A (en) * 2020-01-09 2020-06-09 上海钧正网络科技有限公司 Disaster recovery method and device for remote service calling

Also Published As

Publication number Publication date
CN114911633B (en) 2024-07-12

Similar Documents

Publication Publication Date Title
US12019652B2 (en) Method and device for synchronizing node data
CN111555940B (en) Client test method and device, electronic equipment and computer readable storage medium
CN110851139B (en) Method and device for checking codes and electronic equipment
CN113553178A (en) Task processing method, device and electronic device
CN111858381A (en) Application program fault tolerance capability test method, electronic device and medium
CN113835992A (en) Memory leak processing method and device, electronic equipment and computer storage medium
CN113157365B (en) Program running method, program running device, electronic equipment and computer readable medium
CN113518183B (en) Camera calling method and device and electronic equipment
CN111427693B (en) Data processing method, system, medium, service system and bypass unloading system
CN113760503A (en) Task migration method, apparatus, electronic device, and computer-readable medium
CN114911633A (en) Remote procedure call retry method, device and equipment
CN116522200A (en) Data circulation method, device, equipment, storage medium and product
CN111756833B (en) Node processing method, node processing device, electronic equipment and computer readable medium
CN110278133B (en) Checking method, device, computing equipment and medium executed by server
CN109669679B (en) Service detection and processing method and device and electronic equipment
CN111626787B (en) Resource issuing method, device, medium and equipment
CN113783666A (en) Method and device for processing service
CN110955583A (en) Notification method and device, electronic equipment and storage medium
CN117971275B (en) Power Internet of Things flow management application loading method, device, equipment and medium
CN111241443A (en) Method and device for pushing information and electronic equipment
CN113312179B (en) Data component management method, device and system, electronic equipment and storage medium
CN113849756B (en) Information generation method, apparatus, electronic device and computer readable medium
CN116450370B (en) Method and device for inter-process communication
CN114356788B (en) Application program detection method, device, equipment and medium based on user information
CN118158082B (en) Method, device, equipment and medium for updating communication resource message of intelligent household equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant