Interface calling method and device, electronic equipment and storage medium

CN119603348BActive Publication Date: 2026-08-11INDUSTRIAL AND COMMERCIAL BANK OF CHINA
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-11-29
Publication Date
2026-08-11

AI Technical Summary

Technical Problem

如果等所有部门和应用系统都完成兼容性整改,时间可能长达几个月甚至几年,这将极大阻碍API网关整体的系统升级优化进程

Benefits of technology

[0018]In this embodiment of the invention, the interface gateway dynamically determines which attributes need to be downloaded by querying the attribute configuration information of the target interface of the target application, avoiding the downloading of all attributes and reducing compatibility issues caused by attribute adjustments. In actual operation, different target applications may have different attribute requirements. The interface gateway flexibly downloads the required attributes based on the query results, improving adaptability to the needs of different application systems, avoiding a "one-size-fits-all" approach, enhancing the system's flexibility and customization capabilities, ensuring that the attributes required by the target interface are accurately downloaded, reducing security risks caused by missing or redundant attributes, and improving the overall system's security and reliability. Attribute configuration information can be centrally managed and dynamically adjusted, ensuring that each application system can consistently and in real-time obtain the latest attribute requirements, ensuring uniformity and consistency during attribute updates. As business develops, adding new interfaces or adjusting the attribute requirements of existing interfaces becomes more convenient. During system upgrades, it's unnecessary to wait for all application systems to complete compatibility adjustments. The interface gateway can gradually update attribute configurations for each application and migrate them step by step, reducing upgrade resistance and maintenance costs. A parallel phase for new and old attributes can be set up to ensure that new attributes are fully verified and adapted before the old attributes are decommissioned, thus ensuring a smooth system transition. Because attribute configurations are dynamically managed and queried, the need for frequent notifications and communication with application systems is reduced. Attribute additions and deletions are centrally managed and processed by the interface gateway, simplifying cross-departmental and cross-system collaboration processes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119603348B_ABST
    Figure CN119603348B_ABST
Patent Text Reader

Abstract

This invention provides an interface invocation method, apparatus, electronic device, and storage medium. The method includes: receiving a service invocation request initiated by a source application; determining the target application corresponding to the service invocation request; querying the attribute configuration information of the target interface of the target application to determine the attributes required by the target interface, thus obtaining the target attributes; encapsulating the values ​​of the target attributes in the service invocation request to obtain the target invocation request; and sending the target invocation request to the target application through the target interface. The interface gateway dynamically determines which attributes need to be downloaded by querying the attribute configuration information of the target interface of the target application, avoiding the downloading of all attributes and reducing compatibility issues caused by attribute adjustments. During system upgrades, it is not necessary to wait for all application systems to complete compatibility rectification; the interface gateway can gradually update the attribute configurations of each application and migrate them gradually, reducing the resistance and maintenance costs of version upgrades.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present invention relate to the field of network communication technology, and in particular to an interface calling method, apparatus, electronic device and storage medium. Background Technology

[0002] Application systems are invoked by other application systems by exposing Application Programming Interfaces (APIs). API gateways can facilitate calls between application systems. When assisting application systems in forwarding call requests, API gateways need to carry certain attributes, such as the caller's registration identifier on the gateway platform, signature type, and gateway type.

[0003] Currently, API gateways typically include all these attributes in the call request, which application systems may use for signature verification. Under normal circumstances, this approach works without issues. However, as API gateways run continuously, attributes may need to be adjusted. If the API gateway adds or removes attributes, the application system must be notified in advance for compatibility modifications. This ensures that the normal processing of existing business transactions on the application side is not affected when a new attribute is officially launched or an old attribute is deprecated. For example, if the API gateway deprecates an attribute, failure to notify the application system in advance for compatibility modifications may result in incorrect signature information generated by the application system, causing the product application to fail signature verification.

[0004] However, API platforms typically connect to thousands to tens of thousands of API interfaces, involving different departments and application systems within a company, each with its own version upgrade schedule. Waiting for all departments and application systems to complete compatibility improvements could take months or even years, significantly hindering the overall system upgrade and optimization process of the API gateway. Summary of the Invention

[0005] This invention provides an interface calling method, apparatus, electronic device, and storage medium, which can reduce system upgrade and maintenance costs and reduce compatibility risks.

[0006] Firstly, the interface calling method provided in the embodiments of the present invention includes:

[0007] Receive service call requests initiated by the source application and determine the target application corresponding to the service call request;

[0008] Query the attribute configuration information of the target interface on the target application side to determine the attributes required by the target interface and obtain the target attributes;

[0009] The target attribute value is encapsulated in the service call request to obtain the target call request;

[0010] Send the target call request to the target application through the target interface.

[0011] Secondly, the interface calling device provided in the embodiments of the present invention includes:

[0012] The receiving module is used to receive service call requests initiated by the source application and determine the target application corresponding to the service call request.

[0013] The query module is used to query the attribute configuration information of the target interface of the target application to determine the attributes required by the target interface and obtain the target attributes.

[0014] The encapsulation module is used to encapsulate the value of the target attribute in the service call request to obtain the target call request;

[0015] The sending module is used to send target call requests to the target application through the target interface.

[0016] Thirdly, the electronic device provided in the embodiments of the present invention includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, it implements the interface calling method as in any embodiment of the present invention.

[0017] Fourthly, the computer-readable storage medium provided in the embodiments of the present invention stores a computer program thereon, which, when executed by a processor, implements the interface calling method as in any embodiment of the present invention.

[0018] In this embodiment of the invention, the interface gateway dynamically determines which attributes need to be downloaded by querying the attribute configuration information of the target interface of the target application, avoiding the downloading of all attributes and reducing compatibility issues caused by attribute adjustments. In actual operation, different target applications may have different attribute requirements. The interface gateway flexibly downloads the required attributes based on the query results, improving adaptability to the needs of different application systems, avoiding a "one-size-fits-all" approach, enhancing the system's flexibility and customization capabilities, ensuring that the attributes required by the target interface are accurately downloaded, reducing security risks caused by missing or redundant attributes, and improving the overall system's security and reliability. Attribute configuration information can be centrally managed and dynamically adjusted, ensuring that each application system can consistently and in real-time obtain the latest attribute requirements, ensuring uniformity and consistency during attribute updates. As business develops, adding new interfaces or adjusting the attribute requirements of existing interfaces becomes more convenient. During system upgrades, it's unnecessary to wait for all application systems to complete compatibility adjustments. The interface gateway can gradually update attribute configurations for each application and migrate them step by step, reducing upgrade resistance and maintenance costs. A parallel phase for new and old attributes can be set up to ensure that new attributes are fully verified and adapted before the old attributes are decommissioned, thus ensuring a smooth system transition. Because attribute configurations are dynamically managed and queried, the need for frequent notifications and communication with application systems is reduced. Attribute additions and deletions are centrally managed and processed by the interface gateway, simplifying cross-departmental and cross-system collaboration processes. Attached Figure Description

[0019] To more clearly illustrate the technical solution of the present invention, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of the present invention and should not be regarded as a limitation on the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.

[0020] Figure 1 This is a flowchart illustrating an interface calling method provided in an embodiment of the present invention;

[0021] Figure 2 This is another flowchart illustrating the interface calling method provided in this embodiment of the invention;

[0022] Figure 3 This is an example diagram of the interface calling method provided in an embodiment of the present invention;

[0023] Figure 4 This is a schematic diagram of the interface calling device provided in an embodiment of the present invention;

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

[0025] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.

[0026] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0027] Figure 1 This is a flowchart illustrating an interface invocation method provided in an embodiment of the present invention. The interface invocation method provided in this embodiment is applicable to scenarios where an API gateway is used to assist various application systems in making interface invocations. This interface invocation method can be executed by an interface invocation device provided in this embodiment, which can be implemented in software and / or hardware. In a specific embodiment, the device can be integrated into an electronic device, which can be an API gateway. The following embodiment uses the integration of the interface invocation device into an API gateway as an example for illustration. See also... Figure 1 The interface calling method in this embodiment may include the following steps:

[0028] Step 110: Receive the service call request initiated by the source application and determine the target application corresponding to the service call request.

[0029] The source application is the originating end of the service call request. It can be a user's mobile application, web application, etc. For example, a user using a mobile banking client could be the source application. The service call request is the request sent from the source application to the API gateway to obtain a service or data, such as querying or downloading data, creating an account, transferring funds, or making a payment. A service call request can be a Hypertext Transfer Protocol (HTTP) request, which may include the request method, destination address, request headers, and request body data. The request method can be a GET method to retrieve data, a POST method to submit data, a PUT method to update data, or a DELETE method to delete data. The target application is the application or system that actually receives and processes the service call request. It can be a microservice, a monolithic application, a third-party API, etc., and executes the instructions in the request and returns the result. For example, a bank's internal system for processing fund transfers could be the target application.

[0030] When an API gateway receives a service call request from a source application, it can determine which specific target application the request should be forwarded to based on preset routing rules or configurations. For example, API gateways are configured with routing rules based on different request paths, methods, and header information. Each rule corresponds to a specific application or service. When the API gateway receives a request, it matches these rules to the specific application service, thus determining the target application. Alternatively, API gateways can use a service registry to dynamically discover services. Each product application registers its information in the service registry, and the API gateway retrieves these services and their corresponding address information by querying the registry, thereby determining the target application. Or, the service call request may carry contextual information (such as paths, parameters, tokens, etc.), which the API gateway parses to determine the target application.

[0031] Step 120: Query the attribute configuration information of the target interface of the target application to determine the attributes required by the target interface and obtain the target attributes.

[0032] An application can expose one or more APIs, the specific number depending on its business needs and system architecture. For example, if the application has complex functions and diverse business logic, it may need to expose multiple APIs to meet different business requirements. Similarly, in a microservice architecture, each microservice focuses on a specific business function, and an application can consist of multiple microservices, each potentially exposing multiple APIs. For instance, a banking application could expose multiple APIs, such as user management, account management, transaction management, and payment APIs, to cover different functional requirements.

[0033] The target interface is the specific API provided by the target application, defining the specific functions that external systems can call. For example, an API for querying account information. Attribute configuration information refers to the attributes or parameters required by the interface and their requirements. These requirements include data type, whether they are required, and default values. This information is usually found in the interface documentation and defines the valid request format. Target attributes are the final attributes determined by querying the attribute configuration information; these are the data fields required by the interface in the request. For example, an interface for querying account information might need attributes such as account identifier and authorization token.

[0034] Specifically, the API gateway can pre-create a property configuration library, which stores the property configuration information of various interfaces for each application. After determining the target application to be called, the API gateway can find the specific interface on the target application, query the property configuration information of that interface from the property configuration library, that is, understand the documentation or configuration of that interface, and find out the properties required by that interface. The properties required by the target interface may include one or more.

[0035] Step 130: Encapsulate the value of the target attribute in the service call request to obtain the target call request.

[0036] The value of a target attribute refers to the specific value that the target attribute needs to be assigned. For example, if the target attributes are an account identifier and an authorization token, the value of the account identifier could be 123456789, and the value of the authorization token could be token12345. Encapsulation refers to organizing these target attribute values ​​according to a certain format or protocol so that they can be sent in the service call request. The target call request is the final constructed request that can be sent to the target interface; it contains the required target attributes and their values.

[0037] Specifically, a service call request can be parsed to extract the attribute values ​​required by the target interface from the request parameters, request body, request headers, or other data sources. Based on the requirements of the target interface, the extracted attribute values ​​are encapsulated into a compliant request, thus obtaining the target call request. For example, if the service call request body includes the account identifier "123456789" and the request header includes the authorization token "token12345", and the target attributes are the account identifier and the authorization token, then the account identifier "123456789" can be obtained from the service call request body, and the authorization token "token12345" can be obtained from the service call request header. The obtained attribute values ​​are then encapsulated in the service call request according to the requirements of the target interface, thus forming the target call request.

[0038] Step 140: Send a target call request to the target application through the target interface.

[0039] The target application can process the target call request, generate the target call response based on the processing result, and send the target call response back to the source client through the API gateway. For example, if the target call request is a data query request, the target application can process the data query request, obtain the query result data, and send the query result data back to the source application through the API gateway.

[0040] In this embodiment, the interface gateway dynamically determines which attributes need to be downloaded by querying the attribute configuration information of the target interface of the target application, avoiding the downloading of all attributes and reducing compatibility issues caused by attribute adjustments. In actual operation, different target applications may have different attribute requirements. The interface gateway flexibly downloads the required attributes based on the query results, improving adaptability to the needs of different application systems, avoiding a "one-size-fits-all" approach, enhancing the system's flexibility and customization capabilities, ensuring that the attributes required by the target interface are accurately downloaded, reducing security risks caused by missing or redundant attributes, and improving the overall system security and reliability. Attribute configuration information can be centrally managed and dynamically adjusted, ensuring that all application systems can consistently and in real-time obtain the latest attribute requirements, ensuring uniformity and consistency during attribute updates. As business develops, adding new interfaces or adjusting the attribute requirements of existing interfaces becomes more convenient. During system upgrades, it's unnecessary to wait for all application systems to complete compatibility adjustments. The interface gateway can gradually update attribute configurations for each application and migrate them step by step, reducing upgrade resistance and maintenance costs. A parallel phase for new and old attributes can be set up to ensure that new attributes are fully verified and adapted before the old attributes are decommissioned, thus ensuring a smooth system transition. Because attribute configurations are dynamically managed and queried, the need for frequent notifications and communication with application systems is reduced. Attribute additions and deletions are centrally managed and processed by the interface gateway, simplifying cross-departmental and cross-system collaboration processes.

[0041] The following examples further illustrate the interface calling method provided in the embodiments of the present invention, such as... Figure 2 As shown, the method in this embodiment may include:

[0042] Step 210: Provide an attribute configuration page for the target application. The attribute configuration page includes optional attributes.

[0043] In this embodiment, the API gateway can provide some common attributes for the interfaces. Common attributes refer to specific data or parameters that are uniformly managed by the API gateway and attached to requests or responses. The API gateway can divide common attributes into two categories: fixed attributes and optional attributes. Fixed attributes are mandatory for every interface, used to ensure the legitimacy and security of each request. Every request must include them, regardless of specific business changes, maintaining consistency throughout the system and ensuring uniform request processing rules. Optional attributes are not mandatory for every interface. They can be determined based on specific business and interface requirements, and can be selectively added according to the needs of each interface. They are not required for every request and are mainly used to provide more detailed contextual information and functional support, helping to optimize request processing and enhance functionality. For example, fixed attributes may include the requester's identity, gateway type, signature information, timestamp, etc. The requester's identity is used to identify the requester's identity, ensuring the request source is correct. The gateway type is used to distinguish the request source type, facilitating appropriate processing or recording by backend services. The signature information is used to verify the integrity and authenticity of the request, preventing tampering and forgery. The timestamp is used to prevent replay attacks, ensuring the request is sent within a reasonable timeframe. For example, optional attributes may include the requester's address, the requester's application name, and the user agent. The requester's address is used for security auditing and geolocation analysis; the requester's application name facilitates the recording and statistical analysis of specific application information; and the user agent provides client software information for logging and analyzing request patterns.

[0044] Since optional attributes can be selectively configured for an interface, this embodiment provides an attribute configuration page for the application side to facilitate the configuration of optional attributes. The attribute configuration page is provided by the API gateway to the application side for configuring optional attributes for interfaces. The attribute configuration page can include multiple attributes that can be selected as needed for the interface; that is, the attributes configured for the interface through the attribute configuration page are optional attributes. Fixed attributes do not need to be selected and configured for the interface; they are fixed configurations for each interface. If an application has multiple interfaces, the optional attributes configured for the multiple interfaces can be different.

[0045] In practice, when each application connects to the API gateway, the API gateway provides an attribute configuration page for each application, allowing each application to configure optional attributes for its own interfaces. Subsequently, the API gateway can also periodically provide attribute configuration pages for each application, allowing each application to adjust the configured optional attributes for its interfaces. For example, application X has two interfaces, X1 and X2. When application X connects to the API gateway, the gateway offers four optional attributes: attribute 1, attribute 2, attribute 3, and attribute 4. Application X can then configure attributes 1 and 2 for interface X1, and attributes 3 and 4 for interface X2.

[0046] When an application initiates a property configuration request, the API gateway responds to the property configuration request from each application and provides the corresponding property configuration page to the application.

[0047] Alternatively, the API gateway can adjust the optional attributes of the interface gateway according to operational needs, and then provide an attribute configuration page to each application based on the adjustment results. The attribute configuration page can include the currently available optional attributes after the adjustment. For example, when application X accesses the API, the gateway has four optional attributes: attribute 1, attribute 2, attribute 3, and attribute 4. Application X configures attributes 1 and 2 for interface X1, and attributes 3 and 4 for interface X2. After a period of operation, the API gateway deletes attribute 4 and adds attribute 5. It can then push the attribute configuration page to application X. The optional attributes on the attribute configuration page include attribute 1, attribute 2, attribute 3, and attribute 5. Application X can then keep the attributes configured for interface X1 unchanged, and update the attributes configured for interface X2 from attribute 3 and 4 to attribute 3, or update them to attribute 3 and 5.

[0048] Step 220: Obtain the attribute selected from the optional attributes for the target interface from the target application side to obtain the target attribute. The target attribute is included in the attribute configuration information of the target interface of the target application side.

[0049] Target attributes refer to the set of attributes that the target application selects from the available attributes and deems suitable for the target interface. The API gateway can generate attribute configuration information for the target interface based on the selected attributes and store this information in the attribute configuration repository. The attribute configuration repository can save the generated attribute configuration information for the target interface in key-value pair format. The key can be the identifier of the target interface, such as the interface number or interface name, and the value can be the name of the specific attribute configured for the target interface and its specific value requirements.

[0050] Step 230: Receive the service call request initiated by the source application and determine the target application corresponding to the service call request.

[0051] An API gateway can determine which specific target application a service call request should be forwarded to based on preset routing rules or configuration.

[0052] Step 240: Query the attribute configuration information of the target interface of the target application to determine the attributes required by the target interface and obtain the target attributes.

[0053] Specifically, the API gateway can query the attribute configuration library based on the target interface's identification information to determine the attributes required by the target interface. The attributes required by the target interface may include one or more.

[0054] Step 250: Obtain the value of the target attribute from the source application and / or from the interface gateway.

[0055] The API gateway can determine whether it has the value of the target attribute. If it does, it directly retrieves the value. If it doesn't have the value, but the source application does, it can retrieve the value from the source application. In other words, the value of the target attribute can be provided by either the source application or the API gateway; they work together to create a complete and valid request, ensuring that the target application receives all the necessary information and parameters.

[0056] Step 260: Encapsulate the values ​​of the fixed attributes, the target attributes, and the request content to obtain the target call request.

[0057] The request content is the data that the source application actually needs to pass to the backend service. This data will vary depending on the specific business function and requirements. The request content can be obtained by parsing the service call request. For example, the values ​​of fixed attributes may include specific values ​​or descriptions of the requester's identity, gateway type, signature information, timestamp, etc., while the values ​​of target attributes may include specific values ​​or descriptions of the requester's address, requester application name, etc. The values ​​of fixed attributes, target attributes, and request content can then be integrated to form a complete call request, namely the target call request.

[0058] Step 270: Send a target call request to the target application through the target interface.

[0059] The target application can process the target call request, generate the target call response based on the processing result, and send the target call response back to the source client through the API gateway. For example, if the target call request is a data query request, the target application can process the data query request, obtain the query result data, and send the query result data back to the source application through the API gateway.

[0060] Specifically, the API gateway can receive the target call response from the target application in response to the target call request through the target interface; query the attribute configuration information of the source interface of the source application to determine the attributes required by the source interface and obtain the source attributes; encapsulate the source attributes in the target call response to obtain the service call response; and send the service call response to the source application through the source interface. The source interface is the interface of the source application. The methods for creating and obtaining the attribute configuration information of the source interface can be the same as those for the target interface, and will not be elaborated here. That is, when sending response information back to the source application, the required optional attributes can still be provided according to the configuration of the source interface.

[0061] The following is combined Figure 3 Examples illustrating the interface calling method of this invention, such as... Figure 3 As shown, the API management system is primarily responsible for maintaining interface attribute information, including processing information entry, application review, and authorization for interface callers. In this embodiment, a gateway public attribute download setting function can be added to the API management system to provide each product application with the optional attribute settings required by its own interface.

[0062] Individual property configuration pages can be provided for each product application, allowing each application to configure the required optional properties for its own interfaces. For example, such as... Figure 3 As shown, Product Application 1 has Interface 1, and Product Application 1 sets Interface 1 to not distribute attribute 1 among all optional attributes. Product Application 2 has Interface 2, and Product Application 2 sets Interface 2 to not distribute attribute 2 among all optional attributes. Product Application N has Interface N, and Product Application N sets Interface N to not distribute any optional attributes. N is an integer greater than 2. The API management system can obtain the optional attribute settings made by each product application for its interface, generate attribute configuration information based on the obtained information, and synchronize the attribute configuration information to the API gateway. After a caller initiates a service call request, the API gateway can determine the target application corresponding to the service call request. For example, if the current call is to Product Application 2, and the interface to be called is Interface 2, then the API gateway can encapsulate the values ​​of all optional attributes except attribute 2, the values ​​of fixed attributes, and the request data from the service call request to form a new call request. This new call request is then sent to Product Application 2 through Interface 2, achieving on-demand distribution.

[0063] A specific application scenario is as follows: An API gateway has added a new optional attribute, API ID, which is needed in report query operations. Product application 1 provides report query services through interface 1, while product application 2 does not involve report query operations. The API gateway can then configure product application 1 to require the newly added optional attribute, API ID, through its attribute configuration page. When processing report query requests, the API gateway can include the value of this optional attribute in the report query request sent to product application 1. Product application 2, which does not involve report query operations, can disregard this newly added optional attribute. The API gateway can dynamically add new optional attributes through attribute configuration, without waiting for product applications 1 and 2 to complete compatibility adjustments, and ensures that both product applications 1 and 2 are compatible with the newly added optional attribute.

[0064] In this embodiment, the interface gateway dynamically determines which attributes need to be downloaded by querying the attribute configuration information of the target interface of the target application, avoiding the downloading of all attributes and reducing compatibility issues caused by attribute adjustments. In actual operation, different target applications may have different attribute requirements. The interface gateway flexibly downloads the required attributes based on the query results, improving adaptability to the needs of different application systems, avoiding a "one-size-fits-all" approach, enhancing the system's flexibility and customization capabilities, ensuring that the attributes required by the target interface are accurately downloaded, reducing security risks caused by missing or redundant attributes, and improving the overall system security and reliability. Attribute configuration information can be centrally managed and dynamically adjusted, ensuring that all application systems can consistently and in real-time obtain the latest attribute requirements, ensuring uniformity and consistency during attribute updates. As business develops, adding new interfaces or adjusting the attribute requirements of existing interfaces becomes more convenient. During system upgrades, it's unnecessary to wait for all application systems to complete compatibility adjustments. The interface gateway can gradually update attribute configurations for each application and migrate them step by step, reducing upgrade resistance and maintenance costs. A parallel phase for new and old attributes can be set up to ensure that new attributes are fully verified and adapted before the old attributes are decommissioned, thus ensuring a smooth system transition. Because attribute configurations are dynamically managed and queried, the need for frequent notifications and communication with application systems is reduced. Attribute additions and deletions are centrally managed and processed by the interface gateway, simplifying cross-departmental and cross-system collaboration processes.

[0065] Figure 4 This is a schematic diagram of an interface invocation device provided in an embodiment of the present invention. This device is suitable for executing the interface invocation method provided in the embodiment of the present invention, such as... Figure 4 As shown, the device may specifically include:

[0066] The receiving module 401 is used to receive service call requests initiated by the source application and determine the target application corresponding to the service call request.

[0067] The query module 402 is used to query the attribute configuration information of the target interface of the target application to determine the attributes required by the target interface and obtain the target attributes.

[0068] Encapsulation module 403 is used to encapsulate the value of the target attribute in the service call request to obtain the target call request;

[0069] The sending module 404 is used to send a target call request to the target application through the target interface.

[0070] In one embodiment, the device further includes a configuration module, which is used to:

[0071] Provides a property configuration page for the target application, which includes optional properties;

[0072] The target application obtains the target attributes selected from the optional attributes for the target interface. The target attributes are included in the attribute configuration information of the target interface on the target application.

[0073] In one embodiment, the configuration module provides an attribute configuration page for the target application, including:

[0074] Adjust the optional attributes of the interface gateway according to operational needs;

[0075] Provide a property configuration page for the target application based on the adjustment results.

[0076] In one embodiment, the configuration module provides an attribute configuration page for the target application, including:

[0077] Receive attribute configuration requests initiated by the target application;

[0078] The property configuration page is provided to the target application in response to the property configuration request.

[0079] In one embodiment, the encapsulation module 403 is further configured to:

[0080] Obtain the value of the target attribute from the source application and / or from the interface gateway.

[0081] In one embodiment, the target attribute is an optional attribute, and the interface gateway also has fixed attributes. The encapsulation module 403 encapsulates the value of the target attribute in the service call request to obtain the target call request, including:

[0082] Parse the service call request to obtain the request content;

[0083] Encapsulate the values ​​of fixed attributes, the values ​​of target attributes, and the request content to obtain the target call request.

[0084] In one embodiment, the receiving module 401 is further configured to receive the target call response from the target application in response to the target call request through the target interface;

[0085] The query module 402 is also used to query the attribute configuration information of the source interface of the source application to determine the attributes required by the source interface and obtain the source attributes;

[0086] The encapsulation module 403 is also used to encapsulate the source attributes in the target call response to obtain the service call response;

[0087] The sending module 404 is also used to send a service call response to the source application through the source interface.

[0088] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional modules is merely an example. In practical applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. The specific working process of the functional modules described above can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.

[0089] The apparatus of this invention dynamically determines which attributes need to be downloaded by querying the attribute configuration information of the target interface of the target application, avoiding the downloading of all attributes and reducing compatibility issues caused by attribute adjustments. In actual operation, different target applications may have different attribute requirements. The interface gateway flexibly downloads the required attributes based on the query results, improving adaptability to the needs of different application systems, avoiding a "one-size-fits-all" approach, enhancing the system's flexibility and customization capabilities, ensuring that the attributes required by the target interface are accurately downloaded, reducing security risks caused by missing or redundant attributes, and improving the overall system security and reliability. Attribute configuration information can be centrally managed and dynamically adjusted, ensuring that each application system can consistently and in real-time obtain the latest attribute requirements, ensuring uniformity and consistency during attribute updates. As business develops, adding new interfaces or adjusting the attribute requirements of existing interfaces becomes more convenient. During system upgrades, it's unnecessary to wait for all application systems to complete compatibility adjustments. The interface gateway can gradually update attribute configurations for each application and migrate them step by step, reducing upgrade resistance and maintenance costs. A parallel phase for new and old attributes can be set up to ensure that new attributes are fully verified and adapted before the old attributes are decommissioned, thus ensuring a smooth system transition. Because attribute configurations are dynamically managed and queried, the need for frequent notifications and communication with application systems is reduced. Attribute additions and deletions are centrally managed and processed by the interface gateway, simplifying cross-departmental and cross-system collaboration processes.

[0090] This invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, it implements the interface calling method provided in any of the above embodiments.

[0091] This invention also provides a computer-readable medium having a computer program stored thereon, which, when executed by a processor, implements the interface calling method provided in any of the above embodiments.

[0092] The following is for reference. Figure 5 It shows a schematic diagram of the structure of a computer system 500 suitable for implementing an electronic device according to embodiments of the present invention. Figure 5 The electronic device shown is merely an example and should not be construed as limiting the functionality and scope of use of the embodiments of the present invention.

[0093] like Figure 5 As shown, the computer system 500 includes a central processing unit (CPU) 501, which can perform various appropriate actions and processes based on programs stored in read-only memory (ROM) 502 or programs loaded from storage section 508 into random access memory (RAM) 503. The RAM 503 also stores various programs and data required for the operation of the computer system 500. The CPU 501, ROM 502, and RAM 503 are interconnected via a bus 504. An input / output (I / O) interface 505 is also connected to the bus 504.

[0094] The following components are connected to I / O interface 505: an input section 506 including a keyboard, mouse, etc.; an output section 507 including a cathode ray tube (CRT), liquid crystal display (LCD), etc., and speakers, etc.; a storage section 508 including a hard disk, etc.; and a communication section 509 including a network interface card such as a LAN card, modem, etc. The communication section 509 performs communication processing via a network such as the Internet. A drive 510 is also connected to I / O interface 505 as needed. A removable medium 511, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., is installed on drive 510 as needed so that computer programs read from it can be installed into storage section 508 as needed.

[0095] In particular, according to the embodiments disclosed in this invention, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments disclosed in this invention include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication section 509, and / or installed from removable medium 511. When the computer program is executed by central processing unit (CPU) 501, it performs the functions defined above in the system of this invention.

[0096] It should be noted that the computer-readable medium shown in this invention can be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A computer-readable storage medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this invention, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In this invention, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. Computer-readable signal media can also be any computer-readable medium other than computer-readable storage media, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wireless, wire, optical fiber, RF, etc., or any suitable combination thereof.

[0097] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of the present invention. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram or flowchart, and combinations of blocks in a block diagram or flowchart, may be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.

[0098] The modules and / or units described in the embodiments of this invention can be implemented in software or hardware. The described modules and / or units can also be housed in a processor; for example, a processor can be described as including a receiving module, a querying module, an encapsulation module, and a transmitting module. The names of these modules do not necessarily limit the module itself.

[0099] In another aspect, the present invention also provides a computer-readable medium, which may be included in the device described in the above embodiments; or it may exist independently and not assembled into the device. The computer-readable medium carries one or more programs, which, when executed by the device, cause the device to include:

[0100] Receive the service call request initiated by the source application and determine the target application corresponding to the service call request; query the attribute configuration information of the target interface of the target application to determine the attributes required by the target interface and obtain the target attributes; encapsulate the value of the target attributes in the service call request to obtain the target call request; and send the target call request to the target application through the target interface.

[0101] According to the technical solution of this embodiment of the invention, the interface gateway dynamically determines which attributes need to be downloaded by querying the attribute configuration information of the target interface of the target application, avoiding the downloading of all attributes and reducing compatibility issues caused by attribute adjustments. In actual operation, different target applications may have different attribute requirements. The interface gateway flexibly downloads the required attributes based on the query results, improving adaptability to the needs of different application systems, avoiding a "one-size-fits-all" approach, enhancing the system's flexibility and customization capabilities, ensuring that the attributes required by the target interface are accurately downloaded, reducing security risks caused by missing or redundant attributes, and improving the overall system's security and reliability. Attribute configuration information can be centrally managed and dynamically adjusted, ensuring that each application system can consistently and in real-time obtain the latest attribute requirements, ensuring uniformity and consistency during attribute updates. As business develops, adding new interfaces or adjusting the attribute requirements of existing interfaces becomes more convenient. During system upgrades, it's unnecessary to wait for all application systems to complete compatibility adjustments. The interface gateway can gradually update attribute configurations for each application and migrate them step by step, reducing upgrade resistance and maintenance costs. A parallel phase for new and old attributes can be set up to ensure that new attributes are fully verified and adapted before the old attributes are decommissioned, thus ensuring a smooth system transition. Because attribute configurations are dynamically managed and queried, the need for frequent notifications and communication with application systems is reduced. Attribute additions and deletions are centrally managed and processed by the interface gateway, simplifying cross-departmental and cross-system collaboration processes.

[0102] It should be understood that the various forms of processes shown above can be used, with steps reordered, added, or deleted. For example, the steps described in this invention can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution of this invention can be achieved, and this is not limited herein.

[0103] It should be noted that the collection, gathering, updating, analysis, processing, use, transmission, and storage of user personal information involved in this disclosed technical solution all comply with relevant laws and regulations, are used for legitimate purposes, and do not violate public order and good morals. Necessary measures are taken to prevent unauthorized access to user personal information data and to safeguard user personal information security, network security, and national security.

[0104] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can occur depending on design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.

Claims

1. An interface invocation method, characterized in that, This method is applied to an interface gateway, which provides public attributes to interfaces. These public attributes are specific data or parameters managed uniformly by the interface gateway and appended to requests or responses. They are used for signature verification and include fixed and optional attributes. The method includes: The optional attributes of the interface gateway are adjusted according to operational needs. Based on the adjustment results, an attribute configuration page is provided to the target application. The attribute configuration page includes optional attributes. The target attributes are obtained from the target application by retrieving the attributes selected from the optional attributes for the target interface. Receive service call requests initiated by the source application and determine the target application corresponding to the service call request; Query the attribute configuration information of the target interface of the target application from the attribute configuration library to determine the attributes required by the target interface and obtain the target attributes; The target attribute value is encapsulated in the service call request to obtain the target call request; this includes: parsing the service call request to obtain the request content, encapsulating the fixed attribute value, the target attribute value, and the request content to obtain the target call request; Send the target call request to the target application through the target interface.

2. The interface calling method according to claim 1, characterized in that, Provide a property configuration page for the target application, including: Receive attribute configuration requests initiated by the target application; The property configuration page is provided to the target application in response to the property configuration request.

3. The interface calling method according to claim 1, characterized in that, Before encapsulating the value of the target attribute in the service call request, the following is also included: Obtain the value of the target attribute from the source application and / or from the interface gateway.

4. The interface calling method according to claim 1, characterized in that, Also includes: Receive the target call response from the target application in response to the target call request through the target interface; Query the attribute configuration information of the source interface on the source application side to determine the attributes required by the source interface and obtain the source attributes; The source attributes are encapsulated in the target call response to obtain the service call response; The service call response is sent to the source application through the source interface.

5. An interface calling device, characterized in that, Applied to an interface gateway, the interface gateway provides public attributes for the interface. These public attributes are specific data or parameters uniformly managed by the interface gateway and appended to requests or responses. The public attributes are used for signature verification and include fixed and optional attributes. The device includes: The configuration module is used to adjust the optional attributes of the interface gateway according to operational needs, and provide an attribute configuration page to the target application based on the adjustment results. The attribute configuration page includes optional attributes; it also retrieves the attribute selected from the optional attributes for the target interface from the target application to obtain the target attribute. The receiving module is used to receive service call requests initiated by the source application and determine the target application corresponding to the service call request. The query module is used to query the attribute configuration information of the target interface of the target application from the attribute configuration library in order to determine the attributes required by the target interface and obtain the target attributes. The encapsulation module is used to encapsulate the value of the target attribute in the service call request to obtain the target call request; it includes: parsing the service call request to obtain the request content, encapsulating the value of the fixed attribute, the value of the target attribute, and the request content to obtain the target call request; The sending module is used to send target call requests to the target application through the target interface.

6. An electronic 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 program, it implements the interface call method as described in any one of claims 1 to 4.

7. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the interface invocation method as described in any one of claims 1 to 4.

Citation Information

Patent Citations

  • Interface calling method, system and device based on micro-service and medium

    CN111737022A