A method and apparatus for invoking an online interface

By registering online interface configuration information and generating SQL requests in the message service management cluster, the problems of large development workload and difficult maintenance in the existing technology are solved, and convenient calling and maintenance of online interfaces are realized.

CN117609276BActive Publication Date: 2026-11-20AGRICULTURAL BANK OF CHINA
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311628255.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-11-30
Publication Date
2026-11-20
Estimated Expiration
2043-11-30

AI Technical Summary

Technical Problem

Existing methods for calling online interfaces are based on Groovy scripting technology, which have problems such as large development workload, high debugging difficulty, and the need for complex code logic modifications when the online interface data changes.

Method used

By registering the configuration information of the online interface in the message service management cluster and generating SQL requests based on the interface call requests, the SQL requests can be used to make serial or parallel calls to the target online interface, reducing development workload and facilitating maintenance.

Benefits of technology

It reduces the development workload required for online interface calls, simplifies maintenance work when data changes, and improves the ease of maintaining online interfaces.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117609276B_ABST
    Figure CN117609276B_ABST
Patent Text Reader

Abstract

The application discloses a method and device for calling an online interface, and relates to the field of big data. By registering the related information of the online interface in a message service management cluster in advance, the online interface can be connected to a big data platform, and an SQL access mode is provided for the connected online interface. Meanwhile, when an interface calling request of a downstream big data application for the online interface is received, an SQL request can be generated according to the interface calling request, and the target online interface can be called in series or in parallel through the SQL request. In the above manner, the online interface is called by using the SQL request, and secondary development is not needed, so that the development amount required for realizing the online interface calling can be reduced, and when the online interface data is changed, only the configuration information corresponding to the online interface needs to be modified, so that the online interface can be maintained conveniently.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of big data, and in particular to a method and apparatus for calling an online interface. Background Technology

[0002] Big data platforms can store, transform, and process various data sources, and provide various data services for downstream big data applications. For online interface data, thanks to development in recent years, big data platforms have established secure and stable access channels, as well as flexible and diverse value-added online interface services. However, the surge in demand for online interface access and services, along with changes to source system online interfaces, has significantly increased the workload for developing and maintaining online interface access and services, and the frequency of system changes is also increasing.

[0003] Existing methods for invoking online interfaces primarily rely on Groovy scripting technology. Leveraging Groovy's dynamic compilation capabilities, these interfaces enable access and service provision, allowing downstream big data applications to directly call them. However, implementing this method using Groovy scripts for downstream big data applications to call online interfaces still presents several challenges: it requires secondary development based on Groovy script templates, resulting in significant development effort and high debugging difficulty; furthermore, changes to the online interface data necessitate complex code logic modifications. Summary of the Invention

[0004] In view of this, this application provides a method and apparatus for calling an online interface, thereby reducing the development effort required to implement online interface calls and making the online interface easier to maintain.

[0005] This application provides a method for calling an online interface, applied to a big data platform, as follows:

[0006] It receives interface call requests from downstream big data applications for the target online interface, and generates a Structured Query Language (SQL) request based on the interface call request. The SQL request is used to call the target online interface according to the SQL access method corresponding to the target online interface; the target online interface includes multiple online interfaces.

[0007] Parse the SQL statement in the SQL request into an SQL query syntax tree;

[0008] The configuration information is obtained from the message service management cluster, and the SQL query syntax tree is validated based on the configuration information. The configuration information is the basic information configured for the online interface to access the big data platform.

[0009] If the configuration information is determined to contain the interface name and input parameter fields from the SQL query syntax tree, then a relational expression is generated based on the SQL query syntax tree.

[0010] The relational expression is converted into a physical execution plan, and the target online interface is called serially or in parallel according to the physical execution plan.

[0011] Optionally, before receiving the interface call request from the downstream big data application for the target online interface and generating a Structured Query Language (SQL) request based on the interface call request, the method further includes:

[0012] In response to the user's first command, the configuration information corresponding to the online interface is registered to the message service management cluster; in response to the user's second command, the access method corresponding to the online interface is registered to the message service management cluster using SQL statements.

[0013] Based on the configuration information and access method of the online interface, generate the corresponding interface plugin. The interface plugin is used to provide the SQL access method for the online interface.

[0014] Then, a Structured Query Language (SQL) request is generated based on the API call request, including:

[0015] Based on the interface name in the interface call request, determine the target interface plugin corresponding to the target online interface;

[0016] Generate an SQL request based on the target interface plugin.

[0017] Optionally, after making serial or parallel calls to the target online interface according to the physical execution plan, the process may also include:

[0018] Receive the return message from the target online interface;

[0019] Perform message parsing, return value judgment, message concatenation and conversion on the return messages of the target online interface.

[0020] Optionally, message parsing is performed on the return message of the target online interface, including:

[0021] Retrieve custom functions, including user-preset custom encryption / decryption functions and custom signature calculation functions;

[0022] Based on the custom function, perform message parsing on the return message of the target online interface.

[0023] Optionally, a relational expression is generated based on the SQL query syntax tree, including:

[0024] Map each node of the SQL query syntax tree to an expression;

[0025] Connect the expressions corresponding to each node to generate a relational expression.

[0026] Optionally, downstream big data applications send API call requests to the big data platform based on the RESTful API access method.

[0027] Optionally, SQL access methods include:

[0028] Java database connection access.

[0029] This application also provides a device for calling an online interface, applied to a big data platform, the device comprising:

[0030] The generation module is used to receive interface call requests from downstream big data applications for the target online interface, and generate a structured query language (SQL) request based on the interface call request. The SQL request is used to call the target online interface according to the SQL access method corresponding to the target online interface; the target online interface includes multiple online interfaces.

[0031] The parsing module is used to parse the SQL statements in the SQL request into an SQL query syntax tree;

[0032] The verification module is used to obtain configuration information from the message service management cluster and verify the SQL query syntax tree based on the configuration information. The configuration information is the basic information configured for the online interface to access the big data platform.

[0033] The generation module is also used to generate relational expressions based on the SQL query syntax tree if it is determined that the configuration information contains the interface name and input parameter fields in the SQL query syntax tree;

[0034] The calling module is used to convert relational expressions into physical execution plans and, based on the physical execution plans, to make serial or parallel calls to the target online interface.

[0035] This application also provides a computer device, which includes: a processor coupled to a memory, the memory storing at least one computer program instruction, the at least one computer program instruction being loaded and executed by the processor to enable the computer device to implement the above-described method of calling the online interface.

[0036] This application also provides a computer storage medium for storing a computer program, which, when executed, implements the above-described method of calling the online interface.

[0037] Therefore, the beneficial effects of this application are as follows: By pre-registering the configuration information of the online interface in the message service management cluster, the online interface can be connected to the big data platform, providing an SQL access method for the connected online interface. Simultaneously, when a downstream big data application receives an interface call request for the online interface, an SQL request can be generated based on the interface call request, and the SQL request can be validated according to the configuration information. If the validation is successful, the target online interface can be called serially or in parallel via the SQL request. Through this configuration-based approach, calling the online interface using SQL requests eliminates the need for secondary development, thus reducing the development workload required to implement online interface calls. Furthermore, when the online interface data changes, only the corresponding configuration information of the online interface needs to be modified, making the online interface easier to maintain. Attached Figure Description

[0038] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of this application. For those skilled in the art, other drawings can be obtained based on the provided drawings.

[0039] Figure 1 This is a flowchart of the first embodiment of this application;

[0040] Figure 2 This is a flowchart of steps S201 to S207 in the second embodiment of this application;

[0041] Figure 3 This is a flowchart of steps S208 to S215 in the second embodiment of this application;

[0042] Figure 4 This is a functional architecture diagram of an online interface configurable access module provided in an embodiment of this application;

[0043] Figure 5 This is a functional architecture diagram of an online interface configurable service module provided in an embodiment of this application;

[0044] Figure 6 This is a schematic diagram of an apparatus according to this application;

[0045] Figure 7 This is a schematic diagram of a computer device according to this application. Detailed Implementation

[0046] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this application.

[0047] The following section will first introduce the relevant technical terms involved in this application.

[0048] Source systems: Systems outside the big data platform used to provide data services. These generally refer to foundational business systems and external data service providers, such as credit management systems and external business data service providers.

[0049] Data source: Data services provided by systems outside the big data platform. Examples include batch file interfaces and online interfaces provided by various business systems and external data service providers.

[0050] Data changes: Changes to the data definition and content within the data source. Examples include changes to the data file structure, the structure of online interface return messages, and the data content.

[0051] Value-added online interface services: The big data platform performs serial or parallel calls to the accessed online interfaces, and performs operations such as message parsing, return value judgment, message concatenation and conversion on the returned messages to form new online interface services.

[0052] The inventors discovered that the access and service of the online interface have the following two problems, which hinder downstream big data applications from calling the online interface:

[0053] First, the diverse forms of online interface data sources create bottlenecks in the development and maintenance efficiency of online interface access. Online interface data sources originate from multiple source systems, each corresponding to different interface interface specifications, and these data sources vary in form. Each source system has its own requirements regarding data access permission verification, request message format, and message encryption / decryption, necessitating corresponding development during the online interface access process. With the surge in demand for online interface access, traditional access methods face problems such as heavy development workload, difficult maintenance, and inflexible and untimely changes.

[0054] Secondly, the complexity of value-added online interface services leads to bottlenecks in their development and maintenance efficiency. Developing value-added online interface services requires serial or parallel calls to the accessed online interfaces, as well as operations such as message parsing, return value judgment, message concatenation, and conversion of returned messages, resulting in complex development logic. Furthermore, changes to the source system can cause a chain reaction of changes to the value-added online interface services. With the increase in value-added online interface services, traditional development methods also face problems such as large development workload, maintenance difficulties, and inflexible and untimely changes.

[0055] This application adopts a configuration-based approach to dynamically access online interfaces, reducing the development workload and change frequency of online interface access. It also provides SQL calling methods for the accessed online interfaces, supporting the development of value-added online interface services through association, aggregation, and other methods, thereby reducing the development workload and change frequency of value-added online interface services.

[0056] Specifically, the method provided in this application can be applied to a big data platform, which connects various source systems and downstream big data applications. Each source system can provide data services to the big data platform, and the big data platform can provide data services to various big data applications through online interfaces based on the accessed data sources.

[0057] In this application embodiment, the device that calls the online interface may include, but is not limited to, computer devices.

[0058] A computer device may include a processor coupled to memory, the memory storing at least one computer program instruction, which is loaded and executed by the processor to enable the computer device to implement a method for calling an online interface. The computer device will be referred to simply as a computer in the following embodiments.

[0059] Please see Figure 1 The specific steps of the first embodiment of this application are as follows:

[0060] S101: The computer receives the interface call request from the downstream big data application for the target online interface, and generates a structured query language request based on the interface call request.

[0061] The target online interface can include multiple online interfaces. The big data platform can call multiple online interfaces serially or in parallel for the interface call requests from downstream big data applications, and can further process and assemble the data returned by multiple online interfaces to form new value-added online interface services.

[0062] A Structured Query Language (SQL) request is used to invoke the target online interface according to the SQL access method corresponding to the target online interface.

[0063] Specifically, SQL access can be via Java Database Connectivity (JDBC). It should be noted that SQL access can also be configured to use other application programming interfaces (APIs) depending on specific needs.

[0064] In some implementations, before the computer executes step S101, the user pre-configures the configuration information of the online interface and the access method corresponding to the online interface, thereby enabling access to the online interface. Specifically, before the computer receives the interface call request from the downstream big data application for the target online interface and generates a structured query language request based on the interface call request, it needs to respond to the user's first instruction by registering the configuration information corresponding to the online interface to the message service management cluster; respond to the user's second instruction by registering the access method corresponding to the online interface to the message service management cluster in the form of SQL statements; and generate an interface plugin corresponding to the online interface based on the configuration information and access method, wherein the interface plugin is used to provide the SQL access method for the online interface.

[0065] Based on the aforementioned interface plugins, the big data platform can generate corresponding SQL requests after receiving interface call requests from downstream big data applications, and can verify the SQL requests and call the online interface after successful verification.

[0066] Therefore, "generating a Structured Query Language (SQL) request based on an interface call request" can be implemented as follows: the computer determines the target interface plugin corresponding to the target online interface based on the interface name in the interface call request; and generates an SQL request based on the target interface plugin.

[0067] In some implementations, before the computer executes step S101, the user pre-configures the processing logic for calling the online interface. Specifically, in response to a third instruction from the user, the computer registers the processing logic for calling the online interface with the message service management cluster using SQL statements.

[0068] In other implementations, downstream big data applications send API call requests to the big data platform based on RESTful API access.

[0069] S102: The computer parses the SQL statement in the SQL request into an SQL query syntax tree.

[0070] This application also verifies the online interface to be called by the SQL request. By parsing the SQL statement in the SQL request into an SQL query syntax tree, the syntactic components of the SQL request can be obtained more intuitively, thereby verifying the key information in the SQL request.

[0071] S103: The computer obtains configuration information from the message service management cluster and verifies the SQL query syntax tree based on the configuration information.

[0072] It should be noted that the message service management cluster can specifically be a Zookeeper cluster.

[0073] The configuration information refers to the basic information configured for the online interface when accessing the big data platform. Specifically, the configuration information may include, but is not limited to: the request address of the online interface, the request method, the static request header, the static request body, the request body type, the filter parameter list, the proxy information, the authentication information, the exception code handling method, the data path, and the paginator.

[0074] The request method can include GET or POST; the request body type can include key-value pairs, JSON, or XML; the filter parameter list can allow parameters in the list to be passed to the request address, request headers, or request body via a WHERE clause.

[0075] Since the configuration information is information that has already been registered in the message service management cluster, by verifying the SQL query syntax tree based on the configuration information, it can be determined whether the interface name and input parameter fields contained in the SQL request have been registered in the message service management cluster.

[0076] In some implementations, the computer can also determine whether subqueries and joins in an SQL request are valid by validating the SQL query syntax tree.

[0077] In other implementations, "the computer obtains configuration information from the message service management cluster" can be achieved in the following way: the computer obtains the configuration information corresponding to the target online interface from the message service management cluster according to the target interface plugin corresponding to the target online interface.

[0078] S104: If the computer determines that the configuration information contains the interface name and input parameter fields in the SQL query syntax tree, it generates a relational expression based on the SQL query syntax tree.

[0079] If the verification is successful, it means that the target online interface has been connected to the big data platform. The target online interface can be called through an SQL request. At this time, the SQL query syntax tree can be converted into a relational expression.

[0080] In some implementations, "generating relational expressions from SQL query syntax trees" can be achieved as follows: the computer maps each node of the SQL query syntax tree to an expression; and then connects the expressions corresponding to each node to generate a relational expression.

[0081] S105: The computer converts the relational expression into a physical execution plan and, based on the physical execution plan, makes serial or parallel calls to the target online interface.

[0082] The physical execution plan may include at least one of the following: making serial or parallel calls to the target online interface, parsing the messages returned by the target online interface, judging the return value, and concatenating and converting messages.

[0083] Specifically, "making serial or parallel calls to the target online interface" can be achieved as follows: the computer makes serial or parallel calls to the target online interface based on the target interface plugin corresponding to the target online interface.

[0084] In some implementations, the computer converts the relational expression into a physical execution plan, and after making serial or parallel calls to the target online interface according to the physical execution plan, it also receives the return message from the target online interface; and performs message parsing, return value judgment, message concatenation and conversion on the return message from the target online interface.

[0085] In the first embodiment of this application, by pre-registering the configuration information of the online interface in the message service management cluster, the online interface can be connected to the big data platform. This provides an SQL access method for the connected online interface. Simultaneously, when a downstream big data application receives an interface call request for the online interface, an SQL request can be generated based on the interface call request. The SQL request is then validated according to the configuration information. If the validation is successful, the target online interface can be called serially or in parallel via the SQL request. Through this configuration-based approach, calling the online interface using SQL requests eliminates the need for secondary development, thus reducing the development workload required to implement online interface calls. Furthermore, when the online interface data changes, only the corresponding configuration information of the online interface needs to be modified, making the online interface easy to maintain.

[0086] Since encryption and decryption of messages are often required during the interaction of interface messages, repeatedly configuring encryption and decryption functions and signature calculation functions for different online interfaces would also take unnecessary time. Therefore, in the second embodiment, the concept of a custom function is introduced. The following describes a specific implementation of this application in conjunction with the custom function.

[0087] Please see Figures 2 to 5 .in, Figures 2 to 3 This is the flowchart corresponding to this embodiment. Figure 4 This is a functional architecture diagram of a configurable access module for an online interface provided in this embodiment. Figure 5 This is a functional architecture diagram of a configurable online interface service module provided in this embodiment. Based on the configurable online interface access module and the configurable online interface service module, configurable access and services for online interfaces can be realized.

[0088] The specific steps of the second embodiment of this application are as follows:

[0089] S201: In response to the user's first command, the computer registers the configuration information corresponding to the online interface with the Zookeeper cluster.

[0090] It should be noted that in this embodiment, the message service management cluster is set as a Zookeeper cluster.

[0091] S202: In response to the user's second instruction, the computer registers the access method corresponding to the online interface with the Zookeeper cluster using SQL statements.

[0092] S203: In response to a third user command, the computer registers the processing logic for calling the online interface to the Zookeeper cluster using SQL statements.

[0093] S204: In response to the user's fourth instruction, the computer uploads the user-defined function to the target directory.

[0094] The target directory can be used to store various custom functions. Users can pre-define custom functions according to their actual needs. When the big data platform sends or receives messages, it can reuse these custom functions by calling them from the target directory. It should be noted that custom functions can be shared and reused across multiple online interfaces.

[0095] Specifically, custom functions may include, but are not limited to: user-preset custom encryption / decryption functions and custom signature calculation functions.

[0096] In some implementations, the custom function is uploaded to the target directory as a JAR file.

[0097] In other implementations, the computer can also perform version management for custom functions. If a user needs to modify a custom function, all value-added online interface services that use the custom function must be retested. Only after the retesting is completed can the new version of the custom function take effect.

[0098] It should be noted that this application does not limit the execution order of steps S201 to S204, and the execution order of steps S201 to S204 can be set according to actual needs.

[0099] S205: The computer generates an interface plugin corresponding to the online interface based on the configuration information and access method of the online interface.

[0100] It should be noted that an interface plugin can be instantiated for each online interface accessed in the big data platform.

[0101] S206: The computer receives an interface call request from a downstream big data application for the target online interface.

[0102] S207: The computer determines the target interface plugin corresponding to the target online interface based on the interface name in the interface call request, and generates an SQL request based on the target interface plugin.

[0103] S208: The computer parses the SQL statements in the SQL request into an SQL query syntax tree.

[0104] Specifically, step S208 can be implemented using an SQL parser.

[0105] S209: The computer obtains the configuration information corresponding to the target online interface from the Zookeeper cluster according to the target interface plugin, and verifies the SQL query syntax tree according to the configuration information corresponding to the target online interface.

[0106] Specifically, step S209 can be implemented using an SQL validator.

[0107] S210: If the computer determines that the configuration information contains the interface name and input parameter fields in the SQL query syntax tree, it generates a relational expression based on the SQL query syntax tree.

[0108] Specifically, step S210 can be implemented using an SQL validator.

[0109] S211: The computer converts relational expressions into physical execution plans.

[0110] Specifically, step S211 can be implemented using a query optimizer.

[0111] S212: The computer makes serial or parallel calls to the target online interface based on the physical execution plan and the target interface plugin.

[0112] Specifically, step S212 can be implemented by an executor.

[0113] S213: The computer receives a return message from the target online interface.

[0114] S214: The computer parses the return message of the target online interface according to the custom encryption / decryption function and the custom signature calculation function to obtain the decrypted return message.

[0115] Specifically, after receiving the return message, the computer can call a custom function from the target directory to complete the decryption and signature calculation of the return message.

[0116] S215: The computer performs return value judgment, message concatenation, and conversion on the decrypted return message.

[0117] In the second embodiment of this application, a configurable approach is provided, allowing users to develop online interface access by configuring online interface metadata. Simultaneously, users can develop value-added online interface services by writing SQL processing logic and configuring online interface access methods. Importing custom functions is supported, enabling the sharing and reuse of encryption / decryption, signature calculation, and other methods used in interface calls, avoiding redundant development and reducing workload. Furthermore, the above method eliminates the need for complex script development, thus reducing the workload of developing and maintaining value-added online interfaces.

[0118] Please see Figure 6 This application provides a device 600 for calling an online interface, which is applied to a big data platform. The device includes: a generation module 601, a parsing module 602, a verification module 603, and a calling module 604.

[0119] Generation module 601: Used to receive interface call requests from downstream big data applications for the target online interface, and generate a structured query language (SQL) request based on the interface call request. The SQL request is used to call the target online interface according to the SQL access method corresponding to the target online interface; the target online interface includes multiple online interfaces.

[0120] Parsing module 602: Used to parse the SQL statements in an SQL request into an SQL query syntax tree.

[0121] Verification module 603: Used to obtain configuration information from the message service management cluster and verify the SQL query syntax tree based on the configuration information. The configuration information is the basic information configured for the online interface when accessing the big data platform.

[0122] Generation module 601: It is also used to generate a relational expression based on the SQL query syntax tree if it is determined that the configuration information contains the interface name and input parameter fields in the SQL query syntax tree.

[0123] Call module 604: Used to convert relational expressions into physical execution plans and, based on the physical execution plans, to make serial or parallel calls to the target online interface.

[0124] Optionally, a device 600 for calling an online interface further includes a registration module 605.

[0125] Registration module 605: In response to the user's first instruction, it registers the configuration information corresponding to the online interface to the message service management cluster; in response to the user's second instruction, it registers the access method corresponding to the online interface to the message service management cluster using SQL statements.

[0126] Generation module 601: It is also used to generate an interface plugin corresponding to the online interface based on the configuration information and access method of the online interface. The interface plugin is used to provide the SQL access method of the online interface.

[0127] Then, the generation module 601 is specifically used to determine the target interface plugin corresponding to the target online interface based on the interface name in the interface call request; and to generate an SQL request based on the target interface plugin.

[0128] Optionally, a device 600 for invoking an online interface further includes a receiving module 606.

[0129] Receiver module 606: Used to receive return messages from the target online interface; perform message parsing, return value judgment, message concatenation and conversion on the return messages from the target online interface.

[0130] Optionally, the parsing module 602 is specifically used to obtain custom functions, including user-preset custom encryption / decryption functions and custom signature calculation functions; and to parse the returned messages of the target online interface according to the custom functions.

[0131] Optionally, the generation module 601 is specifically used to map each node of the SQL query syntax tree into an expression; and to connect the expressions corresponding to each node to generate a relational expression.

[0132] Regarding the apparatus in the above embodiments, the specific manner in which each module performs its operation has been described in detail in the embodiments related to the method, and will not be elaborated upon here.

[0133] It should be noted that the device for calling the online interface provided in the above embodiments is only illustrated by the division of the above functional modules when implementing the function of calling the online interface. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device for calling the online interface can be divided into different functional modules to complete all or part of the functions described above. In addition, the device for calling the online interface provided in the above embodiments and the method embodiments for calling the online interface belong to the same concept, and the specific implementation process is detailed in the method embodiments, which will not be repeated here.

[0134] Please see Figure 7 This application also provides a computer device 700, including a processor 701 and a memory 702.

[0135] The processor 701 is coupled to the memory 702, which stores at least one computer program instruction. The processor 701 loads and executes the at least one computer program instruction to enable the computer device to implement the method of calling the online interface.

[0136] This application also provides a computer storage medium for storing a computer program, which, when executed, is used to implement the above-described method of calling the online interface.

[0137] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0138] The above description of the disclosed embodiments enables those skilled in the art to make or use this application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this application. Therefore, this application is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A method for calling an online interface, characterized in that, Applied to big data platforms, the method includes: The system receives interface call requests from downstream big data applications for a target online interface, and generates a Structured Query Language (SQL) request based on the interface call request. The SQL request is used to call the target online interface according to the SQL access method corresponding to the target online interface. The target online interface includes multiple online interfaces. Parse the SQL statement in the SQL request into an SQL query syntax tree; The configuration information is obtained from the message service management cluster, and the SQL query syntax tree is validated according to the configuration information. The configuration information is the basic information configured for the online interface to access the big data platform. If it is determined that the configuration information contains the interface name and input parameter fields in the SQL query syntax tree, then a relational expression is generated based on the SQL query syntax tree; The relational expression is converted into a physical execution plan, and the target online interface is called serially or in parallel according to the physical execution plan; Before receiving the interface call request from the downstream big data application for the target online interface and generating a Structured Query Language (SQL) request based on the interface call request, the method further includes: In response to the user's first instruction, the configuration information corresponding to the online interface is registered to the message service management cluster; in response to the user's second instruction, the access method corresponding to the online interface is registered to the message service management cluster using SQL statements. Based on the configuration information and access method corresponding to the online interface, an interface plugin corresponding to the online interface is generated. The interface plugin is used to provide the SQL access method for the online interface. Then, based on the interface call request, a Structured Query Language (SQL) request is generated, including: Based on the interface name in the interface call request, determine the target interface plugin corresponding to the target online interface; The SQL request is generated based on the target interface plugin.

2. The method according to claim 1, characterized in that, After making serial or parallel calls to the target online interface according to the physical execution plan, the method further includes: Receive the return message from the target online interface; The returned messages from the target online interface are parsed, the return values ​​are judged, and the messages are concatenated and converted.

3. The method according to claim 2, characterized in that, The parsing of the return message from the target online interface includes: Obtain custom functions, including: user-preset custom encryption / decryption functions and custom signature calculation functions; The returned message from the target online interface is parsed according to the custom function.

4. The method according to claim 1, characterized in that, The step of generating relational expressions based on the SQL query syntax tree includes: Map each node of the SQL query syntax tree to an expression; The expressions corresponding to each node are connected to generate the relational expression.

5. The method according to claim 1, characterized in that, The downstream big data application sends the interface call request to the big data platform based on the RESTful API access method.

6. The method according to any one of claims 1 to 5, characterized in that, The SQL access methods include: Java database connection access.

7. A device for invoking an online interface, characterized in that, The device, applied to a big data platform, includes: The generation module is used to receive interface call requests from downstream big data applications for a target online interface, and generate a Structured Query Language (SQL) request based on the interface call request. The SQL request is used to call the target online interface according to the SQL access method corresponding to the target online interface; the target online interface includes multiple online interfaces. The parsing module is used to parse the SQL statements in the SQL request into an SQL query syntax tree; The verification module is used to obtain configuration information from the message service management cluster and verify the SQL query syntax tree according to the configuration information. The configuration information is the basic information configured for the online interface to access the big data platform. The generation module is also used to generate a relational expression based on the SQL query syntax tree if it is determined that the configuration information contains the interface name and input parameter fields in the SQL query syntax tree; The calling module is used to convert the relational expression into a physical execution plan, and to make serial or parallel calls to the target online interface according to the physical execution plan; The registration module is used to register the configuration information corresponding to the online interface to the message service management cluster in response to the user's first instruction; and to register the access method corresponding to the online interface to the message service management cluster in the form of SQL statements in response to the user's second instruction. The generation module is further configured to generate an interface plugin corresponding to the online interface based on the configuration information and access method corresponding to the online interface. The interface plugin is used to provide the SQL access method for the online interface. The generation module is specifically used to generate a Structured Query Language (SQL) request based on the interface call request, including: determining the target interface plugin corresponding to the target online interface based on the interface name in the interface call request; and generating the SQL request based on the target interface plugin.

8. A computer device, characterized in that, The computer device includes: a processor coupled to a memory storing at least one computer program instruction, the at least one computer program instruction being loaded and executed by the processor to enable the computer device to implement the method of any one of claims 1-6.

9. A computer storage medium, characterized in that, Used to store a computer program, which, when executed, is used to implement the method described in any one of claims 1-6.

Citation Information

Patent Citations

  • A method for achieving http interface calling in a Spark SQL mode

    CN112287012A

  • Multi-source data service REST API interface construction method and device

    CN116048991A