Disclosure of Invention
By providing the program calling method, the technical problems that RPC calling is too complex and program performance is unstable in the prior art are solved.
In one aspect, the present application provides a program calling method according to an embodiment of the present application, where the method includes:
when detecting that an agent interface of a client is used, acquiring annotation notes added in the agent interface, wherein the annotation notes are used for indicating that the agent interface supports an agent;
judging whether a corresponding implementation class exists in the client according to the annotation, wherein the implementation class is used for processing the service request of the client;
if not, calling a pre-configured proxy class in a remote calling mode to send the service request to a server for processing, and receiving a request processing result returned by the server.
Optionally, the annotation includes a conditional annotation provided by a lightweight Spring container, and the determining, according to the annotation, whether a corresponding implementation class exists in the client includes:
and loading a remote condition RemoteCondition class in the condition annotation, calling a matching matches method of the RemoteCondition class, and judging whether an implementation class of a proxy interface of the server exists in the Spring container.
Optionally, the method further comprises:
and if the corresponding implementation class exists in the client, calling the implementation class to process the service request by adopting a local calling mode.
Optionally, before the obtaining of the annotation added in the proxy interface, the method further includes:
a preset remote module is led into the client, an agent interface of the client is defined in the remote module, and the agent interface supports remote calling;
adding the annotation note in the agent interface of the client, wherein the annotation note comprises a module value which is used for identifying the agent interface of the client;
adding a switch annotation in a starting class of the client, and specifying a basic package basePackage in the switch annotation, wherein the basePackage is used for indicating the agent interface marked by the annotation.
Optionally, before the invoking a pre-configured proxy class in a remote invocation manner sends the service request to the server for processing, the method further includes:
after the client is started, loading the switch annotation, wherein the switch annotation comprises an ImportBeanDefinitionRegistrar interface which is dynamically registered to the outside;
calling a scanning remotecClientScanner class in an outward dynamic registration register BeanDefinitions method of the ImportBeanDefinitionRegistrar interface, scanning a path of a basic packet to be scanned in a light-weight Spring container, and scanning to obtain the proxy interface marked by the mark annotation under the basic packet;
calling an implementation class AkkaClientproxy in the register BeanDefinites method to proxy the proxy interface and generating a proxy class corresponding to the proxy interface;
registering the proxy class in the Spring container using an injector beandefinition registry introduced into the Spring container.
Optionally, the invoking a pre-configured proxy class in a remote invocation manner to send the service request to the server for processing includes:
when the agent class corresponding to the agent interface of the client is called, the client process ClientActor of the client sends the service request to a local process LocalActor of a server, so that the LocalActor searches the implementation class corresponding to the agent interface from a lightweight Spring container of a programming agent worker service after receiving the service request, and reflects and calls the implementation class to process the service request.
Optionally, before the obtaining of the annotation added in the proxy interface when detecting that the proxy interface of the client is used, the method further includes:
and when the client is started, injecting the implementation class into the lightweight Spring container of the client by using the injection Autowired annotation provided by the lightweight Spring container.
Optionally, the service request is a request sent by a Java development framework Akka cluster.
On the other hand, the present application provides a program calling device through an embodiment of the present application, where the device includes an obtaining module, a determining module, and a processing module, where:
the acquisition module is used for acquiring annotation notes added in the agent interface when the agent interface of the client is detected to be used, and the annotation notes are used for indicating that the agent interface supports an agent;
the judging module is used for judging whether a corresponding implementation class exists in the client according to the annotation, and the implementation class is used for processing the service request of the client;
and the processing module is used for calling a pre-configured proxy class in a remote calling mode to send the service request to a server for processing if the corresponding implementation class does not exist in the client, and receiving a request processing result returned by the server.
For the content that is not introduced or not described in the embodiment of the present application, reference may be made to the related descriptions in the foregoing method embodiments, and details are not described here again.
On the other hand, the present application provides a terminal device according to an embodiment of the present application, where the terminal device includes: a processor, a memory, a communication interface, and a bus; the processor, the memory and the communication interface are connected through the bus and complete mutual communication; the memory stores executable program code; the processor executes a program corresponding to the executable program code by reading the executable program code stored in the memory, for executing the program calling method as described above.
On the other hand, the present application provides a computer-readable storage medium storing a program that executes the program calling method described above when the program runs on a terminal device, through an embodiment of the present application.
One or more technical solutions provided in the embodiments of the present application have at least the following technical effects or advantages: when detecting that an agent interface of a client is used, the method and the device obtain a marking annotation added in the agent interface, then judge whether a corresponding implementation class exists in the client according to the marking annotation, if not, call a pre-configured agent class in a remote call mode to send a service request to a server for processing, and receive a request processing result returned by the server. According to the remote call processing method and device, the remote call processing request is realized by simply adding the annotation in the proxy interface, the program development difficulty is reduced, the program performance stability is ensured, and the technical problems that in the prior art, the code needs to be modified due to module function splitting, RPC calling is too complex, the program performance is unstable and the like are solved.
Detailed Description
The applicant finds out in the process of the application that: existing RPC calls basically use the HTTP protocol and the split between modules must modify the program code. Although the existing development framework Akka is also applied to large data frameworks such as distributed processing Flink and the like, the existing development framework Akka is not integrated with a lightweight Spring technology and abstracted into a corresponding RPC remote call framework.
By providing the program calling method, the technical problems that RPC calling is too complex and program performance is unstable in the prior art are solved.
In order to solve the technical problems, the general idea of the embodiment of the application is as follows: when detecting that an agent interface of a client is used, acquiring annotation notes added in the agent interface, wherein the annotation notes are used for indicating that the agent interface supports an agent; judging whether a corresponding implementation class exists in the client according to the annotation, wherein the implementation class is used for processing the service request of the client; if not, calling a pre-configured proxy class in a remote calling mode to send the service request to a server for processing, and receiving a request processing result returned by the server.
In order to better understand the technical solution, the technical solution will be described in detail with reference to the drawings and the specific embodiments.
First, it is stated that the term "and/or" appearing herein is merely one type of associative relationship that describes an associated object, meaning that three types of relationships may exist, e.g., a and/or B may mean: a exists alone, A and B exist simultaneously, and B exists alone. In addition, the character "/" herein generally indicates that the former and latter related objects are in an "or" relationship.
In order to solve various problems in the prior art, the application provides an RPC remote call scheme realized based on Spring and Akka frameworks, and the purpose of the RPC remote call scheme is to solve the standardization and the interfacing of remote call. The interface is used for decoupling the modules, the modules can be called locally in the same process, and remote calling is used in different processes. Therefore, when the module is split, the realization class of the proxy interface can be appointed by adding annotation to solve the module splitting. And can support multiple communication protocols on the protocol and support the mutual switching between the protocols.
Fig. 1 is a schematic flowchart of a program calling method according to an embodiment of the present application. The method as shown in fig. 1 comprises the following implementation steps:
s101, when detecting that the agent interface of the client is used, obtaining annotation notes added in the agent interface, wherein the annotation notes are used for indicating that the agent interface supports the agent.
When the client uses the self agent interface, the client can obtain the annotation remotecClient annotation added in advance in the agent interface. The proxy interface is a functional interface used for realizing RPC calling. The RemoteClient annotation is used for identifying/indicating that the proxy interface of the client supports being proxied.
Before step S101, the application may configure and implement the RPC remote call in advance accordingly. Please refer to fig. 2, which is a flowchart illustrating a configuration of an RPC remote call according to an embodiment of the present application. Fig. 2 implements remote invocation by way of annotation and interface, and the method shown in fig. 2 includes the following implementation steps:
s201, a preset remote module is led into a target end, and the target end is a client or a server.
According to the method and the system, the remote module can be respectively led in the client and the server, the remote module can be regarded as an open source frame, and the user-defined function program can be added or modified on the open source frame subsequently.
S202, defining a proxy interface of the target end in the remote module, wherein the proxy interface supports remote calling.
After the target end is created, an agent interface of the target end, such as a WorkerApi interface or other interfaces, may be further defined, which is not limited in the present application. In the following, the description of the related content is made by taking the proxy interface as a WorkerApi interface as an example, but the invention is not limited thereto. The proxy interface supports a remote calling function and is used for realizing the abstraction that the client A calls the server A. The client side clientA maintains the realization of the self-agency interface, and the server side serverA maintains the realization of the self-agency interface.
S203, adding annotation notes in the agent interface of the target end, wherein the annotation notes comprise module values, and the module values are used for identifying the agent interface of the client.
According to the method and the device, a RemoteClient annotation is added and marked on the agent interface, a value is assigned to a module value in the RemoteClient annotation, and the value is used for identifying the agent interface, for example, is represented as a module name where the agent interface is located, such as client side client A or server side server A.
S204, adding a switch annotation in the starting class of the target end, and specifying a basePackage in the switch annotation, wherein the basePackage is used for indicating the agent interface marked by the annotation.
According to the method, a switch annotation EnableRemoteClient can be added in a starting class of a program, a basePackage in the switch annotation EnableRemoteClient is assigned with a value, and a complete package name of an agent interface Workerapi is given. The basePackage is used to indicate the proxy interface marked by the annotated RemoteClient annotation, which may specifically represent the complete package name of the scan interface.
It should be noted that, if the programs of the client clientA and the server a are in the same process, the client clientA can directly call the implementation class of WorkerApi in the server a to implement the method when calling the proxy interface WorkerApi. On the contrary, if the programs of the client clientA and the server A are not in the same process, the client clientA calls the proxy interface WorkerrApi in a remote calling mode to call the implementation class of WorkerrApi in the server A to implement the method.
After a program is started (for example, a starting class of a client is started), all agent interfaces marked by the annotation remotecClient annotation under a basic package basePackage specified in the switch annotation EnableRemoteClient can be automatically scanned, and then the agent classes corresponding to the agent interfaces are generated. Specific embodiments of generating proxy classes are described below. Please refer to fig. 3, which is a flowchart illustrating an implementation of RPC remote call according to an embodiment of the present application. The method as shown in fig. 3 comprises the following implementation steps:
s301, after the client is started, loading the switch annotation EnableRemoteClient at the client side.
According to the method and the device, when client clientA is started, a lightweight Spring container on the client side loads a registered remoteclientRegistrar class which is imported by inputting Import annotation into switch annotation EnableRemoteClientClient. Wherein the Import annotation is an annotation provided by a Spring container. The remotecClientRegistrar class realizes the dynamic registration of the ImportBeanDefinitionRegistrar interface to the outside. The Spring container calls back a foreign dynamic registration register definitions method in the ImportBeanDefinitionRegistrar interface when starting.
S302, a scanning path is obtained from the switch annotation, and the agent interface marked by the mark annotation is obtained by scanning under the scanning path.
When the register BeanDefinitions method is called, an injector BeanDefinitions register of a Spring container and a path of a basic packet to be scanned are transmitted into the method. And then the application calls the scanning remotecclientscanner class under the method of the register beer definitions to scan all the proxy interfaces marked by the marked remotecclientannotation in the basic package under the path.
And S303, circularly generating the proxy class corresponding to the proxy interface after the proxy interface is obtained.
After all the proxy interfaces are obtained, the proxy interfaces for realizing AkkaClientproxy classes can be further used, and then the proxy classes corresponding to the proxy interfaces are generated.
And S304, registering the proxy class into a lightweight Spring container of the client.
The application utilizes an injector BeanDefinitionRegistration to register the proxy classes corresponding to the proxy interfaces into a Spring container, so that the configuration of RPC remote call implementation is completed.
Understandably, the AkkaClientproxy class is an implementation class of a factory Bean interface. When the Spring container obtains the Bean instance, the object obtaining getObject method is called to obtain the proxy AkkaClientproxy class. When each method of the interface is rewritten, a custom-designed client process ClientActor and a local process localack actor are used.
Specifically, for example, when the client clientA calls any method of the proxy class in the proxy interface WorkerApi thereof, that is, when the client clientA calls the proxy class of the proxy interface WorkerApi, the client process clientacter of the client clientA may send a request to the local process localack acter of the server a. The localcactor searches a real implementation class of an agent interface WorkerApi from a Spring container of a programming agent worker service, calls a corresponding method processing request under the implementation class by using a reflection mechanism, and returns a processing result to realize RPC remote calling.
S102, judging whether a corresponding implementation class exists in the client according to the annotation, wherein the implementation class is used for processing the service request of the client.
After the configuration of RPC remote call and the configuration of RPC remote call realization are completed, PRC remote call and local call can be switched according to actual service requirements. Specifically, the code of the client clientA and the code of the server A can be in the same process or different processes. If the local direct call can be selected in the same process, RPC remote call is not needed. If the call cannot be directly called in different processes, RPC remote call needs to be realized through a network.
Specifically, when the client clientA is detected to be started or the client clientA is detected to use the proxy interface WorkerrApi of the client clientA, the implementation class of the proxy interface WorkerrApi for injecting the automatic annotation into the server A of the server side can be used by the client clientA provided by the Spring container. In other words, the application can directly use the automatic annotation to inject the implementation class.
After obtaining the remark RemoteClient annotation in the proxy interface of the client clientA, the method can further judge whether the client clientA has the implementation class of the proxy interface WorkerrApi of the server serverA. Specifically, the RemoteConditional annotation includes a conditional RemoteConditional annotation provided by Spring, and the RemoteConditional annotation can load a remote conditional RemoteConditional class designed by the application in a user-defined manner and call a matching matches method under the remote conditional RemoteConditional class. And then judging whether the implementation class of the proxy interface WorkerrApi of the server A exists in the Spring container or not in the method. If so, determining that the client clientA program and the server A program are in the same process, and then continuing to execute step S104. Otherwise, it is determined that the client clientA and the server a programs are not in the same process, and at this time, the step S103 may be continuously executed.
S103, calling a pre-configured proxy class in a remote calling mode to send the service request to a server for processing, and receiving a request processing result returned by the server.
When determining that no corresponding implementation class exists in the Spring container, the method can call a pre-configured proxy class in a remote call mode to send the service request to the server A for processing, and receive a request processing result returned by the server A.
Specifically, when the client calls the proxy class in the proxy interface WorkerApi, the client process ClientActor of the client sends the service request to the local process LocalActor of the server a. The localcactor searches a real implementation class of an agent interface WorkerApi from a Spring container of a programming agent worker service, calls a corresponding method under the implementation class by using a reflection mechanism to process the request, and returns a request processing result to realize RPC remote call.
In an alternative embodiment, the service request may be a service request generated by a client side, and may also be a service request sent by a Java development framework Akka cluster, which is not limited in this application.
And S104, calling the implementation class to process the service request by adopting a local calling mode.
When the implementation class of the proxy interface WorkerrApi of the server side server A exists in the Spring container, the corresponding method in the implementation class can be directly called in a local calling mode to process the service request.
For better understanding of the present application, a specific embodiment of the RPC remote call is described in detail below with reference to the client clientA and the server a. Please refer to fig. 4, which is a flowchart illustrating a remote RPC call method according to an embodiment of the present application. The method as shown in fig. 4 comprises the following implementation steps:
s401, when detecting the implementation class in the proxy interface of the calling client server A, sending the service request to the server A. Accordingly, the server a receives the service request.
The service request may be a service request sent by an Akka cluster, where the Akka is a development framework under the programming language Java, please refer to fig. 5, which shows an implementation class diagram of a possible Akka logic implementation. As shown in fig. 5, the Akka framework client service (AkkaClientService) supports functions such as an invoking process (actors ref), a message sending (sendmasage), and an invoking process configuration (setacorref). AkkaClientService provides client service, namely message sending; it can also call an object process (ObjectActor) in real applications, which provides/supports process handling methods (actor handler), such as remote calls and local calls. The acterhandler provides various types, process names, method identifiers and other contents, and the application is not limited.
S402, the server A judges whether a corresponding implementation class exists. Specifically, after receiving the service request, the server a may determine whether a corresponding implementation class and a method for processing the service request under the implementation class exist in its own Spring container. If so, continuing to execute step S403; otherwise, step S404 is executed.
And S403, calling the implementation class to process the service request, and returning a calling result, wherein the calling result is used for indicating that the server A is successfully called. Optionally, the call result further carries a request processing result corresponding to the service request.
S404, returning a calling result, wherein the calling result is used for indicating that the server A is failed to call.
S405, the server A packages the calling result into a request processing result and returns the request processing result to the client server A.
For the content not described in the embodiment of the present application, reference may be made to the embodiment corresponding to the method described in fig. 1 to fig. 3, and details of the present application are not repeated herein.
By implementing the method, when the agent interface of the client is detected to be used, the annotation added in the agent interface is obtained, whether the corresponding implementation class exists in the client is judged according to the annotation, if not, the service request is sent to the server to be processed by calling the pre-configured agent class in a remote calling mode, and the request processing result returned by the server is received. According to the remote call processing method and device, the remote call processing request is realized by simply adding the annotation in the proxy interface, the program development difficulty is reduced, the program performance stability is ensured, and the technical problems that in the prior art, the code needs to be modified due to module function splitting, RPC calling is too complex, the program performance is unstable and the like are solved. In addition, various communication protocols can be supported in the remote calling, and the practicability of program calling is improved.
Based on the same inventive concept, another embodiment of the present application provides a device and a terminal device corresponding to the method for invoking the program in the embodiment of the present application.
Fig. 6 is a schematic structural diagram of a program calling device according to an embodiment of the present application. The apparatus shown in fig. 6 includes an obtaining module 601, a determining module 602, and a processing module 603, where:
the obtaining module 601 is configured to obtain an annotation added in an agent interface when detecting that the agent interface of a client is used, where the annotation is used to indicate that the agent interface supports an agent;
the judging module 602 is configured to judge whether a corresponding implementation class exists in the client according to the annotation, where the implementation class is used to process a service request of the client;
the processing module 603 is configured to, if there is no corresponding implementation class in the client, invoke a pre-configured proxy class in a remote invocation manner to send the service request to the server for processing, and receive a request processing result returned by the server.
Optionally, the annotation includes a conditional annotation provided by a lightweight Spring container, and the determining module 602 is specifically configured to:
and loading a remote condition RemoteCondition class in the condition annotation, calling a matching matches method of the RemoteCondition class, and judging whether an implementation class of a proxy interface of the server exists in the Spring container.
Optionally, the processing module 603 is further configured to:
and if the corresponding implementation class exists in the client, calling the implementation class to process the service request by adopting a local calling mode.
Optionally, before the obtaining of the annotation added in the proxy interface, the processing module 603 is further configured to:
a preset remote module is led into the client, an agent interface of the client is defined in the remote module, and the agent interface supports remote calling;
adding the annotation note in the agent interface of the client, wherein the annotation note comprises a module value which is used for identifying the agent interface of the client;
adding a switch annotation in a starting class of the client, and specifying a basic package basePackage in the switch annotation, wherein the basePackage is used for indicating the agent interface marked by the annotation.
Optionally, before the remotely invoking a pre-configured proxy class to send the service request to the server for processing, the processing module 603 is further configured to:
after the client is started, loading the switch annotation, wherein the switch annotation comprises an ImportBeanDefinitionRegistrar interface which is dynamically registered to the outside;
calling a scanning remotecClientScanner class in an outward dynamic registration register BeanDefinitions method of the ImportBeanDefinitionRegistrar interface, scanning a path of a basic packet to be scanned in a light-weight Spring container, and scanning to obtain the proxy interface marked by the mark annotation under the basic packet;
calling the proxy interface for realizing AkkaClientproxy in the register BeanDefinitions method to generate a proxy class corresponding to the proxy interface;
registering the proxy class in the Spring container using an injector beandefinition registry introduced into the Spring container.
Optionally, the processing module 603 is specifically configured to:
when the agent class corresponding to the agent interface of the client is called, the client process ClientActor of the client sends the service request to a local process LocalActor of a server, so that the LocalActor searches the implementation class corresponding to the agent interface from a lightweight Spring container of a programming agent worker service after receiving the service request, and reflects and calls the implementation class to process the service request.
Optionally, before the annotation added in the proxy interface is obtained when the proxy interface of the client is detected to be used, the processing module 603 is further configured to:
and when the client is started, injecting the implementation class into the lightweight Spring container of the client by using the injection Autowired annotation provided by the lightweight Spring container.
Optionally, the service request is a request sent by a Java development framework Akka cluster.
Please refer to fig. 7, which is a schematic structural diagram of a terminal device according to an embodiment of the present application. The terminal device 70 shown in fig. 7 includes: at least one processor 701, a communication interface 702, a user interface 703 and a memory 704, where the processor 701, the communication interface 702, the user interface 703 and the memory 704 may be connected by a bus or by other means, and the embodiment of the present invention is exemplified by being connected by the bus 705. Wherein,
processor 701 may be a general-purpose processor, such as a Central Processing Unit (CPU).
The communication interface 702 may be a wired interface (e.g., an ethernet interface) or a wireless interface (e.g., a cellular network interface or using a wireless local area network interface) for communicating with other terminals or websites. In this embodiment of the present invention, the communication interface 702 is specifically configured to obtain a service request.
The user interface 703 may specifically be a touch panel, including a touch screen and a touch screen, for detecting an operation instruction on the touch panel, and the user interface 703 may also be a physical button or a mouse. The user interface 703 may also be a display screen for outputting, displaying images or data.
The Memory 704 may include Volatile Memory (Volatile Memory), such as Random Access Memory (RAM); the Memory may also include a Non-Volatile Memory (Non-Volatile Memory), such as a Read-Only Memory (ROM), a Flash Memory (Flash Memory), a Hard Disk (Hard Disk Drive, HDD), or a Solid-State Drive (SSD); the memory 704 may also comprise a combination of the above types of memory. The memory 704 is used for storing a set of program codes, and the processor 701 is used for calling the program codes stored in the memory 704 to execute the following operations:
when detecting that an agent interface of a client is used, acquiring annotation notes added in the agent interface, wherein the annotation notes are used for indicating that the agent interface supports an agent;
judging whether a corresponding implementation class exists in the client according to the annotation, wherein the implementation class is used for processing the service request of the client;
if not, calling a pre-configured proxy class in a remote calling mode to send the service request to a server for processing, and receiving a request processing result returned by the server.
Optionally, the annotation includes a conditional annotation provided by a lightweight Spring container, and the determining, according to the annotation, whether a corresponding implementation class exists in the client includes:
and loading a remote condition RemoteCondition class in the condition annotation, calling a matching matches method of the RemoteCondition class, and judging whether an implementation class of a proxy interface of the server exists in the Spring container.
Optionally, the processor 701 is further configured to:
and if the corresponding implementation class exists in the client, calling the implementation class to process the service request by adopting a local calling mode.
Optionally, before the obtaining of the annotation added in the proxy interface, the method further includes:
a preset remote module is led into the client, an agent interface of the client is defined in the remote module, and the agent interface supports remote calling;
adding the annotation note in the agent interface of the client, wherein the annotation note comprises a module value which is used for identifying the agent interface of the client;
adding a switch annotation in a starting class of the client, and specifying a basic package basePackage in the switch annotation, wherein the basePackage is used for indicating the agent interface marked by the annotation.
Optionally, before the invoking a pre-configured proxy class in a remote invocation manner sends the service request to the server for processing, the processor 701 is further configured to:
after the client is started, loading the switch annotation, wherein the switch annotation comprises an ImportBeanDefinitionRegistrar interface which is dynamically registered to the outside;
calling a scanning remotecClientScanner class in an outward dynamic registration register BeanDefinitions method of the ImportBeanDefinitionRegistrar interface, scanning a path of a basic packet to be scanned in a light-weight Spring container, and scanning to obtain the proxy interface marked by the mark annotation under the basic packet;
calling an implementation class AkkaClientproxy in the register BeanDefinites method to proxy the proxy interface and generating a proxy class corresponding to the proxy interface;
registering the proxy class in the Spring container using an injector beandefinition registry introduced into the Spring container.
Optionally, the invoking a pre-configured proxy class in a remote invocation manner to send the service request to the server for processing includes:
when the agent class corresponding to the agent interface of the client is called, the client process ClientActor of the client sends the service request to a local process LocalActor of a server, so that the LocalActor searches the implementation class corresponding to the agent interface from a lightweight Spring container of a programming agent worker service after receiving the service request, and reflects and calls the implementation class to process the service request.
Optionally, before the annotation added in the proxy interface is obtained when the proxy interface of the client is detected to be used, the processor 701 is further configured to:
and when the client is started, injecting the implementation class into the lightweight Spring container of the client by using the injection Autowired annotation provided by the lightweight Spring container.
Optionally, the service request is a request sent by a Java development framework Akka cluster.
Since the terminal device described in this embodiment is a terminal device used for implementing the program calling method in this embodiment, based on the program calling method described in this embodiment, a person skilled in the art can understand the specific implementation manner of the terminal device in this embodiment and various variations thereof, so that a detailed description of how to implement the method in this embodiment by the terminal device is omitted here. As long as a person skilled in the art implements the terminal device used in the method for invoking a program in the embodiment of the present application, the terminal device is within the scope of the present application.
The technical scheme in the embodiment of the application at least has the following technical effects or advantages: when detecting that an agent interface of a client is used, the method and the device obtain a marking annotation added in the agent interface, then judge whether a corresponding implementation class exists in the client according to the marking annotation, if not, call a pre-configured agent class in a remote call mode to send a service request to a server for processing, and receive a request processing result returned by the server. According to the remote call processing method and device, the remote call processing request is realized by simply adding the annotation in the proxy interface, the program development difficulty is reduced, the program performance stability is ensured, and the technical problems that in the prior art, the code needs to be modified due to module function splitting, RPC calling is too complex, the program performance is unstable and the like are solved.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
While preferred embodiments of the present invention have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including preferred embodiments and all such alterations and modifications as fall within the scope of the invention.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present invention without departing from the spirit and scope of the invention. Thus, if such modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include such modifications and variations.