API interface management method, device, equipment and storage medium based on big data
Configuring the database pool and generating target API interfaces through the interface management system enables querying of different data sources, solving the problems of large data volume and lack of fine-grained interface security control, and improving development efficiency and security.
Patent Information
- Application Number
- CN202311626330.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-29
- Publication Date
- 2024-09-13
- Estimated Expiration
- 2043-11-29
AI Technical Summary
During the report development process, data queries from different data sources lead to large amounts of data in the system and slow queries, which increase development costs and project cycles, and the interface security control is not fine-grained enough.
Configure database information through the interface management system, establish a database pool, match the target database, generate target data templates and API interfaces, perform interface management and authentication, and generate log information for monitoring and early warning to realize data query from different data sources.
Reduce development costs, improve development efficiency, improve interface security and control accuracy, and simplify data source configuration and operation processes.
Smart Images

Figure CN117633078B
Abstract
Description
Technical Field
[0001] The present application relates to the field of Internet technology, and in particular to a method, device, equipment and storage medium for API interface management based on big data. Background Art
[0002] In the report development process, the displayed data is all provided by API service calls. The development of interface services requires developers who understand programming languages. The program reads the database table data to return the results. Different data is often in different databases. Under the current circumstances, the amount of data in the system is large and the query is slow.
[0003] A common solution is to develop different API interface services to implement data query. This method not only increases the development cost and labor cost of developers, but also prolongs the project cycle. Currently, for the big data platform API interface service configured by templates, the external API interface service is configured according to the configuration template or drag table. The front-end page calls the interface service to interact with the database, which results in insufficient granularity in the control of interface security. Summary of the invention
[0004] The present application provides an API interface management method, device, equipment and storage medium based on big data. The present application realizes data query from different data sources, thereby reducing development costs and improving development efficiency.
[0005] The first aspect of the present application provides an API interface management method based on big data, and the API interface management method based on big data includes:
[0006] Configure database information through the interface management system, establish a database pool, and receive the interface processing request to be processed to perform database matching on the database pool to obtain the target database;
[0007] Generate a target data template for the interface processing request according to the target database, and generate a corresponding target API interface according to the target data template;
[0008] Creating multiple interface management operations, and performing interface management on the target API interface according to the multiple interface management operations to obtain multiple interface management operation information;
[0009] Create an interface authentication process, and perform authentication management on the target API interface according to the interface authentication process to obtain the target interface authentication result;
[0010] The target log information of the target API interface is generated according to the multiple interface management operation information and the target interface authentication result, and the interface management system is monitored and warned according to the target log information to obtain monitoring and warning feedback information.
[0011] The second aspect of the present application provides an API interface management device based on big data, and the API interface management device based on big data includes:
[0012] A matching module is used to configure database information through an interface management system, establish a database pool, and receive an interface processing request to be processed to perform database matching on the database pool to obtain a target database;
[0013] A processing module, used to generate a target data template for the interface processing request according to the target database, and generate a corresponding target API interface according to the target data template;
[0014] An interface management module is used to create multiple interface management operations, and perform interface management on the target API interface according to the multiple interface management operations to obtain multiple interface management operation information;
[0015] The authentication management module is used to create an interface authentication process, and perform authentication management on the target API interface according to the interface authentication process to obtain the target interface authentication result;
[0016] The monitoring and early warning module is used to generate target log information of the target API interface according to the multiple interface management operation information and the target interface authentication result, and monitor and warn the interface management system according to the target log information to obtain monitoring and early warning feedback information.
[0017] The third aspect of the present application provides an API interface management device based on big data, comprising: a memory and at least one processor, wherein instructions are stored in the memory; the at least one processor calls the instructions in the memory so that the API interface management device based on big data executes the above-mentioned API interface management method based on big data.
[0018] The fourth aspect of the present application provides a computer-readable storage medium, which stores instructions. When the computer-readable storage medium is run on a computer, it enables the computer to execute the above-mentioned big data-based API interface management method.
[0019] In the technical solution provided by the present application, a database pool is established through an interface management system and an interface processing request is received to match the database to obtain a target database; a target data template is generated according to the target database, and a target API interface is generated according to the target data template; multiple interface management operations are created and interface management is performed on the target API interface to obtain multiple interface management operation information; an interface authentication process is created and authentication management is performed on the target API interface to obtain a target interface authentication result; target log information is generated according to multiple interface management operation information and target interface authentication results, and the interface management system is monitored and warned according to the target log information to obtain monitoring and warning feedback information, and a dynamic data source big data API interface data query service or data query engine based on a data template configures different data source information according to the data template, and does not need to pay attention to the database type, and can realize data query of different data sources. The prior art needs to develop different data query interfaces according to different data requirements, which requires a lot of work for developers. The present application only needs to configure the data template and publish it as a data service. All operations have interface configurations, which is simple and convenient, and reduces development costs and improves development efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] Figure 1 This is a schematic diagram of an embodiment of the API interface management method based on big data in an embodiment of the present application;
[0021] Figure 2 A flowchart of obtaining a second data template matching strategy in an embodiment of the present application;
[0022] Figure 3 This is a schematic diagram of an embodiment of an API interface management device based on big data in an embodiment of the present application. DETAILED DESCRIPTION
[0023] The present application embodiment provides a kind of API interface management method, device, equipment and storage medium based on big data, for realizing data query of different data sources, thereby reducing development cost and improving development efficiency. The terms "first", "second", "third", "fourth", etc. (if any) in the specification and claims of this application and the above-mentioned drawings are used to distinguish similar objects, and do not have to be used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable in appropriate circumstances, so that the embodiments described here can be implemented in an order other than the content illustrated or described here. In addition, the term "including" or "having" and any variation thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0024] For ease of understanding, the specific process of the embodiment of the present application is described below. Figure 1 In the embodiment of the present application, an embodiment of the API interface management method based on big data includes:
[0025] S101, configuring database information through an interface management system, establishing a database pool, and receiving an interface processing request to be processed to perform database matching on the database pool to obtain a target database;
[0026] It is understandable that the execution subject of the present application can be an API interface management device based on big data, or a terminal or a server, which is not limited here. The present application embodiment is described by taking the server as the execution subject as an example.
[0027] Specifically, the interface management system configures external data sources. The configuration of external data sources includes not only third-party data sources, but also big data platform data to ensure the diversity and extensiveness of data. The purpose of configuring these data sources is to provide more abundant and real-time data support for the interface management system, making interface processing more efficient and accurate. A database pool is established based on the configured external data source. The role of this database pool is not just to simply store database link information, but also includes driver classes and driver packages to facilitate efficient connection and interaction with various databases. Such a design allows the system to quickly access appropriate database resources when processing interface requests, thereby improving overall processing efficiency and response speed. The system receives and processes interface requests, and parses the interface processing requests to obtain target request information, preparing for subsequent data matching and processing. The corresponding target data format is obtained according to the target request information, and compared with the database data format corresponding to multiple candidate databases in the database pool. If the data format of the target request information matches the data format of a candidate database in the database pool, then this candidate database is selected as the target database corresponding to the interface processing request. This process ensures the consistency and accuracy of data processing. If the data format of the target request information is inconsistent with the database data format in the database pool, the system will try to convert the data format of the target request information to the data format corresponding to the database information in the database pool, and determine whether the conversion is successful or not. If the data format conversion is successful, the converted target request information will be input into the database pool for database matching to obtain the adapted target database. This step reflects the flexibility and adaptability of the system, ensuring that the system can still efficiently process interface requests even when the data format is inconsistent.
[0028] S102, generating a target data template for an interface processing request according to a target database, and generating a corresponding target API interface according to the target data template;
[0029] Specifically, the target data template of the interface processing request is obtained according to the target database to ensure that the data format matches the interface requirements. If the server successfully obtains the target data template, it can directly generate the corresponding target API interface based on the template; but if the acquisition fails, the server adopts another strategy, that is, obtaining the interface service format corresponding to the target database. Based on the obtained interface service format, the server matches the candidate data template from the target database, and through in-depth analysis of the structure and format of the database, ensures that the matched data template can meet the requirements of the interface processing request. The candidate data template is pushed to the interface processing request. The server also queries whether the requester accepts these candidate data templates. This is an interactive and confirmation process to ensure that the pushed data template meets the expectations and requirements of the requester. If the requester accepts the pushed candidate data template, the server uses the API interface corresponding to the template as the target API interface. This means that the matched data template can already meet the data format and structure requirements of the interface processing request. However, if the requester does not accept the pushed candidate data template, the server takes further measures to adapt to the specific needs of the requester. In this case, the server makes necessary modifications and adjustments to the candidate data template to generate an interface service dedicated to the interface processing request. This customization process allows the server to create an interface service that is more precise and meets specific needs. The modified interface service is added to the list of preset data templates to improve the efficiency of processing similar requests in the future. The server determines the API interface of this dedicated interface service as the target API interface for the interface processing request.
[0030] The first data template is obtained from the existing data template list. The first data template usually defines a set of specific data structures and fields and is designed for specific data processing requirements. The server obtains the second data template corresponding to the first data template based on the preset matching strategy. This matching strategy selects the second data template that can supplement or enhance its function according to the characteristics and purpose of the first data template. The server determines the input data of the third data template based on the characteristics of the first and second data templates. The design of the third data template depends on the data structure and output of the first two templates. On this basis, the output data of the first data template is determined as the output data of the third data template to ensure the coherence and logical consistency of data processing. The server combines the first data template and the second data template to create a comprehensive third data template that meets specific data processing requirements. This combination process involves reconfiguring data fields, adjusting data structures, or introducing new data processing logic. After the combination is completed, the third data template is added to the data template list as a new entity, thereby updating the original data template list. This updated data template list reflects the latest data template configuration and provides the server with a wider range of data processing options. The server optimizes the first data template matching strategy based on the updated data template list to generate a more efficient second data template matching strategy. This strategy optimization process is intended to improve the accuracy and efficiency of data template matching to ensure that the data template can better meet the ever-changing data processing needs.
[0031] S103, creating multiple interface management operations, and performing interface management on the target API interface according to the multiple interface management operations to obtain multiple interface management operation information;
[0032] It should be noted that multiple interface management operations are created through the interface management system. These operations include key management functions such as interface list, interface release, interface authorization and interface offline. The main function of the interface list is to display the interface information that has been released, and provide operation options such as query, authorization, offline and deletion, so that the administrator can clearly understand the status and detailed information of all current interfaces. Interface release is the process of publishing the configured interface information online. This step ensures that the newly configured interface can be correctly integrated into the system and start to provide services. The function of interface authorization is to authorize the published interface to the target organization, allowing these organizations to obtain signatures and call interface services according to the authorization code. This process enhances the security and controllability of interface use. The interface offline function is used to offline the interface that has been released but not used temporarily from the system, which helps to optimize the use and management of system resources. Then, the server comprehensively manages the target API interface based on these interface management operations, and collects and generates relevant information for multiple interface management operations. This information includes the usage, authorization status, operation history, etc. of the interface, providing a comprehensive perspective for the server to observe and evaluate the performance and usage of the interface. For example, by analyzing the information in the interface list, the server identifies which interfaces are most popular and which need to be improved or updated. Information about interface releases can help the server monitor the integration and performance of new interfaces. Information about interface authorization helps maintain interface security because it helps the server track which organizations are authorized to use specific interfaces and how these interfaces are used. With information about interface offline, the server can reasonably allocate and adjust system resources to improve the overall efficiency and performance of the system.
[0033] S104, create an interface authentication process, and perform authentication management on the target API interface according to the interface authentication process to obtain the target interface authentication result;
[0034] Specifically, the server creates an interface authentication process, and performs a blacklist IP match on the target API interface according to the interface authentication process to obtain a blacklist IP match result. The server checks all IP addresses that attempt to access the API and compares them with the pre-defined blacklist IP to identify and block access requests from untrusted sources. The obtained blacklist IP match result can effectively prevent malicious access and network attacks. The server uses the blacklist IP match result to further perform whitelist IP match to confirm whether the access request comes from a verified and trusted source. Through whitelist matching, the server can ensure that only authorized users or organizations can access the API, thereby enhancing the security of the interface. The server triggers the current limit judgment on the target API interface based on the whitelist IP match result. Thus, abnormal traffic patterns are identified, such as a large number of access requests in a short period of time, which is caused by network attacks or system overloads. The result of the trigger current limit judgment helps the server implement traffic control when necessary to ensure the stability and responsiveness of the API service. The server performs a signature legitimacy judgment on the target API interface based on the trigger current limit judgment result. The server checks whether the signature of each access request is legal to ensure that the request is initiated by a legitimate user. Signature legitimacy judgment is a key link in ensuring the security of data exchange, and can effectively prevent data leakage and unauthorized access. The server performs load balancing based on the signature legitimacy judgment results. This process not only ensures the high availability of the service, but also intelligently allocates server resources according to the source and nature of the request. In this way, the server finally generates the target interface authentication result corresponding to the target API interface. This result is a comprehensive evaluation of the entire authentication process, which ensures the security, effectiveness and availability of the API interface, and also ensures the stability and response speed of the server when facing high-traffic requests. Through such an interface authentication process, the API interface management method based on big data can effectively respond to various security challenges and ensure the security and efficient operation of the API interface.
[0035] S105, generating target log information of the target API interface according to the multiple interface management operation information and the target interface authentication result, and performing monitoring and early warning on the interface management system according to the target log information to obtain monitoring and early warning feedback information.
[0036] Specifically, the server generates target log information of the target API interface based on multiple interface management operation information and target interface authentication results. These log information provide detailed records of interface operations and authentication processes, providing important data for subsequent analysis and monitoring. At the same time, the server also obtains system status information of the interface management system, including the system's operating status, resource usage, etc., to provide a basis for identifying the overall health status of the system. The server performs one-hot vector encoding processing on the collected target log information and converts the log information into a log encoding vector. One-hot encoding is a method of converting categorical variables into a form that can be understood by a machine learning model, which makes the log information easier to analyze and process. The processed log encoding vector is then input into a preset log monitoring model, which performs in-depth analysis of the log information and outputs log evaluation indicators. These indicators reflect the normality and abnormality of the interface operations and authentication conditions recorded in the log. The server inputs the system status information into a preset system status analysis model. This model focuses on extracting key features from the system status information and outputs system status features. These features help understand the current operating status of the system, including performance bottlenecks or potential failure points. The server determines whether the log evaluation indicators exceed the preset normal range and whether the system status features are abnormal. This judgment process is the core of the monitoring and early warning system. Through the comprehensive analysis of log evaluation indicators and system status characteristics, the server can accurately identify problems in interface operations and abnormal conditions in system status. If the log evaluation indicators exceed the preset threshold, or the system status characteristics show abnormal conditions, the server will generate monitoring and early warning feedback information. These feedback messages are warnings of the current status of the interface management system, prompting managers to take appropriate measures to solve the identified problems or anomalies. Through such a continuous and comprehensive process, the server not only ensures the efficient and safe operation of the interface, but also can promptly identify and respond to system problems, ensuring the stability and reliability of the entire interface management system.
[0037] In the embodiment of the present application, a database pool is established through an interface management system and an interface processing request is received to match the database, and a target database is obtained; a target data template is generated according to the target database, and a target API interface is generated according to the target data template; multiple interface management operations are created and interface management is performed on the target API interface to obtain multiple interface management operation information; an interface authentication process is created and authentication management is performed on the target API interface to obtain a target interface authentication result; target log information is generated according to multiple interface management operation information and target interface authentication results, and the interface management system is monitored and warned according to the target log information to obtain monitoring and warning feedback information, and a dynamic data source big data API interface data query service or data query engine based on a data template configures different data source information according to the data template, and does not need to pay attention to the database type, so that different data source data queries can be realized. The prior art needs to develop different data query interfaces according to different data requirements, which requires a lot of work for developers. The present application only needs to configure the data template and publish it as a data service. All operations have interface configurations, which is simple and convenient, and reduces development costs and improves development efficiency.
[0038] In a specific embodiment, the process of executing step S101 may specifically include the following steps:
[0039] (1) Configure external data sources through the interface management system. External data sources include third-party data sources and big data platform data;
[0040] (2) establishing a database pool based on an external data source, the database pool being used to store database link information, driver classes, and driver packages;
[0041] (3) receiving the interface processing request to be processed, and performing request parsing on the interface processing request to obtain target request information;
[0042] (4) obtaining a target data format corresponding to the target request information according to the target request information, and determining whether the target data format of the target request information is consistent with database data formats corresponding to multiple candidate databases in the database pool;
[0043] (5) If they are consistent, the candidate database corresponding to the database data format is used as the target database corresponding to the interface processing request;
[0044] (6) If they are inconsistent, converting the target data format corresponding to the target request information into the database data format corresponding to the database information of the database pool, and determining whether the conversion is successful;
[0045] (7) If the conversion is successful, the target request information after the conversion is input into the database pool for database matching to obtain the target database corresponding to the interface processing request.
[0046] Specifically, external data sources are configured through the interface management system, which includes third-party data sources and big data platform data. For example, the configuration involves user data of Internet service providers, transaction data of e-commerce platforms, or user behavior data of social media platforms. The purpose of this step is to ensure that the API can access and process data from different sources and types. A database pool is established based on these external data sources. The role of the database pool is to store the link information, driver classes, and driver packages of various databases, so that multiple database resources can be effectively managed and called. For example, for an interface management system covering user data, transaction data, and behavior data, the database pool contains multiple database links and corresponding drivers for processing these different types of data. Then, the interface processing request to be processed is received. Each request contains different data acquisition or processing requirements. The system parses these requests to obtain target request information. Correctly understanding the content of the request is the prerequisite for ensuring accurate response. The corresponding target data format is obtained according to the target request information and compared with the data formats of multiple candidate databases in the database pool. If the data format of the target request information matches the data format of a database in the database pool, the system uses the database as the target database corresponding to the interface processing request. For example, if a request needs to obtain data in SQL format, and there is a database that supports SQL in the database pool, the system will directly use the database to process the request. However, if the data format of the target request information does not match the format of any database in the database pool, the system needs to convert the format of the request information into a format compatible with the database pool. This conversion process must ensure that the data is converted accurately. For example, if the request information was originally in XML format, and the database in the database pool only supports JSON format, the system needs to convert the XML format data into JSON format. After the conversion is successful, the system enters this data into the database pool for matching to determine the most suitable target database.
[0047] In a specific embodiment, the process of executing step S102 may specifically include the following steps:
[0048] (1) Obtain the target data template of the interface processing request according to the target database, and determine whether the acquisition is successful;
[0049] (2) If the acquisition fails, the interface service format corresponding to the target database is obtained, and the candidate data template is matched from the target database according to the interface service format;
[0050] (3) Pushing the candidate data template to the interface processing request and querying whether the interface processing request accepts the candidate data template;
[0051] (4) If accepted, the API interface corresponding to the interface service of the candidate data template is used as the target API interface of the interface processing request;
[0052] (5) If not accepted, the candidate data template is modified to obtain an exclusive interface service for the interface processing request, and the exclusive interface service is added to the preset data template list and the API interface of the exclusive interface service is determined as the target API interface for the interface processing request.
[0053] Specifically, the target data template of the interface processing request is obtained according to the target database. The target data template refers to the data structure and format designed to meet a specific interface request, which ensures the consistency and availability of data during transmission. For example, if the interface request is to obtain user data, the target data template will include fields such as user ID, name, age, etc. In this step, the server attempts to extract the template of this information from the target database and needs to determine whether the acquisition process is successful. If the server fails to successfully obtain the target data template, it is due to various reasons, such as changes in the data structure of the database or the definition of the template is outdated. At this time, the server turns to obtain the interface service format corresponding to the target database. The interface service format refers to the format standard defined by the database for external communication and data exchange, which includes specific data fields, data types and structures. Once the interface service format is obtained, the server next needs to match the candidate data template that conforms to this format in the target database. This matching process is dynamic and requires the server to have an in-depth understanding of the current structure of the database and the available templates. The server pushes the matched candidate data template to the interface processing request. This is a verification process, the purpose of which is to confirm whether the requester accepts the pushed candidate data template. The pushed data template needs to accurately meet the data needs and format requirements of the requester. Therefore, the server will query whether the interface processing request accepts these candidate data templates. For example, if the data format expected by the requester is JSON, but the pushed data template is in XML format, the requester will refuse to accept this template. If the requester accepts the pushed candidate data template, the interface service of this template will be used to build the target API interface. The server will design and implement a new API interface based on the accepted data template, which can meet the specific data exchange requirements. For example, if the pushed XML format data template is accepted, the server will build an API interface that can provide user data in XML format. However, if the requester does not accept the pushed candidate data template, the server will make necessary modifications to the candidate data template to generate a dedicated interface service specifically for the interface processing request. This includes operations such as adjusting data fields, changing data structures, or converting data formats. The modified data template becomes an interface service dedicated to the request. This customized service can more accurately meet the specific needs of the requester. For example, the server needs to convert the XML format data template into JSON format to meet the needs of the requester. After completing these modifications, the dedicated interface service will be added to the preset data template list, which not only provides a solution for the current request, but also accumulates experience and resources for processing similar requests in the future. The API interface based on this dedicated interface service will be determined as the target API interface for interface processing requests.
[0054] In a specific embodiment, if Figure 3As shown, the above-mentioned API interface management method based on big data also includes the following steps:
[0055] S201, obtaining a first data template corresponding to the data template list, and obtaining a second data template corresponding to the first data template according to a preset first data template matching strategy;
[0056] S202, determining input data of a third data template according to the first data template and the second data template, and using output data of the first data template as output data of the third data template;
[0057] S203, combining the first data template and the second data template to obtain a combined data template, using the combined data template as a basic configuration of a third data template, and adding the third data template to a data template list to obtain an updated data template list;
[0058] S204: Optimize the first data template matching strategy according to the updated data template list to obtain a second data template matching strategy.
[0059] Specifically, the first data template in the data template list is obtained, which is usually selected based on preset conditions or specific rules. The first data template usually defines a set of specific data fields and structures, which are designed to meet specific data processing or exchange requirements. For example, if the server is processing a request involving user personal information, the first data template includes fields such as the user's name, age, and contact information. The server obtains the second data template corresponding to the first data template according to the preset first data template matching strategy. This matching strategy is based on specific rules or algorithms and aims to find the second data template that is most compatible or complementary to the first data template. For example, if the first data template is about the user's basic information, then the second data template is about the user's purchase history or behavior habits to provide a more comprehensive user portrait. The input data of the third data template is determined based on the first and second data templates, and the output data of the first data template is used as the output data of the third data template. The design of the third data template is based on the data requirements and outputs of the first two data templates to ensure the coherence and consistency of the data flow. For example, if the first data template provides the user's basic information and the second data template provides the user's purchase history, then the third data template will combine this information to generate a purchase prediction or recommendation for the user. Then, the server combines the first and second data templates to obtain a comprehensive data template. This combined data template, i.e., the third data template, is a basic configuration based on the first and second data templates. It not only includes the data fields and structures of the first two templates, but also introduces new fields or adjusts the structure of the original fields to better serve specific data processing needs. For example, based on the combination of user basic information and purchase history, the third data template will add user preferred fields to provide more accurate user recommendation services. After the combination is completed, the third data template is added to the data template list, so that an updated data template list is obtained. This updated list not only reflects the current data template configuration, but also provides the server with more options and flexibility to cope with different types of data processing needs. For example, with the addition of new data templates, the server more efficiently handles complex requests involving user personal information, purchase history and preferences. The server optimizes the first data template matching strategy according to the updated data template list to obtain a more efficient second data template matching strategy. This optimization process is to ensure that the matching of the data template is more accurate and efficient, thereby improving the data processing capability of the entire server. For example, by analyzing the effect and usage of a newly added third data template, the server will adjust the matching strategy to better identify and select the appropriate data template, thereby more accurately meeting different types of data requests.
[0060] In a specific embodiment, the process of executing step S103 may specifically include the following steps:
[0061] (1) Create multiple interface management operations through the interface management system, including: interface list, interface release, interface authorization, and interface offline; the interface list is used to display the interface information that has been released, so as to query, authorize, offline, and delete operations; interface release is used to release the configured interface information online; interface authorization is used to authorize the released interface to the target organization, so as to obtain the signature and call the interface service according to the authorization code; interface offline is used to offline the interface that has been released and not used;
[0062] (2) Interface management is performed on the target API interface according to the multiple interface management operations to obtain multiple interface management operation information.
[0063] Specifically, multiple interface management operations are created through the interface management system, including key functions such as interface list, interface release, interface authorization, and interface offline. The interface list is used to display all published interface information. In this list, each interface will be described in detail, including its function, data format, usage status, etc. The interface list not only provides query functions, but also allows users to perform operations such as authorization, offline, and deletion on interfaces. For example, if an interface is responsible for processing a specific type of data query, the interface list will display detailed information about this interface, including the query types it supports and the returned data format. Users can monitor and manage these interfaces through the interface list, such as checking their usage frequency and performance indicators. Interface release is the process of publishing the configured interface information online. This includes everything from interface development and testing to final deployment. Interface release ensures that the newly developed interface can be correctly integrated into the system and start providing services. For example, the server creates a new data analysis interface, which is added to the interface list through the interface release function after testing, allowing users to start using this new interface. Interface authorization authorizes the published interface to specific users or organizations. This process usually requires the generation of an authorization code, which is required to call the interface and ensures the security of the interface and the confidentiality of the data. For example, if an interface provides access to sensitive data, the server generates a unique authorization code for a specific user through the interface authorization function, and only users with this authorization code can call the interface. The interface offline function is used to manage and optimize system resources, especially when an interface has not been used for a long time or needs maintenance. Interface offline not only helps keep the system clean, but also prevents outdated or no longer needed interfaces from consuming valuable system resources. For example, if an interface has not been called by any user in the past few months, the server will decide to take it offline until new needs arise. Based on these interface management operations, the system performs comprehensive interface management on the target API interface and collects relevant information generated by multiple interface management operations. This information includes the frequency of use of the interface, performance indicators, authorization status, etc., providing server administrators with a comprehensive perspective to monitor and evaluate the performance and usage of the interface. For example, by analyzing the information in the interface list, the server can identify which interfaces are most popular and which need to be improved or updated. The information published by the interface can help the server monitor the integration and performance of the new interface. Interface authorization information is crucial to maintaining interface security because it helps the server track which users are authorized to use specific interfaces and how those interfaces are used. With information about interface offline, the server can reasonably allocate and adjust system resources to improve the overall efficiency and performance of the system.
[0064] In a specific embodiment, the process of executing step S104 may specifically include the following steps:
[0065] (1) Create an interface authentication process, and perform blacklist IP matching on the target API interface according to the interface authentication process to obtain the blacklist IP matching result;
[0066] (2) According to the blacklist IP matching result, the target API interface is matched with the whitelist IP to obtain the whitelist IP matching result;
[0067] (3) According to the whitelist IP matching result, the target API interface is triggered to limit the flow and obtain the trigger limit judgment result;
[0068] (4) Perform a signature legitimacy judgment on the target API interface based on the trigger current limiting judgment result to obtain a signature legitimacy judgment result;
[0069] (5) Perform load balancing based on the signature legitimacy judgment result and generate the target interface authentication result corresponding to the target API interface.
[0070] Specifically, the server creates a port authentication process, which includes key steps such as blacklist IP matching, whitelist IP matching, triggering current limiting judgment, and signature legitimacy judgment. The server performs blacklist IP matching on the target API interface. The blacklist is pre-defined by the server and contains a series of untrusted or known malicious IP addresses. The purpose of this matching process is to prevent these bad IP addresses from accessing the API interface, thereby protecting the server from potential network attacks and unauthorized access. For example, if the server detects an access attempt from an IP address on the blacklist, the request will be immediately rejected and the server will also log the event. The server performs whitelist IP matching on the target API interface based on the blacklist IP matching results. In contrast to the blacklist, the whitelist contains IP addresses that are considered safe, usually the IP addresses of regular users or partners of the server. The purpose of whitelist matching is to quickly identify and authorize these trusted access requests. For example, if a request from a whitelist IP address attempts to access the API, the server will quickly allow this access because it has been identified as coming from a secure and trusted source. The whitelist IP matching results not only improve the response efficiency of the server, but also ensure smooth access for partners and regular users. The server triggers the flow limit judgment on the target API interface based on the whitelist IP matching results. This is to prevent server crashes or performance degradation caused by request overload. The trigger flow limit judgment is based on the preset traffic threshold. The server will monitor the request traffic in real time. Once the traffic is abnormal or reaches the threshold, the server will start the flow limit measures. For example, if a large number of requests are poured in within a short period of time, the server will temporarily restrict access from certain IP addresses until the traffic returns to normal. This trigger flow limit judgment result helps maintain the stability and availability of the server. The server performs a signature legitimacy judgment on the target API interface based on the trigger flow limit judgment result. Each API request usually includes a signature, which is a security mechanism for verifying the legitimacy of the request. Signature legitimacy judgment involves checking whether the signature of each request is valid and whether it matches the signature recorded by the server. For example, if the signature of a request is invalid or does not match the server, this indicates that the request is forged or has potential security risks, so the server will reject the request. The signature legitimacy judgment result is a key step to ensure that each request is safe and legal. The server performs load balancing based on the signature legitimacy judgment result and generates the target interface authentication result corresponding to the target API interface. Load balancing is done to ensure efficient allocation of server resources and prevent any single component from affecting the performance of the entire server due to overload. For example, the server will distribute requests to different servers or processing units based on the type and source of the request to ensure efficient and smooth operation.In this way, the server finally generates the target interface authentication results for each API interface, which not only covers security considerations but also includes performance and efficiency optimization.
[0071] In a specific embodiment, the process of executing step S105 may specifically include the following steps:
[0072] (1) Generate target log information of the target API interface based on multiple interface management operation information and target interface authentication results, and obtain system status information of the interface management system;
[0073] (2) Perform one-hot vector encoding on the target log information to obtain a log encoding vector;
[0074] (3) Inputting the log encoding vector into a preset log monitoring model for processing, and outputting the log evaluation index of the target log information;
[0075] (4) Inputting the system status information into a preset system status analysis model to extract system status features, and outputting the system status features of the interface management system;
[0076] (5) determining whether the log evaluation index of the target log information exceeds the preset log evaluation index range, and determining whether the system status characteristics have system status abnormalities;
[0077] (6) If the log evaluation index of the target log information exceeds the preset log evaluation index threshold and the system status characteristic has a system status abnormality, monitoring warning feedback information of the interface management system is generated.
[0078] Specifically, the server generates target log information of the target API interface based on multiple interface management operation information and the authentication result of the target interface. These log information contain detailed records about the interface operation, such as the time, duration, returned results, and any exceptions or errors of the interface call. For example, if an interface fails because it receives invalid request data, all details of this operation, including the requested data and the reason for the failure, will be recorded in the target log. At the same time, the server also needs to obtain the system status information of the interface management system. This information usually includes the system's operating status, resource usage, performance indicators, etc. The system status information helps to assess the overall health of the system and warn of potential problems. For example, the system status information shows that the memory usage rate is higher than normal, which is a warning signal indicating that the system is under excessive load or has a memory leak. The system performs one-hot vector encoding on the target log information. One-hot vector encoding is a method of converting categorical variables into machine-processable numerical forms, which makes log information easier to analyze and process. In this process, different attributes of each log entry (such as error type, operation type, etc.) are converted into a series of binary values. For example, if a log entry includes multiple error types, each error type is assigned a unique binary code, and the corresponding position in the one-hot encoding vector is set to 1. After this conversion, the log information is converted into a series of log encoding vectors, which is convenient for further data processing and analysis. The log encoding vectors are then input into a preset log monitoring model. This model is pre-trained and can perform in-depth analysis of log data and output log evaluation indicators. These evaluation indicators usually include error frequency, abnormal operation patterns, performance change trends, etc. For example, the log monitoring model analyzes whether the failure rate of a specific interface has an upward trend, or whether a certain type of operation has an unusual pattern. These indicators provide the server with important information about the operation status of the interface, helping them to quickly identify and locate potential problems. At the same time, the server inputs the system status information into the preset system status analysis model, which focuses on extracting key features from the system status information and outputs the system status features of the interface management system. These features help understand the current operation status of the system, including performance bottlenecks or potential failure points. For example, the system status analysis model identifies an abnormal increase in CPU usage or an unusual pattern of disk I / O, which are important features of the system status and indicate issues that need attention. The system needs to determine whether the log evaluation index of the target log information exceeds the preset log evaluation index range, and whether there are any abnormalities in the system status characteristics. This is a critical decision-making process that involves comprehensive analysis of log evaluation indicators and system status characteristics to assess the overall status and operational risks of the system. For example, if the log evaluation indicators show that the error rate of a certain interface has suddenly increased, or the system status characteristics show abnormal memory usage, this is a sign that there is a problem with the system.If the log evaluation index of the target log information exceeds the preset log evaluation index threshold, or the system status characteristics show an abnormality, the system will generate monitoring warning feedback information for the interface management system. These feedback messages are warnings of the current status of the interface management system, prompting the server to take appropriate measures to solve the identified problems or anomalies. For example, a monitoring warning will notify the server that a specific interface fails frequently and needs to be checked and resolved immediately, or tell the server that the system resource usage has reached a dangerous level and needs to be optimized or expanded.
[0079] The above describes the API interface management method based on big data in the embodiment of the present application. The following describes the API interface management device based on big data in the embodiment of the present application. Figure 3 In the embodiment of the present application, an embodiment of the API interface management device based on big data includes:
[0080] The matching module 301 is used to configure database information through the interface management system, establish a database pool, and receive an interface processing request to be processed to perform database matching on the database pool to obtain a target database;
[0081] The processing module 302 is used to generate a target data template for the interface processing request according to the target database, and generate a corresponding target API interface according to the target data template;
[0082] The interface management module 303 is used to create multiple interface management operations, and perform interface management on the target API interface according to the multiple interface management operations to obtain multiple interface management operation information;
[0083] The authentication management module 304 is used to create an interface authentication process, and perform authentication management on the target API interface according to the interface authentication process to obtain a target interface authentication result;
[0084] The monitoring and warning module 305 is used to generate target log information of the target API interface according to the multiple interface management operation information and the target interface authentication result, and monitor and warn the interface management system according to the target log information to obtain monitoring and warning feedback information.
[0085] Through the collaborative cooperation of the above-mentioned components, a database pool is established through the interface management system and an interface processing request is received for database matching to obtain a target database; a target data template is generated according to the target database, and a target API interface is generated according to the target data template; multiple interface management operations are created and interface management is performed on the target API interface to obtain multiple interface management operation information; an interface authentication process is created and authentication management is performed on the target API interface to obtain a target interface authentication result; target log information is generated according to multiple interface management operation information and target interface authentication results, and the interface management system is monitored and warned according to the target log information to obtain monitoring and warning feedback information, and a dynamic data source big data API interface data query service or data query engine based on a data template configures different data source information according to the data template, and can realize data query of different data sources without paying attention to the database type. The existing technology needs to develop different data query interfaces according to different data requirements, which requires a lot of work for developers. This application only needs to configure the data template and publish it as a data service. All operations have interface configurations, which is simple and convenient, and reduces development costs and improves development efficiency.
[0086] The present application also provides an API interface management device based on big data, which includes a memory and a processor. The memory stores computer-readable instructions. When the computer-readable instructions are executed by the processor, the processor executes the steps of the API interface management method based on big data in the above-mentioned embodiments.
[0087] The present application also provides a computer-readable storage medium, which may be a non-volatile computer-readable storage medium or a volatile computer-readable storage medium. Instructions are stored in the computer-readable storage medium. When the instructions are executed on a computer, the computer executes the steps of the API interface management method based on big data.
[0088] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0089] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk and other media that can store program code.
[0090] As described above, the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims
1. An API interface management method based on big data, It is characterized in that The API interface management method based on big data includes: Configure database information through the interface management system, establish a database pool, and receive the interface processing request to be processed to perform database matching on the database pool to obtain a target database; Generate a target data template for the interface processing request according to the target database, and generate a corresponding target API interface according to the target data template; specifically include: obtaining the target data template for the interface processing request according to the target database, and judging whether the acquisition is successful; if the acquisition fails, obtaining the interface service format corresponding to the target database, and matching the candidate data template from the target database according to the interface service format; pushing the candidate data template to the interface processing request, and querying whether the interface processing request accepts the candidate data template; if accepted, using the API interface corresponding to the interface service of the candidate data template as the target API interface of the interface processing request; if not accepted, modifying the candidate data template to obtain an exclusive interface service for the interface processing request, adding the exclusive interface service to a preset data template list and determining the API interface of the exclusive interface service as the target API interface of the interface processing request; Creating multiple interface management operations, and performing interface management on the target API interface according to the multiple interface management operations to obtain multiple interface management operation information; Create an interface authentication process, and perform authentication management on the target API interface according to the interface authentication process to obtain the target interface authentication result; The target log information of the target API interface is generated according to the multiple interface management operation information and the target interface authentication result, and the interface management system is monitored and warned according to the target log information to obtain monitoring and warning feedback information.
2. According to the API interface management method based on big data according to claim 1, It is characterized in that The step of configuring database information through the interface management system, establishing a database pool, and receiving an interface processing request to be processed to perform database matching on the database pool to obtain a target database includes: Configure external data sources through the interface management system, where the external data sources include third-party data sources and big data platform data; Establishing a database pool according to the external data source, wherein the database pool is used to store database link information, driver classes and driver packages; Receiving an interface processing request to be processed, and performing request parsing on the interface processing request to obtain target request information; Acquire a target data format corresponding to the target request information according to the target request information, and determine whether the target data format of the target request information is consistent with database data formats corresponding to multiple candidate databases in the database pool; If they are consistent, the candidate database corresponding to the database data format is used as the target database corresponding to the interface processing request; If they are inconsistent, converting the target data format corresponding to the target request information into the database data format corresponding to the database information of the database pool, and determining whether the conversion is successful; If the conversion is successful, the target request information after the conversion is input into the database pool for database matching to obtain the target database corresponding to the interface processing request.
3. According to the API interface management method based on big data according to claim 1, It is characterized in that The API interface management method based on big data also includes: Acquire a first data template corresponding to the data template list, and acquire a second data template corresponding to the first data template according to a preset first data template matching strategy; Determine input data of a third data template according to the first data template and the second data template, and use output data of the first data template as output data of the third data template; Performing data template combination on the first data template and the second data template to obtain a combined data template, using the combined data template as a basic configuration of the third data template, and adding the third data template to the data template list to obtain an updated data template list; The first data template matching strategy is optimized according to the updated data template list to obtain a second data template matching strategy.
4. According to the API interface management method based on big data according to claim 1, It is characterized in that The creating of multiple interface management operations, and performing interface management on the target API interface according to the multiple interface management operations to obtain multiple interface management operation information includes: Multiple interface management operations are created through the interface management system, and the multiple interface management operations include: interface list, interface release, interface authorization, and interface offline; the interface list is used to display the published interface information for query, authorization, offline, and deletion operations; interface release is used to publish the configured interface information online; interface authorization is used to authorize the published interface to the target organization to obtain the signature and call the interface service according to the authorization code; interface offline is used to offline the published and unused interface; Interface management is performed on the target API interface according to the multiple interface management operations to obtain multiple interface management operation information.
5. According to the API interface management method based on big data according to claim 1, It is characterized in that The interface authentication process is created, and the target API interface is authenticated and managed according to the interface authentication process to obtain the target interface authentication result, including: Create an interface authentication process, and perform blacklist IP matching on the target API interface according to the interface authentication process to obtain a blacklist IP matching result; According to the blacklist IP matching result, the target API interface is matched with the whitelist IP to obtain the whitelist IP matching result; According to the whitelist IP matching result, the target API interface is triggered to limit the flow of judgment, and a trigger current limit judgment result is obtained; Performing a signature legitimacy judgment on the target API interface according to the trigger current limiting judgment result to obtain a signature legitimacy judgment result; Load balancing is performed based on the signature legitimacy judgment result and a target interface authentication result corresponding to the target API interface is generated.
6. The API interface management method based on big data according to claim 1, It is characterized in that The method of generating target log information of the target API interface according to the multiple interface management operation information and the target interface authentication result, and monitoring and warning the interface management system according to the target log information to obtain monitoring and warning feedback information includes: Generate target log information of the target API interface according to the multiple interface management operation information and the target interface authentication result, and obtain system status information of the interface management system; Performing one-hot vector encoding processing on the target log information to obtain a log encoding vector; Inputting the log encoding vector into a preset log monitoring model for processing, and outputting a log evaluation index of the target log information; Inputting the system status information into a preset system status analysis model to extract system status features, and outputting system status features of the interface management system; Determine whether the log evaluation index of the target log information exceeds the preset log evaluation index range, and determine whether the system status feature has a system status abnormality; If the log evaluation index of the target log information exceeds the preset log evaluation index threshold and the system status feature has a system status abnormality, monitoring warning feedback information of the interface management system is generated.
7. An API interface management device based on big data, It is characterized in that The API interface management device based on big data includes: A matching module is used to configure database information through an interface management system, establish a database pool, and receive an interface processing request to be processed to perform database matching on the database pool to obtain a target database; A processing module, used to generate a target data template for the interface processing request according to the target database, and generate a corresponding target API interface according to the target data template; specifically comprising: obtaining the target data template for the interface processing request according to the target database, and determining whether the acquisition is successful; if the acquisition fails, obtaining the interface service format corresponding to the target database, and matching the candidate data template from the target database according to the interface service format; pushing the candidate data template to the interface processing request, and querying whether the interface processing request accepts the candidate data template; if accepted, using the API interface corresponding to the interface service of the candidate data template as the target API interface for the interface processing request; if not accepted, modifying the candidate data template to obtain an exclusive interface service for the interface processing request, adding the exclusive interface service to a preset data template list, and determining the API interface of the exclusive interface service as the target API interface for the interface processing request; An interface management module, used to create multiple interface management operations, and perform interface management on the target API interface according to the multiple interface management operations to obtain multiple interface management operation information; The authentication management module is used to create an interface authentication process, and perform authentication management on the target API interface according to the interface authentication process to obtain the target interface authentication result; The monitoring and early warning module is used to generate target log information of the target API interface according to the multiple interface management operation information and the target interface authentication result, and monitor and warn the interface management system according to the target log information to obtain monitoring and early warning feedback information.
8. An API interface management device based on big data, It is characterized in that The API interface management device based on big data includes: a memory and at least one processor, wherein instructions are stored in the memory; The at least one processor calls the instruction in the memory so that the big data-based API interface management device executes the big data-based API interface management method as described in any one of claims 1-6.
9. A computer-readable storage medium having instructions stored thereon, It is characterized in that When the instructions are executed by the processor, the API interface management method based on big data as described in any one of claims 1-6 is implemented.
