Disclosure of Invention
The invention provides a third-party service access method and a third-party service access system based on OSB API specification, and aims to solve the problems that in the prior art, due to a third-party service access mode, the interface access flexibility is reduced and the expandability of a plug-in layer is reduced because the plug-in layer codes of a cloud platform need to be correspondingly modified every time a third-party service is newly added.
According to a first aspect of the present invention, the present invention provides a third party service access method based on OSB API specification, including:
adding an OSB plug-in the SaaS platform;
and accessing the third-party service by using the OSB plug-in according to the OSB API specification.
Preferably, the step of accessing the third party service by using the OSB plug-in according to the OSB API specification includes:
establishing a service agent in the SaaS platform, and establishing the connection between the service agent and the OSB plug-in;
according to the service type of the third-party service, accessing the third-party service by using a corresponding service agent in the SaaS platform;
and accessing the third-party service to the OSB plug-in through the connection of the service agent and the OSB plug-in.
Preferably, the step of accessing the third party service by using the OSB plug-in according to the OSB API specification includes:
using an OSB plug-in to obtain a service address of a service agent;
controlling the OSB plug-in to splice the service address according to the OSB API specification to obtain a URL;
and controlling the OSB plug-in to access the third-party service of the service agent to the SaaS platform through the URL.
Preferably, the step of controlling the OSB plug-in to splice the service address according to the OSB API specification to obtain the URL includes:
controlling an OSB plug-in to obtain a creation interface address defined by an OSB API specification;
and controlling the OSB plug-in to splice the creation interface address and the service address defined by the OSB API specification to obtain the URL.
Preferably, the third-party service access method further includes:
according to the front-end requirement of the SaaS platform, a service access unified interface is additionally arranged on a software development tool layer of the SaaS platform, wherein the service access unified interface comprises a service instance;
using the OSB plug-in to inherit the service to access the uniform interface;
and when the OSB plug-in is accessed to the third-party service, the service instance of the service access unified interface is used for processing the third-party service.
Preferably, the step of processing the third-party service by using the service instance of the service access unified interface includes:
establishing an instance corresponding relation between a service access unified interface and a created interface defined by OSB API specification;
and controlling the OSB plug-in to operate the third-party service according to the corresponding relation of the instances.
According to a second aspect of the present invention, the present invention further provides a third party service access system based on OSB API specification, including:
the plug-in creating module is used for additionally arranging an OSB plug-in the SaaS platform;
and the service access module is used for accessing the third-party service by using the OSB plug-in according to the OSB API specification.
Preferably, the service access module comprises:
the connection establishing sub-module is used for establishing a service agent in the SaaS platform and establishing the connection between the service agent and the OSB plug-in;
the service access sub-module is used for accessing the third-party service by using a corresponding service agent in the SaaS platform according to the service type of the third-party service;
and the plug-in access sub-module is used for accessing the third-party service to the OSB plug-in through the connection of the service agent and the OSB plug-in.
Preferably, the service access module comprises:
the address acquisition submodule is used for acquiring the service address of the service agent by using the OSB plug-in;
the address splicing submodule is used for controlling the OSB plug-in to splice the service address according to the OSB API specification to obtain a URL;
and the platform access submodule is used for controlling the OSB plug-in to access the third-party service of the service agent to the SaaS platform through the URL.
Preferably, the third party service access system further includes:
the software development system comprises an interface creation module, a service access unified interface and a service access module, wherein the interface creation module is used for additionally arranging the service access unified interface on a software development tool layer of the SaaS platform according to the front-end requirement of the SaaS platform, and the service access unified interface comprises a service instance;
the interface inheritance module is used for inheriting the service access unified interface by using the OSB plug-in;
and the service processing module is used for controlling the OSB plug-in to use the service instance of the service access unified interface to process the third-party service when the OSB plug-in is accessed to the third-party service.
According to the third-party service access scheme based on the OSB API specification, the OSB plug-in is additionally arranged on the SaaS platform, and then the OSB plug-in is used for accessing the third-party service according to the OSB API specification. The OSB API is called an Open Service Broker API, that is, an Open Service agent API, through which independent software vendors, SaaS providers and developers can integrate and run their services on SaaS platforms, such as cloud computing platforms and kubernets platforms, very conveniently. Such API specifications have been adopted by an increasing number of platforms or service providers. Service items such as generating services, accessing services and managing services can be realized through a group of API endpoints. The SaaS platform realizes the OSB plug-in of service agent access, a third-party service provider realizes the service agent of the third-party service provider according to the OSB API specification, and the SaaS platform can conveniently access the third-party service such as kubernets cluster service, big data cluster service and the like by accessing the service agent of a corresponding manufacturer through the plug-in.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
The main technical problems of the embodiment of the invention are as follows:
in the aspect of service implementation, the SaaS platform encapsulates various operations of service instances through the SDK layer, develops corresponding plug-ins for different types of services, and the plug-ins perform the operations of the service instances by inheriting the interfaces of the SDK layer. And the adaptation layer of the SaaS platform calls the realization of the corresponding plug-in layer according to different service types. For a third-party service, a third-party service plug-in needs to be set, and in the third-party service plug-in, the third-party service is accessed according to the logic of each service provider. The access of the third-party service can be realized by expanding the third-party plug-in, and the mode has high expansibility. However, in this way, when a third-party service is newly added, the code of the SaaS platform plug-in layer needs to be modified correspondingly, and a third-party plug-in is accessed to adapt to interfaces of different service providers again. This not only results in reduced interface access flexibility, but also reduces the scalability of the plug-in layer.
In order to solve the above problem, referring to fig. 1 specifically, in a technical solution provided by the following embodiments of the present application, the present application provides an OSB API service architecture. In the service architecture, an OSB plug-in 105 is added to a plug-inlayer 109 in aservice factory 100 of the SaaS platform, the OSB plug-in 105 can implement an OSB API specification, and different service agents, such as thebig data agent 106 and thek8s agent 107 in fig. 1, can be accessed through the OSB plug-in 105, so that a variety of third party services can be accessed without the corresponding service plug-in. In addition, theservice factory 100 further includes anAPI server 101, adirectory service 102, aservice adapter 103 provided in a service unifiedaccess layer 108, and an SDK definition service unified interface.
Referring to fig. 2 in particular, fig. 2 is a schematic flowchart of a third-party service access method based on OSB API specification according to an embodiment of the present invention. As shown in fig. 2, the third party service access method based on the OSB API specification includes:
s110: and adding an OSB plug-in the SaaS platform. The OSB plug-in can realize OSB API specification and inherit a related interface in the SaaS platform, so that the access of third-party service is realized.
S120: and accessing the third-party service by using the OSB plug-in according to the OSB API specification. The format of the OSB API specification is shown in the following table, and includes interface addresses of various interfaces, and the functions of the OSB API specification include creating a service instance, deleting the service instance, querying details of the service instance, expanding the service instance, and mailing to obtain service information (name, description, and specification).
OSB API specification table
According to the third-party service access method based on the OSB API specification, the OSB plug-in is additionally arranged on the SaaS platform, and then the OSB plug-in is used for accessing the third-party service according to the OSB API specification. The OSB API is called an Open Service Broker API, that is, an Open Service agent API, through which independent software vendors, SaaS providers and developers can integrate and run their services on SaaS platforms, such as cloud computing platforms and kubernets platforms, very conveniently. Such API specifications have been adopted by an increasing number of platforms or service providers. Service items such as generating services, accessing services and managing services can be realized through a group of API endpoints. The SaaS platform realizes the OSB plug-in of service agent access, a third-party service provider realizes the service agent of the third-party service provider according to the OSB API specification, and the SaaS platform can conveniently access the third-party service such as kubernets cluster service, big data cluster service and the like by accessing the service agent of a corresponding manufacturer through the plug-in.
As a preferred embodiment, as shown in fig. 3, the step S120: the step of using the OSB plug-in to access the third party service according to the OSB API specification comprises the following steps:
s121: and establishing a service agent in the SaaS platform, and establishing the connection between the service agent and the OSB plug-in. According to the method and the device, the service agents such as the big data agent and the k8s agent are created in the SaaS platform, and the service agents can establish connection with the OSB plug-in, so that the SaaS platform can access different third-party services, and the different third-party services can be accessed and managed uniformly through the OSB plug-in.
S122: and according to the service type of the third-party service, accessing the third-party service by using a corresponding service agent in the SaaS platform. The service types of the third-party services comprise big data services, artificial intelligence services, k8s services and the like, corresponding service agents are provided in the SaaS platform, and different services are respectively accessed, so that different service agents can transmit different services to the OSB plug-in.
S123: and accessing the third-party service to the OSB plug-in through the connection of the service agent and the OSB plug-in.
In the embodiment of the application, all service agents are connected with the OSB plug-in, so that different third-party services can be accessed into the SaaS platform only by using one type of plug-in of the OSB plug-in the SaaS platform.
As a preferred embodiment, as shown in fig. 4, the step S120: the step of using the OSB plug-in to access the third party service according to the OSB API specification comprises the following steps:
s124: the service address of the service agent is obtained using the OSB plug-in. The service address of the service agent is obtained by using the OSB plug-in, then the connection between the OSB plug-in and the service agent can be established by using the service address, and when the service agent obtains the related third-party service, the third-party service can be accessed into the OSB plug-in through the service address.
S125: and controlling the OSB plug-in to splice the service address according to the OSB API specification to obtain the URL. The URL connects the service agent with the creation interface address defined by the OSB API specification so that the OSB plug-in can connect different service agents through the URL to access different third party services.
The step of obtaining the URL by splicing the service address by the control OSB plug-in according to the OSB API specification comprises the following steps: controlling an OSB plug-in to obtain a creation interface address defined by an OSB API specification; and controlling the OSB plug-in to splice the creation interface address and the service address defined by the OSB API specification to obtain the URL. Specifically, for example, the address of the ServiceBroker dedicated to the big data service is http:// bigdata-ServiceBroker: 32100; the creation interface defined by the OSB API is/v 2/service _ instances/{ instance Id }; then the complete URL address is: http:// bigdata-servicebrowser: 32100/v2/service _ instances/{ instanceId }.
S126: and controlling the OSB plug-in to access the third-party service of the service agent to the SaaS platform through the URL. Because the OSB plug-in obtains the uniform resource locator URL through the service address, the OSB can access the third-party service of the service agent into the SaaS platform through the URL in an HTTP manner.
As a preferred embodiment, as shown in fig. 5, the third party service access method provided in the embodiment of the present application further includes, in addition to the above steps:
s210: according to the front-end requirement of the SaaS platform, a service access unified interface is additionally arranged on a software development tool layer of the SaaS platform, wherein the service access unified interface comprises a service instance. According to the front-end requirement of the SaaS platform, a service access unified interface is additionally arranged on an SDK layer of the SaaS platform, an OSB plug-in can be controlled to realize the function of the interface according to the user requirement, and external third-party services are further accessed and processed through the interface.
S220: the OSB plug-in is used to inherit the service access unified interface.
S230: and when the OSB plug-in is accessed to the third-party service, the service instance of the service access unified interface is used for processing the third-party service.
According to the technical scheme provided by the embodiment of the application, the OSB plug-in is used for inheriting the service access unified interface, so that the third-party service can be processed according to the service examples contained in various interface methods defined by a user by using the service access unified interface.
As a preferred embodiment, as shown in fig. 6, the step of processing the third-party service by using the service instance of the service access unified interface includes:
s231: and establishing an instance corresponding relation between the service access unified interface and a creating interface defined by the OSB API specification.
S232: and controlling the OSB plug-in to operate the third-party service according to the corresponding relation of the instances. The operation method comprises the steps of carrying out data interaction, information display and the like with a third-party service.
Specifically, as shown in the OSB API specification table, the service instance of the creation interface defined by the OSB API specification corresponds to the instance of the service access unified interface, so that the specific third-party service can be operated according to the correspondence relationship between the service access unified interface and the instance of the creation interface defined by the OSB API specification, and processing of different types of third-party services can be realized by the above manner.
In addition, based on the same concept of the embodiment of the method, the embodiment of the present invention further provides a third party service access system based on the OSB API specification, for implementing the method of the present invention, because the principle of solving the problem of the embodiment of the system is similar to that of the method, the embodiment of the present invention at least has all the beneficial effects brought by the technical solution of the embodiment, and details are not repeated herein.
Referring to fig. 7, fig. 7 is a schematic structural diagram of a third-party service access system based on OSB API specification according to an embodiment of the present invention, and as shown in fig. 7, the third-party service access system includes:
the plug-in creatingmodule 110 is used for adding an OSB plug-in the SaaS platform;
and theservice access module 120 is configured to access a third-party service according to the OSB API specification by using an OSB plug-in.
In the third-party service access system based on the OSB API specification, the OSB plug-in is added to the SaaS platform through the plug-increation module 110, and then theservice access module 120 accesses the third-party service using the OSB plug-in according to the OSB API specification. The OSB API is called an Open Service Broker API, that is, an Open Service agent API, through which independent software vendors, SaaS providers and developers can integrate and run their services on SaaS platforms, such as cloud computing platforms and kubernets platforms, very conveniently. Such API specifications have been adopted by an increasing number of platforms or service providers. Service items such as generating services, accessing services and managing services can be realized through a group of API endpoints. The SaaS platform realizes the OSB plug-in of service agent access, a third-party service provider realizes the service agent of the third-party service provider according to the OSB API specification, and the SaaS platform can conveniently access the third-party service such as kubernets cluster service, big data cluster service and the like by accessing the service agent of a corresponding manufacturer through the plug-in.
As a preferred embodiment, as shown in fig. 8, theservice access module 120 includes:
the connection establishing sub-module 121 is configured to establish a service agent in the SaaS platform, and establish a connection between the service agent and the OSB plug-in;
the service access sub-module 122 is configured to access a third-party service by using a corresponding service agent in the SaaS platform according to a service type of the third-party service;
and the plug-in access sub-module 123 is configured to access the third-party service to the OSB plug-in through the connection between the service agent and the OSB plug-in.
As a preferred embodiment, as shown in fig. 9, theservice access module 120 includes:
anaddress obtaining submodule 124 for obtaining a service address of the service agent by using the OSB plug-in;
theaddress splicing submodule 125 is used for controlling the OSB plug-in to splice the service addresses according to the OSB API specification to obtain the URL;
and the platform access sub-module 126 is used for controlling the OSB plug-in to access the third-party service of the service agent to the SaaS platform through the URL.
As a preferred embodiment, as shown in fig. 10, the third-party service access system further includes:
theinterface creating module 210 is configured to add a service access unified interface on a software development tool layer of the SaaS platform according to a front-end requirement of the SaaS platform, where the service access unified interface includes a service instance;
aninterface inheritance module 220 for inheriting the service access unified interface using the OSB plug-in;
and theservice processing module 230 is configured to control the OSB plug-in to process the third-party service by using the service instance of the service access unified interface when accessing the third-party service.
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.
It should be noted that in the claims, any reference signs placed between parentheses shall not be construed as limiting the claim. The word "comprising" does not exclude the presence of elements or steps not listed in a claim. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. The invention may be implemented by means of hardware comprising several distinct elements, and by means of a suitably programmed computer. In the unit claims enumerating several means, several of these means may be embodied by one and the same item of hardware. The usage of the words first, second and third, etcetera do not indicate any ordering. These words may be interpreted as names.
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.