Interface gateway management method, device and medium based on adapter plug-in mode
The adapter plugin pattern in interface gateway management systems addresses the challenge of vendor-specific differences by dynamically loading appropriate software packages, enhancing compatibility and scalability.
Patent Information
- Application Number
- CN202510473461.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-16
- Publication Date
- 2025-07-15
- Estimated Expiration
- 2045-04-16
AI Technical Summary
The lack of unified standards for traditional interface gateway management systems has led to complex integration between cross-platform and cross-vendors, increasing maintenance costs and technical thresholds, and it is difficult to adapt to new interface gateway types or versions.
The interface gateway management method based on the adapter plug-in mode is adopted. By obtaining gateway information, the target policy implementation class is determined, and the target software packages are found from the preset software package library. It supports software packages developed by default manufacturers and other manufacturers based on unified interface specifications, and dynamically loads the adapter plug-in to handle different types of interface gateways.
It improves the standardization and scalability of the system, realizes compatibility and interoperability between different manufacturers, reduces the need for core code modification, and enhances the flexibility and processing efficiency of the system.
Smart Images

Figure CN120017512B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer network technology, and in particular, to a method, device, and medium for managing an interface gateway based on an adapter plug-in mode. Background Art
[0002] In the field of interface gateway technology, with the wide application of the microservices architecture, the interface gateway, as a unified request entry, plays a crucial role. It is not only responsible for basic functions such as request routing, load balancing, and protocol conversion, but also needs to handle the adaptation and docking of service interfaces related to different types and versions of interface gateways. However, in the current interface gateway management field, interface gateways and service interfaces provided by different manufacturers often lack a unified standard. Although this diversity promotes market competition and technological progress, it also brings significant integration challenges. Specifically, traditional interface gateway management systems usually need to separately write adapters or software packages for each specific manufacturer's interface gateway to achieve effective docking and management with these gateways. Since each manufacturer designs its own interface gateway according to its own needs, there are great differences in interface protocols, data formats, authentication mechanisms, etc. This makes cross-platform and cross-manufacturer interface gateway management and integration extremely complex, increasing the system's maintenance cost and technical threshold. When introducing a new type or version of interface gateway, the system must perform additional development work to create corresponding adapters or software packages. In summary, traditional interface gateway management systems have poor standardization and scalability. Summary of the Invention
[0003] The main purpose of this application is to provide a method, device, and medium for managing an interface gateway based on an adapter plug-in mode, aiming to improve the standardization and scalability of interface gateway management.
[0004] To achieve the above objective, this application proposes a method for managing an interface gateway based on an adapter plug-in mode, including:
[0005] Obtain externally input gateway information, where the gateway information includes the communication protocol, domain name address, authentication parameters, type, and version of the interface gateway;
[0006] Determine a target policy implementation class according to the gateway information, where the target policy implementation class defines the processing logic of the interface gateway;
[0007] According to the gateway information, find a target software package from a preset software package library through a preset adapter plug-in, and call the target software package according to the target policy implementation class, where the software package library includes software packages of the default manufacturer and software packages developed by other manufacturers based on a unified interface specification.
[0008] In one embodiment, the step of determining a target policy implementation class according to the gateway information includes:
[0009] Determine whether the gateway information is qualified gateway information according to the communication protocol, domain name address, and authentication parameters;
[0010] If the gateway information is qualified gateway information, extract characteristic parameters from the qualified gateway information, where the characteristic parameters include the type and version of the interface gateway;
[0011] Query the target policy implementation class that matches the characteristic parameters in the preset policy implementation class library.
[0012] In one embodiment, after the step of querying the target policy implementation class that matches the characteristic parameters in the preset policy implementation class library, it includes:
[0013] If no target policy implementation class that matches the characteristic parameters is queried, for each policy implementation class in the policy implementation class library, calculate the matching degree between each parameter in the characteristic parameters and the policy implementation class, and perform weighted calculation on the matching degree according to the preset weight parameters to obtain the similarity between the policy implementation class and the characteristic parameters;
[0014] Select the policy implementation class with the highest similarity from the similarities corresponding to each policy implementation class in the policy implementation class library as the target policy implementation class.
[0015] In one embodiment, before the step of searching for the target software package from the preset software package library according to the gateway information through the preset adapter plugin, it includes:
[0016] Determine the preset data acquisition conversion interface specification and data configuration distribution interface specification, where the data acquisition conversion interface specification is used to specify the rules for converting the software package into a preset data format, and the data configuration distribution interface specification is used to specify the rules for distributing the data configuration of the software package to the target interface;
[0017] Mark the data acquisition conversion interface specification and the data configuration distribution interface specification as the first version number, and save them to the preset interface specification document library;
[0018] Obtain the software packages developed by other manufacturers based on the data acquisition conversion interface specification and the data configuration distribution interface specification corresponding to the first version number in the interface specification document library;
[0019] Store the software packages sent by other manufacturers and the software packages of the preset default manufacturer together in the preset software package library.
[0020] In one embodiment, after the step of marking the data acquisition conversion interface specification and the data configuration distribution interface specification as the first version number and saving them to the preset interface specification document library, it further includes:
[0021] When it is detected that the data acquisition conversion interface specification and the data configuration distribution interface specification are updated, mark the updated data acquisition conversion interface specification and the data configuration distribution interface specification as the second version number, and save them to the interface specification document library;
[0022] Obtain new software packages developed by other manufacturers based on the data acquisition conversion interface specification and the data configuration distribution interface specification corresponding to the second version number in the interface specification document library;
[0023] Store the new software packages in a preset software package library.
[0024] In one embodiment, the step of searching for a target software package from a preset software package library according to gateway information through a preset adapter plugin includes:
[0025] Input the gateway information into a preset memory mapping table, and query the software package information corresponding to the gateway information in the memory mapping table;
[0026] Call the software package information corresponding to the gateway information according to the preset adapter plugin, and search for the target software package from the preset software package library.
[0027] In one embodiment, before the step of inputting the gateway information into a preset memory mapping table includes:
[0028] Query the software packages corresponding to the type and version in the gateway information in the software package library;
[0029] If a software package corresponding to the type and version in the gateway information is queried, establish a first mapping relationship between the gateway information and the corresponding software package;
[0030] If a software package corresponding to the type and version in the gateway information is not queried, input the gateway information into a pre-trained learning model, and establish a second mapping relationship between the predicted software package output by the learning model and the gateway information;
[0031] Store the first mapping relationship and the second mapping relationship into a preset memory mapping table.
[0032] In one embodiment, after the step of calling the target software package according to the target policy implementation class, it further includes:
[0033] If a network exception occurs when calling the target software package, re-call the target software package;
[0034] If a data format error occurs when calling the target software package, output an error prompt;
[0035] If the number of abnormal situations occurring within a preset time is greater than a preset quantity, the invocation of the target software package is temporarily interrupted, where the abnormal situations include network abnormalities and data format errors.
[0036] In addition, to achieve the above object, the present application also proposes an interface gateway management device based on the adapter plugin mode, the device including: a memory, a processor, and a computer program stored on the memory and executable on the processor, the computer program configured to implement the steps of the interface gateway management method based on the adapter plugin mode as described above.
[0037] In addition, to achieve the above object, the present application also proposes a medium, the medium being a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, it implements the steps of the interface gateway management method based on the adapter plugin mode as described above.
[0038] In addition, to achieve the above object, the present application also provides a product, the product being a computer program product, the computer program product including a computer program, and when the computer program is executed by a processor, it implements the steps of the interface gateway management method based on the adapter plugin mode as described above.
[0039] One or more technical solutions proposed by the present application have at least the following technical effects:
[0040] The present application obtains externally input gateway information, where the gateway information includes the communication protocol, domain name address, authentication parameters, type, and version of the interface gateway; determines a target policy implementation class according to the gateway information, where the target policy implementation class defines the processing logic of the interface gateway, which ensures that the most appropriate processing policy can be adopted for different types or priorities of requests, improving the system processing efficiency and response speed; according to the gateway information, searches for a target software package from a preset software package library through a preset adapter plugin, and invokes the target software package according to the target policy implementation class, where the software package library includes software packages of the default manufacturer and software packages developed by other manufacturers based on a unified interface specification, allowing the system to adapt to new business requirements or technical upgrades by adding or replacing software packages without modifying the core code. This design promotes compatibility and interoperability between different manufacturers, and also enhances the flexibility, standardization, and scalability of the system. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] The drawings here are incorporated into the specification and form a part of the specification, showing embodiments consistent with the present application, and are used together with the specification to explain the principles of the present application.
[0042] To more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the accompanying drawings required for the description of the embodiments or the prior art. Obviously, for those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings.
[0043] Figure 1 It is a schematic flow chart of the interface gateway management method based on the adapter plug-in mode of the present application;
[0044] Figure 2 It is a schematic scenario diagram of the interface gateway management method based on the adapter plug-in mode of the present application;
[0045] Figure 3 It is another schematic flow chart of the interface gateway management method based on the adapter plug-in mode of the present application;
[0046] Figure 4 It is a schematic module structure diagram of the interface gateway management device based on the adapter plug-in mode in the embodiments of the present application;
[0047] Figure 5 It is a schematic device structure diagram of the hardware operating environment involved in the interface gateway management method based on the adapter plug-in mode in the embodiments of the present application.
[0048] The implementation, functional features and advantages of the present application will be further described with reference to the embodiments and the accompanying drawings. Detailed implementation manners
[0049] It should be understood that the specific embodiments described herein are only used to explain the technical solutions of the present application and are not used to limit the present application.
[0050] To better understand the technical solutions of the present application, the following will be described in detail in combination with the accompanying drawings of the specification and the specific implementation manners.
[0051] It should be noted that the execution subject of this embodiment can be a computing service device with data processing, network communication and program running functions, such as a tablet computer, a personal computer, a mobile phone, etc., or an electronic device or a terminal system that can implement the above functions. Hereinafter, the system will be used as an example to illustrate this embodiment and the following embodiments.
[0052] Based on this, this embodiment provides an interface gateway management method based on the adapter plug-in mode, referring to Figure 1 , Figure 1 It is a schematic flow chart of the interface gateway management method based on the adapter plug-in mode of the present application. The interface gateway management method based on the adapter plug-in mode includes steps S10 to S30:
[0053] Step S10: Obtain the gateway information input externally, where the gateway information includes the communication protocol, domain name address, authentication parameters, type, and version of the interface gateway;
[0054] Step S20: Determine the target policy implementation class according to the gateway information, where the target policy implementation class defines the processing logic of the interface gateway;
[0055] Step S30: According to the gateway information, search for the target software package from the preset software package library through the preset adapter plugin, and call the target software package according to the target policy implementation class, where the software package library includes software packages of the default manufacturer and software packages developed by other manufacturers based on the unified interface specification.
[0056] The gateway information is the detailed information such as the communication protocol, domain name address, authentication parameters, type, and version of the interface gateway, and this information is used to determine how to process the requests of this gateway. The target policy implementation class is the class that defines the processing logic of the interface gateway. It determines how to process the requests according to the gateway information, including operations such as data query and data synchronization. The adapter plugin is a dynamically loaded component used to search for the target software package from the software package library according to the gateway information. The software package library is a collection that stores multiple software packages, and these software packages include software packages of the default manufacturer and software packages developed by other manufacturers based on the unified interface specification, ensuring that the system can perform data interaction with different types of interface gateways.
[0057] The system first obtains the external input gateway information, including the communication protocol, domain name address, authentication parameters, type, and version of the interface gateway. The process of obtaining the gateway information is to parse the externally input configuration data and extract the key attributes related to the interface gateway. This information serves as the basis for subsequent steps and is used to determine how to process the requests of this gateway. Next, the system determines the target policy implementation class according to the gateway information. The target policy implementation class is a pre-defined class that contains the specific logic for processing interface gateway requests, such as data query, data synchronization, and other operations. The process of determining the target policy implementation class is to match the type and version in the gateway information and find the appropriate class from the policy implementation class library. For example, if the gateway information is "type: Type A, version: 1.0", the system will search the policy implementation class library for a policy implementation class that matches "Type A" and version "1.0". After finding the target policy implementation class, the system searches for the target software package from the preset software package library through the adapter plugin. The adapter plugin searches for the appropriate software package in the software package library according to the type and version in the gateway information. The software package library is a collection that stores multiple software packages, including software packages from the default manufacturer and software packages developed by other manufacturers based on a unified interface specification. The adapter plugin dynamically loads these software packages through the SPI (Service Provider Interface) mechanism to ensure that the system can handle different types of interface gateways. After finding the target software package, the system calls the API (Application Programming Interface) in this software package according to the target policy implementation class to perform operations such as data query and data synchronization. The target policy implementation class ensures that the system can process different types of requests according to the gateway information by calling the API in the software package.
[0058] Furthermore, in a multi-cloud environment, different cloud service providers may use different types of interface gateways. Through the solution of this embodiment, these interface gateways can be uniformly managed, simplifying the interface gateway management and data synchronization operations in a multi-cloud environment. In an Internet of Things scenario, devices from different manufacturers may use different interface protocols. Through the solution of this embodiment, different manufacturers' interface protocols can be quickly adapted to achieve the rapid access and management of Internet of Things devices.
[0059] Furthermore, automated tools can also be developed to automatically generate adapter plugins according to the gateway information, reducing the workload of manually developing adapter plugins. When dynamically loading software packages, a caching mechanism can be adopted to reduce the overhead of repeated loading and improve the system performance. A more flexible SPI interface can be designed to support more types of interface gateways and enhance the scalability of the system.
[0060] Exemplarily, refer to Figure 2, when performing gateway management, adding a new gateway triggers the creation of a task chain, and deleting a gateway deactivates and deletes tasks. The tasks in the task chain can be set according to business requirements. After creating the task chain, through the policy factory pattern, according to the gateway type and version of the newly added gateway, data synchronization task policy implementation classes (such as Policy Implementation Class 1 and Policy Implementation Class 2) are found. At the same time, various service data is managed through the service management module, including service data refresh and policy configuration data distribution. Service data refresh ensures that the service data in the system is consistent with the data in the API gateway, and policy configuration data distribution ensures that the API gateway can operate according to the system's policy configuration. API data is managed through the API management module, including API data refresh and policy configuration data distribution. API data refresh ensures that the API data in the system is consistent with the data in the API gateway, and policy configuration data distribution ensures that the API gateway can operate according to the system's policy configuration. The adapter plugin finds the software package corresponding to the gateway according to the gateway type and version. The adapter plugin dynamically loads the appropriate software package through the SPI mechanism to ensure that the system can process different types of API gateways. The software package is a collection of codes containing the processing logic of the API gateway, developed by third-party service providers according to the uniformly defined interface specifications and uniformly named (such as Package 1 provided by Service Provider 1, Package 2 and Package 3 provided by Service Provider 2, and Package 4 provided by Service Provider n). The software package is dynamically loaded through the adapter plugin to ensure that the system can interact with different types of API gateways for data. Through the above process, the system can effectively manage different types of API gateways, ensure the synchronization and consistency of service data, API data, and policy configuration data, and at the same time dynamically execute tasks through task scheduling and the policy factory pattern to ensure the flexibility and scalability of the system.
[0061] In this embodiment, the gateway information input externally is obtained, where the gateway information includes the communication protocol, domain name address, authentication parameters, type, and version of the interface gateway; the target policy implementation class is determined according to the gateway information, where the target policy implementation class defines the processing logic of the interface gateway, which ensures that the most appropriate processing strategy can be adopted for requests of different types or priorities, improving the system processing efficiency and response speed; according to the gateway information, the target software package is found from the preset software package library through the preset adapter plugin, and the target software package is called according to the target policy implementation class. The software package library includes software packages of the default manufacturer and software packages developed by other manufacturers based on the unified interface specifications, allowing the system to adapt to new business requirements or technology upgrades by adding or replacing software packages without modifying the core code. This design promotes compatibility and interoperability between different manufacturers, and at the same time enhances the flexibility, standardization, and scalability of the system.
[0062] In a feasible implementation manner, the steps in step S30 may include steps T10 to T30:
[0063] Step T10, if a network exception occurs when calling the target software package, then call the target software package again.
[0064] Step T20, if a data format error occurs when calling the target software package, then output an error prompt.
[0065] Step T30, if the number of exceptions occurring within a preset time exceeds a preset quantity, then temporarily interrupt the call to the target software package, where the exceptions include network exceptions and data format errors.
[0066] It should be noted that a network exception refers to a situation where the call fails due to network connection problems (such as timeouts, disconnections, etc.) when calling the target software package. A data format error refers to a situation where the data format returned when calling the target software package does not match the expected format, resulting in the system being unable to process the data normally. An error prompt is the prompt information output by the system when detecting a data format error, used to notify the user or administrator for processing. The preset quantity is the threshold of the number of exceptions set by the system. When the number of consecutive exceptions exceeds this threshold, the system will temporarily interrupt the call to the target software package to avoid further problems.
[0067] When the system calls the target software package, it first detects whether a network exception occurs. A network exception may be caused by reasons such as unstable network connection, unavailable target server, etc. If a network exception is detected, the system will call the target software package again. The re - call process is implemented through a retry mechanism. The system will try to call the target software package again after a certain time interval to ensure successful call after the network returns to normal. For example, when the system detects a network timeout when calling the target software package, it will try to call again after 5 seconds. If a data format error occurs when calling the target software package, the system will output an error prompt. A data format error may be caused by the data format returned by the target software package not matching the format expected by the system. The process of outputting an error prompt is to record the error information in the log and notify the user or administrator for processing. For example, when the system finds that the data format returned when calling the target software package does not conform to the JSON (a file format) specification, the system will output a prompt message of "data format error". If the number of consecutive exceptions exceeds the preset quantity, the system will temporarily interrupt the call to the target software package. The preset quantity is the threshold of the number of exceptions set by the system, such as 3 times. The process of temporarily interrupting the call is implemented through a circuit - breaker mechanism. The system will stop calling the target software package within a certain time to avoid further problems. For example, when the system encounters network exceptions three consecutive times when calling the target software package, it will temporarily interrupt the call and try to call again after 30 minutes.
[0068] Furthermore, in a highly available system, the retry mechanism and the circuit breaker mechanism can ensure that the system remains somewhat available even when there are network anomalies or the service is unavailable. In a distributed system, through error prompts and the circuit breaker mechanism, problems can be detected and handled in a timely manner to prevent them from spreading throughout the system.
[0069] Furthermore, the retry interval and the number of retries can also be dynamically adjusted according to the network conditions. For example, when the network conditions are poor, the retry interval can be increased and the number of retries can be reduced. The detailed information of the error prompt can be increased, such as the error code, the reason for the error, etc., to facilitate users or administrators to quickly locate the problem. The circuit breaker time can be dynamically adjusted according to the type and frequency of the anomaly. For example, when network anomalies occur frequently, the circuit breaker time can be extended.
[0070] This embodiment effectively improves the stability and reliability of the system by detecting and handling abnormal situations such as network anomalies and data format errors, as well as implementing the circuit breaker mechanism, ensures the correct invocation of the target software package, and reduces the system risks caused by continuous anomalies.
[0071] Based on Embodiment 1 of this application, in Embodiment 2 of this application, the content that is the same as or similar to the above Embodiment 1 can be referred to the above introduction and will not be elaborated hereinafter. On this basis, referring to Figure 3 , the steps of step S20 further include steps A10 to A30:
[0072] Step A10, determine whether the gateway information is qualified gateway information according to the communication protocol, the domain name address, and the authentication parameters;
[0073] Step A20, if the gateway information is qualified gateway information, extract the characteristic parameters from the qualified gateway information, where the characteristic parameters include the type and version of the interface gateway;
[0074] Step A30, query the target policy implementation class that matches the characteristic parameters in the preset policy implementation class library.
[0075] It should be noted that the communication protocol is the data transmission protocol used by the interface gateway to determine how data is transmitted through the network. The domain name address is the network address of the interface gateway, which is used to identify the location of the gateway. The authentication parameter is the credential used to verify the identity of the interface gateway to ensure the security of the request. The qualified gateway information refers to the gateway information in which the communication protocol, the domain name address, and the authentication parameters meet the system requirements, ensuring that the system can process the requests of this gateway safely and effectively. The characteristic parameters are the key attributes extracted from the qualified gateway information, such as the type and version of the interface gateway, which are used to match the policy implementation class. The policy implementation class library is a collection that stores multiple policy implementation classes, and each policy implementation class is associated with specific characteristic parameters and is used to process different types of interface gateways. The target policy implementation class is the policy implementation class that matches the characteristic parameters and defines the processing logic of the interface gateway.
[0076] The system first determines whether the gateway information is qualified gateway information based on the communication protocol, domain name address, and authentication parameters. The process of determining qualified gateway information is to verify whether the communication protocol is a protocol supported by the system, whether the domain name address is a valid network address, and whether the authentication parameters meet the security requirements of the system. If the gateway information is qualified gateway information, the system extracts characteristic parameters from the qualified gateway information, including the type and version of the interface gateway. The process of extracting characteristic parameters is to parse the qualified gateway information and filter out the key attributes related to the processing logic. For example, if the qualified gateway information is "Type: A, Version: 1.0", the system extracts "Type" and "Version" as characteristic parameters. Next, the system queries the preset policy implementation class library to find the target policy implementation class that matches the characteristic parameters. The process of querying the policy implementation class library is to match the type and version in the characteristic parameters to find a suitable policy implementation class from the policy implementation class library. For example, if the characteristic parameters are "Type: A, Version: 1.0", the system will search for a policy implementation class that matches the "A" type and "1.0" version in the policy implementation class library.
[0077] Furthermore, in a microservices architecture, the type and version of the interface gateway may change frequently. Through the solution of this embodiment, the policy implementation class can be dynamically matched to adapt to the changes of the gateway and reduce manual intervention. In a multi-tenant system, different tenants may use different types of interface gateways. Through the solution of this embodiment, a suitable policy implementation class can be matched for each tenant to achieve personalized gateway management.
[0078] Furthermore, more characteristic parameters can be added, such as the protocol type and authentication method of the gateway, to improve the accuracy of policy matching. A more efficient data structure (such as a hash table) can be used to store the policy implementation classes to speed up the query. An automated tool can be developed to automatically extract characteristic parameters according to the gateway information to reduce the workload of manual configuration.
[0079] This embodiment realizes the flexible management and processing of different types and versions of interface gateways by extracting characteristic parameters from the gateway information and quickly matching the corresponding processing logic in the preset policy implementation class library, improving the scalability and processing efficiency of the system.
[0080] In a feasible implementation manner, after step A20, steps B10 to B20 are further included:
[0081] Step B10, if no target policy implementation class that matches the characteristic parameters is found, then for each policy implementation class in the policy implementation class library, calculate the matching degree between each parameter in the characteristic parameters and the policy implementation class, and perform weighted calculation on the matching degree according to the preset weight parameters to obtain the similarity between the policy implementation class and the characteristic parameters;
[0082] Step B20: Select the policy implementation class with the highest similarity from the similarities corresponding to each policy implementation class in the policy implementation library as the target policy implementation class.
[0083] It should be noted that the matching degree refers to the similarity between the feature parameters and the policy implementation class, and this similarity can be quantified through weighted calculation. The similarity is the quantified result of the matching degree and is used to measure the closeness between the policy implementation class and the feature parameters. The higher the similarity, the more suitable the policy implementation class is for processing the current gateway request.
[0084] When the system cannot query a policy implementation class in the policy implementation library that exactly matches the feature parameters, the system will perform a weighted calculation based on the matching degrees between each feature parameter and the policy implementation class to obtain the similarities of each policy implementation class in the policy implementation library. The calculation of the matching degree is performed by comparing the attributes of the feature parameters and the policy implementation class, such as the gateway type, version, etc., and calculating their closeness in terms of value or logic. The weighted calculation means assigning a weight to each feature parameter and calculating the overall similarity based on the weights. For example, the weight of the gateway type may be higher than the version number because the type has a greater impact on the processing logic. After the calculation is completed, the system will obtain the similarity score of each policy implementation class. Next, the system determines the policy implementation class with the highest similarity from the policy implementation library. Determining the policy implementation class with the highest similarity is done by comparing the similarity scores of all policy implementation classes and selecting the class with the highest score as the policy implementation class for processing the current gateway request. For example, assume there are three classes in the policy implementation library with similarity scores of 0.8, 0.7, and 0.9 respectively. The system will select the policy implementation class with a score of 0.9 to process the request.
[0085] The core idea of similarity calculation is to find the policy implementation class that is most suitable for processing the current gateway request by quantifying the closeness between the feature parameters and the policy implementation class attributes. The advantage of this method is that even if there is no exactly matching policy implementation class, the system can find the closest solution through similarity calculation to ensure that the request can be processed.
[0086] Furthermore, in scenarios where the gateway type and version change frequently, the most appropriate policy implementation class can be dynamically selected through similarity calculation, reducing manual intervention. In scenarios where multi-version interface gateways are supported, the most appropriate policy implementation class can be selected for the new version gateway through similarity calculation to ensure compatibility.
[0087] Furthermore, the weights of feature parameters can be dynamically adjusted according to the actual scenario. For example, in a certain scenario, the importance of the version number is higher than that of the type, and the system can automatically adjust the weights. More complex similarity algorithms, such as cosine similarity or Euclidean distance, can be adopted to improve the matching accuracy. The policy implementation class library can be updated regularly to add more types of policy implementation classes and improve the adaptability of the system.
[0088] In this embodiment, when a suitable policy implementation class cannot be directly matched, the similarity is calculated by weighted matching degree between the feature parameters and the policy implementation class, so as to automatically select the closest policy implementation class to process the gateway request, ensuring the flexibility and accuracy of the system in processing requests.
[0089] Based on Embodiment 1 or Embodiment 2 of this application, in Embodiment 3 of this application, the same or similar content as that in Embodiment 1 or Embodiment 2 above can be referred to the above introduction and will not be elaborated hereinafter. After the steps of Step S30, the steps C10 to C40 are further included:
[0090] Step C10, determine the preset data acquisition conversion interface specification and data configuration distribution interface specification. Among them, the data acquisition conversion interface specification is used to specify the rules for converting software packages into preset data formats, and the data configuration distribution interface specification is used to specify the rules for distributing data configurations of software packages to the target interface;
[0091] Step C20, mark the data acquisition conversion interface specification and the data configuration distribution interface specification as the first version number and save them to the preset interface specification document library;
[0092] Step C30, obtain the software packages developed by other manufacturers based on the data acquisition conversion interface specification and the data configuration distribution interface specification corresponding to the first version number in the interface specification document library;
[0093] Step C40, store the software packages sent by other manufacturers and the software packages of the preset default manufacturer together in the preset software package library.
[0094] It should be noted that the data acquisition and conversion interface specification defines the rules and standards for obtaining data from the interface gateway and converting it into a preset data format, ensuring that API gateways from different vendors can provide data according to a unified specification. The data configuration distribution interface specification defines the rules for pushing configuration data to the target interface, ensuring that the system can distribute configuration information according to a unified specification. The first version number is used to identify the initial version number of the interface specification document, ensuring that the system can distinguish different versions of the interface specification document. The interface specification document library is a collection that stores multiple interface specification documents, facilitating system access and use. The software package is a collection of codes containing the processing logic of the API gateway, usually provided in the form of an SDK (Software Development Kit, a file format). These software packages are developed according to the data acquisition and conversion interface specification and the data configuration distribution interface specification, ensuring that the system can interact with different types of API gateways. The software package library is a collection that stores multiple software packages, including software packages from the default vendor and software packages developed by other vendors based on the unified interface specification, ensuring that the system can dynamically load suitable software packages according to requirements.
[0095] The system first determines the preset data acquisition and conversion interface specification and the data configuration distribution interface specification. The data acquisition and conversion interface specification defines the rules for obtaining data from the interface gateway and converting it into a preset data format, such as how to extract data such as systems, applications, and services from the gateway and convert it into a unified format. The data configuration distribution interface specification defines the rules for pushing configuration data to the target interface, such as how to distribute information such as policy configurations and API configurations to the gateway. The process of determining these specifications is to define a unified interface protocol by analyzing the general requirements of the onboarding gateway and combining with the SPI mechanism. Next, the system marks the data acquisition and conversion interface specification and the data configuration distribution interface specification with the first version number and saves them to the preset interface specification document library. The process of saving the interface specification document is to store the document in the system's document library for subsequent access and use. For example, the system saves "Data Acquisition and Conversion Interface Specification_v1.0" and "Data Configuration Distribution Interface Specification_v1.0" to the interface specification document library. Then, the system obtains software packages sent by other vendors that are developed based on the data acquisition and conversion interface specification and the data configuration distribution interface specification corresponding to the first version number in the interface specification document library. The process of obtaining the software packages is to cooperate with the vendors, require them to develop SDK packages according to the specification, and upload these packages to the system. Finally, the system stores the software packages sent by these other vendors and the preset software packages of the default vendor together in the preset software package library. The process of storing the software packages is to store these SDK packages in the system's software package library, ensuring that the system can dynamically load suitable software packages according to requirements. When there are no software packages provided by the vendors, the system can try to call the preset software packages of the default vendor.
[0096] Furthermore, in a multi-cloud environment, different cloud service providers may use different types of interface gateways. Through the solution of this embodiment, these interface gateways can be uniformly managed, simplifying the management and data synchronization operations of interface gateways in a multi-cloud environment. In the Internet of Things scenario, devices from different manufacturers may use different interface protocols. Through the solution of this embodiment, different manufacturers' interface protocols can be quickly adapted to achieve the rapid access and management of Internet of Things devices.
[0097] Furthermore, automated tools can also be developed to automatically generate data acquisition and conversion interface specifications and data configuration distribution interface specifications according to the general requirements of the managed gateways, reducing the workload of manual definition. A version management mechanism can be introduced to ensure that the system can support different versions of the SDK packages and perform version switching when needed. When dynamically loading the SDK packages, a caching mechanism can be adopted to reduce the overhead of repeated loading and improve the system performance.
[0098] This embodiment realizes the efficient management and data interaction of different interface gateways by formulating unified data acquisition and conversion and configuration distribution interface specifications and obtaining software packages developed based on these specifications, enhancing the compatibility and scalability of the system.
[0099] In a feasible implementation manner, the steps of step C20 further include steps C201 to C204:
[0100] Step C201, query for a software package corresponding to the type and version in the gateway information in the software package library;
[0101] Step C202, if a software package corresponding to the type and version in the gateway information is found, establish a first mapping relationship between the gateway information and the corresponding software package;
[0102] Step C203, if a software package corresponding to the type and version in the gateway information is not found, input the gateway information into a pre-trained learning model, and establish a second mapping relationship between the predicted software package output by the learning model and the gateway information;
[0103] Step C204, store the first mapping relationship and the second mapping relationship in a preset memory mapping table.
[0104] It should be noted that in this embodiment, the type and version in the gateway information are key parameters for identifying a specific interface gateway. The software package library is a centralized storage area that contains all available software packages developed by the default vendor and other vendors based on a unified interface specification. Querying refers to the process by which the system searches for matching items in the software package library according to given conditions (such as type and version). The first mapping relationship refers to the association established between the gateway information and the software package when a software package matching the type and version in the gateway information is found. The second mapping relationship is established between the gateway information and the predicted software package by predicting the most suitable software package through a pre-trained learning model in the case where no matching software package is found. The memory mapping table is an efficient data structure used to store and quickly retrieve these mapping relationships.
[0105] First, the system parses the externally input gateway information and extracts the key parameters therein, namely the type and version. Next, the system queries the software package library for software packages that match these key parameters. This query process involves traversing all entries in the software package library and checking whether each software package meets the given type and version requirements. If a matching software package is found, the system immediately establishes the first mapping relationship between the gateway information and the software package. This mapping relationship clarifies which software package should be used to process specific gateway information. If the query fails to find a software package that matches the type and version in the gateway information, the system will take further measures. At this time, the system inputs the gateway information into the pre-trained learning model. This learning model is trained with a large amount of historical data and can predict the most suitable software package based on the characteristics of the gateway information. The output result of the learning model is one or more candidate software packages. The system selects the software package with the highest score as the predicted software package and establishes the second mapping relationship between the gateway information and the predicted software package. Whether the first mapping relationship or the second mapping relationship is established, the system stores these mapping relationships in a preset memory mapping table. The memory mapping table uses an efficient data structure (such as a hash table or a B-tree) that supports fast insertion, update, and lookup operations. This ensures that the software package corresponding to specific gateway information can be quickly located in subsequent steps. In addition, to improve performance, the system introduces a multi-level caching mechanism. The first-level cache stores the most recently used mapping relationships, the second-level cache stores the more commonly used mapping relationships, and so on, reducing repeated calculations and improving the response speed.
[0106] In a specific application scenario, such as an API gateway management system of a large enterprise, this process allows the system to quickly adapt to new interface gateway changes while maintaining support for multiple third-party software packages. To optimize this process, the system can introduce automated tools to simplify the maintenance and update of the software package library. For example, a notification is triggered when a new version of a software package is detected, and the administrator is guided to make necessary adjustments. In addition, the system can integrate intelligent monitoring and alarm mechanisms to track the development progress and quality of software packages in real time, early warning of potential problems, and helping administrators take timely measures.
[0107] For a large-scale distributed environment, a sharding storage strategy can be considered to optimize the performance of the software package library. By distributing the software package library to multiple nodes, the query speed and the fault tolerance of the system can be improved. At the same time, caching technology is used to accelerate the access to frequently used software packages and reduce the repeated loading time. These optimization measures not only improve the efficiency of the system, but also enhance its reliability and scalability.
[0108] Furthermore, in a scenario where the gateway type and version change frequently, the appropriate software package can be quickly found and loaded through the memory mapping table, reducing manual intervention. In a multi-tenant system, different tenants may use different types of interface gateways. Through the memory mapping table, the appropriate software package can be quickly found for each tenant to achieve personalized gateway management.
[0109] Furthermore, more attributes can be added as keys, such as the protocol type and authentication method of the gateway, to improve the accuracy of the mapping relationship. A more efficient data structure (such as a red-black tree) can be used to store the mapping relationship to speed up the search. Automated tools can be developed to automatically generate the mapping relationship based on gateway information and software package attributes, reducing the workload of manual configuration.
[0110] In this embodiment, by establishing the mapping relationship between gateway information and software packages and storing it in the memory mapping table, the rapid response and processing of interface gateway requests are realized, the efficiency of the system for finding and loading software packages is significantly improved, and the efficient management and flexible adaptation for different gateways are ensured.
[0111] In a feasible implementation manner, the steps of step S30 further include steps D10~D20:
[0112] Step D10, input the gateway information into a preset memory mapping table, and query the software package information corresponding to the gateway information in the memory mapping table;
[0113] Step D20, call the software package information corresponding to the gateway information according to the preset adapter plugin, and find the target software package from the preset software package library.
[0114] It should be noted that the memory mapping table is an efficient lookup structure used to store and quickly retrieve the mapping relationship between gateway information and software packages. This table establishes an association by using gateway information as the key and software package information as the value. The adapter plugin is the component responsible for dynamically selecting and loading appropriate software packages based on gateway information. The software package library contains all available software packages, including official software packages provided by default manufacturers and software packages developed by other manufacturers based on a unified interface specification.
[0115] When the system receives externally input gateway information, it first parses this information to extract key parameters such as communication protocol, domain name address, authentication parameters, type, and version. Then, the system uses these key parameters as keys to query the records in the memory mapping table. The memory mapping table has been pre-populated with the mapping relationships from gateway information to software package information, which are constructed by the adapter plugin according to the latest interface specification document library when the system starts up or is updated. Therefore, when querying the memory mapping table, the system can quickly find the software package information that matches the current gateway information. Next, the system invokes the software package information corresponding to the gateway information based on the adapter plugin. The adapter plugin determines the specific software package to be loaded by reading the software package information stored in the memory mapping table. The adapter plugin will check the software package library to ensure that the target software package exists and that its version and features meet the requirements of the current gateway. This process utilizes the SPI mechanism to automatically discover and load appropriate implementation classes through a configuration file. The adapter plugin may also apply additional verification steps, such as checking digital signatures to ensure the security of the software package source. Once the target software package is determined, the adapter plugin will load the software package from the software package library. During the loading process, the adapter plugin may execute initialization logic, such as setting necessary configuration parameters or establishing network connections. To improve performance, the system can introduce a multi-level caching mechanism to cache commonly used software package information, reducing the number of repeated calculations and database queries. In addition, for software packages that are not frequently used, a lazy loading mechanism can be adopted to load them into memory only when they are first called, saving resources. During this process, if multiple possible software packages are encountered, the adapter plugin can select the optimal one according to a preset priority order. For example, for the same type of API gateway, software packages of a new version are usually given priority. At the same time, the system can also integrate an intelligent association model, using historical data to train a neural network model to predict the most suitable software package, further optimizing the selection process.
[0116] Furthermore, in practical application scenarios, such as the service governance platform within an enterprise, the parsing of gateway information and the query of the memory mapping table can be completed in an extremely short time, ensuring a quick response to user requests. By implementing the memory mapping table using efficient data structures such as hash tables, the query speed can be significantly improved. In addition, for large-scale distributed systems, load balancing strategies can be combined to distribute requests among multiple nodes, ensuring the stability and high availability of the system.
[0117] Furthermore, a hot update mechanism can also be considered to allow the memory mapping table and software package library to be updated without downtime, thus ensuring the continuous operation of the system. In addition, by regularly reviewing and updating security policies and promptly patching known vulnerabilities, the security of the system can be maintained. Finally, to enhance the self-healing ability of the system, monitoring and alarm functions can be added to track the status of the API gateway in real time, pre-warn potential problems, and help administrators take timely measures.
[0118] This embodiment significantly improves the efficiency and accuracy of the system in processing interface gateway requests by constructing query conditions based on gateway information and quickly matching target software packages in the memory mapping table using an adapter plugin, ensuring the precise loading and efficient utilization of software packages.
[0119] In a feasible implementation manner, after step C10, steps E10 to E30 are further included:
[0120] Step E10, when it is detected that the data acquisition conversion interface specification and the data configuration distribution interface specification are updated, mark the updated data acquisition conversion interface specification and data configuration distribution interface specification with a second version number and save them to the interface specification document library;
[0121] Step E20, obtain new software packages developed by other manufacturers based on the data acquisition conversion interface specification and the data configuration distribution interface specification corresponding to the second version number in the interface specification document library;
[0122] Step E30, store the new software packages in a preset software package library.
[0123] It should be noted that when updates are detected in the data acquisition and transformation interface specification and the data configuration distribution interface specification, the system will mark these updated specifications with a new version number (such as the second version number) and save them to the interface specification document library. The interface specification document library is a place that centrally stores all versions of the data acquisition and transformation interface specification and the data configuration distribution interface specification, ensuring unified management and version control of the specifications. Other manufacturers can develop software packages according to the data acquisition and transformation interface specification and the data configuration distribution interface specification corresponding to the second version number in the latest interface specification document library. The developed software packages will then be sent to the system and stored in a preset software package library. The software package library contains all available software packages developed by the default manufacturer and other manufacturers based on different versions of the interface specification.
[0124] First, the system periodically checks whether there are updates in the data acquisition and transformation interface specification and the data configuration distribution interface specification. If there are updates, the system will generate a new version number (such as the second version number) and associate the updated specification file with the new version number. This process involves reading the content of the new specification, verifying its correctness and integrity, and then storing it in the interface specification document library. The interface specification document library is used to store and manage specification files of multiple versions, ensuring that each version can be accurately traced and used. Next, other manufacturers can access the interface specification document library and download the data acquisition and transformation interface specification and the data configuration distribution interface specification corresponding to the latest second version number. The manufacturers develop compatible software packages according to these specifications. During the development process, the manufacturers need to strictly implement according to the specification requirements to ensure that the software packages can be seamlessly docked with the adapter plugins of the system. Once the development is completed, the manufacturers send the software packages back to the system, usually through a secure transmission protocol to ensure the security of the data. After receiving the software packages sent by the manufacturers, the system will perform a series of verification operations on them, including but not limited to digital signature verification, format check, etc., to ensure the security and compatibility of the software packages. After passing the verification, the system stores the software packages in a preset software package library. The software package library is a centralized storage area that contains software packages from different manufacturers and different versions. For easy management and search, each software package will be tagged with information recording its corresponding interface specification version number and other metadata.
[0125] Furthermore, for example, in an API gateway management system of a large enterprise, such a process allows the system to quickly adapt to new interface specification changes while maintaining support for multiple third-party software packages. To optimize this process, the system can introduce automated tools to simplify the specification update and software package verification steps. For example, trigger a notification when an interface specification update is detected and guide the manufacturers to make necessary adjustments. In addition, the system can integrate intelligent monitoring and alarm mechanisms to track the development progress and quality of software packages in real time, give early warnings of potential problems, and help administrators take measures in a timely manner.
[0126] Furthermore, for large-scale distributed environments, a sharding storage strategy can be considered to optimize the performance of the software package library. By distributing the software package library across multiple nodes, the query speed and the fault tolerance of the system can be improved. At the same time, caching technology is used to accelerate the access to frequently used software packages and reduce the repeated loading time. These optimization measures not only enhance the efficiency of the system but also improve its reliability and scalability.
[0127] In this embodiment, by generating and saving interface specification documents with different version numbers, the change history of the interface specifications for data acquisition conversion and configuration distribution is effectively managed, facilitating system developers to consult and track the updates of the interface specifications, and ensuring the accuracy and consistency of system implementation.
[0128] It should be noted that the above examples are only for understanding this application and do not constitute a limitation on the interface gateway management method based on the adapter plug-in mode of this application. Any simple transformations in more forms based on this technical concept are within the protection scope of this application.
[0129] This application also provides an interface gateway management device based on the adapter plug-in mode. Please refer to Figure 4 , the interface gateway management device based on the adapter plug-in mode includes:
[0130] An acquisition gateway module 10 that acquires externally input gateway information, where the gateway information includes the communication protocol, domain name address, authentication parameters, type, and version of the interface gateway;
[0131] A determination policy module 20 that determines a target policy implementation class according to the gateway information, where the target policy implementation class defines the processing logic of the interface gateway;
[0132] A determination software package module 30 that, according to the gateway information, searches for a target software package from a preset software package library through a preset adapter plug-in and calls the target software package according to the target policy implementation class, where the software package library includes software packages of the default manufacturer and software packages developed by other manufacturers based on a unified interface specification.
[0133] The interface gateway management device based on the adapter plug-in mode provided by this application adopts the interface gateway management method based on the adapter plug-in mode in the above embodiment, and can solve the technical problem of unbalanced management of the interface gateway based on the adapter plug-in mode. Compared with the prior art, the beneficial effects of the interface gateway management device based on the adapter plug-in mode provided by this application are the same as those of the interface gateway management method based on the adapter plug-in mode provided in the above embodiment, and other technical features in the interface gateway management device based on the adapter plug-in mode are the same as the features disclosed in the above embodiment method, and will not be elaborated here.
[0134] This application provides an interface gateway management device based on the adapter plugin mode. The interface gateway management device based on the adapter plugin mode includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein, the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the interface gateway management method based on the adapter plugin mode in the first embodiment above.
[0135] Reference is made below Figure 5 , which shows a schematic structural diagram of an interface gateway management device based on the adapter plugin mode suitable for implementing the embodiments of the present application. The interface gateway management device based on the adapter plugin mode in the embodiments of the present application may include, but is not limited to, mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistant), PADs (Portable Application Description: tablet computers), PMPs (Portable Media Players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 5 The interface gateway management device based on the adapter plugin mode shown is only an example and should not impose any limitation on the functions and usage scope of the embodiments of the present application.
[0136] As Figure 5As shown, the interface gateway device for managing devices based on the adapter plug-in mode may include a processing device 1001 (such as a central processing unit, a graphics processing unit, etc.), which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM: Read Only Memory) 1002 or the program loaded from the storage device 1003 into the random access memory (RAM: Random Access Memory) 1004. In the RAM 1004, various programs and data required for the operation of the interface gateway device for managing devices based on the adapter plug-in mode are also stored. The processing device 1001, the ROM 1002, and the RAM 1004 are connected to each other through a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Generally, the following systems may be connected to the I / O interface 1006: an input device 1007 including, for example, a touch screen, a touch pad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; an output device 1008 including, for example, a liquid crystal display (LCD: Liquid Crystal Display), a speaker, a vibrator, etc.; a storage device 1003 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 1009. The communication device 1009 can allow the interface gateway device for managing devices based on the adapter plug-in mode to communicate with other devices wirelessly or wiredly to exchange data. Although the figure shows an interface gateway device for managing devices based on the adapter plug-in mode with various systems, it should be understood that it is not required to implement or have all the systems shown. Instead, more or fewer systems may be implemented or had.
[0137] In particular, according to the embodiments disclosed in the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program contains program codes for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication device, or installed from the storage device 1003, or installed from the ROM 1002. When the computer program is executed by the processing device 1001, the above functions defined in the method of the embodiments disclosed in the present application are executed.
[0138] The interface gateway management device based on the adapter plugin mode provided by this application adopts the interface gateway management method based on the adapter plugin mode in the above embodiments, which can improve the standardization and scalability of interface gateway management. Compared with the prior art, the beneficial effects of the interface gateway management device based on the adapter plugin mode provided by this application are the same as those of the interface gateway management method based on the adapter plugin mode provided by the above embodiments, and other technical features in the interface gateway management device based on the adapter plugin mode are the same as the features disclosed in the method of the previous embodiment, which will not be elaborated here.
[0139] It should be understood that each part disclosed in this application can be implemented by hardware, software, firmware or a combination thereof. In the description of the above embodiments, specific features, structures, materials or characteristics can be combined in a suitable manner in any one or more embodiments or examples.
[0140] The above are only the specific implementation manners of this application, but the protection scope of this application is not limited thereto. Any person skilled in the art within the technical scope disclosed in this application can easily think of changes or substitutions, which should all be covered by the protection scope of this application. Therefore, the protection scope of this application should be subject to the protection scope of the claims.
[0141] This application provides a medium, which is a computer-readable storage medium with computer-readable program instructions (i.e., computer programs) stored thereon. The computer-readable program instructions are used to execute the interface gateway management method based on the adapter plugin mode in the above embodiments.
[0142] The computer-readable storage medium provided by this application can be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems or devices, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: electrical connections with one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM) or flash memory, optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the above. In this embodiment, the computer-readable storage medium can be any tangible medium that contains or stores a program, and this program can be used by or in combination with an instruction execution system or device. The program code contained on the computer-readable storage medium can be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination of the above.
[0143] The above computer-readable storage medium can be included in an interface gateway management device based on the adapter plug-in mode; it can also exist separately and not be assembled into an interface gateway management device based on the adapter plug-in mode.
[0144] The above computer-readable storage medium carries one or more programs. When the above one or more programs are executed by an interface gateway management device based on the adapter plug-in mode, the interface gateway management device based on the adapter plug-in mode is enabled to:
[0145] Obtain externally input gateway information, where the gateway information includes the communication protocol, domain name address, authentication parameters, type, and version of the interface gateway;
[0146] Determine a target policy implementation class according to the gateway information, where the target policy implementation class defines the processing logic of the interface gateway;
[0147] According to the gateway information, search for a target software package from a preset software package library through a preset adapter plug-in, and call the target software package according to the target policy implementation class. The software package library includes software packages of the default manufacturer and software packages developed by other manufacturers based on a unified interface specification.
[0148] Computer program code for performing the operations of this application can be written in one or more programming languages or combinations thereof. The above-mentioned programming languages include object-oriented programming languages such as Java, Smalltalk, C++, and also include conventional procedural programming languages such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, executed as a stand-alone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer can be connected to the user's computer through any kind of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computer (for example, by connecting through an Internet service provider using the Internet).
[0149] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architectures, functions, and operations of systems, methods, and computer program products according to various embodiments of this application. In this regard, each block in the flowchart or block diagram may represent a module, a program segment, or a part of code that contains one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order than marked in the accompanying drawings. For example, two consecutive blocks shown may actually be executed substantially in parallel, and they may sometimes be executed in the reverse order, depending on the functions involved. It should also be noted that each block in the block diagram and / or flowchart, and combinations of blocks in the block diagram and / or flowchart, can be implemented by a dedicated hardware-based system for performing the specified functions or operations, or can be implemented by a combination of dedicated hardware and computer instructions.
[0150] The modules described in the embodiments of this application can be implemented in software or in hardware. Among them, the name of the module does not constitute a limitation on the unit itself in some cases.
[0151] The readable storage medium provided by this application is a computer-readable storage medium. The computer-readable storage medium stores computer-readable program instructions (i.e., computer programs) for performing the above-mentioned interface gateway management method based on the adapter plug-in mode, which can improve the standardization and scalability of interface gateway management. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided by this application are the same as those of the interface gateway management method based on the adapter plug-in mode provided in the above embodiments, and will not be elaborated here.
[0152] The present application also provides a product, which is a computer program product including a computer program. When the computer program is executed by a processor, it implements the steps of the interface gateway management method based on the adapter plugin mode as described above.
[0153] The computer program product provided by the present application can improve the standardization and scalability of interface gateway management. Compared with the prior art, the beneficial effects of the computer program product provided by the present application are the same as those of the interface gateway management method based on the adapter plugin mode provided in the above embodiments, and will not be elaborated here.
[0154] The above are only partial embodiments of the present application, and do not limit the patent scope of the present application. Any equivalent structural transformation made by using the content of the specification and drawings of the present application under the technical concept of the present application, or any direct / indirect application in other related technical fields is included in the patent protection scope of the present application.
Claims
1. An interface gateway management method based on the adapter plugin mode, characterized in that The interface gateway management method based on the adapter plugin mode includes: Obtain the gateway information input externally, where the gateway information includes the communication protocol, domain name address, authentication parameters, type, and version of the interface gateway; Determine the target policy implementation class according to the gateway information, where the target policy implementation class defines the processing logic of the interface gateway, and the step of determining the target policy implementation class according to the gateway information includes: Determine whether the gateway information is qualified gateway information according to the communication protocol, domain name address, and authentication parameters; If the gateway information is qualified gateway information, extract the feature parameters from the qualified gateway information, where the feature parameters include the type and version of the interface gateway; Query the target policy implementation class matching the feature parameters in the preset policy implementation class library; According to the gateway information, find the target software package from the preset software package library through the preset adapter plugin, and call the target software package according to the target policy implementation class, where the software package library includes software packages of the default manufacturer and software packages developed by other manufacturers based on the unified interface specification. The step of finding the target software package from the preset software package library through the preset adapter plugin according to the gateway information includes: Input the gateway information into the preset memory mapping table, and query the software package information corresponding to the gateway information in the memory mapping table. The memory mapping table includes a first-level cache and a second-level cache. The first-level cache stores the recently used mapping relationships, and the second-level cache stores the commonly used mapping relationships. The mapping relationship is the relationship between the software package and the gateway information; Call the software package information corresponding to the gateway information according to the preset adapter plugin, and find the target software package from the preset software package library.
2. The interface gateway management method based on the adapter plugin mode according to claim 1, wherein After the step of querying the target policy implementation class matching the feature parameters in the preset policy implementation class library includes: If the target policy implementation class matching the feature parameters is not found, calculate the matching degree between each parameter in the feature parameters and each policy implementation class in the policy implementation class library, and perform weighted calculation on the matching degree according to the preset weight parameters to obtain the similarity between the policy implementation class and the feature parameters; Select the policy implementation class with the highest similarity as the target policy implementation class from the similarities corresponding to each policy implementation class in the policy implementation class library.
3. The interface gateway management method based on the adapter plugin mode according to claim 1, characterized in that Before the step of finding the target software package from the preset software package library through the preset adapter plugin according to the gateway information includes: Determine the preset data acquisition conversion interface specification and data configuration distribution interface specification, where the data acquisition conversion interface specification is used to specify the rules for converting the software package into the preset data format, and the data configuration distribution interface specification is used to specify the rules for distributing the data configuration of the software package to the target interface; Mark the data acquisition conversion interface specification and the data configuration distribution interface specification with the first version number and save them to the preset interface specification document library. Obtain software packages sent by other manufacturers and developed based on the data acquisition and conversion interface specification corresponding to the first version number in the interface specification document library and the data configuration distribution interface specification; Store the software packages sent by the other manufacturers and the software packages of the preset default manufacturer together in a preset software package library.
4. The interface gateway management method based on the adapter plugin mode according to claim 3, wherein After the step of marking the data acquisition and conversion interface specification and the data configuration distribution interface specification with the first version number and saving them to a preset interface specification document library, the following steps are further included: When it is detected that the data acquisition and conversion interface specification and the data configuration distribution interface specification are updated, mark the updated data acquisition and conversion interface specification and the data configuration distribution interface specification with the second version number and save them to the interface specification document library; Obtain new software packages sent by other manufacturers and developed based on the data acquisition and conversion interface specification corresponding to the second version number in the interface specification document library and the data configuration distribution interface specification; Store the new software packages in a preset software package library.
5. The interface gateway management method based on the adapter plug-in mode according to claim 1, characterized in that Before the step of inputting the gateway information into a preset memory mapping table, the following steps are included: Query in the software package library for software packages corresponding to the type and version in the gateway information; If a software package corresponding to the type and version in the gateway information is queried, establish a first mapping relationship between the gateway information and the corresponding software package; If no software package corresponding to the type and version in the gateway information is queried, input the gateway information into a pre-trained learning model, and establish a second mapping relationship between the predicted software package output by the learning model and the gateway information; Store the first mapping relationship and the second mapping relationship in a preset memory mapping table.
6. The interface gateway management method based on the adapter plug-in mode according to claim 1, characterized in that After the step of invoking the target software package according to the target policy implementation class, the following steps are further included: If a network exception occurs when invoking the target software package, re-invoke the target software package; If a data format error occurs when invoking the target software package, output an error prompt; If the number of abnormal situations occurring within a preset time is greater than a preset quantity, temporarily interrupt the invocation of the target software package, where the abnormal situations include network exception situations and data format error situations.
7. An interface gateway managed device based on the adapter plugin mode, characterized in that, The interface gateway management device based on the adapter plug-in mode includes: a memory, a processor, and a computer program stored on the memory and executable on the processor, and the computer program is configured to implement the steps of the interface gateway management method based on the adapter plug-in mode according to any one of claims 1 to 6.
8. A computer-readable storage medium, characterized in that, A computer program is stored on a computer-readable storage medium, and when the computer program is executed by a processor, it implements the steps of the interface gateway management method based on the adapter plug-in mode according to any one of claims 1 to 6.
Citation Information
Patent Citations
API gateway management method and device based on plug-in
CN113595788A
Network management method and device, electronic equipment and storage medium
CN115037588A