Interface calling method and device, electronic equipment and storage medium
Through the interface gateway dynamically query and determine the attributes that the API gateway needs to be uploaded, the compatibility problem caused by attribute adjustment during the API gateway upgrade process is solved, and the flexibility and cost reduction of system upgrade is achieved.
Patent Information
- Application Number
- CN202411742630.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-29
- Publication Date
- 2025-03-11
- Estimated Expiration
- 2044-11-29
AI Technical Summary
During the system upgrade and maintenance of API gateways, compatibility problems caused by attribute adjustments have caused the application system to undergo compatibility rectification for a long time, hindering the system upgrade and optimization process.
Through the interface gateway, query the attribute configuration information of the target interface of the target application side, dynamically determine which attributes need to be uploaded, avoid all attributes being uploaded, and flexibly adapt to the attribute requirements of different application systems.
It reduces system upgrade and maintenance costs, reduces compatibility risks, improves system flexibility and customization capabilities, ensures the unity and consistency of attribute updates, and simplifies cross-departmental and cross-system collaboration processes.
Smart Images

Figure CN119603348A_ABST
Abstract
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, device, electronic device and storage medium. Background Art
[0002] Application systems are called by other application systems by exposing the Application Programming Interface (API). The API gateway can assist in the calls between application systems. When the API gateway assists in forwarding the call request between application systems, it needs to carry some attributes, such as the registration ID of the caller on the gateway platform, the signature type, the gateway type, etc.
[0003] Currently, the API gateway usually carries all these attributes in the call request and transmits them down, and the application system may use these attributes to perform some signature verification. Under normal circumstances, there is nothing wrong with this processing method. However, the API gateway continues to run, and there are situations where the attributes need to be adjusted. If the API gateway adds or subtracts attributes, it is necessary to notify the application system in advance to make compatibility modifications so that when the new attribute is officially launched or the old attribute is offline, it does not affect the normal processing of existing business transactions on the application side. For example, if the API gateway takes an attribute offline, if the application system is not notified in advance to make compatibility modifications, the signature information generated by the application system may be incorrect, resulting in the failure of the product application signature verification.
[0004] However, the API platform usually has thousands to tens of thousands of API interfaces, involving different departments and application systems of the company. Each department and application system has its own version transformation rhythm. If all departments and application systems complete the compatibility rectification, it may take several months or even years, which will greatly hinder the overall system upgrade and optimization process of the API gateway. Summary of the invention
[0005] The embodiments of the present invention provide an interface calling method, device, electronic device and storage medium, which can reduce system upgrade and maintenance costs and reduce compatibility risks.
[0006] In a first aspect, an interface calling method provided by an embodiment of the present invention includes:
[0007] Receive a service call request initiated by a source application, and determine a target application corresponding to the service call request;
[0008] Query the attribute configuration information of the target interface of the target application end to determine the attributes required by the target interface and obtain the target attributes;
[0009] Encapsulate the value of the target attribute in the service call request to obtain the target call request;
[0010] Send a target call request to the target application through the target interface.
[0011] In a second aspect, an interface calling device provided by an embodiment of the present invention includes:
[0012] A receiving module is used to receive a service call request initiated by a source application and determine a target application corresponding to the service call request;
[0013] A query module is used to query the attribute configuration information of the target interface of the target application end 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 a target call request to the target application end through the target interface.
[0016] In a third aspect, an electronic device provided by an embodiment of the present invention includes a memory, a processor, and a computer program stored in the memory and executable on the processor, and when the processor executes the program, an interface calling method as in any embodiment of the present invention is implemented.
[0017] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, on which a computer program is stored, and when the program is executed by a processor, an interface calling method as in any embodiment of the present invention is implemented.
[0018] In the embodiment of the present invention, the interface gateway dynamically determines which attributes need to be transmitted by querying the attribute configuration information of the target interface of the target application end, thereby avoiding the transmission of all attributes and reducing compatibility issues caused by attribute adjustment; in actual operation, different target application ends may have different attribute requirements, and the interface gateway flexibly transmits the required attributes according to the query results, thereby improving the adaptability to the requirements of different application systems, avoiding the "one-size-fits-all" processing method, and improving the flexibility and customization capabilities of the system, which can ensure that the attributes required by the target interface are accurately transmitted, reduce the security risks caused by missing or redundant attributes, and improve the security and reliability of the overall system. Attribute configuration information can be centrally managed and dynamically adjusted to ensure that each application system can obtain the latest attribute requirements consistently and in real time, ensure the uniformity and consistency when updating attributes, and with the development of business, it becomes more convenient to add new interfaces or adjust the attribute requirements of existing interfaces. During the system upgrade process, there is no need to wait for all application systems to complete compatibility rectification. The interface gateway can gradually update the attribute configuration of each application end and migrate gradually to reduce the resistance and maintenance cost of version upgrades. The parallel stage of new and old attributes can be set to ensure that the new attributes have been fully verified and adapted before the old attributes are offline, thereby ensuring a smooth transition of the system. Because the attribute configuration is dynamically managed and queried, the frequent notification and communication needs for the application system are reduced. The increase and decrease of attributes are uniformly managed and processed by the interface gateway, simplifying the cross-department and cross-system collaboration process. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] In order to more clearly illustrate the technical solution of the present invention, the drawings required for use in the embodiments are briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0020] Figure 1 It is a flowchart of the interface calling method provided by an embodiment of the present invention;
[0021] Figure 2 is another flowchart of the interface calling method provided by an embodiment of the present invention;
[0022] Figure 3 is an example diagram of an interface calling method provided by an embodiment of the present invention;
[0023] Figure 4 It is a structural diagram of an interface calling device provided by an embodiment of the present invention;
[0024] Figure 5 It is a structural schematic diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0025] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work 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 and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0027] Figure 1 This is a flowchart of the interface calling method provided by an embodiment of the present invention. The interface calling method provided by an embodiment of the present invention can be applied to the scenario of using an API gateway to assist various application systems in making interface calls. The interface calling method can be executed by the interface calling device provided by an embodiment of the present invention, and the device can be implemented in software and / or hardware. In a specific embodiment, the device can be integrated in an electronic device, and the electronic device can be an API gateway. The following embodiment is described by taking the example of integrating the interface calling device in the API gateway. Figure 1 The interface calling method of this embodiment may include the following steps:
[0028] Step 110: receiving a service call request initiated by a source application, and determining a target application corresponding to the service call request.
[0029] The source application end refers to the initiator of the service call request. The source application end can be the user's mobile application, web application, etc. For example, a user uses a mobile banking client, and this client can be the source application end. The service call request is a call request sent by the source application end to the API gateway, the purpose of which is to obtain a certain service or data, such as querying or downloading data, creating an account, transferring or paying, etc. The service call request can be a Hypertext Transfer Protocol (HTTP) request. The service call request can include the request method, destination address, request header and request body data. The request method can be a get method for obtaining data, a post method for submitting data, a put method for updating data, or a delete method for deleting data. The target application end is the application or system that actually receives and processes the service call request. The target application end can be a microservice, a monolithic application, a third-party API, etc., which specifically executes the instructions in the request and returns the result. For example, the system used by the bank to process fund transfers can be the target application end.
[0030] When the API gateway receives a service call request initiated by the source application, it can determine which specific target application the service call request should be forwarded to based on the preset routing rules or configurations. For example, some routing rules will be configured on the API gateway. These rules are configured according to different request paths, request methods, request header information, etc. Each rule corresponds to a specific application or service. When the API gateway receives a request, it matches the specific application service through these rules to determine the target application. For another example, the API gateway can use the service registry to dynamically discover services. Each product application will register its own information in the service registry. The API gateway obtains these services and their corresponding address information by querying the service registry to determine the target application. Alternatively, the service call request will carry some context information (such as path, parameters, tokens, etc.), and the API gateway will parse this information to determine the target application of the request.
[0031] Step 120, query the attribute configuration information of the target interface of the target application end to determine the attributes required by the target interface and obtain the target attributes.
[0032] An application can expose one or more APIs, which can be determined based on the application's own business requirements, system architecture, etc. For example, if the application has complex functions and diverse business logic, the application may need to expose multiple APIs to meet different business needs. For example, in a microservice architecture, each microservice focuses on a specific business function. An application can be composed of multiple microservices, and each microservice may expose multiple APIs. For example, a banking application can expose multiple APIs such as user management interface, account management interface, transaction management interface, payment interface, etc. to cover different functional requirements.
[0033] The target interface is a specific API provided by the target application, which defines specific functions that can be called by external systems. For example, an API for querying account information. Attribute configuration information refers to the attributes or parameters required by the interface and the requirements for these attributes or parameters. The requirements for attributes or parameters, such as data types, whether they are required, default values, etc., are usually information contained in the interface document, which defines the legal request format. The 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 may require attributes such as account ID, authorization token, etc.
[0034] Specifically, the API gateway can pre-create a property configuration library, which stores the property configuration information of each interface of each application end. After determining the target application end to be called, the API gateway can find the specific interface in the target application end and query the property configuration information of this interface from the property configuration library, that is, understand the document or configuration of this interface and find out the properties required by this interface. The properties required by the target interface can 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 the target attribute may refer to the value that the target attribute needs to be specifically assigned. For example, if the target attribute is an account ID and an authorization token, the value of the account ID may be 123456789, and the value of the authorization token may be token12345. Encapsulation refers to organizing the values of these target attributes in a certain format or protocol so that they can be sent in a service call request. The target call request is the final constructed request that can be sent to the target interface, which contains the required target attributes and their values.
[0037] Specifically, the service call request can be parsed, and the attribute values required by the target interface can be extracted from the request parameters, request body, request header or other data sources. According to the requirements of the target interface, the extracted attribute values are encapsulated into a request that complies with the specification, thereby obtaining the target call request. For example, the request body of the service call request includes the account ID 123456789, and the request header includes the authorization token 12345. The target attributes are the account ID and the authorization token. Then, the account ID 123456789 can be obtained from the request body of the service call request, and the authorization token 12345 can be obtained from the request header of the service call request. The obtained attribute values are encapsulated in the service call request according to the requirements of the target interface, thereby forming the target call request.
[0038] Step 140: Send a target call request to the target application end through the target interface.
[0039] The target application can process the target call request, generate a target call response based on the processing result, and feed back the target call response 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 feed back the query result data to the source application through the API gateway.
[0040] In this embodiment, the interface gateway dynamically determines which attributes need to be transmitted by querying the attribute configuration information of the target interface of the target application end, thereby avoiding the transmission of all attributes and reducing compatibility issues caused by attribute adjustment; in actual operation, different target application ends may have different attribute requirements. The interface gateway flexibly transmits the required attributes according to the query results, thereby improving the adaptability to the requirements of different application systems, avoiding the "one-size-fits-all" processing method, and improving the flexibility and customization capabilities of the system. It can ensure that the attributes required by the target interface are accurately transmitted, reduce the security risks caused by missing or redundant attributes, and improve the security and reliability of the overall system. Attribute configuration information can be centrally managed and dynamically adjusted to ensure that each application system can obtain the latest attribute requirements consistently and in real time, ensuring the uniformity and consistency of attribute updates. With the development of business, it becomes more convenient to add new interfaces or adjust the attribute requirements of existing interfaces. During the system upgrade process, there is no need to wait for all application systems to complete compatibility rectification. The interface gateway can gradually update the attribute configuration of each application end and migrate gradually to reduce the resistance and maintenance cost of version upgrades. The parallel stage of new and old attributes can be set to ensure that the new attributes have been fully verified and adapted before the old attributes are offline, thereby ensuring a smooth transition of the system. Because the attribute configuration is dynamically managed and queried, the frequent notification and communication needs for the application system are reduced. The increase and decrease of attributes are uniformly managed and processed by the interface gateway, simplifying the cross-department and cross-system collaboration process.
[0041] The following further illustrates the interface calling method provided by the embodiment of the present invention. Figure 2 As shown, the method of this embodiment may include:
[0042] Step 210: providing a property configuration page for the target application, where the property configuration page includes optional properties.
[0043] In this embodiment, the API gateway can provide some common attributes for the interface. Common attributes refer to specific data or parameters that are uniformly managed and attached to the request or response by the API gateway. The API gateway can divide common attributes into two categories: fixed attributes and optional attributes. Fixed attributes are required attributes for each interface, which can be used to ensure the legitimacy and security of each request. Each request must carry them, and they are not dependent on specific business changes. They are consistent throughout the system to ensure uniform request processing rules. Optional attributes are not required attributes for each interface. They can be determined according to specific business and interface requirements, and can be selectively added according to the requirements of each interface. They are not required for every request. They are mainly used to provide more detailed context information and functional support to help optimize request processing and enhance functions. For example, fixed attributes can include the identity of the requester, gateway type, signature information, timestamp, etc. The identity of the requester is used to identify the identity of the requester and ensure that the request source is correct. The gateway type is used to distinguish the type of request source so that the backend service can perform corresponding processing or recording. The signature information is used to verify the integrity and authenticity of the request to prevent tampering and forgery. The timestamp is used to prevent replay attacks and ensure that the request is issued within a reasonable time. For example, the optional attributes may include the requester address, the requester application name, the user agent, etc. The requester address is used for security auditing and geographic location analysis, the requester application name is convenient for recording and counting specific application information called, and the user agent provides the client software information of the request for logging and analyzing request patterns.
[0044] Since optional attributes can be selectively configured for the interface, in order to facilitate the configuration of optional attributes for the interface, this embodiment can provide an attribute configuration page for the application side. The attribute configuration page is a page provided by the API gateway to the application side for configuring optional attributes for the interface. The attribute configuration page may include multiple attributes that can be selected on demand 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 and are fixed configurations for each interface. If an application side has multiple interfaces, the optional attributes configured for the multiple interfaces can be different.
[0045] In a specific implementation, when each application terminal is connected to the API gateway, the API gateway can provide a property configuration page for each application terminal, so that each application terminal can configure optional properties for its own interface through the property configuration page. Subsequently, the API gateway can also periodically provide a property configuration page for each application terminal, so that each application terminal can adjust the configured optional properties for its own interface. For example, application terminal X has 2 interfaces, interface X1 and interface X2. When application terminal X is connected to the API gateway, the API gateway has 4 optional properties, namely property 1, property 2, property 3 and property 4. Then application terminal X can choose to configure property 1 and property 2 for interface X1, and select to configure property 3 and property 4 for interface X2.
[0046] When each application terminal has configuration requirements and initiates a property configuration request, the API gateway responds to the property configuration request of each application terminal and provides a property configuration page to the corresponding application terminal.
[0047] Alternatively, the API gateway adjusts the optional attributes of the interface gateway according to operational needs, and provides an attribute configuration page for each application end according to the adjustment results. The attribute configuration page may include the optional attributes currently available for selection after the adjustment. For example, when application end X is connected, the API gateway has 4 optional attributes, namely attribute 1, attribute 2, attribute 3 and attribute 4. Application end X chooses to configure attribute 1 and attribute 2 for interface X1, and selects to configure attribute 3 and attribute 4 for interface X2. After a period of operation, the API gateway deletes attribute 4 and adds attribute 5. Then the attribute configuration page can be pushed to application end X. The optional attributes in the attribute configuration page include attribute 1, attribute 2, attribute 3 and attribute 5. Then application end X can keep the attributes configured for interface X1 unchanged, and update the attributes configured for interface X2 from attribute 3 and attribute 4 to attribute 3, or update to attribute 3 and attribute 5.
[0048] Step 220: Acquire the attribute selected from the optional attributes for the target interface from the target application end to obtain the target attribute. The attribute configuration information of the target interface of the target application end includes the target attribute.
[0049] Target attributes refer to the set of attributes that the target application selects from the optional attributes and considers suitable for the target interface. The API gateway can generate attribute configuration information for the target interface based on the attributes selected for the target interface, and store the generated attribute configuration information in the attribute configuration library. In the attribute configuration library, the attribute configuration information generated for the target interface can be saved in the form of key-value pairs. The key can be the identification information of the target interface, such as the interface number, interface name, etc., and the value can be the name of the specific attribute configured for the target interface and the specific value requirements, etc.
[0050] Step 230: Receive a service call request initiated by a source application, and determine a target application corresponding to the service call request.
[0051] The API gateway can determine to which specific target application the service call request should be forwarded based on preset routing rules or configurations.
[0052] Step 240, query the attribute configuration information of the target interface of the target application end 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 according to the identification information of the target interface 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 end and / or obtain the value of the target attribute from the interface gateway.
[0055] The API gateway can determine whether it has the value of the target attribute. If it does, it directly obtains the value of the target attribute. If it does not, but the source application has it, it can obtain the value of the target attribute from the source application. That is, the value of the target attribute can be provided by the source application or by the API gateway. They work together to implement a complete and effective request, ensuring that the target application obtains all the required information and parameters.
[0056] Step 260, encapsulate the value of the fixed attribute, the value of the target attribute and the request content to obtain a target call request.
[0057] The request content is the data that the source application actually wants to pass to the backend service. This part of data will vary according to the specific business functions and requirements. The service call request can be parsed to obtain the request content. For example, the value of the fixed attribute can include the specific value or description of the requester's identity, gateway type, signature information, timestamp, etc., and the value of the target attribute includes the specific value or description of the requester's address, requester application name, etc. Then, the value of the fixed attribute, the value of the target attribute and the request content can be integrated together to form a complete call request, that is, a target call request.
[0058] Step 270: Send a target call request to the target application end through the target interface.
[0059] The target application can process the target call request, generate a target call response based on the processing result, and feed back the target call response 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 feed back the query result data to the source application through the API gateway.
[0060] Specifically, the API gateway can receive the target call response fed back by the target application side for the target call request through the target interface; query the attribute configuration information of the source interface of the source application side 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 side through the source interface. The source interface is the interface of the source application side. The method of creating and obtaining the attribute configuration information of the source interface can be the same as the method of creating and obtaining the attribute configuration information of the target interface, which will not be repeated here. That is, when feeding back the response information to the source application side, it can still provide it with the required optional attributes according to the configuration of the source interface.
[0061] Combine the following Figure 3 The interface calling method of the embodiment of the present invention is described by way of example. Figure 3 As shown, the API management system is mainly responsible for the maintenance of interface attribute information, including information entry, application review, authorization, etc. of the interface caller. 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 setting of optional attributes required by its own interface.
[0062] A property configuration page may be provided for each product application to allow each product application to configure the required optional properties for its own interface. For example, Figure 3 As shown, product application 1 has interface 1, and product application 1 sets interface 1 as follows: attribute 1 among all optional attributes is not issued, product application 2 has interface 2, and product application 2 sets interface 2 as follows: attribute 2 among all optional attributes is not issued, product application N has interface N, and product application N sets interface N as follows: all optional attributes are not issued, and N is an integer greater than 2. Then the API management system can obtain the optional attribute setting information of 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, the product application 2 is currently to be called, and the interface to be called is interface 2. Then the API gateway can encapsulate the values of the optional attributes except attribute 2 in the optional attributes, the values of the fixed attributes, and the request data from the service call request to form a new call request, and send the new call request to product application 2 through interface 2, thereby realizing on-demand issuance.
[0063] A specific application scenario is as follows: the API gateway newly launches an optional attribute API ID, which is required for report query business. Product application 1 provides report query business through interface 1, and product application 2 does not involve report query business. The API gateway can use the attribute configuration page to let product application 1 configure the newly launched optional attribute API ID for interface 1. When processing the report query request, the API gateway can carry the value of the optional attribute API ID in the report query request and send it to product application 1. For product application 2, it does not involve report query business, so it can ignore this newly launched optional attribute. The API gateway can launch the new optional attribute through dynamic attribute configuration, without waiting for product application 1 and product application 2 to complete compatibility rectification, and ensure that both product application 1 and product application 2 can achieve compatibility with the newly launched optional attribute.
[0064] In this embodiment, the interface gateway dynamically determines which attributes need to be transmitted by querying the attribute configuration information of the target interface of the target application end, thereby avoiding the transmission of all attributes and reducing compatibility issues caused by attribute adjustment; in actual operation, different target application ends may have different attribute requirements. The interface gateway flexibly transmits the required attributes according to the query results, thereby improving the adaptability to the requirements of different application systems, avoiding the "one-size-fits-all" processing method, and improving the flexibility and customization capabilities of the system. It can ensure that the attributes required by the target interface are accurately transmitted, reduce the security risks caused by missing or redundant attributes, and improve the security and reliability of the overall system. Attribute configuration information can be centrally managed and dynamically adjusted to ensure that each application system can obtain the latest attribute requirements consistently and in real time, ensuring the uniformity and consistency of attribute updates. With the development of business, it becomes more convenient to add new interfaces or adjust the attribute requirements of existing interfaces. During the system upgrade process, there is no need to wait for all application systems to complete compatibility rectification. The interface gateway can gradually update the attribute configuration of each application end and migrate gradually to reduce the resistance and maintenance cost of version upgrades. The parallel stage of new and old attributes can be set to ensure that the new attributes have been fully verified and adapted before the old attributes are offline, thereby ensuring a smooth transition of the system. Because the attribute configuration is dynamically managed and queried, the frequent notification and communication needs for the application system are reduced. The increase and decrease of attributes are uniformly managed and processed by the interface gateway, simplifying the cross-department and cross-system collaboration process.
[0065] Figure 4 is a structural diagram of an interface calling device provided in an embodiment of the present invention, and the device is suitable for executing the interface calling method provided in an 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 a service call request initiated by a source application and determine a target application corresponding to the service call request;
[0067] A query module 402 is used to query the attribute configuration information of the target interface of the target application end to determine the attributes required by the target interface and obtain the target attributes;
[0068] The 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 end through the target interface.
[0070] In one embodiment, the device further includes a configuration module, and the configuration module is used to:
[0071] Provide a property configuration page for the target application, which includes optional properties;
[0072] The target interface attributes selected from the optional attributes are acquired from the target application end to obtain the target attributes, and the attribute configuration information of the target interface of the target application end includes the target attributes.
[0073] In one embodiment, the configuration module provides a property configuration page for the target application, including:
[0074] Adjust the optional attributes of the interface gateway according to operational requirements;
[0075] Provide a property configuration page for the target application based on the adjustment results.
[0076] In one embodiment, the configuration module provides a property configuration page for the target application, including:
[0077] Receive the attribute configuration request initiated by the target application;
[0078] In response to the property configuration request, a property configuration page is provided to the target application.
[0079] In one embodiment, the encapsulation module 403 is further used for:
[0080] Obtain the value of the target attribute from the source application and / or obtain the value of the target attribute from the interface gateway.
[0081] In one embodiment, the target attribute is an optional attribute, and the interface gateway also has a fixed attribute. 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 value of the fixed attribute, the value of the target attribute and the request content to obtain the target call request.
[0084] In one embodiment, the receiving module 401 is further used to receive, through the target interface, a target call response fed back by the target application end in response to the target call request;
[0085] The query module 402 is also used to query the attribute configuration information of the source interface of the source application end to determine the attributes required by the source interface and obtain the source attributes;
[0086] The encapsulation module 403 is further used to encapsulate the source attribute in the target call response to obtain the service call response;
[0087] The sending module 404 is further used to send a service call response to the source application end through the source interface.
[0088] Those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example for illustration. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device is 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 refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.
[0089] The device of the embodiment of the present invention dynamically determines which attributes need to be transmitted by querying the attribute configuration information of the target interface of the target application end, thereby avoiding the transmission of all attributes and reducing compatibility issues caused by attribute adjustment; in actual operation, different target application ends may have different attribute requirements, and the interface gateway flexibly transmits the required attributes according to the query results, thereby improving the adaptability to the requirements of different application systems, avoiding the "one-size-fits-all" processing method, and improving the flexibility and customization capabilities of the system, which can ensure that the attributes required by the target interface are accurately transmitted, reduce the security risks caused by missing or redundant attributes, and improve the security and reliability of the overall system. Attribute configuration information can be centrally managed and dynamically adjusted to ensure that each application system can obtain the latest attribute requirements consistently and in real time, ensure the uniformity and consistency when updating attributes, and as the business develops, it becomes more convenient to add new interfaces or adjust the attribute requirements of existing interfaces. During the system upgrade process, there is no need to wait for all application systems to complete compatibility rectification. The interface gateway can gradually update the attribute configuration of each application end and migrate gradually to reduce the resistance and maintenance cost of version upgrades. The parallel stage of new and old attributes can be set to ensure that the new attributes have been fully verified and adapted before the old attributes are offline, thereby ensuring a smooth transition of the system. Because the attribute configuration is dynamically managed and queried, the frequent notification and communication needs for the application system are reduced. The increase and decrease of attributes are uniformly managed and processed by the interface gateway, simplifying the cross-department and cross-system collaboration process.
[0090] An embodiment of the present invention further provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the interface calling method provided in any of the above embodiments when executing the program.
[0091] An embodiment of the present invention further provides a computer-readable medium on which a computer program is stored. When the program is executed by a processor, the interface calling method provided in any of the above embodiments is implemented.
[0092] Reference below Figure 5 , which shows a schematic diagram of the structure of a computer system 500 of an electronic device suitable for implementing an embodiment of the present invention. Figure 5 The electronic device shown is only an example and should not bring any limitation to the functions 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 according to a program stored in a read-only memory (ROM) 502 or a program loaded from a storage part 508 into a random access memory (RAM) 503. In the RAM 503, various programs and data required for the operation of the computer system 500 are also stored. The CPU 501, the ROM 502, and the RAM 503 are connected to each other 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 the I / O interface 505: an input section 506 including a keyboard, a mouse, etc.; an output section 507 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, 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, a modem, etc. The communication section 509 performs communication processing via a network such as the Internet. A drive 510 is also connected to the I / O interface 505 as needed. A removable medium 511, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 510 as needed, so that a computer program read therefrom is installed into the storage section 508 as needed.
[0095] In particular, according to the embodiments disclosed in the present invention, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present invention include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 509, and / or installed from the removable medium 511. When the computer program is executed by the central processing unit (CPU) 501, the above-mentioned functions defined in the system of the present invention are executed.
[0096] It should be noted that the computer-readable medium shown in the present invention may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present invention, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present invention, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.
[0097] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present invention. In this regard, each box in the flow chart or block diagram can represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0098] The modules and / or units involved in the embodiments of the present invention may be implemented in software or hardware. The modules and / or units described may also be arranged in a processor. For example, they may be described as follows: a processor includes a receiving module, a query module, a packaging module, and a sending module. The names of these modules do not, in some cases, constitute limitations on the modules themselves.
[0099] As another aspect, the present invention further provides a computer-readable medium, which may be included in the device described in the above embodiment; or may exist independently without being assembled into the device. The above computer-readable medium carries one or more programs, and when the above one or more programs are executed by a device, the device includes:
[0100] Receive a service call request initiated by a 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 attribute in the service call request to obtain the target call request; send the target call request to the target application through the target interface.
[0101] According to the technical solution of the embodiment of the present invention, the interface gateway dynamically determines which attributes need to be transmitted by querying the attribute configuration information of the target interface of the target application end, thereby avoiding the transmission of all attributes and reducing compatibility issues caused by attribute adjustment; in actual operation, different target application ends may have different attribute requirements, and the interface gateway flexibly transmits the required attributes according to the query results, thereby improving the adaptability to the requirements of different application systems, avoiding the "one-size-fits-all" processing method, and improving the flexibility and customization capabilities of the system, which can ensure that the attributes required by the target interface are accurately transmitted, reduce the security risks caused by missing or redundant attributes, and improve the security and reliability of the overall system. Attribute configuration information can be centrally managed and dynamically adjusted to ensure that each application system can obtain the latest attribute requirements consistently and in real time, ensuring the uniformity and consistency when updating attributes, and with the development of business, it becomes more convenient to add new interfaces or adjust the attribute requirements of existing interfaces. During the system upgrade process, there is no need to wait for all application systems to complete compatibility rectification. The interface gateway can gradually update the attribute configuration of each application end and migrate gradually to reduce the resistance and maintenance cost of version upgrades. The parallel stage of new and old attributes can be set to ensure that the new attributes have been fully verified and adapted before the old attributes are offline, thereby ensuring a smooth transition of the system. Because the attribute configuration is dynamically managed and queried, the frequent notification and communication needs for the application system are reduced. The increase and decrease of attributes are uniformly managed and processed by the interface gateway, simplifying the cross-department and cross-system collaboration process.
[0102] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.
[0103] It should be noted that the collection, collection, updating, analysis, processing, use, transmission, storage and other aspects of user personal information involved in the technical solution of this disclosure are in compliance with the provisions of relevant laws and regulations, are used for legitimate purposes, and do not violate public order and good morals. Necessary measures are taken for user personal information to prevent illegal access to user personal information data and maintain the security of user personal information, network security and national security.
[0104] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may occur depending on design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. An interface calling method, characterized in that: include: Receive a service call request initiated by a source application, and determine a target application corresponding to the service call request; Query the attribute configuration information of the target interface of the target application end to determine the attributes required by the target interface and obtain the target attributes; Encapsulate the value of the target attribute in the service call request to obtain the target call request; Send a target call request to the target application through the target interface.
2. The interface calling method according to claim 1, characterized in that: Before querying the property configuration information of the target interface of the target application side, it also includes: Provide a property configuration page for the target application, which includes optional properties; The target interface attributes selected from the optional attributes are acquired from the target application end to obtain the target attributes, and the attribute configuration information of the target interface of the target application end includes the target attributes.
3. The interface calling method according to claim 2, characterized in that: Provides a property configuration page for the target application, including: Adjust the optional attributes of the interface gateway according to operational requirements; Provide a property configuration page for the target application based on the adjustment results.
4. The interface calling method according to claim 2, characterized in that: Provides a property configuration page for the target application, including: Receive the attribute configuration request initiated by the target application; In response to the property configuration request, a property configuration page is provided to the target application.
5. The interface calling method according to claim 1, characterized in that: Before encapsulating the value of the target attribute in the service call request, also include: Obtain the value of the target attribute from the source application and / or obtain the value of the target attribute from the interface gateway.
6. The interface calling method according to claim 1, characterized in that: The target attribute is an optional attribute. The interface gateway also has a fixed attribute. The value of the target attribute is encapsulated in the service call request to obtain the target call request, including: Parse the service call request to obtain the request content; Encapsulate the value of the fixed attribute, the value of the target attribute and the request content to obtain the target call request.
7. The interface calling method according to claim 1, characterized in that: Also includes: Receiving a target call response from the target application end in response to the target call request through the target interface; Query the attribute configuration information of the source interface of the source application end to determine the attributes required by the source interface and obtain the source attributes; Encapsulate the source attribute in the target call response to obtain the service call response; Send a service call response to the source application through the source interface.
8. An interface calling device, characterized in that: include: A receiving module is used to receive a service call request initiated by a source application and determine a target application corresponding to the service call request; A query module is used to query the attribute configuration information of the target interface of the target application end 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; The sending module is used to send a target call request to the target application end through the target interface.
9. 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, the interface calling method as described in any one of claims 1 to 7 is implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the interface calling method according to any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Method, device and system for calling software interface
CN102779071A
Interface calling method, system and device based on micro-service and medium
CN111737022A
Data query method and device, storage medium and equipment
CN116382805A
Experience Based Dispatch of Regulated Workloads in a Cloud Environment
US20240098115A1
Service processing methods and apparatuses
US20240346026A1