Interface access management method, device, equipment and medium for application program interface

Through the action management system, the basic information and parameter entry data of the API interface are automatically processed, and the problems of cumbersome API docking process and the incoming interface of the interface cannot be synchronized in real time in the existing technology are solved, thereby achieving efficient API communication.

CN118708377BActive Publication Date: 2025-04-11SHANGHAI SHUHE INFORMATION TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202410752838.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-06-12
Publication Date
2025-04-11
Estimated Expiration
2044-06-12

AI Technical Summary

Technical Problem

In the prior art, the API docking process is cumbersome, and the interface parameters are not synchronized in real time, resulting in low API communication efficiency.

Method used

The basic information, input parameters and output parameters of the application program interface are obtained through the action management system, the parameter data is automatically processed and the request method is determined, so as to realize API interface access management and avoid manual code development.

Benefits of technology

It simplifies the API docking process, realizes rapid synchronization of interface parameter changes, and improves API communication efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118708377B_ABST
    Figure CN118708377B_ABST
Patent Text Reader

Abstract

The present application relates to an interface access management method, device, computer equipment and storage medium of an application program interface, including: in response to the triggering operation of the target access action of the application program interface, obtaining the basic information, input parameters and output parameters of the target access action from the action management system; obtaining input parameter data based on the input parameters, and determining the request method and interface access request of the target application interface based on the basic information; encapsulating the input parameter data into the interface access request, and initiating the interface access request to the application in a request manner; receiving the service data fed back by the application in response to the interface access request, processing the fed back service data based on the output parameters and the set output format to obtain the response data; and feeding back the response data to the initiator of the triggering operation of the target access action. The above method realizes that the API docking process is simple and feasible, and the interface input parameters can be quickly synchronized when they are changed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data processing technology, and in particular to an interface access management method, device, computer equipment and storage medium for an application program interface. Background Art

[0002] For API (application programming interface) communication between production servers, the current mainstream method is to define the interface through code. When an application needs to access this application programming interface, the connection is achieved by writing code; or the API message body is defined, and the system obtains the API address and parameters that need to be accessed by parsing the message body to make API communication calls.

[0003] In this way, the interface code changes need to go through the interface synchronization-development-testing-online process, and when there are changes in the interface input parameters, the interface code needs to be modified and the online process needs to be re-modified. Therefore, the API docking process is cumbersome and the interface input parameters cannot be synchronized and effective in real time. Summary of the invention

[0004] Based on this, it is necessary to provide an interface access management method, device, computer equipment and storage medium for an application program interface to address the above-mentioned technical problems. The interaction of application program interfaces between systems does not require manual code development and online docking. The API docking process is simple and feasible, and the interface input parameters can be quickly synchronized when changed.

[0005] An interface access management method for an application program interface comprises: in response to a trigger operation of a target access action of the application program interface, obtaining basic information, input parameters and output parameters of the target access action from an action management system; obtaining input parameter data based on the input parameters, and determining a request mode and an interface access request of the target application interface based on the basic information; encapsulating the input parameter data into an interface access request, and initiating an interface access request to an application program in a request mode; receiving service data fed back by the application program in response to the interface access request, processing the fed back service data based on output parameters and a set output format to obtain response data; and feeding back the response data to the initiator of the trigger operation of the target access action.

[0006] In one of the embodiments, obtaining input parameter data based on input parameters includes: identifying a linkage relationship between multiple target input parameters among multiple input parameters; obtaining input parameter data of each target input parameter based on the linkage relationship; and obtaining input parameter data of other input parameters that are not in a linkage relationship.

[0007] In one of the embodiments, obtaining input parameter data of each target input parameter based on the linkage relationship includes: determining the target input parameter of the main linkage and the target input parameter of the slave linkage based on the linkage relationship; if it is identified that the input parameter data of the target input parameter of the main linkage comes from a first external data source, reading the interface call information of the first external data source, requesting the first external data source to obtain configuration data based on the interface call information of the first external data source, and filtering out the input parameter data of the target input parameter of the main linkage and the input parameter data of the target input parameter of the slave linkage from the configuration data; if it is identified that the input parameter data of the target input parameter of the main linkage comes from an internal data source, and the input parameter data of the target input parameter of the slave linkage comes from the first external data source, obtaining the input parameter data of the target input parameter of the main linkage from the internal data source, and reading the interface call information of the first external data source, using the input parameter data of the target input parameter of the main linkage as the input parameter data of the first external data source, and requesting the first external data source to obtain configuration data based on the interface call information of the first external data source, and filtering out the input parameter data of the target input parameter of the slave linkage from the configuration data.

[0008] In one of the embodiments, obtaining input parameter data of other input parameters of non-linked relationships includes: if it is identified that the input parameter data of other input parameters comes from a second external data source, requesting the second external data source to obtain configuration data based on the interface call information of the second external data source, and filtering out the input parameter data of other input parameters from the configuration data; if it is identified that the input parameter data of other input parameters comes from an internal data source, obtaining the input parameter data of other input parameters from the internal data source.

[0009] In one of the embodiments, before the step of obtaining the basic information, input parameters and output parameters of the target access action from the action management system, it also includes: obtaining relevant data of the target access action from an internal data source; obtaining the basic information of the target access action from the relevant data; if the relevant data contains the input parameters of the target access action, then obtaining the input parameters of the target access action from the relevant data; if the relevant data does not contain the input parameters of the target access action, then obtaining the input parameters of the target access action through a manual configuration interface; if the relevant data contains the output parameters of the target access action, then obtaining the output parameters of the target access action from the relevant data; if the relevant data does not contain the output parameters of the target access action, then obtaining the output parameters of the target access action through a manual configuration interface; the basic information, input parameters and output parameters of the target access action are recorded in the action management system.

[0010] In one of the embodiments, an interface access management method for an application program interface also includes: if the relevant data contains a linkage relationship among multiple target input parameters, then the linkage relationship among the multiple target input parameters is configured and then the multiple target input parameters are added to the action management system; if the relevant data does not contain a linkage relationship among multiple target input parameters, then the linkage relationship among the multiple target input parameters is obtained through a manual configuration interface and the linkage relationship among the multiple target input parameters is configured and then the multiple target input parameters are added to the action management system; if it is identified that the input parameter data of any input parameter comes from an external data source, then any input parameter is marked to indicate that the input parameter data needs to be obtained by calling an external data source, and the interface call information of the corresponding external data source is configured for any input parameter, so that the corresponding external data source can be called through the interface call information to obtain the corresponding input parameter data.

[0011] In one of the embodiments, the input parameter data is encapsulated into the interface access request, including: identifying the data format of the target application interface, converting the input parameter data according to the data format of the target application interface and encapsulating it into the interface access request; processing the feedback service data based on the output parameters and the set output format to obtain response data, including: identifying each output parameter data in the feedback service data based on the output parameters; converting the parameters of each output parameter data according to the set output format to obtain response data that meets the requirements of the upstream system.

[0012] An interface access management device for an application program interface, comprising: a first acquisition module, used to respond to the trigger operation of a target access action of the application program interface, and obtain basic information, input parameters and output parameters of the target access action from an action management system; a second acquisition module, used to obtain input parameter data based on the input parameters, and determine the request mode and interface access request of the target application interface based on the basic information; a sending module, used to encapsulate the input parameter data into an interface access request, and initiate an interface access request to an application program in a request mode; a response data processing module, used to receive service data fed back by the application program in response to the interface access request, and process the fedback service data based on the output parameters and the set output format to obtain response data; and a feedback module, used to feed back the response data to the initiator of the trigger operation of the target access action.

[0013] A computer device includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the steps of any of the above-mentioned embodiments are implemented.

[0014] A computer-readable storage medium stores a computer program, which implements the steps of any of the above-mentioned method embodiments when the computer program is executed by a processor.

[0015] The above-mentioned interface access management method, device, computer equipment and storage medium of an application program interface, in response to the triggering operation of the target access action of the application program interface, obtains the basic information, input parameters and output parameters of the target access action from the action management system; obtains the input parameter data based on the input parameters, and determines the request method and interface access request of the target application interface based on the basic information; encapsulates the input parameter data into the interface access request, and initiates the interface access request to the application program in the request method; receives the service data fed back by the application program in response to the interface access request, processes the fed back service data based on the output parameters and the set output format, and obtains the response data; and feeds back the response data to the initiator of the triggering operation of the target access action.

[0016] Therefore, the interaction of application program interfaces between systems does not need to be connected through manual code development and online launch. The basic information, input parameters and output parameters of the application program interface can be directly obtained from the action management system for API connection. The API connection process is simple and feasible, and the interface input parameters can be quickly synchronized when they change. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] Figure 1 An application environment diagram of an interface access management method of an application program interface in one embodiment;

[0018] Figure 2 A schematic diagram of a flow chart of an interface access management method of an application program interface in one embodiment;

[0019] Figure 3 A configuration interface diagram of basic information of a target access action in an embodiment;

[0020] Figure 4 A diagram of a configuration interface for input parameters of a target access action in one embodiment;

[0021] Figure 5 A diagram of a configuration interface for output parameters of a target access action in one embodiment;

[0022] Figure 6 It is an interactive schematic diagram of the configuration operation of the target access action in one embodiment;

[0023] Figure 7 for Figure 6 An interactive schematic diagram of a specific configuration of a target access action in an embodiment;

[0024] Figure 8 It is a schematic diagram of interactions in the execution process of an interface access management method of an application program interface in one embodiment;

[0025] Fig. 9A structural block diagram of an interface access management device for an application program interface in one embodiment;

[0026] Fig.10 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0027] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0028] The present application provides an interface access management method for an application program interface, which is applied to Figure 1 In the application environment shown. Figure 1 As shown, the interface access management system 100 is used to implement an interface access management method for an application program interface of the present application. Specifically, the interface access management system 100 responds to the trigger operation of the initiator 300 of the target access action of the application program interface, obtains the basic information, input parameters and output parameters of the target access action from the action management system 200; obtains the input parameter data based on the input parameters, and determines the request method and interface access request of the target application interface based on the basic information; encapsulates the input parameter data into the interface access request, and initiates the interface access request to the application 400 in a request manner; receives the service data fed back by the application 400 in response to the interface access request, processes the fed back service data based on the output parameters and the set output format, and obtains the response data; and feeds back the response data to the initiator 300 of the trigger operation of the target access action.

[0029] In one embodiment, Figure 2 As shown, a method for managing interface access to an application program interface is provided, and the method is applied to Figure 1 The interface access management system 100 in FIG. 1 is taken as an example to illustrate, and the following steps are included:

[0030] S202, in response to a triggering operation of a target access action of an application program interface, obtaining basic information, input parameters, and output parameters of the target access action from an action management system.

[0031] In this embodiment, the API interface of any application can be configured with multiple access actions. When the target access action of the API interface is triggered, the attribute information of the target access action is obtained from the action management system. The attribute information includes basic information, input parameters and output parameters of the target access action. Specifically, the attribute information includes basic information such as variables, input parameters and output parameters of the target access action, attribute description information, etc. Among them, the configuration of the basic information of the target access action is as follows: Figure 3As shown in the figure, basic information may include action name, action category, triggered application, request method, whether to retry, action code, implementation method, API, and timeout period. The configuration of input parameters of the target access action is as follows: Figure 4 As shown, the configured input parameters can be formatted and provided for the management of the input parameters.

[0032] S204, obtaining input parameter data based on the input parameters, and determining the request mode and interface access request of the target application interface based on the basic information.

[0033] In this embodiment, Figure 3 As shown, based on the basic information of the target access action, the request method and API of the target application interface can be determined, and based on the API, the request address of the interface access request can be obtained. Figure 4 As shown, the corresponding input parameter data can be pulled based on the configured input parameters, and the input parameter data can be formatted, adjusted and managed.

[0034] In one embodiment, the above-mentioned obtaining of input parameter data based on input parameters includes: identifying the linkage relationship between multiple target input parameters among multiple input parameters; obtaining the input parameter data of each target input parameter based on the linkage relationship; and obtaining the input parameter data of other input parameters with non-linkage relationships.

[0035] In this embodiment, the linkage relationship means that when the input parameter data of one input parameter changes, the input parameter data of other input parameters associated with it also change accordingly. The linkage relationship includes master linkage and slave linkage. The slave linkage is controlled by the master linkage, and when the master linkage changes, the slave linkage changes accordingly.

[0036] There are multiple input parameters for the target access action, and there are multiple target input parameters with linkage relationships among the multiple input parameters. At this time, the input parameter data of each target input parameter is obtained based on the linkage relationship. For input parameters with no linkage relationship, the corresponding input parameter data can be directly obtained without being constrained by the linkage relationship. For example, multiple target input parameters with linkage relationships include data suppliers, cache days, and tokens. It is necessary to obtain the input parameter data of the data supplier, and then determine the input parameter data of the cache days and the input parameter data of the token based on the input parameter data of the data supplier. Therefore, accurate input parameter data can be obtained quickly.

[0037] In one example, the above-mentioned obtaining the input parameter data of each target input parameter based on the linkage relationship includes: determining the target input parameter of the main linkage and the target input parameter of the slave linkage based on the linkage relationship; if it is identified that the input parameter data of the target input parameter of the main linkage comes from the first external data source, then reading the interface call information of the first external data source, requesting the first external data source to obtain configuration data based on the interface call information of the first external data source, and filtering out the input parameter data of the target input parameter of the main linkage and the input parameter data of the target input parameter of the slave linkage from the configuration data; if it is identified that the input parameter data of the target input parameter of the main linkage comes from the internal data source, and the input parameter data of the target input parameter of the slave linkage comes from the first external data source, then obtaining the input parameter data of the target input parameter of the main linkage from the internal data source, and reading the interface call information of the first external data source, using the input parameter data of the target input parameter of the main linkage as the input parameter data of the first external data source, and requesting the first external data source to obtain configuration data based on the interface call information of the first external data source, and filtering out the input parameter data of the target input parameter of the slave linkage from the configuration data.

[0038] In this example, the input parameter data can come from an internal data source or an external data source. For the acquisition of the input parameter data of each target input parameter that has a linkage relationship: if the input parameter data of the target input parameter of the main linkage comes from the first external data source, since the input parameter data of the target input parameter of the slave linkage is constrained by the target input parameter of the main linkage, the input parameter data of the target input parameter of the slave linkage also needs to be obtained from the first external data source, so the input parameter data of the target input parameter of the main linkage and the input parameter data of the target input parameter of the slave linkage are obtained through the first external data source. If the input parameter data of the target input parameter of the main linkage comes from the internal data source, and the input parameter data of the target input parameter of the slave linkage comes from the first external data source, after obtaining the input parameter data of the target input parameter of the main linkage from the internal data source, it is used as the input parameter data of the first external data source, and the input parameter data of the target input parameter of the slave linkage is requested from the first external data source. Among them, the interface call information of the first external data source is pre-defined by the system, and a data acquisition request can be initiated to the first external data source based on the interface call information.

[0039] For example, multiple target input parameters with linkage relationships include data suppliers, cache days, and tokens. The input parameter data of the data supplier is obtained from the internal data source, and the input parameter data of the data supplier is used as a constraint condition to obtain values ​​from the first external data source, thereby obtaining the input parameter data of the cache days and the input parameter data corresponding to the token.

[0040] In one example, the above-mentioned acquisition of input parameter data of other input parameters with non-linked relationships includes: if it is identified that the input parameter data of other input parameters comes from a second external data source, then based on the interface call information of the second external data source, requesting the second external data source to obtain configuration data, and filtering out the input parameter data of other input parameters from the configuration data; if it is identified that the input parameter data of other input parameters comes from an internal data source, then acquiring the input parameter data of other input parameters from the internal data source.

[0041] In this example, when the input parameter data of other input parameters of non-linked relationships come from the second external data source, the input parameter data of other input parameters are obtained through the second external data source. If it comes from an internal data source, the input parameter data of other input parameters are obtained directly from the internal data source. Among them, the second external data source and the first external data source can be the same data source or different data sources. The "first" and "second" here are mainly used to distinguish the external data sources expressed in the two examples.

[0042] In one embodiment, before the above-mentioned step of obtaining the basic information, input parameters and output parameters of the target access action from the action management system, it also includes: obtaining relevant data of the target access action from an internal data source; obtaining the basic information of the target access action from the relevant data; if the relevant data contains the input parameters of the target access action, then obtaining the input parameters of the target access action from the relevant data; if the relevant data does not contain the input parameters of the target access action, then obtaining the input parameters of the target access action through a manual configuration interface; if the relevant data contains the output parameters of the target access action, then obtaining the output parameters of the target access action from the relevant data; if the relevant data does not contain the output parameters of the target access action, then obtaining the output parameters of the target access action through a manual configuration interface; the basic information, input parameters and output parameters of the target access action are recorded in the action management system.

[0043] Among them: if the relevant data contains a linkage relationship among multiple target input parameters, the linkage relationship among the multiple target input parameters is configured and then the multiple target input parameters are dropped into the action management system; if the relevant data does not contain a linkage relationship among multiple target input parameters, the linkage relationship among the multiple target input parameters is obtained through a manual configuration interface and the linkage relationship among the multiple target input parameters is configured and then the multiple target input parameters are dropped into the action management system; if it is identified that the input parameter data of any input parameter comes from an external data source, any input parameter is marked to indicate that the input parameter data needs to be obtained by calling an external data source, and the interface call information of the corresponding external data source is configured for any input parameter, so that the corresponding external data source can be called through the interface call information to obtain the corresponding input parameter data.

[0044] In this embodiment, before the above step of obtaining basic information, input parameters and output parameters of the target access action from the action management system, it also includes a configuration operation for the target access action, and the data of the configured target access action is recorded in the action management system.

[0045] Specifically, the configuration operation of the target access action is as follows: Figure 6 As shown in the figure. Accessing an API means obtaining the data of the accessed API from an internal data source. Action input parameters refer to the input parameters of the target access action, and action output parameters refer to the output parameters of the target access action. Figure 6 As shown, the basic information part of the action mainly obtains the basic data related to the target application interface and obtains the basic information of the action from the basic data. The input parameter part of the action mainly configures the input parameters of the action. The input parameters of the action can be obtained by screening the basic data obtained in the previous step or directly configured manually. If the input parameters of the action are obtained through an external data source, the data source type and remote data source of the input parameters of the action are configured, and then the interface of the remote data source is configured. The input parameters of the action are configured by calling the structure returned by the remote data source, and the configuration method is field mapping. If linkage needs to be configured, the linkage field is configured. In addition, input parameter conversion can also be selected. That is, the obtained action input parameters are configured for parameter conversion to match the input parameter type of the target application interface. In addition, template input parameters can also be configured to save the obtained action input parameters in the form of a template, and then query parameters through the template when the action input parameters are used later, and quickly read the relevant action input parameters. The output parameter part of the action is mainly used to configure the output parameters of the access action of the target application interface, and the action output parameters are configured for parameter conversion to match the output parameter type of the target application interface. The node verification part mainly verifies the basic information of the above-configured actions, action input parameters and action output parameters. After the verification is successful, the configured information is saved and recorded in the action management system.

[0046] The above actions or access actions refer to calling API methods to implement interface calls. For the specific configuration process, please refer to Figure 7 As shown, the basic data of the accessed API is obtained from the action management system in the internal data source. The configuration operation process is as follows:

[0047] 1) Enter the action management interface.

[0048] 2) Configure the properties of the action, including the person in charge, URL, and input / output parameters.

[0049] 3) Users can choose to configure parameter conversion, customize the parameter type of the interface, and field key.

[0050] 4) Configure action templates to simplify action definitions.

[0051] 5) Configure parameter conversion. You can convert parameter types and field keys for the response of the interface, and you can customize rules to control the success or failure of the interface call.

[0052] 6) Configure the fuse attributes. You can configure the fuse rules separately for the interface.

[0053] 7) Configure save verification. When using this action, it must pass the verification rules to take effect, ensuring the validity of the action configuration.

[0054] 8) The execution end obtains the action configuration in real time when calling and performs related operations.

[0055] S206, encapsulate the input parameter data into an interface access request, and initiate the interface access request to the application program in a request manner.

[0056] In this embodiment, after the input parameter data is encapsulated into the interface access request, the interface access request is initiated to the application program through the request method. Figure 3 As shown in the figure, the API gives the URL address of the interface access request, encapsulates the input parameter data into the interface access request, and sends a POST request based on the API.

[0057] S208, receiving service data fed back by the application program in response to the interface access request, and processing the fed back service data based on output parameters and a set output format to obtain response data.

[0058] In this embodiment, the service data fed back by the application is related to the data format and type settings within the application. The output parameters of the target access action can identify the fed-back service data. For example, the fed-back service data includes the name of the data source and the specific data corresponding to the credit name. The specific data is set according to the data format and type settings within the application. The output parameters of the target access action are the name of the data source and the credit name. Therefore, the corresponding data can be directly identified and extracted from the fed-back service data. The configuration of the output parameters of the target access action is as follows: Figure 5 shown.

[0059] Set the output format to the format of the output parameter data in this system. After extracting the output parameter data fed back by the application from the fed-back service data through the output parameters of the target access action, process the output parameter data according to the set output format to obtain response data that meets the requirements of this system.

[0060] S210, feeding back response data to the initiator of the triggering operation of the target access action.

[0061] In this embodiment, the response data is fed back to the initiator of the triggering operation of the target access action. Therefore, it is not necessary to configure the interface code for the initiator to trigger the target access action, so as to initiate an interface access request to the application by running the interface code, and the result data of the target access action required by the initiator, i.e., the above-mentioned response data, can be obtained through the above-mentioned steps S202-S208.

[0062] In one example, the input parameter data is encapsulated into an interface access request, including: identifying the data format of the target application interface, converting the input parameter data according to the data format of the target application interface, and then encapsulating it into the interface access request; the above-mentioned processing of the feedback service data based on the output parameters and the set output format to obtain response data includes: identifying each output parameter data in the feedback service data based on the output parameters; performing parameter conversion on each output parameter data according to the set output format to obtain response data that meets the requirements of the upstream system.

[0063] Specifically, the input parameter of the target application interface is set with a corresponding data format. The input parameter data obtained above meets the data format of this system, but does not meet the data format of the target application interface. Therefore, the input parameter data needs to be converted according to the data format of the target application interface and then encapsulated into the interface access request. In addition, the service data fed back by the target application also meets the data format set internally by the target application. Here, it is necessary to identify each output parameter data in the service data through the output parameter, and then convert each output parameter data according to the set output format to obtain the response data that meets the requirements of the upstream system. Among them, the upstream system refers to the initiator of the trigger operation of the target access action. That is, the device / platform / system that needs to obtain the result data of the target access action.

[0064] The above-mentioned interface access management method of an application program interface, in response to the triggering operation of the target access action of the application program interface, obtains the basic information, input parameters and output parameters of the target access action from the action management system; obtains the input parameter data based on the input parameters, and determines the request method and interface access request of the target application interface based on the basic information; encapsulates the input parameter data into the interface access request, and initiates the interface access request to the application program in the request method; receives the service data fed back by the application program in response to the interface access request, processes the fedback service data based on the output parameters and the set output format, and obtains the response data; and feeds back the response data to the initiator of the triggering operation of the target access action. Therefore, the interaction of the application program interface between systems does not need to be connected through the online form of manual code development, but directly obtains the basic information, input parameters and output parameters of the application program interface from the action management system for API docking. The API docking process is simple and feasible, and can be quickly synchronized when the interface input parameters change.

[0065] The above-mentioned interface access management method of an application program interface has the following execution process: Figure 8 As shown. An action executor and an action processor are set in the interface access management system 100. The action executor is used to initiate an interface access request for the application program interface, that is, to create an access action for the application program. The action processor is used to execute the access action and return the execution result to the action executor. In response to the trigger operation of the access action initiated by the action executor, the action processor obtains the configuration of the access action from the action management system and converts the request parameters in the configuration. The request parameter conversion here includes the conversion of the input parameter data obtained in the configuration and the input parameter data obtained from the external data source. Then, the request parameters are encapsulated into the access request of the application program to execute the access action. The response value returned by the application program is received, and the response value here is the service data fed back above. The returned response value is converted so that the converted response value meets the system usage requirements, and then the converted response value is returned to the action executor, so that the action executor can directly obtain the execution result of the access action without the need to configure the corresponding interface code for adapting the downstream application program interface.

[0066] An interface access management method of an application program interface of the present application:

[0067] 1) New interface is convenient for docking:

[0068] There is no need for code docking, development, testing, and online deployment. New interfaces can be accessed directly through configuration.

[0069] 2) Flexible customization of input and output parameters

[0070] All fields of input and output parameters can be configured with parameter conversion. The parameter names of the access system can also be supported through parameter conversion when the types are different.

[0071] 3) Support flexible definition of interface response results

[0072] Supports custom fuse policies in interface dimensions; supports response result configuration in interface dimensions. Parameter results can be filtered out through configuration.

[0073] 4) Support save verification of access actions

[0074] You can initiate a save check during configuration. If the configuration is wrong, it cannot be saved, reducing errors in the production environment.

[0075] It should be understood that, although the steps in the flowchart are displayed in sequence as indicated by the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and these steps can be executed in other orders. Moreover, at least a portion of the steps in the accompanying drawings may include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least a portion of the sub-steps or stages of other steps.

[0076] The present application also provides an interface access management device for an application program interface. Fig. 9 As shown, it includes a first acquisition module 902, a second acquisition module 904, a sending module 906, a response data processing module 908 and a feedback module 910. The first acquisition module 902 is used to obtain the basic information, input parameters and output parameters of the target access action from the action management system in response to the triggering operation of the target access action of the application interface; the second acquisition module 904 is used to obtain the input parameter data based on the input parameters, and determine the request mode and interface access request of the target application interface based on the basic information; the sending module 906 is used to encapsulate the input parameter data into the interface access request, and initiate the interface access request to the application in the request mode; the response data processing module 908 is used to receive the service data fed back by the application in response to the interface access request, and process the fed back service data based on the output parameters and the set output format to obtain the response data; the feedback module 910 is used to feed back the response data to the initiator of the triggering operation of the target access action.

[0077] In one of the embodiments, obtaining input parameter data based on input parameters includes: identifying a linkage relationship between multiple target input parameters among multiple input parameters; obtaining input parameter data of each target input parameter based on the linkage relationship; and obtaining input parameter data of other input parameters that are not in a linkage relationship.

[0078] In one of the embodiments, obtaining input parameter data of each target input parameter based on the linkage relationship includes: determining the target input parameter of the main linkage and the target input parameter of the slave linkage based on the linkage relationship; if it is identified that the input parameter data of the target input parameter of the main linkage comes from a first external data source, reading the interface call information of the first external data source, requesting the first external data source to obtain configuration data based on the interface call information of the first external data source, and filtering out the input parameter data of the target input parameter of the main linkage and the input parameter data of the target input parameter of the slave linkage from the configuration data; if it is identified that the input parameter data of the target input parameter of the main linkage comes from an internal data source, and the input parameter data of the target input parameter of the slave linkage comes from the first external data source, obtaining the input parameter data of the target input parameter of the main linkage from the internal data source, and reading the interface call information of the first external data source, using the input parameter data of the target input parameter of the main linkage as the input parameter data of the first external data source, and requesting the first external data source to obtain configuration data based on the interface call information of the first external data source, and filtering out the input parameter data of the target input parameter of the slave linkage from the configuration data.

[0079] In one of the embodiments, obtaining input parameter data of other input parameters of non-linked relationships includes: if it is identified that the input parameter data of other input parameters comes from a second external data source, requesting the second external data source to obtain configuration data based on the interface call information of the second external data source, and filtering out the input parameter data of other input parameters from the configuration data; if it is identified that the input parameter data of other input parameters comes from an internal data source, obtaining the input parameter data of other input parameters from the internal data source.

[0080] In one of the embodiments, an interface access management device for an application program interface also includes a configuration module, which is used to obtain relevant data of a target access action from an internal data source; obtain basic information of the target access action from the relevant data; if the relevant data contains input parameters of the target access action, obtain the input parameters of the target access action from the relevant data, if the relevant data does not contain the input parameters of the target access action, obtain the input parameters of the target access action through a manual configuration interface; if the relevant data contains output parameters of the target access action, obtain the output parameters of the target access action from the relevant data, if the relevant data does not contain the output parameters of the target access action, obtain the output parameters of the target access action through a manual configuration interface; and store the basic information, input parameters and output parameters of the target access action in the action management system.

[0081] In one of the embodiments, the configuration module is also used to, if the relevant data contains a linkage relationship among multiple target input parameters, configure the linkage relationship among multiple target input parameters and then add the multiple target input parameters to the action management system; if the relevant data does not contain a linkage relationship among multiple target input parameters, obtain the linkage relationship among multiple target input parameters through a manual configuration interface, configure the linkage relationship among multiple target input parameters and then add the multiple target input parameters to the action management system; if it is identified that the input parameter data of any input parameter comes from an external data source, mark any input parameter to indicate that the input parameter data needs to be obtained by calling an external data source, and configure the interface call information of the corresponding external data source for any input parameter, so that the corresponding external data source can be called through the interface call information to obtain the corresponding input parameter data.

[0082] In one of the embodiments, the input parameter data is encapsulated into the interface access request, including: identifying the data format of the target application interface, converting the input parameter data according to the data format of the target application interface and encapsulating it into the interface access request; processing the feedback service data based on the output parameters and the set output format to obtain response data, including: identifying each output parameter data in the feedback service data based on the output parameters; converting the parameters of each output parameter data according to the set output format to obtain response data that meets the requirements of the upstream system.

[0083] For the specific definition of an interface access management device for an application program interface, please refer to the definition of an interface access management method for an application program interface above, which will not be repeated here. Each module in the above-mentioned interface access management device for an application program interface can be implemented in whole or in part through software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.

[0084] In one embodiment, a computer device is provided. The computer device may be an action processor in the interface access management system 100. The internal structure diagram thereof may be as follows: Fig.10 As shown. The computer device includes a processor, a memory, a network interface and a database connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the computer device is used to exchange information with downstream applications, etc. When the computer program is executed by the processor, it implements the interface access management method of the above-mentioned application interface.

[0085] Those skilled in the art will understand that Fig.10 The structure shown in the figure is only a block diagram of a part of the structure related to the scheme of the present application, and does not constitute a limitation on the computer device to which the scheme of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different arrangement of components.

[0086] In one embodiment, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the following steps when executing the computer program: in response to a trigger operation of a target access action of an application program interface, obtaining basic information, input parameters, and output parameters of the target access action from an action management system; obtaining input parameter data based on the input parameters, and determining a request mode and an interface access request of the target application interface based on the basic information; encapsulating the input parameter data into an interface access request, and initiating an interface access request to an application program in a request mode; receiving service data fed back by the application program in response to the interface access request, processing the fed back service data based on the output parameters and a set output format to obtain response data; and feeding back the response data to the initiator of the trigger operation of the target access action.

[0087] In one of the embodiments, when the processor executes a computer program to implement the above-mentioned step of obtaining input parameter data based on input parameters, the following steps are specifically implemented: identifying the linkage relationship between multiple target input parameters among multiple input parameters; obtaining the input parameter data of each target input parameter based on the linkage relationship; and obtaining the input parameter data of other input parameters that are not in a linkage relationship.

[0088] In one of the embodiments, when the processor executes a computer program to implement the above-mentioned step of obtaining the input parameter data of each target input parameter based on the linkage relationship, the following steps are specifically implemented: determining the target input parameter of the main linkage and the target input parameter of the slave linkage based on the linkage relationship; if it is identified that the input parameter data of the target input parameter of the main linkage comes from the first external data source, reading the interface call information of the first external data source, requesting the first external data source to obtain configuration data based on the interface call information of the first external data source, and filtering out the input parameter data of the target input parameter of the main linkage and the input parameter data of the target input parameter of the slave linkage from the configuration data; if it is identified that the input parameter data of the target input parameter of the main linkage comes from the internal data source, and the input parameter data of the target input parameter of the slave linkage comes from the first external data source, obtaining the input parameter data of the target input parameter of the main linkage from the internal data source, and reading the interface call information of the first external data source, using the input parameter data of the target input parameter of the main linkage as the input parameter data of the first external data source, and requesting the first external data source to obtain configuration data based on the interface call information of the first external data source, and filtering out the input parameter data of the target input parameter of the slave linkage from the configuration data.

[0089] In one of the embodiments, when the processor executes a computer program to implement the above-mentioned step of obtaining the input parameter data of other input parameters of non-linked relationships, the following steps are specifically implemented: if it is identified that the input parameter data of other input parameters comes from a second external data source, then based on the interface call information of the second external data source, a request is made to obtain configuration data from the second external data source, and the input parameter data of other input parameters are filtered out from the configuration data; if it is identified that the input parameter data of other input parameters comes from an internal data source, then the input parameter data of other input parameters is obtained from the internal data source.

[0090] In one of the embodiments, the processor implements the following steps when executing the computer program: obtaining relevant data of the target access action from an internal data source; obtaining basic information of the target access action from the relevant data; if the relevant data contains input parameters of the target access action, obtaining the input parameters of the target access action from the relevant data; if the relevant data does not contain the input parameters of the target access action, obtaining the input parameters of the target access action through a manual configuration interface; if the relevant data contains output parameters of the target access action, obtaining the output parameters of the target access action from the relevant data; if the relevant data does not contain the output parameters of the target access action, obtaining the output parameters of the target access action through a manual configuration interface; and logging the basic information, input parameters and output parameters of the target access action into the action management system.

[0091] In one of the embodiments, the processor implements the following steps when executing the computer program: if the relevant data contains a linkage relationship among multiple target input parameters, the linkage relationship among the multiple target input parameters is configured and then the multiple target input parameters are added to the action management system; if the relevant data does not contain a linkage relationship among multiple target input parameters, the linkage relationship among the multiple target input parameters is obtained through a manual configuration interface, the linkage relationship among the multiple target input parameters is configured and then the multiple target input parameters are added to the action management system; if it is identified that the input parameter data of any input parameter comes from an external data source, any input parameter is marked to indicate that the input parameter data needs to be obtained by calling an external data source, and the interface call information of the corresponding external data source is configured for any input parameter, so that the corresponding external data source can be called through the interface call information to obtain the corresponding input parameter data.

[0092] In one of the embodiments, when the processor executes a computer program to implement the above-mentioned step of encapsulating the input parameter data into the interface access request, the following steps are specifically implemented: identifying the data format of the target application interface, converting the input parameter data according to the data format of the target application interface, and then encapsulating it into the interface access request; when the processor executes a computer program to implement the above-mentioned step of processing the feedback service data based on the output parameters and the set output format to obtain the response data, the following steps are specifically implemented: identifying each output parameter data in the feedback service data based on the output parameters; performing parameter conversion on each output parameter data according to the set output format to obtain the response data that meets the requirements of the upstream system.

[0093] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented: in response to a trigger operation of a target access action of an application program interface, basic information, input parameters and output parameters of the target access action are obtained from an action management system; input parameter data is obtained based on the input parameters, and a request method and an interface access request of the target application interface are determined based on the basic information; the input parameter data is encapsulated into an interface access request, and an interface access request is initiated to the application program in a request manner; service data fed back by the application program in response to the interface access request is received, and the fed back service data is processed based on the output parameters and a set output format to obtain response data; and the response data is fed back to the initiator of the trigger operation of the target access action.

[0094] In one of the embodiments, when the computer program is executed by the processor to implement the above-mentioned step of obtaining input parameter data based on input parameters, the following steps are specifically implemented: identifying the linkage relationship between multiple target input parameters among multiple input parameters; obtaining the input parameter data of each target input parameter based on the linkage relationship; and obtaining the input parameter data of other input parameters that are not in a linkage relationship.

[0095] In one of the embodiments, when the computer program is executed by the processor to implement the above-mentioned step of obtaining the input parameter data of each target input parameter based on the linkage relationship, the following steps are specifically implemented: determining the target input parameter of the main linkage and the target input parameter of the slave linkage based on the linkage relationship; if it is identified that the input parameter data of the target input parameter of the main linkage comes from the first external data source, reading the interface call information of the first external data source, requesting the first external data source to obtain configuration data based on the interface call information of the first external data source, and filtering out the input parameter data of the target input parameter of the main linkage and the input parameter data of the target input parameter of the slave linkage from the configuration data; if it is identified that the input parameter data of the target input parameter of the main linkage comes from the internal data source, and the input parameter data of the target input parameter of the slave linkage comes from the first external data source, obtaining the input parameter data of the target input parameter of the main linkage from the internal data source, and reading the interface call information of the first external data source, using the input parameter data of the target input parameter of the main linkage as the input parameter data of the first external data source, and requesting the first external data source to obtain configuration data based on the interface call information of the first external data source, and filtering out the input parameter data of the target input parameter of the slave linkage from the configuration data.

[0096] In one of the embodiments, when the computer program is executed by the processor to implement the above-mentioned step of obtaining the input parameter data of other input parameters of non-linked relationship, the following steps are specifically implemented: if it is identified that the input parameter data of other input parameters comes from a second external data source, then based on the interface call information of the second external data source, the second external data source is requested to obtain configuration data, and the input parameter data of other input parameters are filtered out from the configuration data; if it is identified that the input parameter data of other input parameters comes from an internal data source, then the input parameter data of other input parameters is obtained from the internal data source.

[0097] In one of the embodiments, the computer program implements the following steps when executed by a processor: obtaining relevant data of a target access action from an internal data source; obtaining basic information of the target access action from the relevant data; if the relevant data contains input parameters of the target access action, obtaining the input parameters of the target access action from the relevant data; if the relevant data does not contain the input parameters of the target access action, obtaining the input parameters of the target access action through a manual configuration interface; if the relevant data contains output parameters of the target access action, obtaining the output parameters of the target access action from the relevant data; if the relevant data does not contain the output parameters of the target access action, obtaining the output parameters of the target access action through a manual configuration interface; and logging the basic information, input parameters, and output parameters of the target access action into the action management system.

[0098] In one of the embodiments, the computer program implements the following steps when executed by the processor: if the relevant data contains a linkage relationship among multiple target input parameters, the linkage relationship among the multiple target input parameters is configured and then the multiple target input parameters are entered into the action management system; if the relevant data does not contain a linkage relationship among multiple target input parameters, the linkage relationship among the multiple target input parameters is obtained through a manual configuration interface, the linkage relationship among the multiple target input parameters is configured and then the multiple target input parameters are entered into the action management system; if it is identified that the input parameter data of any input parameter comes from an external data source, any input parameter is marked to indicate that the input parameter data needs to be obtained by calling an external data source, and the interface call information of the corresponding external data source is configured for any input parameter, so that the corresponding external data source can be called through the interface call information to obtain the corresponding input parameter data.

[0099] In one of the embodiments, when the computer program is executed by the processor to implement the above-mentioned step of encapsulating the input parameter data into the interface access request, the following steps are specifically implemented: identifying the data format of the target application interface, converting the input parameter data according to the data format of the target application interface, and then encapsulating it into the interface access request; when the computer program is executed by the processor to implement the above-mentioned step of processing the feedback service data based on the output parameters and the set output format to obtain the response data, the following steps are specifically implemented: identifying each output parameter data in the feedback service data based on the output parameters; performing parameter conversion on each output parameter data according to the set output format to obtain the response data that meets the requirements of the upstream system.

[0100] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).

[0101] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, 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.

[0102] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.

Claims

1. A method for managing interface access to an application program interface, characterized in that: The method comprises: In response to a triggering operation of a target access action of an application program interface, obtaining basic information, input parameters and output parameters of the target access action from an action management system; Acquire input parameter data based on the input parameters, and determine the request mode and interface access request of the target application interface based on the basic information; Encapsulating the input parameter data into the interface access request, and initiating the interface access request to the application program using the request method; receiving service data fed back by the application in response to the interface access request, and processing the fed back service data based on the output parameters and the set output format to obtain response data; Feedback the response data to the initiator of the triggering operation of the target access action; Wherein, the obtaining input parameter data based on the input parameter includes: Identify linkage relationships among multiple target input parameters among multiple input parameters; Determine the target input parameter of the main linkage and the target input parameter of the slave linkage based on the linkage relationship; If it is identified that the input parameter data of the target input parameter of the master linkage comes from the first external data source, the interface call information of the first external data source is read, and based on the interface call information of the first external data source, configuration data is requested from the first external data source, and the input parameter data of the target input parameter of the master linkage and the input parameter data of the target input parameter of the slave linkage are filtered out from the configuration data; If it is identified that the input parameter data of the target input parameter of the master linkage comes from the internal data source, and the input parameter data of the target input parameter of the slave linkage comes from the first external data source, the input parameter data of the target input parameter of the master linkage is obtained from the internal data source, and the interface call information of the first external data source is read, the input parameter data of the target input parameter of the master linkage is used as the input parameter data of the first external data source, and the configuration data is requested from the first external data source based on the interface call information of the first external data source, and the input parameter data of the target input parameter of the slave linkage is filtered out from the configuration data; Get the input data of other input parameters of non-linkage relationships.

2. The method according to claim 1, characterized in that The input parameter data of other input parameters of the non-linkage relationship is obtained, including: If it is identified that the input parameter data of the other input parameters come from the second external data source, then based on the interface call information of the second external data source, request the second external data source to obtain configuration data, and filter out the input parameter data of the other input parameters from the configuration data; If it is identified that the input parameter data of the other input parameters come from an internal data source, the input parameter data of the other input parameters are obtained from the internal data source.

3. The method according to claim 2, characterized in that Before the step of obtaining the basic information, input parameters and output parameters of the target access action from the action management system, the method further includes: Acquire relevant data of the target access action from the internal data source; Obtaining basic information of the target access action from the relevant data; If the relevant data includes the input parameters of the target access action, the input parameters of the target access action are obtained from the relevant data; if the relevant data does not include the input parameters of the target access action, the input parameters of the target access action are obtained through a manual configuration interface; If the relevant data includes the output parameter of the target access action, the output parameter of the target access action is obtained from the relevant data; if the relevant data does not include the output parameter of the target access action, the output parameter of the target access action is obtained through a manual configuration interface; The basic information, input parameters and output parameters of the target access action are recorded in the action management system.

4. The method according to claim 3, characterized in that The method further comprises: If the relevant data includes a linkage relationship of multiple target input parameters, the linkage relationship of the multiple target input parameters is configured and then the multiple target input parameters are entered into the action management system; If the relevant data does not include the linkage relationship of the multiple target input parameters, the linkage relationship of the multiple target input parameters is obtained through a manual configuration interface, the linkage relationship of the multiple target input parameters is configured, and then the multiple target input parameters are entered into the action management system; If it is identified that the input data of any input parameter comes from an external data source, the input parameter is marked to indicate that the input data needs to be obtained by calling the external data source, and the interface call information of the corresponding external data source is configured for the input parameter, so that the corresponding external data source can be called through the interface call information to obtain the corresponding input data.

5. The method according to claim 1, characterized in that: The step of encapsulating the input parameter data into the interface access request includes: Identify the data format of the target application interface, convert the input parameter data according to the data format of the target application interface, and then encapsulate it into the interface access request; The processing of the feedback service data based on the output parameter and the set output format to obtain response data includes: Identify each output parameter data in the feedback service data based on the output parameter; Parameter conversion is performed on each output parameter data according to the set output format to obtain response data that meets the requirements of the upstream system.

6. An interface access management device for an application program interface, characterized in that: The device comprises: A first obtaining module, for obtaining basic information, input parameters and output parameters of the target access action from the action management system in response to a triggering operation of the target access action of the application program interface; A second acquisition module is used to obtain input parameter data based on the input parameters, and determine the request mode and interface access request of the target application interface based on the basic information; A sending module, used for encapsulating the input parameter data into the interface access request, and initiating the interface access request to the application program using the request method; A response data processing module, used for receiving the service data fed back by the application in response to the interface access request, and processing the fed back service data based on the output parameters and the set output format to obtain response data; A feedback module, used for feeding back the response data to the initiator of the triggering operation of the target access action; Wherein, the obtaining input parameter data based on the input parameter includes: Identify linkage relationships among multiple target input parameters among multiple input parameters; Determine the target input parameter of the main linkage and the target input parameter of the slave linkage based on the linkage relationship; If it is identified that the input parameter data of the target input parameter of the master linkage comes from the first external data source, the interface call information of the first external data source is read, and based on the interface call information of the first external data source, configuration data is requested from the first external data source, and the input parameter data of the target input parameter of the master linkage and the input parameter data of the target input parameter of the slave linkage are filtered out from the configuration data; If it is identified that the input parameter data of the target input parameter of the master linkage comes from the internal data source, and the input parameter data of the target input parameter of the slave linkage comes from the first external data source, the input parameter data of the target input parameter of the master linkage is obtained from the internal data source, and the interface call information of the first external data source is read, the input parameter data of the target input parameter of the master linkage is used as the input parameter data of the first external data source, and the configuration data is requested from the first external data source based on the interface call information of the first external data source, and the input parameter data of the target input parameter of the slave linkage is filtered out from the configuration data; Get the input data of other input parameters of non-linkage relationships.

7. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 5 are implemented.

8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 5 are implemented.

Citation Information

Patent Citations

  • Automatic interface testing method supported by wide scenes

    CN115344482A

  • Microservice calling method and device, computer equipment and storage medium

    CN115794437A

  • Data request processing method and device, computer equipment and storage medium

    CN116320015A