Interface integration processing method and system, electronic device and readable storage medium

By processing interface request data in a pre-defined thread pool and performing unified interface protocol adaptation and rate limiting control, the problems of interface call complexity and system stability are solved, and efficient interface integration processing is achieved.

CN115904756BActive Publication Date: 2026-01-06ZHONGKE YUNGU TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211606989.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-14
Publication Date
2026-01-06
Estimated Expiration
2042-12-14

AI Technical Summary

Technical Problem

Calling different interface protocols increases development complexity and may affect system performance and security under high load, especially when implemented between heterogeneous systems.

Method used

By obtaining the client's configuration code and interface request data, worker threads are started in a preset thread pool for preprocessing, and the target interface is called according to the configuration code, thereby achieving unified interface request data processing and rate limiting control.

Benefits of technology

It solves the compatibility problem between different interface protocols, improves the stability and reliability of the system, reduces resource consumption, and ensures the smooth operation of the system under high concurrency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115904756B_ABST
    Figure CN115904756B_ABST
Patent Text Reader

Abstract

This application discloses an interface integration processing method, system, electronic device, and readable storage medium. The interface integration processing method includes: obtaining the client's configuration code and interface request data; starting worker threads in a preset thread pool to process the interface request data, the preset thread pool being used to manage a preset number of worker threads; preprocessing the interface request data according to the configuration code to obtain preprocessed data; calling the target interface according to the configuration code and the preprocessed data, and sending the result data returned by the target interface to the client. This application, by uniformly processing and rate-limiting interface request data, can solve the adaptation problem between different interface protocols, improving the stability and reliability of the system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of data processing technology, and in particular to an interface integration processing method, system, electronic device, and readable storage medium. Background Technology

[0002] As businesses grow and the need for digitalization increases, enterprise system construction becomes increasingly complex, and interactions between business systems become more frequent. Data processing on platforms often involves API calls. API calls bridge the gap between software systems developed in different languages ​​and running on different platforms, preventing information distributed across various software systems from becoming isolated silos. However, due to the diverse types of API call protocols, both API callers and service providers need to handle each different protocol, increasing development complexity. During peak business periods, service providers receive a large number of API calls. Without self-protective rate limiting or service degradation mechanisms, the performance of a business system could be impacted by a single API call. API security is also a crucial consideration, but its implementation is relatively complex, especially between heterogeneous systems. Summary of the Invention

[0003] The purpose of this application is to provide an interface integration processing method, system, electronic device, and readable storage medium that can solve the adaptation problem between different interface protocols and improve the stability and reliability of the system.

[0004] To achieve the above objectives:

[0005] In a first aspect, embodiments of this application provide an interface integration processing method, comprising the following steps:

[0006] Obtain the client's configuration encoding and API request data;

[0007] Worker threads are started in a preset thread pool to process the interface request data. The preset thread pool is used to manage a preset number of worker threads.

[0008] The interface request data is preprocessed according to the configuration encoding to obtain preprocessed data;

[0009] The target interface is invoked according to the configuration code and the preprocessed data, and the result data returned by the target interface is sent to the client.

[0010] Optionally, obtaining the client's configuration encoding and interface request data further includes:

[0011] Obtain the client's configuration information, which includes at least one of the following: target address, protocol type, authentication information, parameter format, rate limiting strategy, and exception handling mechanism.

[0012] The configuration code for the client is generated based on the configuration information.

[0013] Optionally, before obtaining the client's configuration code and interface request data, the method further includes:

[0014] Establish a connection channel with the client;

[0015] The client's configuration code and interface request data are obtained through the connection channel.

[0016] Optionally, after obtaining the configuration code and interface request data sent by the client through the connection channel, the method further includes:

[0017] Poll the connection channel;

[0018] When a read / write event occurs in the connection channel, the interface request data in the connection channel is sent to the TaskPipeline module;

[0019] Worker threads are started in the preset thread pool to process the interface request data in the TaskPipeline module.

[0020] Optionally, the step of preprocessing the interface request data according to the configuration encoding to obtain preprocessed data includes:

[0021] Based on the client's configuration encoding, at least one subtask is determined for preprocessing the interface request data;

[0022] Generate a task chain for preprocessing the interface request data based on the sub-tasks;

[0023] The interface request data is preprocessed according to the task chain to obtain the preprocessed data.

[0024] Optionally, the subtasks include at least one of rate limiting, authentication, data processing, protocol adaptation, interface configuration, interface calling, and result data processing.

[0025] Optionally, the step of preprocessing the interface request data using the configuration encoding to obtain preprocessed data further includes:

[0026] Asynchronous processing tasks that occur during the preprocessing of the interface request data are processed asynchronously. The asynchronous processing tasks include at least one of monitoring and alarm, exception handling, data collection, data analysis, and log service.

[0027] Secondly, embodiments of this application provide an interface integration processing system, including:

[0028] The AcceptorHandler module is used to obtain the client's configuration code and interface request data, and to send the result data returned by the target interface to the client.

[0029] The TaskPipeline module is used to start worker threads in a preset thread pool to process the interface request data. The preset thread pool is used to manage a preset number of worker threads.

[0030] The TaskPipeline module is also used to preprocess the interface request data according to the configuration code to obtain preprocessed data, and to call the target interface according to the configuration code and the preprocessed data.

[0031] Thirdly, embodiments of this application provide an electronic device, including: a processor and a memory storing a computer program, wherein when the processor runs the computer program, the steps of the above-described interface integration processing method are implemented.

[0032] Fourthly, embodiments of this application provide a readable storage medium storing a computer program, which, when executed by a processor, implements the steps of the above-described interface integration processing method.

[0033] This application provides an interface integration processing method, system, electronic device, and readable storage medium. The interface integration processing method includes: obtaining the client's configuration code and interface request data; starting worker threads in a preset thread pool to process the interface request data, the preset thread pool being used to manage a preset number of worker threads; preprocessing the interface request data according to the configuration code to obtain preprocessed data; calling the target interface according to the configuration code and the preprocessed data, and sending the result data returned by the target interface to the client. This application, by uniformly processing and rate-limiting interface request data, can solve the adaptation problem between different interface protocols, improving the stability and reliability of the system. Attached Figure Description

[0034] Figure 1 A flowchart illustrating the interface integration processing method provided in an embodiment of the present invention;

[0035] Figure 2 This is an application scenario diagram of the interface integration processing method provided in the embodiments of the present invention;

[0036] Figure 3 This is a schematic diagram of the architecture of the interface integration processing system provided in an embodiment of the present invention;

[0037] Figure 4 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention. Detailed Implementation

[0038] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numerals in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of electronic devices and methods consistent with some aspects of this application as detailed in the appended claims.

[0039] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or electronic device that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or electronic device. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or electronic device that includes that element. Furthermore, components, features, and elements with the same names in different embodiments of this application may have the same meaning or different meanings, the specific meaning of which must be determined by its interpretation in that specific embodiment or further in conjunction with the context of that specific embodiment.

[0040] It should be understood that although the terms first, second, third, etc., may be used herein to describe various information, such information should not be limited to these terms. These terms are used only to distinguish information of the same type from one another. For example, without departing from the scope of this document, first information may also be referred to as second information, and similarly, second information may also be referred to as first information. Depending on the context, the word "if," as used herein, can be interpreted as "when," "when," or "in response to determination." Furthermore, as used herein, the singular forms "a," "an," and "the" are intended to also include the plural forms unless the context indicates otherwise. It should be further understood that the terms "comprising," "including," indicate the presence of the stated feature, step, operation, element, component, item, kind, and / or group, but do not exclude the presence, occurrence, or addition of one or more other features, steps, operations, elements, components, items, kinds, and / or groups. The terms "or" and "and / or" as used herein are to be interpreted as inclusive, or mean any one or any combination thereof. Therefore, "A, B, or C" or "A, B, and / or C" means "any one of the following: A; B; C; A and B; A and C; B and C; A, B, and C". Exceptions to this definition will only occur if the combination of elements, functions, steps, or operations is inherently mutually exclusive in some way.

[0041] It should be understood that although the steps in the flowcharts of this application's embodiments are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some of the steps in the figures may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed at the same time, but can be executed at different times, and their execution order is not necessarily sequential, but can be performed alternately or in turn with other steps or at least a portion of the sub-steps or stages of other steps.

[0042] It should be noted that step designations such as S201 and S202 are used in this document for the purpose of more clearly and concisely describing the corresponding content, and do not constitute a substantial limitation on the order. In specific implementation, those skilled in the art may execute S202 first and then S201, etc., but these should all be within the protection scope of this application.

[0043] It should be understood that the specific embodiments described herein are merely illustrative of this application and are not intended to limit this application.

[0044] In the following description, the use of suffixes such as "module," "part," or "unit" to denote elements is solely for the purpose of illustrative purposes and has no specific meaning in itself. Therefore, "module," "part," or "unit" may be used interchangeably.

[0045] First Embodiment

[0046] See Figure 1 This application provides an interface integration processing method, which can be executed by an interface integration processing system provided in this application. The interface integration processing system can be implemented in software and / or hardware. In this embodiment, a server is taken as the executing entity of the interface integration processing method. The interface integration processing method provided in this embodiment includes:

[0047] Step S201: Obtain the client's configuration code and interface request data.

[0048] In this embodiment, by building an interface integration system, interface call requests from multiple clients (i.e., interface callers) are processed uniformly on the system, and different interface protocols are adapted. This avoids the server (i.e., the service provider) having to process different interface protocols separately, which can effectively simplify the server's processing flow.

[0049] In one embodiment, obtaining the client's configuration code and interface request data further includes:

[0050] Obtain the client's configuration information, which includes at least one of the following: target address, protocol type, authentication information, parameter format, rate limiting policy, and exception handling mechanism.

[0051] Generate client configuration codes based on configuration information.

[0052] In this embodiment, the client needs to pre-configure the target address, protocol type, authentication information, parameter format, rate limiting strategy, and exception handling strategy of its target interface on the interface integration processing system. The target address of the target interface is the target address where the server or database is located. The protocol type refers to the type of interface protocol used by the client; for example, an HTTP (Hypertext Transfer Protocol) interface uses the HTTP protocol, while a webService interface uses the SOAP (Simple Object Access Protocol) protocol for transmission via HTTP. Authentication information is the authentication information required for the client to access the interface; for completely open interface protocols, authentication information is not required. The parameter format is determined based on the data format specified by the target interface protocol. The rate limiting strategy can be determined by statistically analyzing the number of concurrent requests to the target interface. The exception handling strategy can be set using information provided by the client; for example, when an interface call exception occurs, the exception information is pushed to the client, such as to the client's email or communication software, and / or a retry mechanism is triggered within a preset time. Thus, by pre-configuring the client's configuration information, the interface request data sent by the client can be automatically processed, adapting to various different interface protocols.

[0053] Optionally, a corresponding configuration code can be generated for the received client configuration information, so that the interface request data can be preprocessed according to the configuration code later. After the configuration data is persisted, it can be synchronized to a Redis database for caching to provide efficient cache query services.

[0054] In one embodiment, before obtaining the client's configuration code and interface request data, the method further includes:

[0055] Establish a connection channel with the client;

[0056] The client's configuration code and interface request data are obtained through the connection channel.

[0057] In this embodiment, the client sends configuration information and interface request data to the interface integration processing system. For example... Figure 2As shown, the AcceptorHandler module in the interface integration processing system is responsible for establishing a connection channel between the client and the interface integration processing system, and sending the interface request data to the TaskPipeline module in the interface integration processing system.

[0058] In one embodiment, after obtaining the configuration code and interface request data sent by the client through the connection channel, the method further includes:

[0059] Poll the connection channel;

[0060] When a read / write event occurs in the connection channel, the interface request data in the connection channel is sent to the TaskPipeline module;

[0061] Start worker threads in the preset thread pool to process the interface request data in the TaskPipeline module.

[0062] In this embodiment, a selector thread is started in the interface integration processing system. The selector thread acts as a multiplexer, continuously polling the connection channels between the client and the system. Only when a read / write event occurs on the connection channel is the actual memory access invoked to perform the read / write operation. Thus, multiplexing technology supports high-concurrency interface requests, and multiple connection channels can be managed by a single thread. The system does not need to create new processes or threads, greatly reducing resource consumption.

[0063] Step S202: Start worker threads in the preset thread pool to process interface request data. The preset thread pool is used to manage a preset number of worker threads.

[0064] like Figure 2 As shown, the preset thread pool (TaskHandlerThreadPool) is used to uniformly manage a certain number of worker threads (TaskHandlers). The purpose of the preset thread pool is to reduce the resource consumption of starting new worker threads, utilize idle worker threads in the preset thread pool without starting new ones, and uniformly manage worker threads. After a worker thread in the preset thread pool finishes execution, it returns to the preset thread pool to wait for new tasks. By controlling the number of worker threads in the preset thread pool, the TaskHandler worker threads are used to process interface request data in the TaskPipeline module. In this way, by rate limiting the worker threads processing interface request data, system performance can be guaranteed, and peak request periods can be smoothly handled.

[0065] When a read / write event occurs on the connection channel, the interface request data in the connection channel is sent to the TaskPipeline module. The TaskPipeline module has limited capacity; when the number of interface requests with read / write events exceeds the TaskPipeline module's capacity, they need to be queued and processed sequentially. This allows the TaskPipeline module to perform an initial rate limiting on the interface requests to be processed, preventing congestion. Furthermore, a preset number of worker threads are managed in a pre-defined thread pool to process the interface request data in the TaskPipeline module. Since the number of worker threads is limited, the number of interface requests that can be processed concurrently is also limited, allowing for a second rate limiting on the interface requests to be processed. Thus, by rate limiting the concurrent processing of interface requests based on the TaskPipeline module's capacity and the limited number of worker threads in the pre-defined thread pool, the orderly operation of the system can be ensured, improving system stability.

[0066] Step S203: Preprocess the interface request data according to the configuration encoding to obtain preprocessed data.

[0067] In one embodiment, the interface request data is preprocessed according to the configuration encoding to obtain preprocessed data, including:

[0068] Determine at least one subtask for preprocessing interface request data based on the client's configuration encoding;

[0069] A task chain that generates preprocessed interface request data based on subtasks;

[0070] The interface request data is preprocessed according to the task chain to obtain the preprocessed data.

[0071] In this embodiment, when the TaskHandler worker thread processes interface request data in the TaskPipeline module, it determines the subtasks that the system needs to process based on the pre-configured configuration codes of the client. These subtasks include at least one of the following: rate limiting, authentication, data processing, protocol adaptation, interface configuration, interface invocation, and result data processing. Then, a task chain is determined based on the specific content and execution order of the subtasks, and the interface request data is preprocessed according to the content of this task chain. For example, the rate limiting subtask can be used to determine whether the rate limiting standard has been met; the authentication subtask can be used to verify the validity of digital signatures; the data processing subtask can convert or preprocess parameters in the interface request data through pre-built plugins; and the protocol adaptation subtask can perform interface protocol adaptation based on configuration information. In this way, the system provides a flexible processing mechanism for different interface protocols. Through a pluggable chained processing method, functions such as rate limiting, security authentication, data conversion, and protocol adaptation can be flexibly configured and implemented, greatly simplifying the development work for interface integration between systems.

[0072] Optionally, preprocessing the interface request data for configuration encoding to obtain preprocessed data further includes:

[0073] Asynchronous processing tasks that occur during the process of requesting data from the preprocessing interface are processed asynchronously. These asynchronous processing tasks include at least one of the following: monitoring and alarm, exception handling, data collection, data analysis, and log service.

[0074] In this embodiment, for subtasks that do not require immediate feedback of processing results, i.e., asynchronous processing tasks, these asynchronous processing tasks can be processed asynchronously through a message queue. During asynchronous processing, the caller does not need to synchronously wait for the callee to complete processing before returning to do other things. All things can be processed concurrently, thus decoupling the preprocessing process and improving system performance. Asynchronous processing tasks may specifically include monitoring and alarms, exception handling, data collection, data analysis, and log services. For example, if an exception occurs during processing, the exception information can be pushed to the client according to the early warning strategy, and a retry mechanism can be triggered. After completing the interface call, the request parameters and return results can be pushed to the client through a message queue. The log analysis service analyzes the data and generates interface call log records and statistical data. In this way, exception handling mechanisms and monitoring and alarm information pushes can be configured according to business needs, ensuring high system performance through asynchronous processing.

[0075] Step S204: Call the target interface according to the configuration encoding and preprocessed data, and send the result data returned by the target interface to the client.

[0076] In this embodiment, the worker thread TaskHandler calls the target interface according to the configuration encoding and preprocessed data, and sends the result information returned by the target interface to the client through the corresponding connection channel to complete the client's call to the target interface.

[0077] In summary, the interface integration processing method provided in the above embodiments involves: obtaining the client's configuration code and interface request data; starting worker threads in a preset thread pool to process the interface request data, with the preset thread pool managing a preset number of worker threads; preprocessing the interface request data according to the configuration code to obtain preprocessed data; calling the target interface according to the configuration code and the preprocessed data; and sending the result data returned by the target interface to the client. This application embodiment, by uniformly processing and rate-limiting interface request data, can solve the adaptation problem between different interface protocols, improving the stability and reliability of the system.

[0078] Second Embodiment

[0079] Based on the same inventive concept as the foregoing embodiments, see [link / reference]. Figure 2 and Figure 3 This application provides an interface integration processing system, including:

[0080] The AcceptorHandler module is used to obtain the client's configuration encoding and interface request data, and to send the result data returned by the target interface to the client.

[0081] The TaskPipeline module is used to start worker threads in a preset thread pool to process interface request data. The preset thread pool is used to manage a preset number of worker threads.

[0082] The TaskPipeline module is also used to preprocess interface request data according to the configuration encoding to obtain preprocessed data, and to call the target interface according to the configuration encoding and the preprocessed data.

[0083] like Figure 2 and Figure 3 As shown, the client sends interface request data to the interface integration processing system. The system can perform a variety of functions through various sub-tasks to adapt to different interface requests from different clients. These sub-tasks include request acceptance, rate limiting, authentication, data processing, protocol adaptation, interface configuration, monitoring and alarms, exception handling, data collection, data analysis, interface calls, and log services, among others. After adapting the requests to different interfaces, the system sends the requests to the target interface (server or dedicated server) and stores cached data in databases such as MySQL, Elasticsearch, Redis, and Kafka.

[0084] In one embodiment, the interface integration processing system further includes a Selector thread, which polls the connection channel and sends the request data in the connection channel to the TaskPipeline module when a read / write event occurs in the connection channel.

[0085] Thus, by using multiplexing technology to support high-concurrency processing, multiple connection channels can be managed by a single thread, and the system does not need to create new processes or threads, which greatly reduces resource consumption.

[0086] In one implementation, the AcceptorHandler module is further configured to, when obtaining the client's configuration encoding and interface request data, include:

[0087] Obtain the client's configuration information, which includes at least one of the following: target address, protocol type, authentication information, parameter format, rate limiting policy, and exception handling mechanism.

[0088] Generate client configuration codes based on configuration information.

[0089] In this way, by configuring the client's configuration information in advance, the interface request data sent by the client can be processed automatically, adapting to a variety of different interface protocols.

[0090] In one implementation, the AcceptorHandler module is further configured to, before obtaining the client's configuration encoding and interface request data, include:

[0091] Establish a connection channel with the client;

[0092] The client's configuration code and interface request data are obtained through the connection channel.

[0093] In this way, multiplexing technology is used to support high-concurrency interface requests. Multiple connection channels can be managed by a single thread, and the system does not need to create new processes or threads, which greatly reduces resource consumption.

[0094] In one embodiment, the TaskPipeline module is further configured to preprocess the configuration-encoded interface request data to obtain preprocessed data, including:

[0095] Determine at least one subtask for preprocessing the interface request data based on the configuration encoding of the interface request data;

[0096] A task chain that generates preprocessed interface request data based on subtasks;

[0097] The interface request data is preprocessed according to the task chain to obtain preprocessed data.

[0098] In one implementation, the subtask includes at least one of rate limiting, authentication, data processing, protocol adaptation, interface configuration, interface call, and result data processing.

[0099] In this way, the system provides a flexible processing mechanism for different interface protocols. Through a pluggable chain processing method, it can be flexibly configured to implement functions such as rate limiting, security authentication, data conversion, and protocol adaptation, which greatly simplifies the development work of interface docking between systems.

[0100] In one embodiment, the TaskPipeline module is further configured to preprocess the configuration-encoded interface request data to obtain preprocessed data, and includes:

[0101] Asynchronous processing tasks that occur during the process of requesting data from the preprocessing interface are processed asynchronously. These asynchronous processing tasks include at least one of the following: monitoring and alarm, exception handling, data collection, data analysis, and log service.

[0102] In this way, exception handling mechanisms and monitoring alarm information push can be configured according to business needs, and the high performance of the system can be guaranteed through asynchronous processing.

[0103] In summary, in the interface integration processing system provided in the above embodiments, the AcceptorHandler module is used to obtain the client's configuration code and interface request data, and to send the result data returned by the target interface to the client; the TaskPipeline module is used to start worker threads in a preset thread pool to process the interface request data, and the preset thread pool is used to manage a preset number of worker threads; the TaskPipeline module is also used to preprocess the interface request data according to the configuration code to obtain preprocessed data, and to call the target interface according to the configuration code and the preprocessed data. This application embodiment, by uniformly processing and rate-limiting interface request data, can solve the adaptation problem between different interface protocols, and improve the stability and reliability of the system.

[0104] For the specific implementation process of this embodiment, please refer to the first embodiment, which will not be repeated here.

[0105] Based on the same inventive concept as the foregoing embodiments, this invention provides an electronic device, such as... Figure 4 As shown, the electronic device includes: a processor 310 and a memory 311 storing a computer program; wherein, Figure 4 The processor 310 shown in the diagram does not indicate that there is only one processor 310, but only indicates the positional relationship of the processor 310 relative to other devices. In practical applications, there can be one or more processors 310; similarly, Figure 4 The memory 311 illustrated herein has the same meaning, that is, it is only used to indicate the positional relationship of memory 311 relative to other devices. In practical applications, there can be one or more memories 311. When the processor 310 runs the computer program, the interface integration processing method applied to the above-mentioned electronic device is implemented.

[0106] The device may also include at least one network interface 312. The various components of the device are coupled together via a bus system 313. It is understood that the bus system 313 is used to implement communication between these components. In addition to a data bus, the bus system 313 also includes a power bus, a control bus, and a status signal bus. However, for clarity, in... Figure 4 The general designated all buses as Bus System 313.

[0107] The memory 311 can be volatile memory or non-volatile memory, or both. The non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), ferromagnetic random access memory (FRAM), flash memory, magnetic surface memory, optical disc, or compact disc read-only memory (CD-ROM); the magnetic surface memory can be disk storage or magnetic tape storage. The volatile memory can be random access memory (RAM), which is used as an external cache. By way of example, but not limitation, many forms of RAM are available, such as Static Random Access Memory (SRAM), Synchronous Static Random Access Memory (SSRAM), Dynamic Random Access Memory (DRAM), Synchronous Dynamic Random Access Memory (SDRAM), Double Data Rate Synchronous Dynamic Random Access Memory (DDRSDRAM), Enhanced Synchronous Dynamic Random Access Memory (ESDRAM), SyncLink Dynamic Random Access Memory (SLDRAM), and Direct Rambus Random Access Memory (DRRAM).The memory 311 described in the embodiments of the present invention is intended to include, but is not limited to, these and any other suitable types of memory.

[0108] The memory 311 in this embodiment of the invention is used to store various types of data to support the operation of the device. Examples of such data include: any computer programs used to operate on the device, such as operating systems and applications; contact data; phonebook data; messages; pictures; videos, etc. The operating system includes various system programs, such as the framework layer, core library layer, driver layer, etc., used to implement various basic services and handle hardware-based tasks. Applications can include various applications, such as media players, browsers, etc., used to implement various application services. Here, the program implementing the method of this embodiment of the invention can be included in the application.

[0109] Based on the same inventive concept as the foregoing embodiments, this embodiment also provides a computer storage medium storing a computer program. The computer storage medium can be a magnetic random access memory (FRAM), a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), a flash memory, a magnetic surface memory, an optical disc, or a compact disc read-only memory (CD-ROM), etc.; it can also be various devices including one or any combination of the above-mentioned memories, such as mobile phones, computers, tablet devices, personal digital assistants, etc. When the computer program stored in the computer storage medium is executed by a processor, it implements the interface integration processing method applied to the above-mentioned device. For the specific steps implemented when the computer program is executed by the processor, please refer to [link to relevant documentation]. Figure 1 The description of the illustrated embodiments will not be repeated here.

[0110] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0111] In this document, the terms “comprising,” “including,” or any other variations thereof are intended to cover non-exclusive inclusion, which includes not only the elements listed but also other elements not expressly listed.

[0112] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in the present invention should be included within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.

Claims

1. An interface integration processing method, characterized by, The method comprises the following steps: obtaining configuration code and interface request data of a client; starting a work thread in a preset thread pool to process the interface request data, wherein the preset thread pool is used to manage a preset number of work threads; preprocessing the interface request data according to the configuration code to obtain preprocessing data; calling a target interface according to the configuration code and the preprocessing data, and sending result data returned by the target interface to the client; before the step of obtaining the configuration code and the interface request data of the client, the method further comprises: establishing a connection channel with the client; obtaining the configuration code and the interface request data of the client through the connection channel; after the step of obtaining the configuration code and the interface request data of the client through the connection channel, the method further comprises: polling the connection channel; when a read-write event occurs in the connection channel, sending interface request data in the connection channel to a TaskPipeline module; starting a work thread in a preset thread pool to process the interface request data in the TaskPipeline module; the step of preprocessing the interface request data according to the configuration code to obtain preprocessing data comprises: when the number of interface requests with read-write events is greater than the capacity of the TaskPipeline module, the TaskPipeline module performs first flow control on the interface requests to be processed; and the preset number of work threads managed by the preset thread pool performs second flow control on the interface requests.

2. The interface integration processing method of claim 1, wherein, the step of obtaining the configuration code and the interface request data of the client further comprises: obtaining configuration information of the client, wherein the configuration information comprises at least one of a target address, a protocol type, authentication information, a parameter format, a flow control strategy, and an exception handling mechanism; generating the configuration code of the client according to the configuration information.

3. The interface integration processing method of claim 1, wherein, the step of preprocessing the interface request data according to the configuration code to obtain preprocessing data comprises: determining at least one subtask for preprocessing the interface request data according to the configuration code of the client; generating a task chain for preprocessing the interface request data according to the subtask; preprocessing the interface request data according to the task chain to obtain the preprocessing data.

4. The interface integration processing method of claim 3, wherein, the subtask comprises at least one of flow control, authentication, data processing, protocol adaptation, interface configuration, interface calling, and result data processing.

5. The interface integration processing method of claim 1, wherein, the step of preprocessing the interface request data according to the configuration code to obtain preprocessing data further comprises: asynchronously processing asynchronous processing tasks occurring in the process of preprocessing the interface request data, wherein the asynchronous processing tasks comprise at least one of monitoring and alarming, exception handling, data collection, data analysis, and log service.

6. An interface integrated processing system, characterized by, the system comprises: an AcceptorHandler module, configured to obtain configuration code and interface request data of a client, and send result data returned by a target interface to the client; A TaskPipeline module is configured to start a work thread in a preset thread pool to process the interface request data, and the preset thread pool is configured to manage a preset number of work threads. The TaskPipeline module is further configured to preprocess the interface request data according to the configuration code to obtain preprocessed data, and to call a target interface according to the configuration code and the preprocessed data. Before the configuration code and the interface request data of the client are obtained, the method further includes: establishing a connection channel with the client; obtaining the configuration code and the interface request data of the client through the connection channel; After the configuration code and the interface request data sent by the client are obtained through the connection channel, the method further includes: polling the connection channel; when a read-write event occurs in the connection channel, sending the interface request data in the connection channel to the TaskPipeline module; starting a work thread in a preset thread pool to process the interface request data in the TaskPipeline module; The preprocessed data includes: when the number of interface requests with read-write events is greater than the capacity of the TaskPipeline module, the TaskPipeline module performs first flow control on the interface requests to be processed; and the preset number of work threads managed by the preset thread pool performs second flow control on the interface requests.

7. An electronic device, comprising: The method includes: a processor and a memory storing a computer program, when the processor runs the computer program, the steps of the interface integration processing method in any one of claims 1 to 5 are implemented.

8. A readable storage medium, characterized by, a computer program is stored, and when the computer program is executed by a processor, the steps of the interface integration processing method in any one of claims 1 to 5 are implemented.

Citation Information

Patent Citations

  • Method for implementing protocol conversion by API gateway

    CN108989356A

  • Data processing method and device and computer storage medium

    CN114710572A