Remote Call Method, System, Device, Electronic Device and Storage Medium
By allowing the call initiator to send a second call request before receiving the first return value in a synchronous remote call, the problem of wasting time of the call initiator waiting for the peer to return value is solved, and a more efficient call process is achieved.
Patent Information
- Application Number
- CN202210588171.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-26
- Publication Date
- 2025-05-30
- Estimated Expiration
- 2042-05-26
AI Technical Summary
During the synchronous remote call process, the initiator needs to wait for the peer to return the value before making the next call, resulting in a waste of waiting process time and an increase in the execution time of the process.
By sending a first call request to the calling response end, and sending a second call request to the calling response end before receiving the first return value, and performing this step loops until the calling response end meets the call return condition, the target return value is received.
It avoids the waste of waiting time when the call initiator is waiting for the first return value, shortens the execution time of the call process, and improves the calling efficiency.
Smart Images

Figure CN115208936B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of communication technologies, and in particular, to a remote call method, system, device, electronic device, and storage medium. Background Art
[0002] Synchronous remote call is a basic technology in the service-oriented architecture. Through synchronous remote call, a local process can call a service function provided by a remote end. Generally, synchronous remote call means that a process on computer A calls a process on another computer B. Among them, the calling process on computer A is suspended, and the called process executed on computer B starts to execute. When the value is returned to computer A, the process on computer A continues to execute.
[0003] In related technologies, during synchronous remote call, the process often needs to wait for the return from the peer end before the call ends. However, usually when the calling end makes a second call, it does not need the value returned by the peer end for the first time as an input parameter for the call. Instead, the calling end needs to wait for the peer end to return the value before making the next call, resulting in a waste of waiting time and increasing the execution duration of the process. Summary of the Invention
[0004] This application provides a remote call method, system, device, electronic device, and storage medium to solve the problem in the prior art that the calling end needs to wait for the peer end to return the value before making the next call, resulting in a waste of waiting time and increasing the execution duration of the process.
[0005] In a first aspect, an embodiment of this application provides a remote call method, which is applied to a calling end. The method includes:
[0006] Sending a first call request to a call response end, where the first call request is used to call a first return value;
[0007] When the second call request does not depend on the first return value, before receiving the first return value, sending a second call request to the call response end;
[0008] Repeatedly executing the above steps. When the call response end meets the call return condition, receiving a target return value sent by the call response end.
[0009] Optionally, when the call response end meets the call return condition, receiving the target return value sent by the call response end includes:
[0010] Sending a call return request to the call response end, and receiving the target return value sent by the call response end based on the call return request; the call response end meeting the call return condition includes the call response end receiving the call return request.
[0011] Optionally, when the call response end meets the call return condition, receiving a target return value sent by the call response end, including:
[0012] When the number of return values stored in the call response end reaches a preset threshold, receiving the target return value sent by the call response end; the call response end meeting the call return condition includes that the number of return values stored in the call response end reaches the preset threshold.
[0013] In a second aspect, an embodiment of the present application provides a remote call method, which is applied to a call response end, and the method includes:
[0014] Receiving a first call request sent by a call initiating end, where the first call request is used to call a first return value;
[0015] When a second call request does not depend on the first return value, before sending the first return value, receiving the second call request sent by the call initiating end;
[0016] Looping to execute the above steps and storing the return value, and when the call return condition is met, sending the target return value to the call initiating end.
[0017] Optionally, when the call return condition is met, sending the target return value to the call initiating end, including:
[0018] Receiving a call return request sent by the call initiating end, and sending the target return value to the call initiating end based on the call return request; the call return condition being met includes receiving the call return request.
[0019] Optionally, when the call return condition is met, sending the target return value to the call initiating end, including:
[0020] When the number of stored return values reaches a preset threshold, sending the target return value to the call initiating end; the call return condition being met includes that the number of stored return values reaches the preset threshold.
[0021] In a third aspect, an embodiment of the present application provides a remote call system, including: a call initiating end and a call response end;
[0022] The call initiating end is configured to send a first call request to the call response end, where the first call request is used to call a first return value; when a second call request does not depend on the first return value, before receiving the first return value, sending the second call request to the call response end; and looping to execute the above steps;
[0023] The call response end is configured to receive the first call request sent by the call initiation end; when the second call request does not depend on the first return value, before sending the first return value, receive the second call request sent by the call initiation end; loop and execute the above steps and store the return value, and when the call return condition is satisfied, send the target return value to the call initiation end;
[0024] The call initiation end is further configured to receive the target return value sent by the call response end. Fourthly, an embodiment of the present application provides a remote call device, including:
[0025] A first sending module, configured to send a first call request to a call response end, where the first call request is used to call a first return value;
[0026] A second sending module, configured to, when the second call request does not depend on the first return value, before receiving the first return value, send a second call request to the call response end;
[0027] A first receiving module, configured to loop and execute the above steps, and when the call response end satisfies the call return condition, receive the target return value sent by the call response end.
[0028] Fifthly, an embodiment of the present application provides a remote call device, including:
[0029] A second receiving module, configured to receive a first call request sent by a call initiation end, where the first call request is used to call a first return value;
[0030] A third receiving module, configured to, when the second call request does not depend on the first return value, before sending the first return value, receive the second call request sent by the call initiation end;
[0031] A third sending module, configured to loop and execute the above steps and store the return value, and when the call return condition is satisfied, send the target return value to the call initiation end.
[0032] Sixthly, an embodiment of the present application provides an electronic device, including: a processor, a communication interface, a memory, and a communication bus, where the processor, the communication interface, and the memory complete communication with each other through the communication bus;
[0033] The memory is configured to store a computer program;
[0034] The processor is configured to execute the program stored in the memory to implement the remote call method described in the first aspect or the second aspect.
[0035] In a seventh aspect, an embodiment of the present application provides a computer-readable storage medium storing a computer program, and when the computer program is executed by a processor, the remote call method described in the first aspect or the second aspect is implemented.
[0036] The above technical solution provided by the embodiment of the present application has the following advantages compared with the prior art: In the method provided by the embodiment of the present application, a first call request is sent to a call response end, and the first call request is used to call a first return value; when a second call request does not depend on the first return value, before receiving the first return value, a second call request is sent to the call response end; the above steps are cyclically executed, and when the call response end meets the call return condition, a target return value sent by the call response end is received. In this way, when it is determined that the second call request does not depend on the first return value, for the call initiating end, there is no need to wait for the first return value, and a second call request can be sent to the call response end before receiving the first return value, avoiding the waste of the waiting time for the call initiating end to initiate the next call and shortening the execution duration of the call process. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] The accompanying drawings herein are incorporated into the specification and constitute a part of the specification, showing embodiments consistent with the present invention and used together with the specification to explain the principles of the present invention.
[0038] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the accompanying drawings required for use in the description of the embodiments or the prior art. Obviously, for those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings.
[0039] Figure 1 It is a flowchart of a remote call method provided by an embodiment of the present application;
[0040] Figure 2 It is a flowchart of a remote call method provided by another embodiment of the present application;
[0041] Figure 3 It is a flowchart of an interaction process of a remote call method provided by an embodiment of the present application;
[0042] Figure 4 It is a flowchart of an interaction process of a remote call method provided by another embodiment of the present application;
[0043] Figure 5 It is a structural diagram of a remote call system provided by an embodiment of the present application;
[0044] Figure 6 It is a structural diagram of a remote call device provided by an embodiment of the present application;
[0045] Figure 7 Structural diagram of a remote call device provided by an embodiment of the present application;
[0046] Figure 8 Structural diagram of an electronic device provided by an embodiment of the present application. Specific embodiments
[0047] To make the objectives, technical solutions, and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are some, but not all, of the embodiments of the present application. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present application without creative efforts shall fall within the protection scope of the present application.
[0048] Before further elaborating on the embodiments of the present invention, the nouns and terms involved in the embodiments of the present invention are explained, and the nouns and terms involved in the embodiments of the present invention are applicable to the following explanations.
[0049] std::future in C++11 is a template class. std::future provides a mechanism for accessing the results of asynchronous operations. The shared state referred to by std::future cannot be shared with any other asynchronously returned objects. A future is an object that can retrieve a value from an object or function of a certain provider, and if in a different thread, it can correctly synchronize this access.
[0050] Event notifications are special types of database objects used to send information about server and database events to the Service Broker service.
[0051] An embodiment of the present application provides a remote call method, which can be applied to any form of electronic device, such as a terminal and a server at the call initiation end. As Figure 1 shown, the remote call method includes:
[0052] Step 101, send a first call request to the call response end, where the first call request is used to call a first return value.
[0053] In some embodiments, after establishing a connection between the call initiation end and the call response end, when a remote call is required, the call initiation end will send a call request to the call response end to call the return value of the call response end.
[0054] Step 102: When the second call request does not depend on the first return value, before receiving the first return value, send the second call request to the call response end.
[0055] In some embodiments, the situation where the second call request does not depend on the first return value may be that the first return value does not need to be used as an input parameter of the second call request, or the second call request is one of multiple consecutive calls initiated by the call initiating end.
[0056] For each call initiated, when the call initiating end makes the next call, it may not need to use the return value of the previous call, so it can directly initiate the next call request, that is, the second call request.
[0057] Specifically, before initiating the second call request, first determine whether the second call request depends on the first return value. When it needs the first return value, the call response end sends the first return value obtained from the first call request to the call sending end; when it does not need the first return value, before returning the first return value, it can directly initiate the second call request without waiting for the return of the first return value.
[0058] Among them, the second call request is a call request initiated after the first call request is sent.
[0059] Furthermore, whether the initiated second call request depends on the first return value can be determined by the call function used in the second call request. Usually, different call functions are used.
[0060] Specifically, by determining whether the call function is a preset call function, if so, it is determined that the second call request does not depend on the first return value. Among them, the preset call function can be but is not limited to the template class std::future in C++.
[0061] In some embodiments, when the second call request does not depend on the first return value, it is not necessary to wait for the return of the first return value, and the second call request can be initiated before receiving the first return value, thereby reducing the time for waiting for the return of the first return value.
[0062] Step 103: Loop and execute the above Steps 101 and 102. When the call response end meets the call return condition, receive the target return value sent by the call response end.
[0063] Among them, the target return value may include the first return value.
[0064] It can be understood that the call return request can be a request to call the call return value obtained in the previous call, or a request for the return values obtained in the previous N (N is an integer greater than 1) calls. Correspondingly, the target return value can be the call return value obtained in the previous call, or the return values obtained in the previous N calls.
[0065] In some embodiments, the condition for the call response end to meet the call return condition can be set according to the actual situation, and the following two specific methods will be used for specific description.
[0066] First, it can be to send a call return request to the call response end and receive the target return value sent by the call response end based on the call return request; the condition for the call response end to meet the call return condition includes that the call response end receives the call return request.
[0067] When the call initiating end needs the target return value of the previous call, the call initiating end sends a call return request to the call receiving end, so that after the call response end receives the return value request, it sends the stored target return value to the call initiating end, thereby receiving the target return value.
[0068] Second, it can be to receive the target return value sent by the call response end when the number of return values stored in the call response end reaches a preset threshold; the condition for the call response end to meet the call return condition includes that the number of return values stored in the call response end reaches a preset threshold.
[0069] Based on the two methods of active and passive, the call response end is triggered to send the target return value to the call initiating end, so that the call initiating end receives the target return value, thereby completing the remote call.
[0070] Based on the same concept, an embodiment of the present application provides a remote call method. The specific implementation of this device can refer to the description in the method embodiment part above, and the repeated parts will not be elaborated. This method can be applied to any form of electronic device, such as the terminal and server of the call response end. As Figure 2 shown, this remote call method includes:
[0071] Step 201, receive a first call request sent by a call initiating end, where the first call request is used to call a first return value.
[0072] In some embodiments, after the call response end and the call initiating end establish a connection, the call initiating end can send a first call request to the call response end, so that the call response end can obtain the first call request.
[0073] In an optional embodiment, before receiving the first call request sent by the call initiating end, it further includes:
[0074] Obtain the connection request sent by the call initiating end, where the connection request includes a preset threshold for the number of stored return values; establish a connection with the call initiating end based on the connection request and store the preset threshold.
[0075] There are various ways for the call initiating end to establish a connection with the call responding end. For example, the call initiating end sends a connection request to the call responding end, and the connection request includes the device identifier of the call responding end, so that the connection request can be sent to the call responding end, and then the connection between the two is completed. Further, the connection request also includes a preset threshold for the number of stored return values. After the call responding end stores this preset threshold, when the number of stored return values is approximately greater than the preset threshold, relevant operations are triggered, such as sending the stored return values to the call initiating end.
[0076] Step 202: When the second call request does not depend on the first return value, before sending the first return value, receive the second call request sent by the call initiating end.
[0077] In some embodiments, after the call responding end obtains the first call request, it first determines whether the second call request depends on the first return value before sending the first return value. If not, before sending the first return value, receive the second call request sent by the call initiating end.
[0078] Optionally, the call to the call initiating end may be more than once. Therefore, it may be necessary to loop through the above steps 201 and 202.
[0079] Step 203: Loop through the above steps 201 and 202 and store the return values.
[0080] Among them, the stored return values include multiple return values generated by looping through the above steps.
[0081] Step 204: When the call return condition is met, send the target return value to the call initiating end.
[0082] Specifically, there are various ways for the call responding end to meet the call return condition and send the target return value. Specifically, reference can be made to the relevant embodiments on the call initiating end side above, and the same parts will not be elaborated here.
[0083] In some embodiments, when the first return value does not need to be returned immediately, the first return value can be stored first so that when the call initiating end needs to use it later, the first return value can be returned.
[0084] In an alternative embodiment, after storing the first return value, it further includes:
[0085] Statistically store the quantity value of the first return value; when the quantity value reaches a preset threshold, send the stored first return value to the call initiating end.
[0086] In some embodiments, when a connection is established between the call initiating end and the call responding end, the maximum value of the return value data stored by the call responding end is agreed upon, that is, the preset threshold. Therefore, the call responding end statistically counts the quantity of return values, and when the quantity value of the stored return values reaches the preset threshold, it sends the stored return values to the call initiating end.
[0087] In a specific embodiment, when a remote client program (i.e., the above-mentioned call initiating end) makes a synchronous call, in many cases the remote client program does not need to immediately use the return value of the synchronous call. In this case, the program does not need to suspend and wait for this return value, but can continue to run until it needs to use this return value. Its logic is similar to the template class std::future in C++; similarly, when the remote client program makes multiple consecutive synchronous calls, the program does not need to wait for each synchronous call to end, but can continue to run until the return value of a certain synchronous call needs to be used.
[0088] Correspondingly, see Figure 3 , the remote call server program (equivalent to the above-mentioned call responding end) does not need to immediately return the call of the remote call client, but can return it to the remote call client all at once after the number of cached remote return values reaches a certain threshold (loop aggregation threshold); or, see Figure 4 , when cached until a return value request is sent from the client, return the remote return value to the remote call client all at once. Among them, in Figure 3 and Figure 4 , R1, R2, and R3 are return values that need to be returned in different call processes.
[0089] When the remote service connection is established, the remote client program can negotiate the loop aggregation threshold with the remote server program. The remote call server program can use the method of event notification to send the cached remote return values to the remote call client program. The remote call client needs to subscribe to this event from the remote call service program when the remote service connection is established.
[0090] The remote call method of the present application, based on the principle that a variable only needs to be assigned a value when it is used, aggregates remote synchronous return values, reduces the execution time of the remote call program, and reduces the number of small data packets in the network. By reducing the number of times the remote call client program waits for return values in consecutive synchronous calls, the execution time of the program is shortened, and the execution efficiency of the program is improved. And, by combining multiple synchronous call returns of the remote call server program into one, the number of small data packets in the Ethernet is reduced, and the network efficiency is improved.
[0091] Based on the same concept, an embodiment of the present application provides a remote call system. For the specific implementation of this system, reference can be made to the description in the method embodiment part, and repeated parts will not be elaborated again. For example, Figure 5 as shown, this system mainly includes: a call initiation end 501 and a call response end 502;
[0092] The call initiation end is used to send a first call request to the call response end, and the first call request is used to call a first return value; when a second call request does not depend on the first return value, before receiving the first return value, send a second call request to the call response end; and loop to execute the above steps;
[0093] The call response end is used to receive the first call request sent by the call initiation end; when a second call request does not depend on the first return value, before sending the first return value, receive the second call request sent by the call initiation end; loop to execute the above steps and store the return value, and when the call return condition is met, send a target return value to the call initiation end;
[0094] The call initiation end is further used to receive the target return value sent by the call response end.
[0095] Based on the same concept, an embodiment of the present application provides a remote call device. For the specific implementation of this device, reference can be made to the description in the method embodiment part, and repeated parts will not be elaborated again. For example, Figure 6 as shown, this device mainly includes:
[0096] A first sending module 601, which is used to send a first call request to the call response end, and the first call request is used to call a first return value;
[0097] A second sending module 602, which is used to send a second call request to the call response end before receiving the first return value when the second call request does not depend on the first return value;
[0098] A first receiving module 603, which is used to loop to execute the above steps and receive the target return value sent by the call response end when the call response end meets the call return condition.
[0099] Based on the same concept, an embodiment of the present application provides a remote call device. For the specific implementation of this device, reference can be made to the description in the method embodiment part, and repeated parts will not be elaborated again. For example, Figure 7 as shown, this device mainly includes:
[0100] A second receiving module 701, which is used to receive the first call request sent by the call initiation end, and the first call request is used to call a first return value;
[0101] A third receiving module 702, configured to receive a second call request sent by the call initiating end before sending the first return value when the second call request does not depend on the first return value.
[0102] A third sending module 703, configured to loop through the above steps and store the return value, and send a target return value to the call initiating end when a call return condition is met.
[0103] Based on the same concept, an electronic device is further provided in an embodiment of the present application. As Figure 8 shown, the electronic device mainly includes: a processor 801, a memory 802, and a communication bus 803. Among them, the processor 801 and the memory 802 communicate with each other through the communication bus 803. Among them, a process executable by the processor 801 is stored in the memory 802, and the processor 801 executes the process stored in the memory 802 to implement the following steps:
[0104] Send a first call request to a call response end, where the first call request is used to call a first return value.
[0105] When the second call request does not depend on the first return value, send a second call request to the call response end before receiving the first return value.
[0106] Loop through the above steps. When the call response end meets the call return condition, receive the target return value sent by the call response end. Or,
[0107] Receive a first call request sent by a call initiating end, where the first call request is used to call a first return value.
[0108] When the second call request does not depend on the first return value, receive a second call request sent by the call initiating end before sending the first return value.
[0109] Loop through the above steps and store the return value, and send a target return value to the call initiating end when the call return condition is met.
[0110] The communication bus 803 mentioned in the above electronic device may be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus 803 can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 8It is represented only by a thick line, but it does not mean that there is only one bus or one type of bus.
[0111] The memory 802 may include a random access memory (RAM), or may include a non-volatile memory, such as at least one disk memory. Optionally, the memory may also be at least one storage device located far from the aforementioned processor 801.
[0112] The aforementioned processor 801 may be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc., or may also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
[0113] The electronic device provided by the embodiment of the present application may specifically be a module capable of implementing a communication function or a terminal device including the module, etc. The terminal device may be a mobile terminal or an intelligent terminal. The mobile terminal may specifically be at least one of a mobile phone, a tablet computer, a notebook computer, etc.; the intelligent terminal may specifically be a terminal containing a wireless communication module such as an intelligent vehicle, an intelligent watch, a shared bicycle, an intelligent cabinet, etc.; the module may specifically be a wireless communication module, such as any one of a 2G communication module, a 3G communication module, a 4G communication module, a 5G communication module, an NB-IOT communication module, etc.
[0114] In another embodiment of the present application, a computer-readable storage medium is further provided. A computer program is stored in the computer-readable storage medium. When the computer program runs on a computer, the computer is enabled to execute the remote call method described in the above embodiment.
[0115] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer instructions are loaded and executed on a computer, the processes or functions described in the embodiments of the present application are generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions are transmitted from one website, computer, server, or data center to another website, computer, server, or data center by wire (such as coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (such as infrared, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server or data center that includes one or more integrated available media. The available medium can be a magnetic medium (such as a floppy disk, hard disk, magnetic tape, etc.), an optical medium (such as a DVD), or a semiconductor medium (such as a solid-state drive), etc.
[0116] It should be noted that, in this article, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise", or any other variant thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or device that includes a series of elements includes not only those elements but also other elements that are not explicitly listed, or elements that are inherent to such process, method, article, or device. Without further limitation, an element defined by the statement "including one..." does not exclude the existence of additional identical elements in the process, method, article, or device that includes the said element.
[0117] The above are only specific embodiments of the present invention, enabling those skilled in the art to understand or implement the present invention. Various modifications to these embodiments will be obvious to those skilled in the art, and the general principles defined herein can be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to these embodiments shown herein, but rather to the broadest scope consistent with the principles and novel features claimed herein.
Claims
1. A remote call method, applied to a call initiation end, Characterized in that, The method includes: Sending a first call request to a call response end, where the first call request is used to call a first return value; Judging whether the call function adopted by a second call request is a preset call function. If so, determining that the second call request does not depend on the first return value, and before receiving the first return value, sending the second call request to the call response end; Repeatedly executing the above steps. When the call response end meets the call return condition, receiving the target return value sent by the call response end; Wherein, when the call response end meets the call return condition, receiving the target return value sent by the call response end includes: Sending a call return request to the call response end, and receiving the target return value sent by the call response end based on the call return request; the call response end meeting the call return condition includes the call response end receiving the call return request; The call response end meeting the call return condition includes that the number of return values stored by the call response end reaches a preset threshold.
2. The remote call method according to claim 1, Characterized in that, When the call response end meets the call return condition, receiving the target return value sent by the call response end includes: When the number of return values stored by the call response end reaches a preset threshold, receiving the target return value sent by the call response end.
3. A remote call method, applied to a call response end, Characterized in that, The method includes: Receiving a first call request sent by a call initiation end, where the first call request is used to call a first return value; Judging whether the call function adopted by a second call request is a preset call function. If so, determining that the second call request does not depend on the first return value, and before sending the first return value, receiving the second call request sent by the call initiation end; Repeatedly executing the above steps and storing return values. When the call return condition is met, sending the target return value to the call initiation end; Wherein, when the call return condition is met, sending the target return value to the call initiation end includes: Receiving the call return request sent by the call initiation end, and sending the target return value to the call initiation end based on the call return request; the call return condition being met includes receiving the call return request; The call return condition being met includes that the number of stored return values reaches a preset threshold.
4. The remote call method according to claim 3, Characterized in that, When the call return condition is met, sending the target return value to the call initiation end includes: When the number of stored return values reaches a preset threshold, sending the target return value to the call initiation end.
5. A remote call device, Characterized in that, Includes: A first sending module, configured to send a first call request to a call response end, where the first call request is used to call a first return value; A second sending module, configured to determine whether the calling function adopted by the second calling request is a preset calling function. If so, it is determined that the second calling request does not depend on the first return value, and before receiving the first return value, send the second calling request to the call response end; A first receiving module, configured to loop and execute the above steps. When the call response end meets the call return condition, receive the target return value sent by the call response end; Wherein, when the call response end meets the call return condition, receiving the target return value sent by the call response end includes: Sending a call return request to the call response end, and receiving the target return value sent by the call response end based on the call return request; the call response end meeting the call return condition includes the call response end receiving the call return request; the call response end meeting the call return condition includes the number of return values stored in the call response end reaching a preset threshold.
6. A remote call device Characterized in that It includes: A second receiving module, configured to receive a first calling request sent by a call initiating end, where the first calling request is used to call a first return value; A third receiving module, configured to determine whether the calling function adopted by the second calling request is a preset calling function. If so, it is determined that the second calling request does not depend on the first return value, and before sending the first return value, receive the second calling request sent by the call initiating end; A third sending module, configured to loop and execute the above steps and store the return value. When the call return condition is met, send the target return value to the call initiating end; Wherein, when the call return condition is met, sending the target return value to the call initiating end includes: Receiving the call return request sent by the call initiating end, and sending the target return value to the call initiating end based on the call return request; the call return condition being met includes receiving the call return request; the call return condition being met includes the number of stored return values reaching a preset threshold.
7. A remote call system Characterized in that It includes a call initiating end and a call response end; The call initiating end is configured to send a first calling request to the call response end, where the first calling request is used to call a first return value; determine whether the calling function adopted by the second calling request is a preset calling function. If so, it is determined that the second calling request does not depend on the first return value, and before receiving the first return value, send the second calling request to the call response end; And loop and execute the above steps. When the call response end meets the call return condition, receive the target return value sent by the call response end, including: sending a call return request to the call response end, and receiving the target return value sent by the call response end based on the call return request; the call response end meeting the call return condition includes the call response end receiving the call return request; the call response end meeting the call return condition includes the number of return values stored in the call response end reaching a preset threshold; The call response end is configured to receive a first call request sent by the call initiating end; when a second call request does not depend on the first return value, before sending the first return value, receive a second call request sent by the call initiating end; repeatedly execute the above steps and store the return values, and when a call return condition is satisfied, send a target return value to the call initiating end; wherein, when the call return condition is satisfied and a target return value is sent to the call initiating end, it includes: receiving a call return request sent by the call initiating end, and sending a target return value to the call initiating end based on the call return request; the satisfaction of the call return condition includes receiving the call return request; the satisfaction of the call return condition includes that the number of stored return values reaches a preset threshold. The call initiating end is further configured to receive the target return value sent by the call response end.
8. An electronic device Characterized in that it includes: a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory complete mutual communication through the communication bus; the memory is used for storing a computer program; the processor is configured to execute the program stored in the memory to implement the remote call method according to any one of claims 1-2 or the remote call method according to any one of claims 3-4.
9. A computer-readable storage medium storing a computer program Characterized in that when the computer program is executed by a processor, it implements the remote call method according to any one of claims 1-2 or the remote call method according to any one of claims 3-4.
Citation Information
Patent Citations
Asynchronous invocation method, computer device and storage medium
CN109254854A