API open integration method and device, equipment, storage medium and program product
By building a hierarchical API gateway open architecture and asynchronous non-blocking NIO communication framework, the performance degradation of API gateways in high concurrency scenarios is solved, scalability and security are improved, and flexible API protocol access and orchestration are achieved.
Patent Information
- Application Number
- CN202411053677.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-01
- Publication Date
- 2024-11-19
- Estimated Expiration
- 2044-08-01
AI Technical Summary
The existing API gateways have degraded performance in high concurrency scenarios, poor system scalability, and cannot effectively deal with performance problems caused by the scale expansion of Groovy filters, and have problems such as memory expansion and performance decline.
Build a layered API gateway open architecture, including API tool layer, API protocol access layer and API governance layer, deploy microservice components separately, and implement distributed microservice frameworks through asynchronous non-blocking NIO communication framework to decouple API protocol access Layer and API orchestration layer, support independent deployment and flexible orchestration.
It improves the scalability and security of the API gateway, realizes the mutual isolation of API protocol access and orchestration logic, makes networking more flexible, supports multi-protocol access and conversion, and avoids performance degradation and memory expansion problems.
Smart Images

Figure CN118984331A_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of big data technology, and in particular, relates to an API open integration method, device, equipment, storage medium and program product. Background Art
[0002] At present, with the rapid development of information technology and communication technology such as the Internet, Internet of Things, and cloud computing, most companies have embarked on the road of digital transformation. API (Application Programming Interface) has become the core carrier for enterprises to connect to their businesses and has generated huge profit margins. The rapid growth of API scale and call volume has made enterprise IT face more challenges in terms of architecture and model. With the overall trend of API development, the development of API tends to be more concise, integrated, and standardized, prompting more system boundary components to emerge. In the context of the trillion-level API economy, API gateways came into being.
[0003] The API gateway built on Zuul's API open architecture technology is responsible for managing all tasks, including accepting and processing tens of thousands of concurrent API calls, including traffic management, authorization and access control, monitoring, and API version management. As the scale of Groovy filters expands and increases, the performance of the existing API gateway open technology gradually decreases, and the scalability of the system also deteriorates. The classic mode of using a typical thread pool + synchronous blocking thread cannot effectively cope with high-concurrency scenarios.
[0004] Based on this, the industry is still in urgent need of a new API open integration solution to effectively achieve the goal of fully ensuring the scalability and security of the API gateway. Summary of the invention
[0005] The embodiments of the present application provide an API open integration method, apparatus, device, storage medium and program product, which can effectively achieve the purpose of fully ensuring the scalability and security of the API gateway.
[0006] In a first aspect, an embodiment of the present application provides an API open integration method, the API open integration method comprising:
[0007] Build a layered API gateway open architecture, which includes the API tool layer, API protocol access layer, and API governance layer;
[0008] Deploy microservice components with corresponding functions at the API tool layer, API protocol access layer, and API governance layer respectively;
[0009] Identify the microservice components deployed in the API gateway open architecture and establish logical relationships;
[0010] Establish a list of internal and external interfaces of the API gateway, which defines multiple component external interfaces and component internal interfaces;
[0011] Based on the API gateway open architecture and the definition of multiple component external interfaces and component internal interfaces, the API gateway core data model of the API gateway open architecture is defined to form an API gateway integrated development platform. The API gateway integrated open platform supports API open integration.
[0012] In some possible implementations, the API tool layer is used to provide API design, metadata definition, API development, API orchestration, and API testing functions;
[0013] The API protocol access layer is used to implement API unified multi-protocol access, API authentication, and API certification;
[0014] The API governance layer is used to implement online governance, lifecycle management, and operation and maintenance of APIs.
[0015] In some possible implementations, the API tool layer is deployed with: APIDesign microservice components responsible for API design, metadata definition, and API compliance checking; APIBuild microservice components responsible for API online development, testing, and release; APIOrchestration microservice components responsible for API business logic orchestration and supporting multiple orchestration forms;
[0016] The API protocol access layer is deployed with: API Access microservice components for unified multi-protocol API access, API authentication, and certification;
[0017] The API governance layer is deployed with APIGovernance microservice components for online governance, lifecycle management, and operation and maintenance of APIs.
[0018] In some possible implementations, the microservice component in the API gateway open architecture and the APIPortal in the API gateway open architecture use a Restful API communication mode;
[0019] APIPortal is used to provide an API interaction interface and supports publishing, subscribing, and launching APIs.
[0020] In some possible implementations, the microservice components deployed in the API gateway open architecture are identified and logical relationships are established, including:
[0021] The API gateway open architecture adopts a microservice architecture. The front-end access of the API gateway open architecture is load balanced through Nginx. The API Access microservice component is responsible for protocol access and conversion, and then polls the APIOrchestration microservice component by session.
[0022] The API Governance microservice component is used to complete the deployment and upgrade of the API. It notifies the API Access microservice component through NATS messages, and the API Access microservice component pulls the API that needs to be deployed and upgraded from the API Governance microservice component.
[0023] In some possible implementations, when the API Governance microservice component is started, the API Governance microservice component starts to connect to the database DB and Nats, and provides a Restful interface for the API Access microservice component and APIPortal to use;
[0024] When the API Access microservice component is started, the API Access microservice component actively pulls the API information from API Governance or subscribes to Nats messages to load the API information into memory.
[0025] Some possible implementations include building a layered API gateway open architecture, including:
[0026] The distributed microservice framework based on the asynchronous non-blocking NIO communication framework builds an open architecture for the API gateway.
[0027] In some possible implementations, based on the API gateway open architecture and the definition of multiple component external interfaces and component internal interfaces, the API gateway core data model of the API gateway open architecture is defined, including:
[0028] Based on the open architecture of the API gateway and the definitions of multiple component external interfaces and component internal interfaces, build API-related conceptual models, logical data objects, and physical storage models, and define data models for API-related businesses;
[0029] The data model includes at least one of a user data model, an API asset data model, and an API subscription usage information data model.
[0030] In some possible implementations, the API gateway integrated development platform is used to communicate with the business system and the third-party system respectively; after obtaining the API gateway integrated development platform, the API open integration method further includes:
[0031] The API Gateway integrated development platform responds to inbound API requests from third-party systems and provides the internal services of the business system to third-party systems for invocation;
[0032] And / or, the API gateway integrated open platform responds to the business system's request for the outbound API and provides the interface of the third-party system to the business system for calling.
[0033] Based on the same inventive concept, in a second aspect, an embodiment of the present application provides an API open integration device, the API open integration device comprising:
[0034] A first building module is used to build a layered API gateway open architecture, wherein the API gateway open architecture includes an API tool layer, an API protocol access layer, and an API governance layer;
[0035] A first deployment module is used to deploy microservice components of corresponding functions in the API tool layer, the API protocol access layer, and the API governance layer respectively;
[0036] A first establishment module is used to identify microservice components deployed in the API gateway open architecture and establish logical relationships;
[0037] The second establishment module is used to establish an API gateway internal and external interface list, wherein the API gateway internal and external interface list defines multiple component external interfaces and component internal interfaces;
[0038] The first definition module is used to define the API gateway core data model of the API gateway open architecture based on the definitions of the API gateway open architecture and the multiple component external interfaces and component internal interfaces, to form an API gateway integrated development platform, and the API gateway integrated open platform supports API open integration.
[0039] In a third aspect, an embodiment of the present application provides an API open integration device, the API open integration device comprising:
[0040] a processor and a memory storing computer program instructions;
[0041] When the processor executes the computer program instructions, it implements the API open integration method provided in any one of the above-mentioned embodiments of the present application.
[0042] In a fourth aspect, an embodiment of the present application provides a computer storage medium, on which computer readable storage medium is stored computer program instructions, and when the computer program instructions are executed by a processor, an API open integration method as provided in any one of the above-mentioned embodiments of the present application is implemented.
[0043] In a fifth aspect, an embodiment of the present application provides a computer program product. When the instructions in the computer program product are executed by a processor of an electronic device, the electronic device executes an API open integration method provided in any one of the above-mentioned embodiments of the present application.
[0044] It can be seen from the above description that an API open integration method, device, equipment, storage medium and program product of the embodiment of the present application, by constructing the above-mentioned three-layer architecture model including the API tool layer, API protocol access layer and API governance layer, deploys microservice components in different functional layers and establishes logical relationships. Secondly, by establishing internal and external interfaces for the architecture to ensure the effective access of the system to the API gateway, and defining the API gateway core data model of the API gateway open architecture to fully ensure the data analysis and processing capabilities of the API gateway. In this way, an API gateway integrated open platform supporting API open integration is finally formed on the basis of the above architecture. Compared with the prior art, the API open integration method, device, equipment, storage medium and program product of the embodiment of the present application, by designing the decoupling of the API protocol access layer and the API orchestration layer, supports independent deployment of each, improves the flexibility of the actual API orchestration, and realizes the mutual isolation of the API protocol access and API orchestration logic, and the networking is more flexible and lightweight, so as to effectively achieve the purpose of fully ensuring the scalability and security of the API gateway. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] In order to more clearly illustrate the technical solution of the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0046] Figure 1 It is a structural diagram of the existing API gateway system processing architecture provided by an embodiment of the present application;
[0047] Figure 2 It is a flowchart of an API open integration method provided in an embodiment of the present application;
[0048] Figure 3 It is a schematic diagram of a three-layer hierarchical system of an API gateway open architecture provided in an embodiment of the present application;
[0049] Figure 4 This is a schematic diagram of the key technical framework provided by an embodiment of the present application;
[0050] Figure 5 This is a schematic diagram of a business scenario provided by an embodiment of the present application;
[0051] Figure 6This is a design diagram of the implementation architecture of the API gateway open architecture provided in one embodiment of the present application;
[0052] Figure 7 This is a schematic diagram of a scenario flow of protocol access and conversion provided by an embodiment of the present application;
[0053] Figure 8 This is a schematic diagram of the architecture of API online development provided by an embodiment of the present application;
[0054] Fig. 9 This is a flowchart of API online development provided by an embodiment of the present application;
[0055] Fig.10 This is a schematic diagram of the architecture of an API online test provided by an embodiment of the present application;
[0056] Fig.11 This is a flowchart of an API online test provided by an embodiment of the present application;
[0057] Fig.12 It is a structural diagram of an API open integration device provided in an embodiment of the present application;
[0058] Fig.13 It is a structural diagram of an API open integration device provided in one embodiment of the present application. DETAILED DESCRIPTION
[0059] The features and exemplary embodiments of various aspects of the present application will be described in detail below. In order to make the purpose, technical solutions and advantages of the present application clearer, the present application will be further described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are only intended to explain the present application, rather than to limit the present application. For those skilled in the art, the present application can be implemented without the need for some of these specific details. The following description of the embodiments is only to provide a better understanding of the present application by illustrating the examples of the present application.
[0060] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the statement "include..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.
[0061] As mentioned in the background technology section, with the development of digital transformation, the role of API gateways in enterprises has become increasingly important. API gateways are built based on Zuul's open architecture technology. They are responsible for managing and processing a large number of concurrent API calls, including traffic management, authorization and access control, monitoring, and API version management.
[0062] Specific as Figure 1 As shown in the figure, the core of the existing processing architecture is a series of filters that can perform a series of operations during the routing of HTTP (Hypertext Transfer Protocol) requests and responses, and these filters can be dynamically read, compiled and run. The filter can perform a series of operations during the routing of HTTP requests and responses. The request will first enter the pre filter. After the filter is executed, the request will continue to reach the route filter and then be routed to a specific service.
[0063] However, the existing API gateway has some problems. As the scale of Groovy filters increases, the performance gradually decreases and the scalability of the system becomes poor. The typical thread pool + synchronous blocking thread mode cannot effectively handle high-concurrency scenarios. In addition, the architecture is mainly based on Groovy filter implementation. For synchronous API calls, abnormal Groovy may cause the entire API gateway to be unavailable. If all customized APIs run in the same API gateway instance, it is easy to cause a series of problems such as memory expansion and performance degradation.
[0064] In view of the above, in order to solve the problems of the prior art, the embodiments of the present application provide an API open integration method, device, equipment, storage medium and program product. It should be noted that the embodiments provided in the present application are not intended to limit the scope of the present application.
[0065] The following first introduces the API open integration method provided in the embodiment of the present application.
[0066] Figure 2 The flowchart of the API open integration method provided by an embodiment of the present application is shown. The API open integration method is applied to an electronic device, which may include a server or a user terminal. Figure 2 As shown, the API open integration method includes the following steps:
[0067] S210, build a layered API gateway open architecture, which includes the API tool layer, API protocol access layer and API governance layer;
[0068] S220, deploy microservice components with corresponding functions at the API tool layer, API protocol access layer, and API governance layer respectively;
[0069] S230, identifying microservice components deployed in the API gateway open architecture and establishing logical relationships;
[0070] S240, establishing an API gateway internal and external interface list, wherein the API gateway internal and external interface list defines multiple component external interfaces and component internal interfaces;
[0071] S250, based on the API gateway open architecture and the definition of multiple component external interfaces and component internal interfaces, defines the API gateway core data model of the API gateway open architecture, forms an API gateway integrated development platform, and the API gateway integrated open platform supports API open integration.
[0072] It can be seen from the above description that an API open integration method of an embodiment of the present application deploys microservice components in different functional layers and establishes logical relationships by constructing the above-mentioned three-layer architecture model including the API tool layer, the API protocol access layer and the API governance layer. Secondly, by establishing internal and external interfaces for the architecture to ensure the effective access of the system to the API gateway, and defining the API gateway core data model of the API gateway open architecture to fully guarantee the data analysis and processing capabilities of the API gateway. In this way, an API gateway integration open platform that supports API open integration is finally formed on the basis of the above architecture. Compared with the prior art, the API open integration method of the embodiment of the present application, by designing the decoupling of the API protocol access layer and the API orchestration layer, supports independent deployment of each, improves the flexibility of the actual API orchestration, and realizes the mutual isolation of the API protocol access and API orchestration logic, making the networking more flexible and lightweight, thereby being able to effectively achieve the purpose of fully ensuring the scalability and security of the API gateway.
[0073] The specific implementation of the above steps 210 to 250 is described in detail below.
[0074] In S210, during the specific implementation, a layered API gateway open architecture is constructed, and the API gateway open architecture includes an API tool layer, an API protocol access layer, and an API governance layer.
[0075] In this embodiment, based on the core concept of API layering, the unified protocol access layer and API orchestration layer of the API are separated, and the protocol access and API orchestration are no longer placed in the same layer of the API gateway. The API protocol access layer and the API orchestration layer are decoupled to support independent deployment, which improves the flexibility of API orchestration and realizes the mutual isolation of API protocol access and API orchestration logic, making the networking more flexible and lightweight. It is also easier to support the orchestration of multiple protocols, and the orchestration function is independent of the protocol access capability, making the API gateway protocol access more independent and transparent.
[0076] According to some embodiments of the present application, with respect to the specific functional positioning of the above-mentioned API tool layer, API protocol access layer, and API governance layer, optionally, the API tool layer is used to provide API design, metadata definition, API development, API orchestration, and API testing functions;
[0077] The API protocol access layer is used to implement API unified multi-protocol access, API authentication, and API certification;
[0078] The API governance layer is used to implement online governance, lifecycle management, and operation and maintenance of APIs.
[0079] In other words, the above-mentioned API tool layer is equivalent to an API tool set, which provides online API metadata definition, as well as configuration-based API definition and coded API definition, which can be synchronized in both directions. It automatically generates skeleton code, test code and synchronized API online documentation, API examples, and API descriptions based on the API metadata definition, mainly including Designer (research tool), Builder (development tool), and Tester (testing tool).
[0080] API protocol access layer: Access is responsible for unified protocol access, high performance, multi-protocol, and scalability. It supports access, authentication, authorization, message routing, flow control, etc. of protocols such as REST (Representational State Transfer), HTTP (Hypertext Transfer Protocol), SOAP (Simple Object Access Protocol), and DSF (Distributed Service Framework).
[0081] API governance layer: provides capabilities such as dynamic management of the API lifecycle, application management, subscription management (APP (Application) subscribes to API), northbound access management (authentication, flow control), and southbound fault management.
[0082] In some possible implementations, the above-mentioned layered API gateway open architecture includes:
[0083] The distributed microservice framework based on the asynchronous non-blocking NIO communication framework builds an open architecture for the API gateway.
[0084] In this way, building an API gateway open architecture based on a distributed microservice framework based on the asynchronous non-blocking NIO communication framework is conducive to realizing the asynchronous non-blocking architecture of the subsequent protocol stack and the asynchronous call of the script orchestration layer.
[0085] In S220, during the specific implementation, when realizing the functions of each layer of the above-mentioned API gateway open architecture including the API tool layer, API protocol access layer and API governance layer, microservice components of corresponding functions are deployed in the API tool layer, API protocol access layer and API governance layer respectively.
[0086] According to some embodiments of the present application, the API tool layer may optionally be deployed with: an API Design microservice component responsible for API design, metadata definition, and API compliance checking; an API Build microservice component responsible for API online development, testing, and release; an API Orchestration microservice component responsible for API business logic orchestration and supporting multiple orchestration forms;
[0087] The API protocol access layer is deployed with: API Access (API access) microservice components for unified multi-protocol API access, API authentication, and certification;
[0088] The API governance layer is deployed with APIGovernance microservice components for online governance, lifecycle management, and operation and maintenance of APIs.
[0089] According to some embodiments of the present application, optionally, a Restful API communication mode is adopted between the microservice component in the API gateway open architecture and the APIPortal in the API gateway open architecture;
[0090] APIPortal is used to provide an API interaction interface and supports publishing, subscribing, and launching APIs.
[0091] The API gateway open architecture in this embodiment deploys microservices based on the microservice framework to achieve API integration, builds 5 core microservice components + 1 Portal, and uses the Restful API communication mode between the microservice components and the Portal.
[0092] In addition, this application establishes the architectural elements of API governance service, API engine service, publish and subscribe service, API definition service, API development service, API testing service, asset catalog service, developer service, user management service, cache service, message queue, authentication and authorization, database, registration center, and unified agent based on the three-tier architecture model. The established API gateway open architecture can effectively support multiple protocol access and conversion methods, fully ensuring the flexible functional design of API full-online development and the effective management capabilities of API efficient testing.
[0093] In S230, during specific implementation, after deploying the required microservice components in the above-mentioned layered architecture, the microservice components deployed in the API gateway open architecture are identified and logical relationships are established.
[0094] According to some embodiments of the present application, optionally, identifying microservice components deployed in an API gateway open architecture and establishing logical relationships includes:
[0095] The API gateway open architecture adopts a microservice architecture. The front-end access of the API gateway open architecture is load balanced through Nginx. The API Access microservice component is responsible for protocol access and conversion, and then polls the APIOrchestration microservice component by session.
[0096] The API Governance microservice component is used to complete the deployment and upgrade of the API. It notifies the API Access microservice component through NATS messages, and the API Access microservice component pulls the API that needs to be deployed and upgraded from the API Governance microservice component.
[0097] According to some embodiments of the present application, optionally, when the API Governance microservice component is started, the API Governance microservice component starts connecting to a DB (database) and Nats (Native Advanced Technology Services), and provides a Restful interface for use by the API Access microservice component and the API Portal;
[0098] When the API Access microservice component is started, the API Access microservice component actively pulls the API information from API Governance or subscribes to Nats messages to load the API information into memory.
[0099] In S240 , during specific implementation, an API gateway internal and external interface list is established, and a plurality of component external interfaces and component internal interfaces are defined in the API gateway internal and external interface list.
[0100] In S250, when specifically implemented, based on the API gateway open architecture and the definitions of multiple component external interfaces and component internal interfaces, the API gateway core data model of the API gateway open architecture is defined. In this way, the aforementioned architecture is combined to finally form an API gateway integrated development platform, which can fully support various API open integrations.
[0101] More specifically, the above-mentioned API gateway core data model of the API gateway open architecture is defined based on the definition of the API gateway open architecture and multiple component external interfaces and component internal interfaces, including:
[0102] Based on the open architecture of the API gateway and the definitions of multiple component external interfaces and component internal interfaces, build API-related conceptual models, logical data objects, and physical storage models, and define data models for API-related businesses;
[0103] The above data model includes at least one of a user data model, an API asset data model, and an API subscription usage information data model.
[0104] The above user data model can be used to store tenants, users, and permission data on the API gateway integrated development platform through the platform's physical database; user behavior data, including login records, development / archiving / publishing APIs, subscription APIs, modification of SLA (Service Level Agreement) behavior data, etc., are carried through the corresponding physical database.
[0105] The above API asset data model can be used to manage and store APIs, API status, and APIPackage through the asset library Catalog and stored through the file system; APIPolicy, API Proxy, and EndPoint configuration are stored and managed through the DB of the Governance governance service; API asset statistics, including API classification, the number of APIs owned by each user, the number of API calls, the number of API modifications / subscriptions, API activity, etc., are carried through the corresponding physical database.
[0106] The above API subscription usage information data model can be used to define the registration of the subscription App and the SLA of the subscription API, which can be managed through the API Governance governance service and stored in the physical DB. It can also be used to synchronize to the API Engine (API Engine) through API Governance for API access control. The API Engine performs snapshot storage locally and refreshes it when changes occur, thereby enhancing the reliability of the platform and preventing the spread of faults.
[0107] According to some embodiments of the present application, optionally, considering the actual API interface call scenario, the above-mentioned API gateway integrated development platform is used to communicate and connect with the business system and the third-party system respectively; after obtaining the API gateway integrated development platform, the API open integration method further includes:
[0108] The API Gateway integrated development platform responds to inbound API requests from third-party systems and provides the internal services of the business system to third-party systems for invocation;
[0109] And / or, the API gateway integrated open platform responds to the business system's request for the outbound API and provides the interface of the third-party system to the business system for calling.
[0110] In this embodiment, according to business needs, in an open scenario, the internal services of the business system can be exposed to third-party calls through the API gateway inbound API; in an integrated scenario, the internal services of the system can call the interface of the third-party system through the API gateway (outbound API).
[0111] As a platform middleware, API gateway integrated development platform allows API providers, whether they are operators, Internet, or other industries, to develop APIs and encapsulate cloud platform and product suite capabilities into service-oriented and standardized APIs for external use through API capability development, so that they can be directly used by third parties such as power providers / OTT. In addition, application integration is based on the open API interface of the suite, so it can flexibly arrange and convert multi-protocol access, thereby effectively supporting adaptation, integration and docking with third-party systems.
[0112] In order to facilitate understanding of the API open integration method provided in the above embodiment, the above method is described below using a specific scenario embodiment.
[0113] Specifically, the embodiment of the present application is based on the core concept of API layering, which separates the unified protocol access layer and the API orchestration layer of the API, and no longer puts both protocol access and API orchestration in the API gateway. After layering, the new API open architecture is as follows: Figure 2 As shown:
[0114] API tool layer: API tool set, which provides online API metadata definition, as well as configured API definition and coded API definition, which can be synchronized in both directions; it automatically generates skeleton code, test code and synchronized API online documentation, API examples, and API descriptions based on API metadata definition, mainly including Designer (research tool), Builder (development tool), and Tester (test tool).
[0115] API protocol access layer: Access is responsible for unified protocol access, high performance, multi-protocol, and scalability. It supports access, access, authentication, authorization, message routing, and flow control of protocols such as REST, HTTP, SOAP, and DSF.
[0116] API governance layer: provides capabilities such as dynamic management of the API lifecycle, application management, subscription management (APP subscription to API), northbound access management (authentication, flow control), and southbound fault management.
[0117] Among them, in this embodiment, the API gateway adopts an asynchronous non-blocking architecture to realize the asynchronous non-blocking architecture of the protocol stack and the asynchronous call of the script orchestration layer. In the specific implementation, the asynchronous non-blocking of the protocol stack: based on the Java language asynchronous non-blocking NIO communication framework Netty is built. Based on the Netty asynchronous non-blocking model, one NIO thread can handle thousands of client connections. Since the network read and write operations are non-blocking, the reliability of communication has also been greatly improved.
[0118] The steps for implementing the API open integration method based on cloud service gateway technology in this scenario embodiment are as follows:
[0119] Step 1: Architecture model technology selection: When building the open architecture of the API gateway, based on the Netty communication framework, a distributed service framework, cluster deployment, and unified logging, tracing, and fault tolerance are adopted; different component modules use the microservice interface (Restful API) + NATS notification mechanism for communication;
[0120] Among them, the key technical frameworks used are as follows: Figure 4 As shown, Figure 4 This is a schematic diagram of the key technical framework provided by an embodiment of the present application. Figure 4 As shown in the figure, the core service is divided into 5 microservice components + 1 APIPortal. The microservice components and the APIPortal use Restful API for communication. The 5 microservice components include:
[0121] APIDesign: Responsible for API design, metadata definition, API compliance checking, etc.
[0122] API Build: Responsible for API online development, testing, and release, etc.
[0123] API Access: unified multi-protocol access to API, API authentication, etc.
[0124] APIOrchestration: API business logic orchestration, supporting multiple orchestration forms, such as JS script orchestration, graphical orchestration, etc.
[0125] API Governance: API online governance, lifecycle management, and operation and maintenance.
[0126] More specifically, when implementing the functions of microservice components, the implementation of core technology components can be as follows:
[0127] API metadata definition: Based on Swagger extension implementation, supports Swagger specification, self-developed, and uses JSON or YAML format to describe API metadata.
[0128] API multi-protocol access: Based on Netty4.X extension implementation, it supports asynchronous non-blocking I / O communication and has excellent performance.
[0129] API orchestration: Graphical orchestration is implemented based on BPMN and online flowcharts, and JS script orchestration uses the JDK built-in Nashorn engine to execute JS scripts.
[0130] Unified data access layer: based on MyBatis encapsulation, the underlying layer shields heterogeneous data and supports multiple databases such as Oracle\MySQL. You only need to switch the JDBC engine.
[0131] Distributed configuration service: Two implementation strategies. Cluster-level and node-level configuration use DF's configuration service uniformly, implemented based on ZK. API-level configuration is implemented based on NATS+database.
[0132] Step 2: Design of the software system architecture: Please refer to Figure 5 , Figure 5 This is a schematic diagram of a business scenario provided by an embodiment of the present application. Figure 5 As shown, according to business needs, in an open scenario, the internal services of the business system can be exposed to third-party calls through the API gateway inbound API; in an integrated scenario, the internal services of the business system can call the interfaces of the third-party system through the API gateway (outbound API).
[0133] As a platform middleware, API gateway integrated development platform allows API providers, whether they are operators, Internet, or other industries, to develop APIs and encapsulate cloud platform and product suite capabilities into service-oriented and standardized APIs for external use through API capability development, so that they can be directly used by third parties such as power providers / OTT. In addition, application integration is based on the open API interface of the suite, so it can flexibly arrange and convert multi-protocol access, thereby effectively supporting adaptation, integration and docking with third-party systems.
[0134] Therefore, see next Figure 6 , Figure 6 This is a design diagram of the implementation of the API gateway open architecture provided by an embodiment of the present application. Figure 6 As shown in the specific implementation architecture:
[0135] 1) Design API Gateway:
[0136] APIs should be managed as assets, which should include the entire life cycle management, including planning, design, implementation, packaging, operation, version management, maintenance, and exit. The application architecture of APIPlatform should cover the entire API life cycle (creation, implementation, operation, and governance).
[0137] The API platform capability model has three levels: API Gateway (request processing, access control) -> API Management solution (infrastructure, lifecycle management tools, developer management) -> API platform (lifecycle management, creation, implementation, operation, governance tools).
[0138] 2) Design management domain:
[0139] As a service component, the API gateway manages the installation and operation of services with the help of the management domain of the platform or product, such as SaaS OPS.
[0140] 3) Implementing API Gateway:
[0141] API Fabric (API Gateway) is an integrated and open cloud service that focuses on API integration and API capability opening, enabling DSV and ISV to connect and develop systems based on APIs. It also provides API specifications, warehouses, governance, access and development tools to complete interface research, development, testing, statistics and monitoring in one stop.
[0142] See also Figure 7 , Figure 7 1 is a schematic diagram of a scenario flow of protocol access and conversion provided by an embodiment of the present application. Figure 7As shown in the figure, API Gateway supports multiple protocol access and conversion. In the northbound access scenario, API Access supports HTTP+XML (Extensible Markup Language) protocol.
[0143] See also Figure 8 , Figure 8 This is a schematic diagram of the architecture of the API online development provided by an embodiment of the present application. Figure 8 As shown, API supports full online development. The API Gateway integrated development platform provides API development tools that can be developed in online, scripted, and graphical ways, supporting API providers to develop APIs through interface configuration and scripting, lowering the technical threshold and thus facilitating the improvement of development efficiency.
[0144] The overall process of using API development is as follows Fig. 9 As shown, Fig. 9 This is a flow chart of an API online development process provided by an embodiment of the present application. By using the microservice components in the API gateway integrated development platform to create a new API, orchestrate the process, deploy the API, and export the API, online automated development of the API can be achieved.
[0145] See below Fig.10 , Fig.10 Schematic diagram of the architecture of API online testing provided by an embodiment of the present application. Fig.10 In the API testing tool, according to the input API interface definition file, test cases and test piles, the API testing tool automatically, online and visually generates interface test results and success rates. And users can use the API testing tool to effectively manage test cases.
[0146] The overall process of testing using API testing tools is as follows Fig.11 As shown, Fig.11 1 is a flowchart of an API online test provided by an embodiment of the present application. Fig.11 In the process, by using the relevant microservice components in the API gateway integrated development platform to create projects, create interfaces, create test cases, execute test cases, and view test results, the API can be effectively tested.
[0147] Step 3: Identify the relevant components in the API gateway open architecture and establish logical relationships: The API gateway open architecture adopts a microservice architecture. The front-end access is load balanced through Nginx / LB. API Access is responsible for protocol access and conversion, and then APIOrchestration orchestrates services by session polling.
[0148] API Governance is used to complete the deployment and upgrade of APIs. It notifies API Access through NATS messages, and then API Access pulls the APIs that need to be deployed and upgraded from API Governance. API Governance startup: connects to DB, Nats, and provides Restful interfaces for API Access and APIPortal. API Access startup: actively pulls from APIGovernance or subscribes to Nats messages to load API information into memory. APIPortal provides an API interaction interface that can publish, subscribe, and launch APIs, etc.
[0149] Step 4: Create an API gateway internal and external interface list: define the component external interface and internal interface, and define the interface security. The specific interface can be flexibly set in combination with the actual business scenario and service function, and this embodiment does not make strict restrictions here.
[0150] Exemplarily, the external interface may include an authentication interface, an operation management interface, a data integration interface, a human-machine interface, etc. Different interfaces correspond to their own interface types and interface descriptions. When defining an internal interface, the interface name, interface type, interface provider, call relationship, and responsibilities may be defined. This scenario embodiment will not be described in detail here.
[0151] Step 5: Based on the API gateway open architecture and the definitions of multiple component external interfaces and component internal interfaces, define the API gateway core data model of the API gateway open architecture.
[0152] Specifically, based on the open architecture of the API gateway and the definitions of multiple component external interfaces and component internal interfaces, API-related conceptual models, logical data objects, and physical storage models are constructed, and data models for API-related businesses are defined.
[0153] The above data model includes at least one of a user data model, an API asset data model, and an API subscription usage information data model.
[0154] The above user data model can be used to store tenants, users, and permission data on the API gateway integrated development platform through the platform's physical database; user behavior data, including login records, development / archiving / publishing APIs, subscription APIs, modification of SLA (Service Level Agreement) behavior data, etc., are carried through the corresponding physical database.
[0155] The above API asset data model can be used to manage and store APIs, API status, and APIPackage through the asset library Catalog and stored through the file system; APIPolicy, API Proxy, and EndPoint configuration are stored and managed through the DB of the Governance governance service; API asset statistics, including API classification, the number of APIs owned by each user, the number of API calls, the number of API modifications / subscriptions, API activity, etc., are carried through the corresponding physical database.
[0156] The above API subscription usage information data model can be used to define the registration of the subscription App and the SLA of the subscription API, which can be managed through the API Governance governance service and stored in the physical DB. It can also be used to synchronize to the API Engine (API Engine) through API Governance for API access control. The API Engine performs snapshot storage locally and refreshes it when changes occur, thereby enhancing the reliability of the platform and preventing the spread of faults.
[0157] In this scenario, based on the distributed microservice framework, five core microservices + one portal are constructed, and the communication mode between the microservice components and the portal adopts the Restful API. In addition, this embodiment establishes the architecture elements of API governance service, API engine service, publish-subscribe service, API definition service, API development service, API testing service, asset catalog service, developer service, user management service, cache service, message queue, authentication, database, registration center, and unified agent according to the three-tier architecture model.
[0158] In addition, based on this architectural element, the API gateway in this embodiment supports multiple protocol access and conversion methods, and the functional design of API full online development and the effective management capabilities of API efficient testing are all key technical protection points of this application proposal. Based on this technical point, we will create an integrated and open cloud service, facing API integration docking and API capability opening, enabling DSV and ISV to dock and develop systems based on API, and complete interface development, testing, statistics and monitoring in one stop.
[0159] Based on the API open integration method provided in the above embodiment, for the same inventive concept, the present application also provides an API open integration device corresponding to the above API open integration method. Fig.12 A detailed introduction to API open integration devices is given.
[0160] Fig.12 A schematic diagram of the structure of an API open integration device provided in one embodiment of the present application is shown.
[0161] Fig.12 The API open integration device 1200 shown includes:
[0162] A first construction module 1210 is used to construct a layered API gateway open architecture, wherein the API gateway open architecture includes an API tool layer, an API protocol access layer, and an API governance layer;
[0163] A first deployment module 1220 is used to deploy microservice components of corresponding functions in the API tool layer, the API protocol access layer, and the API governance layer respectively;
[0164] A first establishing module 1230 is used to identify microservice components deployed in the API gateway open architecture and establish logical relationships;
[0165] The second establishing module 1240 is used to establish an API gateway internal and external interface list, wherein the API gateway internal and external interface list defines a plurality of component external interfaces and component internal interfaces;
[0166] The first definition module 1250 is used to define the API gateway core data model of the API gateway open architecture based on the definitions of the API gateway open architecture and the multiple component external interfaces and component internal interfaces, to form an API gateway integrated development platform, and the API gateway integrated open platform supports API open integration.
[0167] An API open integration device provided in an embodiment of the present application constructs the above-mentioned three-layer architecture model including the API tool layer, the API protocol access layer and the API governance layer by setting corresponding functional modules, deploys microservice components in different functional layers and establishes logical relationships. Secondly, by establishing internal and external interfaces for the architecture to ensure the effective access of the system to the API gateway, and defining the API gateway core data model of the API gateway open architecture to fully ensure the data analysis and processing capabilities of the API gateway. In this way, an API gateway integrated open platform supporting API open integration is finally formed on the basis of the above architecture. Compared with the prior art, the API open integration device in the embodiment of the present application, by designing the decoupling of the API protocol access layer and the API orchestration layer, supports independent deployment of each, improves the flexibility of the actual API orchestration, and realizes the mutual isolation of the API protocol access and API orchestration logic, making the networking more flexible and lightweight, so as to effectively achieve the purpose of fully ensuring the scalability and security of the API gateway.
[0168] Based on the API open integration method provided in the above embodiment, for the same inventive concept, the present application also provides an API open integration device corresponding to the above API open integration method. Fig.13 Provides a detailed introduction to API open integration devices.
[0169] See below Fig.13 , Fig.13 It is a structural diagram of an API open integration device provided in one embodiment of the present application.
[0170] The API open integration device may include a processor 1301 and a memory 1302 storing computer program instructions.
[0171] Specifically, the processor 1301 may include a central processing unit (CPU), or an application specific integrated circuit (ASIC), or may be configured to implement one or more integrated circuits of the embodiments of the present application.
[0172] The memory 1302 may include a large capacity memory for data or instructions. By way of example and not limitation, the memory 1302 may include a hard disk drive (HDD), a floppy disk drive, a flash memory, an optical disk, a magneto-optical disk, a magnetic tape, or a universal serial bus (USB) drive or a combination of two or more of these. In appropriate cases, the memory 1302 may include a removable or non-removable (or fixed) medium. In appropriate cases, the memory 1302 may be inside or outside the integrated gateway disaster recovery device. In a specific embodiment, the memory 1302 is a non-volatile solid-state memory.
[0173] The memory may include read-only memory (ROM), random access memory (RAM), magnetic disk storage media devices, optical storage media devices, flash memory devices, electrical, optical or other physical / tangible memory storage devices. Thus, typically, the memory includes one or more tangible (non-transitory) computer-readable storage media (e.g., memory devices) encoded with software including computer-executable instructions, and when the software is executed (e.g., by one or more processors), it is operable to perform the operations described with reference to the method according to an aspect of the present disclosure.
[0174] The processor 1301 implements any one of the API open integration methods in the above embodiments by reading and executing computer program instructions stored in the memory 1302 .
[0175] In one example, the data API open integration device may further include a communication interface 1303 and a bus 1310. Fig.13 As shown, the processor 1301, the memory 1302, and the communication interface 1303 are connected via a bus 1310 and communicate with each other.
[0176] The communication interface 1303 is mainly used to implement communication between various modules, devices, units and / or equipment in the embodiments of the present application.
[0177] Bus 1310 includes hardware, software or both, and the parts of API open integrated device are coupled to each other. For example, but not limitation, bus may include accelerated graphics port (AGP) or other graphics bus, enhanced industrial standard architecture (EISA) bus, front side bus (FSB), hypertransport (HT) interconnection, industrial standard architecture (ISA) bus, infinite bandwidth interconnection, low pin count (LPC) bus, memory bus, micro channel architecture (MCA) bus, peripheral component interconnection (PCI) bus, PCI-Express (PCI-X) bus, serial advanced technology attachment (SATA) bus, video electronics standard association local (VLB) bus or other suitable bus or two or more of these combinations. In appropriate cases, bus 1310 may include one or more buses. Although the present application embodiment describes and shows a specific bus, the present application considers any suitable bus or interconnection.
[0178] The API open integration device executes the API open integration method in the embodiment of the present application, thereby realizing the API open integration method described in the embodiment of the present application.
[0179] In addition, in combination with the API open integration method in the above embodiment, the embodiment of the present application can provide a computer storage medium for implementation. The computer storage medium stores computer program instructions; when the computer program instructions are executed by a processor, any one of the API open integration methods in the above embodiment is implemented.
[0180] Based on the API open integration method in the above-mentioned embodiments, an embodiment of the present application provides a computer program product. When the instructions in the computer program product are executed by a processor of an electronic device, the electronic device executes the API open integration method provided in any one of the above-mentioned embodiments of the present application.
[0181] It should be clear that the present application is not limited to the specific configuration and processing described above and shown in the figures. For the sake of simplicity, a detailed description of the known method is omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of the present application is not limited to the specific steps described and shown, and those skilled in the art can make various changes, modifications and additions, or change the order between the steps after understanding the spirit of the present application.
[0182] The functional blocks shown in the above-described block diagram can be implemented as hardware, software, firmware or a combination thereof. When implemented in hardware, it can be, for example, an electronic circuit, an application specific integrated circuit (ASIC), appropriate firmware, a plug-in, a function card, etc. When implemented in software, the elements of the present application are programs or code segments that are used to perform the required tasks. The program or code segment can be stored in a machine-readable medium, or transmitted on a transmission medium or a communication link by a data signal carried in a carrier wave. "Machine-readable medium" can include any medium capable of storing or transmitting information. Examples of machine-readable media include electronic circuits, semiconductor memory devices, ROM, flash memory, erasable ROM (EROM), floppy disks, CD-ROMs, optical disks, hard disks, optical fiber media, radio frequency (RF) links, etc. The code segment can be downloaded via a computer network such as the Internet, an intranet, etc.
[0183] It should also be noted that the exemplary embodiments mentioned in this application describe some methods or systems based on a series of steps or devices. However, this application is not limited to the order of the above steps, that is, the steps can be performed in the order mentioned in the embodiment, or in a different order from the embodiment, or several steps can be performed simultaneously.
[0184] Aspects of the present disclosure are described above with reference to the flowchart and / or block diagram of the method, device (system) and computer program product according to the embodiment of the present disclosure. It should be understood that each box in the flowchart and / or block diagram and the combination of each box in the flowchart and / or block diagram can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device to produce a machine so that these instructions executed by the processor of the computer or other programmable data processing device enable the implementation of the function / action specified in one or more boxes of the flowchart and / or block diagram. Such a processor can be, but is not limited to, a general-purpose processor, a special-purpose processor, a special application processor, or a field programmable logic circuit. It can also be understood that each box in the block diagram and / or flowchart and the combination of boxes in the block diagram and / or flowchart can also be implemented by dedicated hardware that performs a specified function or action, or can be implemented by a combination of dedicated hardware and computer instructions.
[0185] The above is only a specific implementation of the present application. Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working processes of the systems, modules and units described above can refer to the corresponding processes in the aforementioned method embodiments, and will not be repeated here. It should be understood that the protection scope of the present application is not limited to this. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed in this application, and these modifications or replacements should be included in the protection scope of this application.
Claims
1. An API open integration method, characterized in that: The method comprises: Build a layered API gateway open architecture, which includes an API tool layer, an API protocol access layer, and an API governance layer; Deploy microservice components with corresponding functions at the API tool layer, the API protocol access layer, and the API governance layer respectively; Identify microservice components deployed in the API gateway open architecture and establish logical relationships; Establishing an API gateway internal and external interface list, wherein the API gateway internal and external interface list defines multiple component external interfaces and component internal interfaces; Based on the API gateway open architecture and the definitions of the multiple component external interfaces and component internal interfaces, the API gateway core data model of the API gateway open architecture is defined to form an API gateway integrated development platform, and the API gateway integrated open platform supports API open integration.
2. The method according to claim 1, characterized in that The API tool layer is used to provide API design, metadata definition, API development, API orchestration and API testing functions; The API protocol access layer is used to implement API unified multi-protocol access, API authentication, and API certification; The API governance layer is used to implement online governance, lifecycle management, and operation and maintenance of APIs.
3. The method according to claim 1, characterized in that The API tool layer is deployed with: APIDesign microservice components responsible for API design, metadata definition, and API compliance checking; APIBuild microservice component responsible for online API development, testing, and release; APIOrchestration microservice component responsible for the business logic orchestration of APIs, supporting multiple orchestration forms; The API protocol access layer is deployed with: APIAccess microservice components for unified multi-protocol access of APIs, API authentication and certification; The API governance layer is deployed with: APIGovernance microservice components for online governance, lifecycle management, and operation and maintenance of APIs.
4. The method according to claim 3, characterized in that The communication mode of Restful API is adopted between the microservice component in the API gateway open architecture and the APIPortal in the API gateway open architecture; The API Portal is used to provide an API interaction interface and supports publishing, subscribing, and launching APIs.
5. The method according to claim 4, characterized in that The identifying microservice components deployed in the API gateway open architecture and establishing logical relationships includes: The API gateway open architecture adopts a microservice architecture. The front-end access of the API gateway open architecture is load balanced through Nginx. The API Access microservice component is responsible for protocol access and conversion, and then polls the APIOrchestration microservice component according to the session. The API Governance microservice component is used to complete the deployment and upgrade of the API. It notifies the API Access microservice component through NATS messages, and the API Access microservice component pulls the API that needs to be deployed and upgraded from the API Governance microservice component.
6. The method according to claim 5, characterized in that When the API Governance microservice component is started, the API Governance microservice component starts to connect to the database DB and Nats, and provides a Restful interface for use by the API Access microservice component and the APIPortal; When the API Access microservice component is started, the API Access microservice component actively pulls the API information from the APIGovernance or subscribes to Nats messages to load the API information into the memory.
7. The method according to claim 1, characterized in that The layered API gateway open architecture is constructed, including: The API gateway open architecture is constructed based on a distributed microservice framework based on an asynchronous non-blocking NIO communication framework.
8. The method according to claim 1, characterized in that: The API gateway core data model of the API gateway open architecture is defined based on the API gateway open architecture and the definitions of the multiple component external interfaces and component internal interfaces, including: Based on the open architecture of the API gateway and the definitions of the multiple component external interfaces and component internal interfaces, construct API-related conceptual models, logical data objects, and physical storage models, and define data models for API-related services; The data model includes at least one of a user data model, an API asset data model, and an API subscription usage information data model.
9. The method according to claim 1, characterized in that: The API gateway integrated development platform is used to communicate with the business system and the third-party system respectively; After obtaining the API gateway integrated development platform, the method further includes: The API gateway integrated development platform responds to the third-party system's request for the inbound API and provides the internal services of the business system to the third-party system for calling; And / or, the API gateway integrated open platform provides the interface of the third-party system to the business system for calling in response to the business system's request for the outbound API.
10. An API open integration device, characterized in that: The device comprises: A first building module is used to build a layered API gateway open architecture, wherein the API gateway open architecture includes an API tool layer, an API protocol access layer, and an API governance layer; A first deployment module is used to deploy microservice components of corresponding functions in the API tool layer, the API protocol access layer, and the API governance layer respectively; A first establishment module is used to identify microservice components deployed in the API gateway open architecture and establish logical relationships; The second establishment module is used to establish an API gateway internal and external interface list, wherein the API gateway internal and external interface list defines multiple component external interfaces and component internal interfaces; The first definition module is used to define the API gateway core data model of the API gateway open architecture based on the definitions of the API gateway open architecture and the multiple component external interfaces and component internal interfaces, to form an API gateway integrated development platform, and the API gateway integrated open platform supports API open integration.
11. An API open integration device, characterized in that: The device comprises: a processor and a memory storing computer program instructions; When the processor executes the computer program instructions, the API open integration method as described in any one of claims 1-9 is implemented.
12. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer program instructions, and when the computer program instructions are executed by the processor, the API open integration method according to any one of claims 1 to 9 is implemented.
13. A computer program product, characterized in that When the instructions in the computer program product are executed by a processor of an electronic device, the electronic device executes the API open integration method as described in any one of claims 1-9.
Citation Information
Patent Citations
Resource sharing service platform architecture based on micro service
CN113176875A
Distributed and container virtualization-based elastic micro-service system and implementation method
CN114422371A
Micro-service architecture design method and device and computer readable storage medium
CN115695138A
Open cloud platform, construction method thereof and storage medium
CN116232910A
Supervision sandbox architecture, supervision method, device, and storage medium
WO2021218333A1
