CN114285852B - Service calling method and device based on multi-stage service platform - Google Patents

Service calling method and device based on multi-stage service platform Download PDF

Info

Publication number
CN114285852B
CN114285852B CN202111622175.2A CN202111622175A CN114285852B CN 114285852 B CN114285852 B CN 114285852B CN 202111622175 A CN202111622175 A CN 202111622175A CN 114285852 B CN114285852 B CN 114285852B
Authority
CN
China
Prior art keywords
service
service platform
platform
gateway
target
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202111622175.2A
Other languages
Chinese (zh)
Other versions
CN114285852A (en
Inventor
刘珊珊
王鹏
谢心甜
张洪彬
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hangzhou Dt Dream Technology Co Ltd
Original Assignee
Hangzhou Dt Dream Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hangzhou Dt Dream Technology Co Ltd filed Critical Hangzhou Dt Dream Technology Co Ltd
Priority to CN202111622175.2A priority Critical patent/CN114285852B/en
Publication of CN114285852A publication Critical patent/CN114285852A/en
Application granted granted Critical
Publication of CN114285852B publication Critical patent/CN114285852B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

The application provides a service calling method and device based on a multi-stage service platform, which are applied to platform gateways corresponding to any one of the multi-stage service platforms, wherein the method can comprise the following steps: receiving a call request from any service platform, wherein the call request is used for calling a target service; responding to a call request, and determining that the target service belongs to a local service provided by any service platform or a remote service provided by other service platforms from service information corresponding to the target service; if the target service belongs to the local service, the calling request is sent to any service platform for processing; and if the target service belongs to the remote service, requesting to call the target service from the other service platforms.

Description

Service calling method and device based on multi-stage service platform
Technical Field
The application relates to the technical field of network communication, in particular to a service calling method and device based on a multi-level service platform.
Background
The multi-level service platforms may need to invoke services with each other, as required by different services. However, if the service of different service platforms is installed on different gateways, and the cross-gateway and cross-service platform call between the services is to be realized, the network between the service platforms at all levels needs to be all opened, and the routing information needed during the call is stored in a centralized manner, which consumes a great deal of manpower and material resources.
Disclosure of Invention
In view of this, the present application provides a service calling method and device based on a multi-level service platform, which are used for calling services in the multi-level service platform.
Specifically, the application is realized by the following technical scheme:
according to a first aspect of the present application, a service calling method based on a multi-stage service platform is provided, and the service calling method is applied to a platform gateway corresponding to any service platform in the multi-stage service platform, and the method includes:
receiving a call request from any service platform, wherein the call request is used for calling a target service;
responding to the call request, and determining that the target service belongs to a local service provided by any service platform or a remote service provided by other service platforms from service information corresponding to the target service;
if the target service belongs to the local service, the calling request is sent to any service platform for processing; and if the target service belongs to the remote service, requesting to call the target service from the other service platforms.
According to a second aspect of the present application, another service invocation method based on a multi-level service platform is provided, and the method is applied to any service platform in the multi-level service platform, and includes:
Receiving a call request aiming at a target service, wherein the target service is used for acquiring preset resources, and the call request comprises a resource identifier of the preset resources;
responding to the call request, and determining whether the preset resource is provided by any service platform according to the corresponding relation between the resource identifier and the gateway address;
if the corresponding relation indicates that the preset resource is provided by any service platform, the any service platform processes the call request; and if the corresponding relation indicates that the preset resource is provided by the other service platforms, sending the remote gateway address of the other service platforms and the call request to a platform gateway corresponding to any service platform, and sending the call request to the other service platforms for processing according to the remote gateway address through the platform gateway.
According to a third aspect of the present application, a service calling device based on a multi-stage service platform is provided, and the service calling device is applied to a platform gateway corresponding to any service platform in the multi-stage service platform, and the device includes:
the first receiving unit is configured to receive a call request from any service platform, wherein the call request is used for calling a target service;
The first determining unit is configured to determine that the target service belongs to a local service provided by any service platform or a remote service provided by other service platforms from service information corresponding to the target service in response to the call request;
the calling unit is configured to send the calling request to any service platform for processing if the target service belongs to the local service; and if the target service belongs to the remote service, requesting to call the target service from the other service platforms.
According to a fourth aspect of the present application, there is provided a service invocation apparatus based on a multi-level service platform, applied to any service platform of the multi-level service platform, the apparatus comprising:
the second receiving unit is configured to receive a call request for a target service, wherein the target service is used for acquiring preset resources, and the call request comprises a resource identifier of the preset resources;
the second determining unit is configured to determine whether the preset resource is provided by any service platform according to the corresponding relation between the resource identifier and the gateway address in response to the call request;
The sending unit is configured to process the call request by the any service platform if the corresponding relation indicates that the preset resource is provided by the any service platform; and if the corresponding relation indicates that the preset resource is provided by the other service platforms, sending the remote gateway address of the other service platforms and the call request to a platform gateway corresponding to any service platform, and sending the call request to the other service platforms for processing according to the remote gateway address through the platform gateway.
According to a fifth aspect of the present application, there is provided an electronic device comprising:
a processor;
a memory for storing processor-executable instructions;
wherein the processor is configured to implement the method as described in the embodiments of the first aspect described above by executing the executable instructions.
According to a sixth aspect of embodiments of the present application, there is provided a computer readable storage medium having stored thereon computer instructions which, when executed by a processor, implement the steps of the method as described in the embodiments of the first aspect above.
According to the technical scheme provided by the application, the target service to be called is divided into the local service and the remote service, and in the calling process, the two service types are distinguished through the service information. Based on the service information maintained by the service platforms, the gateway of any stage of service platform only needs to select a mode of calling the target service according to the service information, and does not need to pay attention to which stage of service platform the source service of the target service originates from, so that inconvenience caused by storing a large amount of route information and opening all networks of each stage of network platform is avoided.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the application and together with the description, serve to explain the principles of the application.
FIG. 1 is a flow chart illustrating a service invocation method based on a multi-level service platform according to an exemplary embodiment of the present application;
FIG. 2 is a flow chart illustrating another multi-level service platform based service invocation method according to an exemplary embodiment of the present application;
FIG. 3 is a network architecture schematic of a multi-level service platform shown according to an exemplary embodiment of the present application;
FIG. 4 is a specific flow diagram illustrating a service invocation method based on a multi-level service platform according to an exemplary embodiment of the present application;
FIG. 5 is a schematic diagram of a multi-level service platform according to an exemplary embodiment of the present application;
FIG. 6 is a particular flow diagram illustrating another multi-level service platform based service invocation method according to an exemplary embodiment of the present application;
FIG. 7 is a schematic diagram of another multi-level service platform shown according to an exemplary embodiment of the present application;
FIG. 8 is a schematic diagram of an electronic device, according to an exemplary embodiment of the present application;
FIG. 9 is a block diagram of a multi-level service platform based service invocation apparatus according to an exemplary embodiment of the present application;
fig. 10 is a block diagram illustrating another service invocation apparatus based on a multi-level service platform according to an exemplary embodiment of the present application.
Detailed Description
Reference will now be made in detail to exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, the same numbers in different drawings refer to the same or similar elements, unless otherwise indicated. The implementations described in the following exemplary examples are not representative of all implementations consistent with the present application. Rather, they are merely examples of apparatus and methods consistent with some aspects of the present application as detailed in the accompanying claims.
The terminology used in the present application is for the purpose of describing particular embodiments only and is not intended to be limiting of the present application. As used in this application and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should also be understood that the term "and/or" as used herein refers to and encompasses any or all possible combinations of one or more of the associated listed items.
It should be understood that although the terms first, second, third, etc. may be used herein to describe various information, these information should not be limited by these terms. These terms are only used to distinguish one type of information from another. For example, a first message may also be referred to as a second message, and similarly, a second message may also be referred to as a first message, without departing from the scope of the present application. The word "if" as used herein may be interpreted as "at … …" or "at … …" or "responsive to a determination", depending on the context.
Next, embodiments of the present application will be described in detail.
Fig. 1 is a flowchart illustrating a service invocation method based on a multi-level service platform according to an exemplary embodiment of the present application. As shown in fig. 1, the method is applied to a platform gateway corresponding to any service platform in the multi-level service platforms, and may include the following steps:
step 102: and receiving a call request from any service platform, wherein the call request is used for calling a target service.
The service calling method is based on the multi-stage service platforms, each stage of service platform in the multi-stage service platform is provided with a gateway corresponding to the service platform, the gateway corresponding to any one of the multi-stage service platform is used for sending calling requests of the service platform corresponding to the service platform to the gateway corresponding to the other service platform, receiving calling requests of the other service platform sent to the service platform and the like.
In an embodiment, a platform gateway corresponding to any service platform receives a call request initiated by the service platform, where the call request is used for calling a target service. For example, the call request may include an address of the target service, where the address is used to represent the target service.
Step 104: and responding to the call request, and determining that the target service belongs to the local service provided by any service platform or the remote service provided by other service platforms from the service information corresponding to the target service.
Step 106: if the target service belongs to the local service, the calling request is sent to any service platform for processing; and if the target service belongs to the remote service, requesting to call the target service from the other service platforms.
In an embodiment, after receiving the call request, the platform gateway corresponding to any service platform may determine, according to service information corresponding to the target service, whether the target service belongs to a local service provided by any service platform or a remote service provided by other service platforms by using data corresponding to the target service.
In one case, the target service information may include address information of the target service, gateway information of the target service, and other types of information.
Specifically, when the target service is a local service provided by any service platform, the service information of the target service may only include the address information of the target service, or the address information and the gateway information of the target service; because the target service is a local service, the source service platform providing the target service is any service platform, and then any service platform does not need to newly establish an external address for the target service, in other words, if the target service is a local service, the address information contained in the service information is the real address of the target service on any service platform.
Correspondingly, when the target service belongs to a remote service provided by other service platforms, the service information of the target service at any one service platform can comprise the corresponding relation among the remote gateway identification of the other service platform, the real address of the target service and the external address of the target service at any one service platform, wherein the real address of the target service comprises the external address of the target service at the other service platform. Specifically, if the target service belongs to the remote service, which means that any service platform cannot provide the target service locally, but other service platforms provide the target service, the call request needs to be forwarded to the other service platforms for processing. For the remote service, the service information at any service platform can include the external address of the target service at any service platform, the real address of the target service, and the remote gateway identification of other service platforms. The external address of the target service at any service platform is the external address provided by any service platform for calling the target service, the real address of the target service represents the external address of the target service provided by other service platforms, and the remote gateway is used for indicating the gateway corresponding to the other service platforms. And the external address of the target service at any service platform is created by any service platform according to the real address of the target service, in other words, other service platforms provide the external address of the target service at other service platforms to any service platform in advance, and the external address of the target service at any service platform is created by any service platform according to the external address of the target service at other service platforms.
As can be seen from the above, each service platform maintains pre-created service information. In the multi-stage service platform, the gateway of each service platform is connected with the gateway of the unique upper-stage service platform, so that the multi-stage service platform can form a tree structure, and each service platform can have one or more lower-stage service platforms but only has the unique upper-stage service platform. Then, in connection with the structure of the multi-level platform in the present application, the above procedure of pre-creating service information may be specifically: based on the structural characteristics of the multi-stage service platforms, if a certain service platform in the multi-stage service platforms wants to synchronize a certain service of the service platform to any other service platform in the multi-stage service platforms, a gateway connection link exists between the two platforms in the architecture of the multi-stage service platforms. In the gateway connection link between two service platforms, between every two service platforms located at adjacent positions, the downstream service platform to be synchronized synchronizes the external address of any one of the services provided by itself to the upstream service platform to be received through its own gateway, so that the upstream service platform creates the external address of any one of the services at the upstream service platform according to the external address of the downstream service platform according to the any one of the services synchronized by the downstream service platform, and records the remote gateway information corresponding to the downstream service platform. Further, the upstream service platform may take the external address of any service at the downstream service platform as the real address at the upstream service platform, and establish a correspondence between the real address, the created external address at the upstream service platform, and the remote gateway information to generate the identity information at the upstream service platform.
Comparing the service information of the local service and the remote service can show that the service information corresponding to the remote service additionally contains the information of the remote gateway and the information of the real address, and then the platform gateway of any service platform can judge whether the target service belongs to the local service or the remote service by confirming whether the target service information contains the information of the remote gateway and the information of the real address.
In particular implementations, if the user wants to invoke the target service at any service platform, only the external address of the target service needs to be included in the initiated target request, and no knowledge is needed about which platform the target service is provided by, and the gateway at any service platform can determine whether the target service belongs to the local service or the remote service according to the identity information. If the target service belongs to the remote service, further, the gateway of any service platform can determine the remote gateway information corresponding to other service platforms according to the corresponding relation in the service information, and initiate calling to other service platforms corresponding to the remote gateway through the real address contained in the service information.
It should be noted that, the service information corresponding to the plurality of services that may be maintained at any service platform may be maintained in the service information base at any service platform. When the platform gateway corresponding to any service platform processes the call request, if the target service is a remote service, the external address of the target service can be determined from the call request, and then the service information corresponding to the target service is determined in the service information base according to the external address.
In an embodiment, the process that the platform gateway of any service platform initiates a call to the remote gateway of other service platforms based on the real address of the target service may be specifically: the platform gateway of any service platform initiates a verification request to the remote gateway of the target service, and the remote gateway verifies whether the platform gateway of any service platform is a self-trusted gateway or not and whether the target service is a service which is allowed to be called or not. If the two conditions are met, the remote gateway can allow the platform gateway of any service platform to call the target service to other service platforms through the remote gateway.
According to the technical scheme of the embodiment, the target service to be called is divided into the local service and the remote service, and in the calling process, the two service types are distinguished through the service information. Based on the service information maintained by the service platforms, the gateway of any stage of service platform only needs to select a mode of calling the target service according to the service information maintained by the gateway of any stage of service platform, and does not need to pay attention to whether the source service of the target service is sourced from the service platform of which stage, so that inconvenience caused by storing a large amount of route information and opening all networks of each stage of network platform is avoided.
Fig. 2 is a flowchart illustrating another service invocation method based on a multi-level service platform according to an exemplary embodiment of the present application. As shown in fig. 2, the method is applied to any service platform in the multi-level service platform, and may include the following steps:
step 202, receiving a call request for a target service, where the target service is used to obtain a preset resource, and the call request includes a resource identifier of the preset resource.
In an embodiment, a multi-level service platform receives a call request for a target service, where the target service is used to obtain a preset resource from a preset database; the multi-stage service platform can obtain the resource identifier of the preset resource contained in the multi-stage service platform by analyzing the calling request.
Step 204, in response to the call request, determining whether the preset resource is provided by the any service platform according to the corresponding relation between the resource identifier and the gateway address.
Maintaining a corresponding relation between the resource identifier and the gateway address at any service platform, and if the resource identifier of the preset resource corresponds to the gateway address of any service platform or the corresponding gateway address does not exist in the resource identifier of the preset resource, indicating that the preset resource is locally provided by any service platform; if the resource identifier of the preset resource corresponds to the remote gateway address, then it is stated that the preset resource is provided by the other service platform using the remote gateway address.
Step 206, if the correspondence indicates that the preset resource is provided by any service platform, processing the call request by any service platform; if the corresponding relation indicates that the preset resource is provided by other service platforms, the remote gateway addresses and the calling requests of the other service platforms are sent to platform gateways corresponding to any service platform, and the calling requests are sent to the other service platforms for processing according to the remote gateway addresses through the platform gateways.
In a specific implementation, if the preset resource is provided by any service platform, any service platform can directly process the call request, or the call request is sent to a platform gateway corresponding to any service platform, and the platform gateway sends the call request back to any service platform for processing.
In addition, the call request may further include specific parameters of the preset resource, and after any service platform or other service platforms obtain the call request, the specific parameters of the preset resource may be obtained by analyzing the call request, further, a query statement may be generated according to the specific parameters of the preset resource, and the preset resource may be obtained from the database of the corresponding service platform through the query statement.
It should be noted that, the service addresses of the target service in each service platform in the multi-stage service platform are the same, so that the service platforms and the gateways corresponding to the service platforms do not need to distinguish the real addresses or the external addresses of the target service, and the target service for acquiring the preset resource uses the same service address in the multi-stage service platform. The service platforms at all levels only need to pre-establish the corresponding relation between the resource identifier and the gateway address, and when the target service is subsequently called, whether the preset resource is from any local service platform can be determined according to the preset resource identifier.
In an embodiment, in the present application, a gateway of each service platform is connected to a gateway of a unique upper service platform, so that the multiple service platforms may form a tree structure, and each service platform may have one or more lower service platforms, but only has a unique upper service platform. Then, in connection with the structure of the multi-stage platform in the present application, the above correspondence may be established by: in the multi-stage service platforms, the gateway of each service platform is connected with the gateway of the unique upper-stage service platform; in the gateway connecting link of any two service platforms, the downstream service platform of the resource to be synchronized synchronizes the resource identification of the resource provided by the downstream service platform to the upstream service platform of the resource to be received through the gateway of the downstream service platform, so that the upstream service platform records the corresponding relation between the resource identification of the resource provided by the downstream service platform and the gateway of the downstream service platform.
According to the technical scheme of the embodiment, when the target service is used for acquiring the preset resources from the preset database, the service platforms at all levels do not need to create an external address for the target service; any service platform can determine whether the preset resource is data provided by any service platform through the corresponding relation between the resource identifier and the gateway address, and when the preset resource is a service provided by other service platforms, the determined remote gateway address is sent to the platform gateway corresponding to any service platform so as to instruct the platform gateway to send a call request to the remote gateway address. The method and the device unify the addresses of the target services for acquiring the preset resources from the preset database into the same addresses, and realize the call in the multi-level network service platform by using the resource identifier, thereby avoiding the storage pressure on the multi-level service platform caused by creating a large number of target service addresses.
Fig. 3 is a schematic diagram of a network architecture of a multi-level service platform to which the embodiments of the present application are applied. As shown in fig. 3, each service platform in the multi-level service platform has its own corresponding gateway; the gateway of each service platform is connected with the gateway of the unique upper service platform, so that the multi-stage service platforms can form a tree structure, and each service platform can have one or more lower service platforms but only has the unique upper service platform. Specifically, the gateway corresponding to the service platform 31 is the gateway 32, the gateway corresponding to the service platform 33 is the gateway 34, and the gateway corresponding to the service platform 35 is the gateway 36. The service platforms 31, 33, 35 are connected through the gateways 32, 34, 36, the service platform 33 and the service platform 35 have only one upper service platform 31, and the lower service platform corresponding to the service platform 31 has the service platform 33 and the service platform 35.
Fig. 4 is a flowchart illustrating a service invocation method based on a multi-level service platform according to an exemplary embodiment of the present application. The specific steps of the above method are described in detail below in conjunction with fig. 3:
in step 402, any service platform creates service information for a target service.
In this step, for convenience of description, the service platforms 31, 33, 35 in fig. 3 are replaced by service platforms A, A, A2, respectively, and the gateway information corresponding to the gateways 32, 34, 36 is: agate, A1gate, A2gate. The service platforms A1 and A2 have a gateway connection between the three upper service platforms a, A, A1 and A2. There is a connection link A2-A2 from platform A2 to A1. As shown in fig. 5, the service platform A1 provides a service X, which can synchronize address information of the service X and gateway information A1gate corresponding to the service X to an upstream upper stage platform a through the connection link, the upper stage service platform a uses the address information of the service X synchronized by the A1 as real address information of the service X, uses the gateway information A1gate as remote gateway information of the service X, and creates external address information at the service platform a according to the real address information, where the real address information, the external address information and the remote gateway information form service information of the service X maintained by the upper stage platform a; similarly, the service platform a can synchronize the external address information of the service X and the gateway information Agate corresponding to the external address information of the service X to the upstream service platform A2 through the connection link, the upstream service platform A2 uses the external address information of the service X synchronized by the a as the real address information of the service X, uses the gateway information Agate as the remote gateway information of the service X, and creates the external address information at the service platform A2 according to the real address information. The real address information, the external address information and the remote gateway information form service information of the service X maintained by the service platform A2. Of course, the service information maintained by the service platforms at each level may also include other types of information, for example, gateway information corresponding to the corresponding service platform, which is not particularly limited in the present application.
Step 404, the platform gateway of any service platform receives a call request for a target service.
Assuming that any service platform is the service platform 35 (i.e., the service platform A2), the service platform A2 may receive a call request for the target service X, where the call request includes an external address of the service X.
In step 406, the platform gateway corresponding to any service platform determines, according to the service information, that the target service belongs to the local service provided by any service platform or the remote service provided by other service platforms.
In this step, the gateway 36 (i.e. gateway A2 gate) corresponding to the service platform A2 determines, according to the service information, that the service X belongs to the local service provided by the service platform A2 or the remote service provided by other service platforms.
In step 408a, if the target service is a local service, the platform gateway forwards the call request to any service platform for processing. Specifically, if the service information does not include the remote gateway address of the service X, or the included gateway address is the local gateway A2 gateway corresponding to the service platform A2, it indicates that the service X belongs to the local service, and the gateway A2 gateway may forward the call request to the service platform A2 for processing.
In step 408b, if the target service is a remote service, the platform gateway requests other service platforms to call the target service. Specifically, if the service information includes the remote gateway address of the service X, which indicates that the service X belongs to the remote service, the gateway A2gate may initiate a call to the remote gateway Agate for the service X based on the real address of the service X.
Further, as shown in fig. 5, the external address of the X service in the service information of the service platform a is the same as the real address of the X service in the service platform A3. Then, after the gateway Agate of the service platform a receives the call initiated by the gateway A2gate based on the external address of X, the real address of the X service can be further determined from the service information maintained by itself, so as to call the service from the service platform A1. Because the service platform A1 is a source platform of the service X, the service platform A1 can directly process the request for calling the service X.
Through the gradual calling process, any service platform in the multi-level service platform can flexibly call services provided by other service platforms.
Fig. 6 is a flowchart illustrating a service invocation method based on a multi-level service platform according to an exemplary embodiment of the present application. The specific steps of the above method are described in detail below in conjunction with fig. 3:
in step 602, any service platform creates a correspondence between the resource identifier and the gateway address.
In this step, for convenience of description, the service platforms 31, 33, 35 in fig. 3 are replaced by service platforms A, A, A2, respectively, and the gateway information corresponding to the gateways 32, 34, 36 is: agate, A1gate, A2gate. The service platforms A1 and A2 have a gateway connection between the three upper service platforms a, A, A1 and A2. There is a connection link A2-A2 from platform A2 to A1. As shown in fig. 7, the service platform A1 provides the service Y, and the service addresses of the service Y at each level of service platform are the same. The service platform A1 can synchronize the resource identifier corresponding to the resource provided by the service platform A1 and the gateway information A1gate corresponding to the service platform A to an upstream upper-level platform A through the connection link, and the upper-level service platform A takes the resource identifier N synchronized by the A1 and the gateway A1gate of the service platform A1 as service information of the service Y; similarly, the service platform a may synchronize the resource identifier information and the gateway information Agate corresponding to the resource identifier information and the gateway information Agate to the upstream service platform A2 through the connection link, and the upstream service platform A2 uses the resource identifier and the gateway information Agate synchronized by a as the service information of the service Y. Of course, the service information maintained by the service platforms at each level may also include other types of information, for example, gateway information corresponding to the corresponding service platform, which is not particularly limited in the present application.
In step 604, either service platform receives a call request for a target service.
Assuming that any service platform is the service platform 35 (i.e. the service platform A2), the service platform A2 may receive a call request for the target service Y, where the target service Y is used to obtain the preset resource, and assuming that the resource identifier of the preset resource is N, the call request includes the resource identifier N.
In step 606, any service platform determines that the preset resource is provided by any service platform or other service platforms according to the corresponding relationship.
In this step, the service platform A2 may obtain the resource identifier N by analyzing the call request, determine whether the remote gateway exists in the resource identifier N from the identity information, and determine whether the preset resource is provided by the service platform A2 or provided by other service platforms according to whether the remote gateway exists.
Step 608a, if the call request is provided by any service platform, forwarding the call request to any service platform for processing.
If the service information corresponding to the resource identifier N does not include the information of the remote gateway or includes the gateway A2gate corresponding to the service platform A2, the preset resource is specified to be provided locally by the service platform A2. Then the service platform A2 may directly process the above-mentioned call request.
And 608b, if the call request is provided by other service platforms, sending the remote gateway addresses and the call requests of the other service platforms to platform gateways corresponding to any service platform, so that the platform gateways send the call requests to the other service platforms for processing according to the remote gateway addresses.
If the service information corresponding to the resource identifier N includes the information of the remote gateway, the preset resource is provided by the service platform a corresponding to the remote gateway Agate. Then, the service platform A2 may send the resource identifier N and the remote gateway Agate to the gateway Agate corresponding to the service platform A2, where the gateway Agate sends the call request to the service platform a for processing according to the remote gateway Agate. After receiving the request for calling the Y service, the service platform a may repeat the above steps, so as to determine that the preset resource corresponding to the resource identifier N is provided by the service platform A1, and then may forward the call request to the service platform A1 for processing.
The call request may further include specific parameters of the preset resource, and after the service platform A1 obtains the call request, the specific parameters of the preset resource may be obtained by analyzing the call request, so as to generate a query statement according to the specific parameters of the preset resource, and obtain the preset resource from the database of the service platform A1 through the query statement.
Corresponding to the above method embodiments, the present description also provides embodiments of the apparatus.
Fig. 8 is a schematic structural view of an electronic device according to an exemplary embodiment of the present application. Referring to fig. 8, at the hardware level, the electronic device includes a processor 802, an internal bus 804, a network interface 806, memory 808, and non-volatile storage 810, although other hardware required for other services is also possible. The processor 802 reads the corresponding computer program from the non-volatile storage 810 into the memory 808 and then runs 8. Of course, other implementations, such as logic devices or combinations of hardware and software, are not excluded from the present application, that is, the execution subject of the following processing flows is not limited to each logic unit, but may be hardware or logic devices.
Fig. 9 is a block diagram illustrating a service invocation apparatus based on a multi-level service platform according to an exemplary embodiment of the present application. Referring to fig. 9, the apparatus is applied to a platform gateway corresponding to any service platform in a multi-level service platform, and includes a first receiving unit 902, a first determining unit 904, and a calling unit 906, where:
A first receiving unit 902 configured to receive a call request from the any service platform, where the call request is used to call a target service;
a first determining unit 904 configured to determine, in response to the call request, from service information corresponding to the target service that the target service belongs to a local service provided by the any service platform or a remote service provided by another service platform;
a calling unit 906 configured to send the calling request to the any service platform for processing if the target service belongs to the local service; and if the target service belongs to the remote service, requesting to call the target service from the other service platforms.
Optionally, the call request includes an external address used by the target service in any service platform; the apparatus further comprises: the service information determining unit 908 is specifically configured to:
determining the external address from the call request;
and determining service information corresponding to the target service according to the external address.
Optionally, when the target service belongs to a remote service provided by another service platform, the service information of the target service at the any service platform includes a remote gateway identifier of the other service platform, a real address of the target service, and an external address of the target service at the any service platform, where the real address of the target service includes the external address of the target service at the other service platform.
Optionally, the external address of the target service is created by the any service platform according to the real address of the target service.
Optionally, the calling unit 906 is specifically configured to:
if the target service belongs to the remote service, determining a real address corresponding to an external address of the target service at any service platform and a remote gateway corresponding to the other service platforms according to the corresponding relation, and initiating calling to the remote gateway of the other service platforms based on the real address of the target service.
Optionally, the calling unit 906 is specifically configured to:
and initiating a verification request to a remote gateway of the target service, and requesting the other service platforms to call the target service through the remote gateways of the other service platforms under the condition that the remote gateway passes the verification.
Optionally, in the multi-stage service platform, the gateway of each service platform is connected with the gateway of the unique upper-stage service platform; in the gateway connecting link of any two service platforms, between every two service platforms positioned at adjacent positions, the downstream service platform of the service to be synchronized synchronizes the external address of any service provided by the downstream service platform to the upstream service platform of the service to be received through the gateway of the downstream service platform, so that the upstream service platform creates the external address of any service at the upstream service platform according to the external address of any service synchronized by the downstream service platform.
Fig. 10 is a block diagram illustrating another service invocation apparatus based on a multi-level service platform according to an exemplary embodiment of the present application. Referring to fig. 10, the apparatus is applied to any one of multi-stage service platforms, and includes a second receiving unit 1002, a second determining unit 1004, and a transmitting unit 1006, wherein:
a second receiving unit 1002, configured to receive a call request for a target service, where the target service is used to obtain a preset resource, and the call request includes a resource identifier of the preset resource;
a second determining unit 1004, configured to determine, in response to the call request, whether the preset resource is provided by the any service platform according to a correspondence between the resource identifier and a gateway address;
a sending unit 1006, configured to process the call request by the any service platform if the correspondence indicates that the preset resource is provided by the any service platform; and if the corresponding relation indicates that the preset resource is provided by the other service platforms, sending the remote gateway address of the other service platforms and the call request to a platform gateway corresponding to any service platform, so that the platform gateway sends the call request to the other service platforms for processing according to the remote gateway address.
Optionally, the service addresses of the target service in each service platform in the multi-level service platforms are the same.
Optionally, in the multi-stage service platform, the gateway of each service platform is connected with the gateway of the unique upper-stage service platform; in the gateway connecting link of any two service platforms, the downstream service platform of the resource to be synchronized synchronizes the resource identification of the resource provided by the downstream service platform to the upstream service platform of the resource to be received through the gateway of the downstream service platform, so that the upstream service platform records the corresponding relation between the resource identification of the resource provided by the downstream service platform and the gateway of the downstream service platform.
The implementation process of the functions and roles of each unit in the above device is specifically shown in the implementation process of the corresponding steps in the above method, and will not be described herein again.
For the device embodiments, reference is made to the description of the method embodiments for the relevant points, since they essentially correspond to the method embodiments. The apparatus embodiments described above are merely illustrative, wherein the elements illustrated as separate elements may or may not be physically separate, and the elements shown as elements may or may not be physical elements, may be located in one place, or may be distributed over a plurality of network elements. Some or all of the modules may be selected according to actual needs to achieve the purposes of the present application. Those of ordinary skill in the art will understand and implement the present invention without undue burden.
In an exemplary embodiment, a non-transitory computer readable storage medium is also provided, such as a memory, comprising instructions executable by a processor of a multi-level service platform based service invocation apparatus to implement a method as described in any of the above embodiments.
Wherein the non-transitory computer readable storage medium may be a ROM, random-access memory (RAM), CD-ROM, magnetic tape, floppy disk, optical data storage device, etc., which is not limited in this application.
The foregoing description of the preferred embodiments of the present invention is not intended to limit the invention to the precise form disclosed, and any modifications, equivalents, improvements and alternatives falling within the spirit and principles of the present invention are intended to be included within the scope of the present invention.

Claims (13)

1. The service calling method based on the multi-stage service platform is characterized by being applied to platform gateways corresponding to all the service platforms in the multi-stage service platform, and comprises the following steps:
receiving a call request from a first service platform, wherein the call request is used for calling a target service;
responding to the call request, and determining whether the target service belongs to a local service or a remote service actually provided by the first service platform according to service information corresponding to the target service, wherein the remote service is forwarded by the upstream of the first service platform;
If the target service belongs to the local service, determining a real address in the service information, and sending the calling request to the first service platform indicated by the real address for processing;
if the target service belongs to the remote service, the first service platform and the second service platform are positioned adjacently and the first service platform is positioned at the downstream, determining a real address in the service information, and sending the calling request to an upstream service platform indicated by the real address for processing; wherein, when the target service belongs to the remote service, the real address of the target service maintained in the gateway corresponding to the first service platform is the external address of the second service platform;
after the call request is sent to the second service platform, if the target service belongs to the remote service of the second service platform in the second service platform, determining a real address of the target service at the second service platform according to service information maintained in a gateway corresponding to the second service platform, and sending the call request to a service platform indicated by the real address for processing; the real address of the target service maintained in the gateway corresponding to the second service platform is an external address of an upstream service platform of the second service platform under the condition that the target service belongs to the remote service at the second service platform;
Wherein, in the multi-stage service platform, the gateway of each service platform is connected with the gateway of the unique upper-stage service platform; in the gateway connecting link of any two service platforms, between every two service platforms positioned at adjacent positions, an upstream service platform of the service to be synchronized synchronizes the external address of the service provided by the upstream service platform to the corresponding external address of the service of the gateway in the upstream service platform to a downstream service platform of the service to be received through the gateway of the upstream service platform, so that the downstream service platform creates the external address of any service at the downstream service platform according to the external address of any service synchronized by the upstream service platform.
2. The method of claim 1, wherein the call request includes an external address used by the target service in a service platform currently processing the call request; the method further comprises the steps of:
determining an external address used in a service platform which currently processes the call request from the call request;
and determining service information corresponding to the target service according to the external address used in the service platform for processing the call request currently.
3. The method of claim 1, wherein when the target service belongs to the remote service, the service information of the target service includes a correspondence between a remote gateway identifier of the upstream service platform, a real address of the target service, and an external address used by the target service in a service platform currently processing the call request, wherein the real address of the target service includes the external address of the target service at the upstream service platform.
4. A method according to claim 3, wherein the external address of the target service is created by any service platform from the real address of the target service.
5. A method according to claim 3, wherein if the target service belongs to the remote service, determining a real address in the service information, and sending the call request to an upstream service platform indicated by the real address for processing, comprises:
if the target service belongs to the remote service, determining a real address corresponding to an external address of the target service at any service platform and a remote gateway corresponding to the upstream service platform according to the corresponding relation, and initiating calling to the remote gateway of the upstream service platform based on the real address of the target service.
6. The method of claim 5, wherein the initiating a call to a remote gateway of the upstream service platform based on the real address comprises:
and initiating a verification request to a remote gateway of the target service, and requesting the upstream service platform to call the target service through the remote gateway of the upstream service platform under the condition that the remote gateway passes the verification.
7. A service calling method based on multi-stage service platforms, which is applied to each service platform in the multi-stage service platform, wherein a gateway corresponding to each service platform is used for executing the method as claimed in claim 1, and the method comprises:
receiving a call request aiming at a target service, wherein the target service is used for acquiring preset resources, and the call request comprises a resource identifier of the preset resources;
responding to the call request, and determining whether the preset resource is provided by a first service platform according to the corresponding relation between the resource identifier and the gateway address;
if the corresponding relation indicates that the preset resource is actually provided by the first service platform, the first service platform processes the call request; and if the corresponding relation indicates that the preset resource is forwarded by an upstream gateway of the first service platform, sending the gateway address of the second service platform and the call request to a platform gateway corresponding to the first service platform according to the corresponding relation, and sending the call request to the second service platform for processing according to the gateway address through the platform gateway.
8. The method of claim 7, wherein the service addresses of the target service in each of the multiple levels of service platforms are the same.
9. The method of claim 7, wherein in the multi-level service platform, the gateway of each service platform is connected to the gateway of its unique upper level service platform; in the gateway connecting link of any two service platforms, between every two service platforms positioned at adjacent positions, an upstream service platform of a resource to be synchronized synchronizes the resource identification of the resource provided by the upstream service platform to a downstream service platform of the resource to be received through a gateway of the upstream service platform, so that the downstream service platform records the corresponding relation between the resource identification of the resource provided by the upstream service platform and the gateway of the upstream service platform.
10. A service invocation apparatus based on a multi-stage service platform, which is applied to a platform gateway corresponding to each service platform in the multi-stage service platform, the apparatus comprising:
a first receiving unit configured to receive a call request from a first service platform, the call request being for calling a target service;
the first determining unit is configured to respond to the call request and determine whether the target service belongs to a local service or a remote service actually provided by the first service platform according to service information corresponding to the target service, wherein the remote service is forwarded by the upstream of the first service platform;
The calling unit is configured to determine a real address in the service information if the target service belongs to the local service, and send the calling request to the first service platform indicated by the real address for processing; if the target service belongs to the remote service, the first service platform and the second service platform are positioned adjacently and the first service platform is positioned at the downstream, determining a real address in the service information, and sending the calling request to an upstream service platform indicated by the real address for processing; wherein, when the target service belongs to the remote service, the real address of the target service maintained in the gateway corresponding to the first service platform is the external address of the second service platform;
after the call request is sent to the second service platform, if the target service belongs to the remote service of the second service platform in the second service platform, determining a real address of the target service at the second service platform according to service information maintained in a gateway corresponding to the second service platform, and sending the call request to a service platform indicated by the real address for processing; the real address of the target service maintained in the gateway corresponding to the second service platform is an external address of an upstream service platform of the second service platform under the condition that the target service belongs to the remote service at the second service platform;
Wherein, in the multi-stage service platform, the gateway of each service platform is connected with the gateway of the unique upper-stage service platform; in the gateway connecting link of any two service platforms, between every two service platforms positioned at adjacent positions, an upstream service platform of the service to be synchronized synchronizes the external address of the service provided by the upstream service platform to the corresponding external address of the service of the gateway in the upstream service platform to a downstream service platform of the service to be received through the gateway of the upstream service platform, so that the downstream service platform creates the external address of any service at the downstream service platform according to the external address of any service synchronized by the upstream service platform.
11. A service invocation apparatus based on multiple service platforms, applied to each service platform in the multiple service platforms, the gateway corresponding to each service platform being configured as the apparatus as claimed in claim 10, the apparatus comprising:
the second receiving unit is configured to receive a call request for a target service, wherein the target service is used for acquiring preset resources, and the call request comprises a resource identifier of the preset resources;
The second determining unit is configured to respond to the call request and determine whether the preset resource is provided by the first service platform according to the corresponding relation between the resource identifier and the gateway address;
the sending unit is configured to process the call request by the first service platform if the corresponding relation indicates that the preset resource is actually provided by the first service platform; and if the corresponding relation indicates that the preset resource is forwarded by an upstream gateway of the first service platform, sending the gateway address of the second service platform and the call request to a platform gateway corresponding to the first service platform according to the corresponding relation, so that the platform gateway sends the call request to the second service platform for processing according to the gateway address.
12. An electronic device, comprising:
a processor;
a memory for storing processor-executable instructions;
wherein the processor is configured to implement the method of any of claims 1-9 by executing the executable instructions.
13. A computer readable storage medium having stored thereon computer instructions which, when executed by a processor, implement the steps of the method according to any of claims 1-9.
CN202111622175.2A 2021-12-28 2021-12-28 Service calling method and device based on multi-stage service platform Active CN114285852B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111622175.2A CN114285852B (en) 2021-12-28 2021-12-28 Service calling method and device based on multi-stage service platform

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111622175.2A CN114285852B (en) 2021-12-28 2021-12-28 Service calling method and device based on multi-stage service platform

Publications (2)

Publication Number Publication Date
CN114285852A CN114285852A (en) 2022-04-05
CN114285852B true CN114285852B (en) 2023-12-26

Family

ID=80876816

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111622175.2A Active CN114285852B (en) 2021-12-28 2021-12-28 Service calling method and device based on multi-stage service platform

Country Status (1)

Country Link
CN (1) CN114285852B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2023231413A1 (en) * 2022-05-31 2023-12-07 杭州数梦工场科技有限公司 Service processing method, apparatus, cascade system, electronic device and storage medium
CN115002228B (en) * 2022-05-31 2023-12-26 杭州数梦工场科技有限公司 Service cascade calling method and device, electronic equipment and storage medium

Citations (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2005110057A (en) * 2003-09-30 2005-04-21 Nippon Telegr & Teleph Corp <Ntt> Routing method and network system using the same
WO2009039719A1 (en) * 2007-09-24 2009-04-02 China Mobile Communications Corporation A user identifier server, a system and method for processing the data service
KR20140143521A (en) * 2013-06-07 2014-12-17 삼성전자주식회사 Method and apparatus for transmitting and receiving a service in a wireless communication system
WO2019052526A1 (en) * 2017-09-14 2019-03-21 北京金山云网络技术有限公司 Api invoking system, method and apparatus, electronic device and storage medium
CN110266764A (en) * 2019-05-21 2019-09-20 深圳壹账通智能科技有限公司 Internal services call method, device and terminal device based on gateway
CN110336753A (en) * 2019-06-19 2019-10-15 腾讯科技(深圳)有限公司 A kind of service calling method, device, equipment and the storage medium in across a network region
CN110365751A (en) * 2019-06-26 2019-10-22 口碑(上海)信息技术有限公司 Method for processing business, device and the equipment of gateway system
CN110839087A (en) * 2020-01-13 2020-02-25 北京懿医云科技有限公司 Interface calling method and device, electronic equipment and computer readable storage medium
CN111147588A (en) * 2019-12-27 2020-05-12 上海浦东发展银行股份有限公司 Method and system for realizing cross-domain and cross-center communication in enterprise-level micro service platform
CN111756798A (en) * 2020-05-13 2020-10-09 杭州数梦工场科技有限公司 Service scheduling method, device, equipment and storage medium based on gateway cascade
CN111770179A (en) * 2020-06-29 2020-10-13 重庆紫光华山智安科技有限公司 High-performance high-availability cloud networking gateway implementation method, medium and terminal
WO2020233354A1 (en) * 2019-05-21 2020-11-26 深圳壹账通智能科技有限公司 Gateway-based external service calling method and device, and terminal device
CN112152996A (en) * 2020-08-19 2020-12-29 杭州数梦工场科技有限公司 Data transmission method, device, equipment and storage medium based on gateway cascade
CN112738175A (en) * 2020-12-23 2021-04-30 深圳壹账通智能科技有限公司 Request processing method and related equipment
CN113014640A (en) * 2021-02-23 2021-06-22 北京明朝万达科技股份有限公司 Request processing method and device, electronic equipment and storage medium
CN113301166A (en) * 2021-06-16 2021-08-24 杭州华橙软件技术有限公司 Service calling method and device, storage medium and electronic device

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100867992B1 (en) * 2006-12-08 2008-11-10 한국전자통신연구원 System for providing address service using Geocoding API in open service platform and method using the same
US7889649B2 (en) * 2006-12-28 2011-02-15 Ebay Inc. Method and system for gateway communication
US8239520B2 (en) * 2007-04-05 2012-08-07 Alcatel Lucent Network service operational status monitoring
BR102014003580B1 (en) * 2014-02-14 2023-03-21 Samsung Eletrônica da Amazônia Ltda. METHOD TO ENABLE HIERARCHICAL GATEWAY ARCHITECTURE FOR DEVICE MANAGEMENT

Patent Citations (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2005110057A (en) * 2003-09-30 2005-04-21 Nippon Telegr & Teleph Corp <Ntt> Routing method and network system using the same
WO2009039719A1 (en) * 2007-09-24 2009-04-02 China Mobile Communications Corporation A user identifier server, a system and method for processing the data service
KR20140143521A (en) * 2013-06-07 2014-12-17 삼성전자주식회사 Method and apparatus for transmitting and receiving a service in a wireless communication system
WO2019052526A1 (en) * 2017-09-14 2019-03-21 北京金山云网络技术有限公司 Api invoking system, method and apparatus, electronic device and storage medium
CN110266764A (en) * 2019-05-21 2019-09-20 深圳壹账通智能科技有限公司 Internal services call method, device and terminal device based on gateway
WO2020233354A1 (en) * 2019-05-21 2020-11-26 深圳壹账通智能科技有限公司 Gateway-based external service calling method and device, and terminal device
CN110336753A (en) * 2019-06-19 2019-10-15 腾讯科技(深圳)有限公司 A kind of service calling method, device, equipment and the storage medium in across a network region
CN110365751A (en) * 2019-06-26 2019-10-22 口碑(上海)信息技术有限公司 Method for processing business, device and the equipment of gateway system
CN111147588A (en) * 2019-12-27 2020-05-12 上海浦东发展银行股份有限公司 Method and system for realizing cross-domain and cross-center communication in enterprise-level micro service platform
CN110839087A (en) * 2020-01-13 2020-02-25 北京懿医云科技有限公司 Interface calling method and device, electronic equipment and computer readable storage medium
CN111756798A (en) * 2020-05-13 2020-10-09 杭州数梦工场科技有限公司 Service scheduling method, device, equipment and storage medium based on gateway cascade
CN111770179A (en) * 2020-06-29 2020-10-13 重庆紫光华山智安科技有限公司 High-performance high-availability cloud networking gateway implementation method, medium and terminal
CN112152996A (en) * 2020-08-19 2020-12-29 杭州数梦工场科技有限公司 Data transmission method, device, equipment and storage medium based on gateway cascade
CN112738175A (en) * 2020-12-23 2021-04-30 深圳壹账通智能科技有限公司 Request processing method and related equipment
CN113014640A (en) * 2021-02-23 2021-06-22 北京明朝万达科技股份有限公司 Request processing method and device, electronic equipment and storage medium
CN113301166A (en) * 2021-06-16 2021-08-24 杭州华橙软件技术有限公司 Service calling method and device, storage medium and electronic device

Also Published As

Publication number Publication date
CN114285852A (en) 2022-04-05

Similar Documents

Publication Publication Date Title
CN114285852B (en) Service calling method and device based on multi-stage service platform
CN107948135B (en) Data processing method and device supporting multiple API protocols
CN115442423A (en) Method for discovering services provided by a network repository function
CN109635019B (en) Request processing method, device, equipment and storage medium
CN113055421B (en) Service grid management method and system
CN108512903B (en) Abnormal information processing method and device, storage medium and API gateway
CN114025021A (en) Communication method, system, medium and electronic device across Kubernetes cluster
CN114036236A (en) Multi-gateway cluster system
US20160037430A1 (en) Wireless network brokerage
US20060069783A1 (en) Program, method and device for managing information shared among components, recording medium and communication apparatus
CN117155934B (en) Cross-cluster communication method and device, equipment and storage medium
CN105045110B (en) Method and device for forwarding household appliance service call request
CN110636127B (en) Communication processing method and system between information data
WO2017000583A1 (en) Terminal access method and corresponding terminal, base station and main core network
CN107682271B (en) Method and device for generating routing line
CN107766212B (en) Method and device for determining installation state of application program
US11593090B2 (en) Systems and methods of auditing server parameters in a telephony network
US11323368B1 (en) System and method for web service atomic transaction (WS-AT) affinity routing
CN109525539B (en) Capability calling method, call receipt method, information processing method and system
CN108052380B (en) Business function docking method and device, computer equipment and storage medium
CN107820222B (en) Method and device for managing multiple tenants
CN112134902A (en) RADB registration method and system based on API
CN113596890B (en) Communication method, system, device and storage medium
US20220256016A1 (en) Monitoring of communication
CN113965489B (en) Link timeout detection method, device, computer equipment and storage medium

Legal Events

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