Remote procedure call processing method and device, readable storage medium and equipment

By using asynchronous callbacks and reactive objects in the RPC framework, the problem of asynchronous callbacks in the RPC framework not supporting return results is solved, and an efficient and reliable communication process is achieved.

CN119356906APending Publication Date: 2025-01-24BEIJING JINGDONG YUANSHENG TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411404553.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-09
Publication Date
2025-01-24

AI Technical Summary

Technical Problem

Most RPC frameworks do not support returning results for asynchronous callbacks, resulting in limited application scenarios.

Method used

Call the auxiliary service provider through the asynchronous callback method, and use the response object to monitor the recycling results, and quickly return to the call end.

Benefits of technology

It solves the problem that asynchronous callback cannot return processing results, improves the result response speed, and realizes efficient and reliable communication between the caller, service provider and auxiliary service provider.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119356906A_ABST
    Figure CN119356906A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of computers, and provides a remote procedure call processing method, a remote procedure call processing device, a computer readable storage medium and an electronic device.The remote procedure call processing method is applied to a first service provider. The method comprises the following steps: in response to a received remote procedure calling request for a first service sent by a calling end, calling at least one auxiliary service provider in an asynchronous callback mode, so that each auxiliary service provider calls the respective corresponding auxiliary service in the asynchronous calling mode; creating a responsive object; the responsive object is used for monitoring an asynchronous callback result returned by the at least one auxiliary service provider; and when the response type object monitors an asynchronous callback result returned by the at least one auxiliary service provider, returning the asynchronous callback result to the calling end. The problem that asynchronous callback does not support processing result returning in the related technology can be solved.
Need to check novelty before this filing date? Find Prior Art

Description

Background Art

[0002] RPC (Remote Procedure Call) is a programming model that allows programs to call procedures or functions in another address space (usually located on another machine) on different nodes in the network just like calling local functions. This technology allows services in a distributed system to call each other without developers having to deal with complex network communication details directly.

[0003] However, currently, most RPC frameworks do not support returning results for asynchronous callback calling methods, and their application scenarios are very limited.

[0004] In view of this, there is an urgent need in the art to develop a new remote procedure call processing method and device.

[0005] It should be noted that the information disclosed in the above background technology section is only used to enhance the understanding of the background of the present disclosure. Summary of the invention

[0006] The purpose of the present disclosure is to provide a remote procedure call processing method, a remote procedure call processing device, a computer-readable storage medium and an electronic device, thereby at least to a certain extent overcoming the technical problem that most RPC frameworks do not support the return of results for asynchronous callback calling methods due to the limitations of related technologies.

[0007] Other features and advantages of the present disclosure will become apparent from the following detailed description, or may be learned in part by the practice of the present disclosure.

[0008] According to a first aspect of the present disclosure, a remote procedure call processing method is provided, which is applied to a first service provider, where the first service provider is used to provide a first service, where the first service depends on an auxiliary service provided by each of at least one auxiliary service provider, the method comprising:

[0009] In response to receiving a remote procedure call request for the first service sent by the calling end, calling the at least one auxiliary service provider by asynchronous callback, so that each of the auxiliary service providers calls the corresponding auxiliary service by asynchronous calling;

[0010] Creating a responsive object; the responsive object is used to monitor the asynchronous callback result returned by the at least one auxiliary service provider;

[0011] When the responsive object monitors the asynchronous callback result returned by the at least one auxiliary service provider, the asynchronous callback result is returned to the calling end.

[0012] In an exemplary embodiment of the present disclosure, after receiving the remote procedure call request sent by the calling end, the method further includes:

[0013] Verifying the remote procedure call request to obtain a verification result;

[0014] In response to the verification result being a passed verification, the at least one auxiliary service provider is called by way of an asynchronous callback.

[0015] In an exemplary embodiment of the present disclosure, calling the at least one auxiliary service provider by asynchronous callback includes:

[0016] The interface corresponding to each auxiliary service provider is called in an asynchronous callback manner to call the at least one auxiliary service provider.

[0017] In an exemplary embodiment of the present disclosure, when the responsive object monitors the asynchronous callback result returned by the at least one auxiliary service provider, returning the asynchronous callback result to the calling end includes:

[0018] When the responsive object monitors the asynchronous callback result returned by the at least one auxiliary service provider, the asynchronous callback result is passed to the responsive programming middleware;

[0019] The asynchronous callback result in the responsive programming middleware is returned to the calling end through an asynchronous call object.

[0020] In an exemplary embodiment of the present disclosure, returning the asynchronous callback result in the responsive programming middleware to the calling end through an asynchronous call object includes:

[0021] Monitoring the asynchronous callback result in the responsive programming middleware based on a service subscription method;

[0022] When the asynchronous callback result in the responsive programming middleware is monitored, the asynchronous callback result in the responsive programming middleware is returned to the calling end through an asynchronous call object.

[0023] In an exemplary embodiment of the present disclosure, the asynchronous callback result includes call success data and call failure data;

[0024] The step of returning the asynchronous callback result in the responsive programming middleware to the calling end through an asynchronous calling object includes:

[0025] When the asynchronous callback result is the call success data, the call success data in the responsive programming middleware is passed to the asynchronous call object based on the operation success function, so that the asynchronous call object returns the call success data to the calling end;

[0026] When the asynchronous callback result is the call failure data, the call failure data in the responsive programming middleware is passed to the asynchronous call object based on the operation failure function, so that the asynchronous call object returns the call failure data to the calling end.

[0027] In an exemplary embodiment of the present disclosure, the responsive object includes a Mono object.

[0028] According to a second aspect of the present disclosure, a remote procedure call processing device is provided, the device is used to provide a first service, the first service depends on an auxiliary service provided by each auxiliary service provider of at least one auxiliary service provider, the device comprising:

[0029] a service calling module, configured to, in response to receiving a remote procedure call request for the first service sent by a calling end, call the at least one auxiliary service provider by means of an asynchronous callback, so that each of the auxiliary service providers calls the corresponding auxiliary service by means of an asynchronous call;

[0030] An object creation module, used to create a responsive object; the responsive object is used to monitor the asynchronous callback result returned by the at least one auxiliary service provider;

[0031] The call result returning module is used to return the asynchronous callback result to the calling end when the responsive object monitors the asynchronous callback result returned by the at least one auxiliary service provider.

[0032] According to a third aspect of the present disclosure, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the remote procedure call processing method described in the first aspect is implemented.

[0033] According to a fourth aspect of the present disclosure, an electronic device is provided, comprising: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to execute the remote procedure call processing method described in the first aspect above by executing the executable instructions.

[0034] It can be seen from the above technical solutions that the remote procedure call processing method, remote procedure call processing device, computer-readable storage medium and electronic device in the exemplary embodiments of the present disclosure have at least the following advantages and positive effects:

[0035] In the technical solutions provided in some embodiments of the present disclosure, on the one hand, by calling the auxiliary service provider in an asynchronous callback manner, the first service provider does not have to wait for the response of each auxiliary service provider, and can continue to process other tasks or receive new requests, which reduces the blocking waiting time and improves the concurrent processing capability of the service, thereby improving the overall response speed and throughput of the system. On the other hand, by returning the asynchronous callback result to the calling end when the responsive object monitors the asynchronous callback result returned by at least one auxiliary service provider, it can solve the problem in the related technology that the asynchronous callback cannot return the processing result, so that when the asynchronous callback result is monitored, the asynchronous callback result can be quickly returned to the calling end, thereby improving the result response speed and realizing an efficient and reliable communication process between the calling end, the service provider and the auxiliary service provider.

[0036] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] The accompanying drawings herein are incorporated into the specification and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the specification are used to explain the principles of the present disclosure. Obviously, the accompanying drawings described below are only some embodiments of the present disclosure, and for ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without creative work.

[0038] Figure 1 A schematic diagram showing the service call relationship in the relevant distributed system;

[0039] Figure 2 A schematic diagram showing a flow chart of a remote procedure call processing method in an embodiment of the present disclosure;

[0040] Figure 3 A schematic diagram showing a flow chart of returning an asynchronous callback result to a calling end when a responsive object monitors an asynchronous callback result returned by at least one auxiliary service provider in an embodiment of the present disclosure;

[0041] Figure 4 A flow chart showing how to return an asynchronous callback result in a responsive programming middleware to a calling end through an asynchronous call object in an embodiment of the present disclosure;

[0042] Figure 5 A schematic diagram showing the overall architecture of the remote procedure call processing method in an embodiment of the present disclosure is shown;

[0043] Figure 6 A schematic diagram showing the overall flow of the remote procedure call processing method in an embodiment of the present disclosure is shown;

[0044] Figure 7 A schematic diagram showing the structure of a remote procedure call processing device in an exemplary embodiment of the present disclosure is shown;

[0045] Figure 8 A schematic structural diagram of an electronic device in an exemplary embodiment of the present disclosure is shown. DETAILED DESCRIPTION

[0046] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as being limited to the examples set forth herein; on the contrary, these embodiments are provided so that the present disclosure will be more comprehensive and complete, and the concepts of the example embodiments are fully conveyed to those skilled in the art. The described features, structures, or characteristics may be combined in one or more embodiments in any suitable manner. In the following description, many specific details are provided to provide a full understanding of the embodiments of the present disclosure. However, those skilled in the art will appreciate that the technical solutions of the present disclosure may be practiced while omitting one or more of the specific details, or other methods, components, devices, steps, etc. may be adopted. In other cases, known technical solutions are not shown or described in detail to avoid obscuring various aspects of the present disclosure.

[0047] The terms "a", "an", "the" and "said" are used in this specification to indicate the presence of one or more elements / components / etc.; the terms "including" and "having" are used to express an open-ended inclusion and mean that additional elements / components / etc. may exist in addition to the listed elements / components / etc.; the terms "first" and "second" etc. are used only as labels and are not intended to limit the quantity of their objects.

[0048] In addition, the accompanying drawings are only schematic illustrations of the present disclosure and are not necessarily drawn to scale. The same reference numerals in the drawings represent the same or similar parts, and their repeated descriptions will be omitted. Some of the block diagrams shown in the accompanying drawings are functional entities and do not necessarily correspond to physically or logically independent entities.

[0049] refer to Figure 1 , Figure 1 A schematic diagram showing the service call relationship in the relevant distributed system, such as Figure 1 As shown:

[0050] When the calling end initiates an RPC (Remote Procedure Call) request to service S, service S can provide service S to the calling end as a service provider (Provider). However, the provision of service S depends on services A, B, and C. Therefore, service S needs to call services A, B, and C. At this time, service S needs to call service A as a service consumer of service A (service A Consumer), call service B as a service consumer of service B (service BConsumer), and call service C as a service consumer of service C (service CConsumer). Afterwards, the processing results obtained after calling services A, B, and C are returned to the calling end.

[0051] For service consumers, mainstream RPC frameworks (Dubbo, JSF, Thrift) support multiple types of calling methods, including synchronous calling, asynchronous calling, asynchronous callback, etc. For service providers, mainstream RPC frameworks (Dubbo, JSF, Thrift) also support multiple types of calling methods, including synchronous calling, asynchronous calling, etc.

[0052] Among them, synchronous call is a blocking calling method. When a function (or method) is called, the caller must wait for the function to be executed and return the result before continuing to execute the subsequent code. This is a one-way communication mode, that is, a direct calling relationship from the caller to the callee. In synchronous calling, the caller waits synchronously for the callee to return data, and the calling efficiency is very low. If multiple callees need to be called, multiple callees are called sequentially, and the caller interface needs to wait for the callee interface to return data in turn. The waiting time T is the sum of the response time of the N callee interfaces, and the interface response is relatively slow.

[0053] Asynchronous calls allow the caller to continue executing the subsequent code without waiting for a response after initiating a call. It usually processes the results through callback functions, events, or Promise / Future mechanisms. When the called operation is completed, the caller will be notified in some way. Asynchronous calls are mainly used to solve the problem of slow response time caused by calling multiple interfaces at the same time in synchronous call scenarios. The implementation basis of asynchronous calls is multi-threading. Each thread calls an interface concurrently. At this time, the corresponding response time T of the interface is the longest response time among the N interfaces. Although asynchronous calls solve the problem of interface response time, when the system concurrency is large, many threads are required to process requests. Multi-thread switching brings unnecessary system overhead and limits the performance of the system.

[0054] Asynchronous callback is a way to process results in asynchronous calls. When an asynchronous operation is completed, a predefined callback function will be automatically called to process the result of the asynchronous operation. This method ensures that even if the caller has continued to perform other tasks when the operation is completed, it can be notified and respond in time. When making an asynchronous call, obtaining the call result is a predictable behavior of the caller. The result can be obtained after the asynchronous call, but the call may not have returned a result at this time, and it is necessary to wait for the result to return. Asynchronous callback can trigger business processing logic when a result is returned to avoid waiting. Therefore, asynchronous callback can use fewer threads to process more requests. Asynchronous callback is a more ideal calling method, but most RPC framework asynchronous callbacks do not support returning results, and the application scenarios are very limited.

[0055] In summary, the service consumer identity supports three methods of RPC calls: synchronous calls, asynchronous calls, and asynchronous callbacks. Asynchronous callbacks can avoid waiting during synchronous calls and unnecessary system overhead caused by a large number of thread switches during asynchronous calls. It can trigger business processing logic when results are returned, but because the processing results cannot be returned, the use scenarios of asynchronous callbacks are very limited. The service provider identity also supports asynchronous calls, and asynchronous calls support returning result data.

[0056] The present disclosure aims to solve the problem that the service consumer identity cannot return the processing result during the RPC asynchronous callback, and realize the full process asynchronization of the RPC call process.

[0057] In the embodiments of the present disclosure, a remote procedure call processing method is first provided, which at least to some extent overcomes the defect that most RPC frameworks in the related art do not support the return of results for the asynchronous callback calling method.

[0058] Figure 2 A flow chart of a remote procedure call processing method in an embodiment of the present disclosure is shown. The execution subject of the remote procedure call processing method may be a service end corresponding to the first service provider.

[0059] refer to Figure 2 According to an embodiment of the present disclosure, a remote procedure call processing method includes the following steps:

[0060] Step S210, in response to receiving a remote procedure call request for the first service sent by the calling end, calling at least one auxiliary service provider by asynchronous callback, so that each auxiliary service provider calls its corresponding auxiliary service by asynchronous calling;

[0061] Step S220, creating a responsive object; the responsive object is used to monitor the asynchronous callback result returned by at least one auxiliary service provider;

[0062] Step S230: When the responsive object monitors the asynchronous callback result returned by at least one auxiliary service provider, the asynchronous callback result is returned to the calling end.

[0063] exist Figure 2 In the technical solution provided by the illustrated embodiment, on the one hand, the auxiliary service provider is called by asynchronous callback, and the first service provider does not have to wait for the response of each auxiliary service provider to continue processing other tasks or receiving new requests, which reduces the blocking waiting time and improves the concurrent processing capability of the service, thereby improving the overall response speed and throughput of the system. On the other hand, when the responsive object monitors the asynchronous callback result returned by at least one auxiliary service provider, the asynchronous callback result is returned to the calling end, which can solve the problem that the asynchronous callback in the related technology cannot return the processing result. Therefore, when the asynchronous callback result is monitored, the asynchronous callback result can be quickly returned to the calling end, thereby improving the result response speed and realizing the process of efficient and reliable communication between the calling end, the service provider and the auxiliary service provider.

[0064] The following Figure 2 The specific implementation process of each step is described in detail:

[0065] It should be noted that the method disclosed in the present invention can be applied to a first service provider, and the first service provider is used to provide a first service, and the first service depends on an auxiliary service provided by each of at least one auxiliary service provider. For example, the first service provider can provide a first service (exemplarily, it can be called service S), but the provision of the first service requires the assistance of an auxiliary service provided by at least one auxiliary service provider (for example: when providing the above service S, service A must be called). In other words, the first service provider must call service A before it can provide service S.

[0066] In step S210, in response to receiving a remote procedure call request for the first service sent by the calling end, at least one auxiliary service provider is called by asynchronous callback, so that each auxiliary service provider calls its corresponding auxiliary service by asynchronous calling.

[0067] In this step, when the first service provider receives the remote procedure call request for the first service sent by the calling end, it can call at least one auxiliary service provider through asynchronous callback, so that each auxiliary service provider calls its corresponding auxiliary service through asynchronous call.

[0068] The above-mentioned "remote procedure call request" is an RPC request. An RPC request refers to a request sent from a client to a server. This request contains information about the specific procedure (or function) that you want to call on the remote computer and the parameters that may need to be passed to the procedure. When an application wants to call a procedure on another remote computer, it initiates an RPC request. This request is transmitted to the remote computer over the network. After receiving the request, the remote computer executes the called procedure in its local environment and returns the result to the client that initiated the request. The entire process is like calling a procedure locally to the client, but it actually involves communication and data exchange across the network. The RPC mechanism simplifies the interaction between different components in a distributed system, allowing developers to focus on business logic rather than network programming details.

[0069] Optionally, after receiving the remote procedure call request sent by the calling end, the first service provider may verify the remote procedure call request to obtain a verification result. When the verification result indicates that the request verification has passed, the at least one auxiliary service provider may be called via asynchronous callback (i.e., the asynchronous type needs to be specified when calling, for example: configuring "async=true").

[0070] Specifically, the process of verifying a remote procedure call (RPC) request to obtain a verification result may include the following steps:

[0071] Parameter verification: Check whether the parameters in the RPC request meet expectations, which can include checking whether the parameter exists, whether the type is correct, whether the value is within the allowed range, etc. For example, if a function expects to receive an integer parameter, then it is necessary to ensure that the parameter passed in is indeed an integer type and the value is within a reasonable range;

[0072] Permission verification: Verify whether the user or service that initiates the RPC request has the permission to perform the requested operation. This usually involves authentication and authorization mechanisms, such as checking whether the user is logged in and has sufficient permission levels.

[0073] Format verification: Ensure that the data format of the RPC request is correct, such as checking whether the JSON or XML data conforms to a predefined schema or structure;

[0074] Integrity verification: Use a checksum (such as MD5, SHA-1, and other hash algorithms) or a digital signature to ensure that the data has not been tampered with or damaged during transmission;

[0075] Frequency limit: To prevent malicious RPC requests from flooding, you can set a request frequency limit, such as the maximum number of requests that can be processed per second;

[0076] Blacklist and whitelist verification: Check whether the request source is in the allowed IP address list, or whether it comes from a known malicious source;

[0077] Logical verification: Perform more complex verification based on business logic, such as checking whether the request violates business rules, such as not allowing transfers when the account balance is insufficient;

[0078] When the verification result of the above-mentioned request verification is passed, the first service provider can call the corresponding interface of each auxiliary service provider through asynchronous callback (the auxiliary service provider exposes an interface to the outside, and the caller can obtain the service through this interface) to call the above-mentioned at least one auxiliary service provider, so that each of the above-mentioned at least one auxiliary service provider can call their corresponding auxiliary service through asynchronous call.

[0079] By verifying the above remote procedure call requests, it helps to ensure the security and stability of the system and prevent illegal operations and data destruction.

[0080] In step S220, a responsive object is created, where the responsive object is used to monitor the asynchronous callback result returned by at least one auxiliary service provider.

[0081] In this step, the first service provider can create a responsive object, which is one of the core concepts in the responsive programming model and is mainly used to build scalable, elastic and highly responsive applications, especially when dealing with asynchronous data streams and event-driven systems. The core idea of ​​responsive programming is to regard computing as the propagation of data flows and changes. It emphasizes that the program can respond immediately to external changes such as data changes, user input, network events, etc., rather than executing instructions based on a predetermined order.

[0082] Exemplarily, the above responsive object can be a Mono object, which represents an asynchronous sequence of 0 to 1 results. It is mainly used to handle a single result or no result, such as a database query may find zero or one record. The function of the Mono object is to monitor the asynchronous callback result returned by the at least one auxiliary service provider for the above asynchronous call method.

[0083] In step S230, when the responsive object monitors the asynchronous callback result returned by at least one auxiliary service provider, the asynchronous callback result is returned to the calling end.

[0084] In this step, refer to Figure 3 , Figure 3A flow chart showing a process of returning an asynchronous callback result to a calling end when a responsive object monitors an asynchronous callback result returned by at least one auxiliary service provider in an embodiment of the present disclosure includes steps S301-S302:

[0085] In step S301, when the responsive object monitors an asynchronous callback result returned by at least one auxiliary service provider, the asynchronous callback result is passed to the responsive programming middleware.

[0086] In this step, when the responsive object monitors the asynchronous callback result returned by the at least one auxiliary service provider, it can first pass the asynchronous callback result to the responsive programming middleware Sink.

[0087] Reactive Programming is a programming paradigm that focuses on the propagation of asynchronous data streams and events. In Reactive Programming, middleware plays the role of connecting different components and processing data streams. "Sink" is an important concept in Reactive Programming, especially in ReactiveX (such as RxJava, RxJS, etc.) libraries. In Reactive Programming, "Sink" is usually understood as the end point of the data stream, that is, the consumer of the data. When a data stream (such as Observable) generates data, Sink receives the data and performs corresponding operations. Sink can be a subscriber or a more complex processing logic, such as filtering, transforming or aggregating data.

[0088] In step S302, the asynchronous callback result in the responsive programming middleware is returned to the calling end through the asynchronous call object.

[0089] In this step, based on the service subscription method (subscribe method), it is possible to monitor whether the above-mentioned Mono object passes the asynchronous callback result to the above-mentioned responsive programming middleware. Thus, when it is monitored that the above-mentioned asynchronous callback result exists in the above-mentioned responsive programming middleware, the asynchronous callback result in the responsive programming middleware can be returned to the calling end through the RPC asynchronous call object (provided by the RPC framework).

[0090] Specifically, the above asynchronous callback result can include call success data and call failure data, so refer to Figure 4 , Figure 4 A flow chart showing how to return the asynchronous callback result in the responsive programming middleware to the calling end through the asynchronous call object in the embodiment of the present disclosure includes steps S401-S402:

[0091] In step S401, when the asynchronous callback result is call success data, the call success data in the responsive programming middleware is passed to the asynchronous call object based on the operation success function, so that the asynchronous call object returns the call success data to the call end.

[0092] In this step, when the asynchronous callback result is call success data, the call success data in the responsive programming middleware can be passed to the RPC asynchronous call object based on the operation success function Sink.success, so that the RPC asynchronous call object returns the call success data to the calling end.

[0093] In step S402, when the asynchronous callback result is call failure data, the call failure data in the responsive programming middleware is passed to the asynchronous call object based on the operation failure function, so that the asynchronous call object returns the call failure data to the caller.

[0094] In this step, when the above-mentioned asynchronous callback result is call failure data, the call failure data in the above-mentioned responsive programming middleware can be passed to the asynchronous call object based on the operation failure function Sink.error, so that the asynchronous call object returns the call failure data to the calling end, thereby returning the failure result to trigger the relevant exception call processing process.

[0095] refer to Figure 5 , Figure 5 The overall architecture diagram of the remote procedure call processing method in the embodiment of the present disclosure is shown as follows: Figure 5 As shown:

[0096] When the calling end initiates an RPC call request to the first service provider (the service provider Provider corresponding to service S), the first service provider can initiate an asynchronous callback to the auxiliary service provider (i.e., service A Consumer in the figure). Thus, the auxiliary service provider can call service A through an asynchronous call, and then listen to the asynchronous callback result returned by the auxiliary service provider through the Mono object. After listening to the asynchronous callback result, the asynchronous callback result is returned to the calling end.

[0097] refer to Figure 6 , Figure 6 The overall flow chart of the remote procedure call processing method in the embodiment of the present disclosure is shown, including steps S601 to S609:

[0098] In step S601, the calling end initiates an RPC request;

[0099] In step S602, the first service provider performs request verification;

[0100] In step S603, the first service provider calls at least one auxiliary service provider by asynchronous callback, so that each auxiliary service provider calls its corresponding auxiliary service by asynchronous calling;

[0101] In step S604, the first service provider creates a Mono object using responsive programming;

[0102] In step S605, the Mono object monitors the asynchronous callback result returned by at least one auxiliary service provider;

[0103] In step S606, the asynchronous callback result is put into Sink;

[0104] In step S607, Sink passes the asynchronous callback result to the RPC asynchronous call object;

[0105] In step S608, the RPC asynchronous call object returns data to the caller;

[0106] In step S609, complete.

[0107] Based on the above technical solutions, the present disclosure has at least the following technical effects:

[0108] By integrating responsive programming, RPC asynchronous calls of auxiliary service providers, and RPC asynchronous callbacks of the first service provider, the entire RPC call process is asynchronously implemented.

[0109] It should be noted that the present disclosure can be applicable to scenarios where the RPC framework uses JSF and the responsive programming framework uses Reactor3. It is also applicable to but not limited to RPC frameworks such as Thrift and Double, and responsive programming frameworks such as RxJava, Vert.x, Akka, and Quarkus. All of them can be set according to actual conditions, and the present disclosure does not make any special limitations on this.

[0110] The present disclosure also provides a remote procedure call processing device, the device is used to provide a first service, the first service depends on an auxiliary service provided by each auxiliary service provider of at least one auxiliary service provider, Figure 7 A schematic diagram showing the structure of a remote procedure call processing device in an exemplary embodiment of the present disclosure is shown; Figure 7 As shown, the remote procedure call processing device 700 may include a service calling module 710 , an object creating module 720 and a calling result returning module 730 .

[0111] in:

[0112] The service calling module 710 is used to respond to the received request sent by the calling end for the first

[0113] The remote procedure call request of the service is called by asynchronous callback to at least one auxiliary

[0114] service provider, so that each of the auxiliary service providers calls each other through asynchronous calling

[0115] the corresponding auxiliary services;

[0116] The object creation module 720 is used to create a responsive object; the responsive object is used to monitor

[0117] Listen to the asynchronous callback result returned by the at least one auxiliary service provider;

[0118] The call result return module 730 is used to

[0119] When an asynchronous callback result is returned by an auxiliary service provider, the asynchronous callback result is returned to

[0120] The calling end.

[0121] In an exemplary embodiment of the present disclosure, after receiving the remote procedure call request sent by the calling end, the service calling module 710 is configured to:

[0122] Verifying the remote procedure call request to obtain a verification result;

[0123] In response to the verification result being a passed verification, the at least one auxiliary service provider is called by way of an asynchronous callback.

[0124] In an exemplary embodiment of the present disclosure, the service calling module 710 calls the at least one auxiliary service provider by asynchronous callback, including:

[0125] The interface corresponding to each auxiliary service provider is called in an asynchronous callback manner to call the at least one auxiliary service provider.

[0126] In an exemplary embodiment of the present disclosure, when the responsive object monitors the asynchronous callback result returned by the at least one auxiliary service provider, the call result returning module 730 returns the asynchronous callback result to the calling end, including:

[0127] When the responsive object monitors the asynchronous callback result returned by the at least one auxiliary service provider, the asynchronous callback result is passed to the responsive programming middleware;

[0128] The asynchronous callback result in the responsive programming middleware is returned to the calling end through an asynchronous call object.

[0129] In an exemplary embodiment of the present disclosure, the call result returning module 730 returns the asynchronous callback result in the responsive programming middleware to the call end through an asynchronous call object, including:

[0130] Monitoring the asynchronous callback result in the responsive programming middleware based on a service subscription method;

[0131] When the asynchronous callback result in the responsive programming middleware is monitored, the asynchronous callback result in the responsive programming middleware is returned to the calling end through an asynchronous call object.

[0132] In an exemplary embodiment of the present disclosure, the asynchronous callback result includes call success data and call failure data;

[0133] The call result returning module 730 returns the asynchronous callback result in the responsive programming middleware to the call end through an asynchronous call object, including:

[0134] When the asynchronous callback result is the call success data, the call success data in the responsive programming middleware is passed to the asynchronous call object based on the operation success function, so that the asynchronous call object returns the call success data to the calling end;

[0135] When the asynchronous callback result is the call failure data, the call failure data in the responsive programming middleware is passed to the asynchronous call object based on the operation failure function, so that the asynchronous call object returns the call failure data to the calling end.

[0136] In an exemplary embodiment of the present disclosure, the responsive object includes a Mono object. The specific details of each module in the above remote procedure call processing device have been described in detail in the corresponding remote procedure call processing method, so they will not be repeated here.

[0137] It should be noted that, although several modules or units of the device for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiments of the present disclosure, the features and functions of two or more modules or units described above can be embodied in one module or unit. On the contrary, the features and functions of one module or unit described above can be further divided into multiple modules or units to be embodied.

[0138] In addition, although the steps of the method in the present disclosure are described in a specific order in the drawings, this does not require or imply that the steps must be performed in this specific order, or that all the steps shown must be performed to achieve the desired results. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step, and / or one step may be decomposed into multiple steps, etc.

[0139] Through the description of the above implementation, it is easy for those skilled in the art to understand that the example implementation described here can be implemented by software, or by software combined with necessary hardware. Therefore, the technical solution according to the implementation of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, including several instructions to enable a computing device (which can be a personal computer, a server, a mobile terminal, or a network device, etc.) to execute the method according to the implementation of the present disclosure.

[0140] The present disclosure also provides a computer-readable storage medium, which may be included in the electronic device described in the above embodiments; or may exist independently without being assembled into the electronic device.

[0141] The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus or device, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to, an electrical connection with one or more wires, a portable computer disk, 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 disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in conjunction with an instruction execution system, apparatus, or device.

[0142] Computer-readable storage media can send, propagate or transmit programs for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer-readable storage medium can be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.

[0143] The computer-readable storage medium carries one or more programs. When the one or more programs are executed by an electronic device, the electronic device implements the method described in the above embodiments.

[0144] In addition, an electronic device capable of implementing the above method is also provided in an embodiment of the present disclosure.

[0145] Those skilled in the art will appreciate that various aspects of the present disclosure may be implemented as systems, methods or program products. Therefore, various aspects of the present disclosure may be specifically implemented in the following forms, namely: complete hardware implementation, complete software implementation (including firmware, microcode, etc.), or a combination of hardware and software, which may be collectively referred to herein as "circuits", "modules" or "systems".

[0146] Refer to the following Figure 8 The electronic device 800 according to this embodiment of the present disclosure is described. Figure 8 The electronic device 800 shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.

[0147] like Figure 8 As shown, the electronic device 800 is in the form of a general computing device. The components of the electronic device 800 may include but are not limited to: at least one processor 810, at least one memory 820, a bus 830 connecting different system components (including the memory 820 and the processor 810), and a display 840.

[0148] The memory stores program codes, which can be executed by the processor 810, so that the processor 810 performs the steps according to various exemplary embodiments of the present disclosure described in the above “Exemplary Method” section of this specification. For example, the processor 810 can perform the following steps: Figure 2 As shown in: Step S210, in response to receiving a remote procedure call request for the first service sent by the calling end, calling at least one auxiliary service provider by asynchronous callback, so that each of the auxiliary service providers calls the corresponding auxiliary service by asynchronous call; Step S220, creating a responsive object; the responsive object is used to monitor the asynchronous callback result returned by the at least one auxiliary service provider; Step S230, when the responsive object monitors the asynchronous callback result returned by the at least one auxiliary service provider, the asynchronous callback result is returned to the calling end.

[0149] The memory 820 may include a readable medium in the form of a volatile storage, such as a random access memory (RAM) 8201 and / or a cache memory 8202 , and may further include a read-only memory (ROM) 8203 .

[0150] The memory 820 may also include a program / utility 8204 having a set (at least one) of program modules 8205, such program modules 8205 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment.

[0151] Bus 830 may be a bus representing one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processor, or a local bus using any of a variety of bus architectures.

[0152] The electronic device 800 may also communicate with one or more external devices 900 (e.g., keyboards, pointing devices, Bluetooth devices, etc.), may also communicate with one or more devices that enable a user to interact with the electronic device 800, and / or communicate with any device that enables the electronic device 800 to communicate with one or more other computing devices (e.g., routers, modems, etc.). Such communication may be performed via an input / output (I / O) interface 850. Furthermore, the electronic device 800 may also communicate with one or more networks (e.g., local area networks (LANs), wide area networks (WANs), and / or public networks, such as the Internet) via a network adapter 860. As shown, the network adapter 860 communicates with other modules of the electronic device 800 via a bus 830. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the electronic device 800, including but not limited to: microcode, device drivers, redundant processors, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, etc.

[0153] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. The present disclosure is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary technical means in the art that are not disclosed in the present disclosure. The description and examples are to be considered exemplary only, and the true scope and spirit of the present disclosure are indicated by the claims.

Claims

1. A remote procedure call processing method, characterized in that: Applied to a first service provider, the first service provider is used to provide a first service, the first service depends on an auxiliary service provided by each of at least one auxiliary service provider, the method comprising: In response to receiving a remote procedure call request for the first service sent by the calling end, calling the at least one auxiliary service provider by asynchronous callback, so that each of the auxiliary service providers calls the corresponding auxiliary service by asynchronous calling; Creating a responsive object; the responsive object is used to monitor the asynchronous callback result returned by the at least one auxiliary service provider; When the responsive object monitors the asynchronous callback result returned by the at least one auxiliary service provider, the asynchronous callback result is returned to the calling end.

2. The method according to claim 1, characterized in that After receiving the remote procedure call request sent by the calling end, the method further includes: Verifying the remote procedure call request to obtain a verification result; In response to the verification result being a passed verification, the at least one auxiliary service provider is called by way of an asynchronous callback.

3. The method according to claim 2, characterized in that The calling of the at least one auxiliary service provider by asynchronous callback includes: The interface corresponding to each auxiliary service provider is called in an asynchronous callback manner to call the at least one auxiliary service provider.

4. The method according to claim 1, characterized in that: When the responsive object monitors the asynchronous callback result returned by the at least one auxiliary service provider, returning the asynchronous callback result to the calling end includes: When the responsive object monitors the asynchronous callback result returned by the at least one auxiliary service provider, the asynchronous callback result is passed to the responsive programming middleware; The asynchronous callback result in the responsive programming middleware is returned to the calling end through an asynchronous call object.

5. The method according to claim 4, characterized in that The step of returning the asynchronous callback result in the responsive programming middleware to the calling end through an asynchronous calling object includes: Monitoring the asynchronous callback result in the responsive programming middleware based on a service subscription method; When the asynchronous callback result in the responsive programming middleware is monitored, the asynchronous callback result in the responsive programming middleware is returned to the calling end through an asynchronous call object.

6. The method according to claim 5, characterized in that The asynchronous callback result includes call success data and call failure data; The step of returning the asynchronous callback result in the responsive programming middleware to the calling end through an asynchronous calling object includes: When the asynchronous callback result is the call success data, the call success data in the responsive programming middleware is passed to the asynchronous call object based on the operation success function, so that the asynchronous call object returns the call success data to the calling end; When the asynchronous callback result is the call failure data, the call failure data in the responsive programming middleware is passed to the asynchronous call object based on the operation failure function, so that the asynchronous call object returns the call failure data to the calling end.

7. The method according to any one of claims 1 to 6, characterized in that: The responsive object includes a Mono object.

8. A remote procedure call processing device, characterized in that: The apparatus is used to provide a first service, the first service being dependent on an auxiliary service provided by each of at least one auxiliary service provider, the apparatus comprising: a service calling module, configured to, in response to receiving a remote procedure call request for the first service sent by a calling end, call the at least one auxiliary service provider by means of an asynchronous callback, so that each of the auxiliary service providers calls the corresponding auxiliary service by means of an asynchronous call; An object creation module, used to create a responsive object; the responsive object is used to monitor the asynchronous callback result returned by the at least one auxiliary service provider; The call result returning module is used to return the asynchronous callback result to the calling end when the responsive object monitors the asynchronous callback result returned by the at least one auxiliary service provider.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the remote procedure call processing method according to any one of claims 1 to 7 is implemented.

10. An electronic device, characterized in that: include: processor; as well as A memory, configured to store executable instructions of the processor; The processor is configured to execute the remote procedure call processing method according to any one of claims 1 to 7 by executing the executable instructions.