Interface calling method, device, electronic device and storage medium
By providing interface calling methods on low-code development platforms, the problem that existing platforms cannot support interface calling is solved, and the unified call process of the interface is realized, and the development efficiency is improved.
Patent Information
- Application Number
- CN202210688086.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-16
- Publication Date
- 2025-03-18
- Estimated Expiration
- 2042-06-16
AI Technical Summary
The existing low-code development platform cannot support interface calls, which affects development efficiency.
It provides an interface calling method, which obtains the interface to be called and the input parameters and converts the input parameters based on the input parameter description information of the interface to be called, obtains the interface parameters and passes them to the interface to be called; receives the interface parameters returned by the interface to be called, and converts the interface parameters based on the parameter description information to obtain the output parameters.
The interface call function is realized, especially when there may be differences in the entry and exit structures of various interfaces, the unified call process of various interfaces is realized, which improves the development efficiency.
Smart Images

Figure CN115033233B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present invention relate to the field of computer technology, and in particular to an interface calling method, device, electronic device and storage medium. Background Art
[0002] In recent years, with the development of enterprise digital transformation and cloud computing, low-code platforms have become a hot topic, and major Internet companies have launched their own low-code platforms. Compared with the previous native development model of manually writing code, low-code development can significantly improve development efficiency.
[0003] In the process of implementing the present invention, the inventors found that the following technical problems exist in the prior art: the existing low-code development platform cannot support interface calls, which will have a certain impact on development efficiency. Summary of the invention
[0004] The embodiment of the present invention provides an interface calling method, device, electronic device and storage medium to realize the interface calling function.
[0005] According to one aspect of the present invention, there is provided an interface calling method, which may include:
[0006] In response to the interface call instruction, obtain the interface to be called and input parameters;
[0007] Based on the input parameter description information of the interface to be called, the input parameter is structurally converted to obtain the interface input parameter, and the interface input parameter is passed to the interface to be called;
[0008] Receive the interface output parameter returned by the interface to be called based on the received interface input parameter, and perform structural conversion on the interface output parameter based on the output parameter description information of the interface to be called to obtain the output output parameter;
[0009] The input parameter structure, configured input parameters, output parameter structure and configured output parameters of the interface to be called are obtained in the process of configuring the interface to be called. The input parameter description information is obtained by parsing the configured input parameters through the input parameter structure, and the output parameter description information is obtained by parsing the configured output parameters through the output parameter structure.
[0010] Optionally, the input parameter structure includes an input parameter nested structure, and the input parameter description information stores input parameter path information for configuring the input parameter;
[0011] Based on the input parameter description information of the interface to be called, the input parameter is converted into a structure to obtain the interface input parameter, which may include:
[0012] According to the input parameter path information in the input parameter description information of the interface to be called, the input parameter is filled into the input parameter final path of the configuration input parameter to obtain the interface input parameter.
[0013] On this basis, optionally, at least two input parameter path information are stored in the input parameter description information;
[0014] Get the final path of the input parameters according to the input parameter path information in the input parameter description information of the interface to be called, fill the input parameters into the final path of the input parameters of the configuration input parameters, and get the interface input parameters, which may include:
[0015] For each input parameter path information in the input parameter description information of the interface to be called, obtain the input parameter final level path according to the input parameter path information;
[0016] Fill the matching input parameter that matches the input parameter path information in the input parameter into the input parameter final path of the configured input parameter to obtain the filled input parameter;
[0017] Merge all filled-in parameters to get the interface input parameters.
[0018] Optionally, the interface call instruction is generated when a bound component that has completed interface binding is triggered;
[0019] In response to the interface calling instruction, obtaining the interface to be called may include:
[0020] In response to the interface call instruction, obtaining the bound component corresponding to the interface call instruction;
[0021] The bound interface bound to the bound component in the process of configuring the interface to be called is determined, and the bound interface is used as the interface to be called.
[0022] On this basis, optionally, when the bound component is composed of a search condition input component, a search component, and a search result display component, an interface call instruction is generated when the search component in the bound component is triggered.
[0023] Optionally, the interface to be called is configured through the following steps:
[0024] In response to an interface registration instruction for a to-be-registered to-be-called interface, obtaining interface registration information, wherein the interface registration information includes configuration input parameters and configuration output parameters;
[0025] The interface to be registered and called is used as the interface to be registered;
[0026] The interface to be registered is registered based on the interface registration information to obtain the registered interface, so as to obtain the configured interface to be called according to the registered interface.
[0027] On this basis, optionally, registering the interface to be registered based on the interface registration information may include:
[0028] Get the input parameter structure pre-entered for the interface to be registered;
[0029] In response to verifying that a configuration format of the configuration input parameter is correct based on the input parameter structure, registering the interface to be registered based on the interface registration information.
[0030] On this basis, optionally, in response to verifying that the configuration format of the configuration input parameter is correct based on the input parameter structure, the above interface calling method may further include:
[0031] Parse the configuration input parameters through the input parameter structure to obtain the input parameter description information, and display the obtained input parameter description information;
[0032] In response to the information adjustment instruction acting on the displayed input parameter description information, the input parameter description information is adjusted, and the input parameter description information is updated according to the adjustment result.
[0033] Alternatively, the interface registration information may further include an interface path of the interface to be registered, and the above interface calling method may further include:
[0034] Get the interface registration application;
[0035] Registering the interface to be registered based on the interface registration information may include:
[0036] In response to the interface path not being registered under the interface registration application, registering the interface to be registered based on the interface registration information.
[0037] Another optional method of obtaining a configured interface to be called according to a registered interface may include:
[0038] In response to the interface binding instruction for the registered interface, the component to be bound is obtained, and the component to be bound and the registered interface are bound to obtain a configured interface to be called.
[0039] On this basis, optionally, before responding to the interface binding instruction for the registered interface, the interface calling method may further include:
[0040] Obtain the object role of the interface configuration object that configures the interface to be called, determine the controllable components that can be controlled by the object role, and display the controllable components;
[0041] In response to the component dragging instruction triggered by the interface configuration object, the component to be dragged is determined from the displayed controllable components, and the component to be dragged is displayed at the target position of the target page, wherein the component to be bound belongs to the component to be dragged displayed at the target position.
[0042] According to another aspect of the present invention, there is provided an interface calling device, which may include:
[0043] An input parameter acquisition module is used to obtain the interface to be called and input parameters in response to the interface call instruction;
[0044] The interface input parameter transfer module is used to perform structural conversion on the input parameters based on the input parameter description information of the interface to be called, obtain the interface input parameters, and pass the interface input parameters to the interface to be called;
[0045] The output parameter obtaining module is used to receive the interface output parameter returned by the interface to be called based on the received interface input parameter, and perform structural conversion on the interface output parameter based on the output parameter description information of the interface to be called to obtain the output parameter;
[0046] Among them, the input parameter structure, configuration input parameters, output parameter structure and configuration output parameters of the interface to be called are obtained in the process of configuring the interface to be called. The input parameter description information is obtained by parsing the input parameter configuration structure, and the output parameter description information is obtained by parsing the output parameter configuration structure.
[0047] According to another aspect of the present invention, there is provided an electronic device, which may include:
[0048] at least one processor; and
[0049] a memory communicatively connected to at least one processor; wherein,
[0050] The memory stores a computer program that can be executed by at least one processor. The computer program is executed by at least one processor so that the at least one processor implements the interface calling method provided by any embodiment of the present invention when executing the computer program.
[0051] According to another aspect of the present invention, a computer-readable storage medium is provided, on which computer instructions are stored. The computer instructions are used to enable a processor to implement the interface calling method provided by any embodiment of the present invention when executed.
[0052] The technical solution of the embodiment of the present invention obtains the interface to be called and the input parameters by responding to the interface call instruction; since the input parameter description information of the interface to be called is obtained by parsing the configuration input parameters of the interface to be called through the input parameter structure of the interface to be called, the input parameter is structurally converted based on the input parameter description information, thereby obtaining the interface input parameter that can be directly applied by the interface to be called, and the interface input parameter is passed to the interface to be called; the interface output parameter returned by the interface to be called based on the received interface input parameter is received, and similarly, since the output parameter description information of the interface to be called is obtained by parsing the configuration output parameter of the interface to be called through the output parameter structure of the interface to be called, the interface output parameter is structurally converted based on the output parameter description information, thereby obtaining the output output parameter that can be directly applied by the interface caller of the interface to be called, and the interface call process is completed. The above technical solution uses the input and output parameter description information as the intermediate medium to realize the structural conversion of the input input parameter and the interface output parameter, thereby realizing the interface call process, especially when the input and output parameter structures of various interfaces may be different, a unified call process of various interfaces is realized.
[0053] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0054] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0055] Figure 1 is a flowchart of an interface calling method provided according to an embodiment of the present invention;
[0056] Figure 2 is a flowchart of another interface calling method provided according to an embodiment of the present invention;
[0057] Figure 3 is a schematic diagram of interface registration in another interface calling method provided in an embodiment of the present invention;
[0058] Figure 4 is a flowchart of another interface calling method provided according to an embodiment of the present invention;
[0059] Figure 5 A schematic diagram of component authority control in another interface calling method is provided according to an embodiment of the present invention;
[0060] Figure 6is a schematic diagram of component dragging in another interface calling method provided by an embodiment of the present invention;
[0061] Figure 7a is a flowchart of an optional example of another interface calling method provided in an embodiment of the present invention;
[0062] Figure 7b is a framework diagram of an optional example of another interface calling method provided according to an embodiment of the present invention;
[0063] Figure 8 is a structural block diagram of an interface calling device provided according to an embodiment of the present invention;
[0064] Fig. 9 It is a structural schematic diagram of an electronic device for implementing the interface calling method of an embodiment of the present invention. DETAILED DESCRIPTION
[0065] 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.
[0066] 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 interchangeable 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. The situations of "target", "original", etc. are similar and will not be repeated here. In addition, the terms "including" and "having" and any of their variations 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.
[0067] Figure 1 1 is a flow chart of an interface calling method provided in an embodiment of the present invention. This embodiment is applicable to the case of interface calling, and is particularly applicable to the case of uniformly calling various interfaces. The method can be executed by the interface calling device provided in an embodiment of the present invention, and the device can be implemented by software and / or hardware, and the device can be integrated in an electronic device, and the device can be various user terminals or servers.
[0068] See also Figure 1 The method of the embodiment of the present invention specifically includes the following steps:
[0069] S110, in response to the interface calling instruction, obtaining the interface to be called and inputting input parameters.
[0070] Among them, the interface call instruction can be an instruction for calling the interface to be called. In actual applications, it can be optionally generated when a page, component or event bound to the interface to be called is triggered. The interface to be called can be understood as the application programming interface (API) to be called. The input parameter can be understood as the input parameter input by the interface call object of the interface to be called to call the interface to be called. Exemplarily, assuming that the backend service connected to the interface to be called is a search service, the input parameter can be a search condition, such as a product keyword entered on an e-commerce platform. In response to the interface call instruction, the interface to be called and the input parameter are obtained.
[0071] S120. Perform structural conversion on the input parameters based on the input parameter description information of the interface to be called to obtain interface input parameters, and pass the interface input parameters to the interface to be called, wherein the input parameter description information is obtained by parsing the configuration input parameters of the interface to be called through the input parameter structure of the interface to be called, and the input parameter structure and the configuration input parameters are obtained in the process of configuring the interface to be called.
[0072] Among them, it has been found through research that there may be differences in the input parameter structure and the interface input parameter structure that can be used by the interface to be called. For example, the input parameters are mostly flat structures, that is, structures without nested relationships, while the interface input parameters are mostly nested structures, such as objects nested in objects or objects nested in arrays. Moreover, the input parameter structures of interface parameters of different interfaces may also be different. For example, the interface input parameters of interface 1 may be a three-layer nested structure, while the interface input parameters of interface 2 may be a four-layer nested structure. On this basis, in order to achieve a unified calling process for various interfaces, a technical solution is proposed here to perform structural conversion on the input parameters based on the input parameter description information of the interface to be called, obtain the interface input parameters of the interface to be called, and thereby implement the calling process of the interface to be called based on the interface input parameters. Specifically,
[0073] The input parameter description information can be obtained by parsing the configuration input parameters through the input parameter structure. Among them, the input parameter structure can be obtained in the process of configuring the interface to be called, such as taking the structure of the interface configuration object input for the configuration input parameters in the process of configuring the interface to be called as the input parameter structure. In practical applications, the input parameter structure can be exactly the same as the input parameter structure that can be understood by the interface to be called, or it can be one or more of the input parameter structures that can be understood by the interface to be called, and so on, which are not specifically limited here. The configuration input parameter can be the input parameter configured by the interface configuration object according to the input parameter structure of the interface to be called during the process of configuring the interface to be called. Therefore, the input parameter description information obtained after parsing the configuration input parameter through the input parameter structure can accurately describe the detailed information of the configuration input parameter, such as how many paths are contained in the configuration input parameter, how many layers of nesting are under each path, what type of information is under each layer, or whether the information under each layer is default information or blank information, etc.
[0074] From the above, we can see that the input parameter description information can be understood as the description information of the configuration input parameter. The configuration input parameter is obtained through the input parameter structure configuration that can be understood by the interface to be called. Then the interface input parameter obtained after the input parameter is structurally converted based on the input parameter description information can be considered as the input parameter that can be directly applied by the callable interface. In actual applications, the structural conversion process here can be understood as the process of converting the input parameter from a flat structure to a nested structure that matches the input parameter structure of the interface to be called.
[0075] The interface input parameters are passed to the interface to be called, so that the interface to be called passes the received interface input parameters to the background service connected to itself, and then returns the service results returned by the background service as the interface output parameters to the interface caller of the interface to be called.
[0076] S130. Receive the interface output parameters returned by the interface to be called based on the received interface input parameters, and perform structural conversion on the interface output parameters based on the output parameter description information of the interface to be called to obtain output output parameters, wherein the output parameter description information is obtained by parsing the configuration output parameters of the interface to be called through the output parameter structure of the interface to be called, and the output parameter structure and the configuration output parameters are obtained in the process of configuring the interface to be called.
[0077] Among them, similar to the input parameter related content described in the previous step, the output parameter structure of the interface returned by the interface to be called may be different from the output parameter structure that the interface caller can understand. Therefore, here the interface output parameter is structurally converted based on the output parameter description information of the interface to be called, so as to obtain the output parameter that matches the output parameter structure that the interface caller can understand. Specifically,
[0078] The output parameter description information can be obtained by parsing the configuration output parameters through the output parameter structure. Among them, the output parameter structure can be obtained in the process of configuring the interface to be called, such as taking the structure of the interface configuration object input for the configuration output parameter in the process of configuring the interface to be called as the output parameter structure. In practical applications, the output parameter structure can be exactly the same as the output parameter structure that can be understood by the interface to be called, or it can be one or more of the output parameter structures that can be understood by the interface to be called, and so on, which are not specifically limited here. The configuration output parameter can be the output parameter configured by the interface configuration object according to the output parameter structure of the interface to be called during the process of configuring the interface to be called. Therefore, the output parameter description information obtained after parsing the configuration output parameter through the output parameter structure can accurately describe the detailed information of the configuration output parameter, such as how many paths are included in the configuration output parameter, how many layers of nesting are under each path, what type of information is under each layer, or whether the information under each layer is default information or blank information, etc.
[0079] From the above, we can see that the output parameter description information can be understood as the description information of the configuration output parameter. The configuration output parameter is obtained by configuring the output parameter structure that can be understood by the interface to be called. Then, the interface output parameter obtained after the output parameter is structurally converted based on the output parameter description information can be considered as the output parameter that can be directly applied by the callable interface. In actual applications, the structural conversion process here can be understood as the process of converting the output parameter from a nested structure to a flat structure that can be understood by the interface caller.
[0080] After obtaining the output parameters, the calling process of the interface to be called ends.
[0081] The technical solution of the embodiment of the present invention obtains the interface to be called and the input parameters by responding to the interface call instruction; since the input parameter description information of the interface to be called is obtained by parsing the configuration input parameters of the interface to be called through the input parameter structure of the interface to be called, the input parameter is structurally converted based on the input parameter description information, thereby obtaining the interface input parameter that can be directly applied by the interface to be called, and the interface input parameter is passed to the interface to be called; the interface output parameter returned by the interface to be called based on the received interface input parameter is received, and similarly, since the output parameter description information of the interface to be called is obtained by parsing the configuration output parameter of the interface to be called through the output parameter structure of the interface to be called, the interface output parameter is structurally converted based on the output parameter description information, thereby obtaining the output output parameter that can be directly applied by the interface caller of the interface to be called, and the interface call process is completed. The above technical solution uses the input and output parameter description information as the intermediate medium to realize the structural conversion of the input input parameter and the interface output parameter, thereby realizing the interface call process, especially when the input and output parameter structures of various interfaces may be different, a unified call process of various interfaces is realized.
[0082] An optional technical solution, the input parameter structure includes a nested input parameter structure, and the input parameter description information stores the input parameter path information of the configuration input parameter; based on the input parameter description information of the interface to be called, the input parameter is structurally converted to obtain the interface input parameter, which may include: obtaining the input parameter final path according to the input parameter path information in the input parameter description information of the interface to be called, and filling the input input parameter into the configuration input parameter final path to obtain the interface input parameter. Among them, the input parameter path information can describe the path where each layer of information in the configuration input parameter with a nested structure (i.e., the input parameter nested structure) is located. For example, the input parameter nested structure is an apple element nested under a fruit object, and a variety attribute under the apple element. Then the input parameter path description information can describe the path where the information under the fruit object is located, the path where the information under the apple element is located, and the path where the information under the variety attribute is located. The final path of the input parameter is obtained according to the input parameter path information, such as the path where the information under the variety attribute in the above example is located. Considering that the input parameters of the interface call object input are mostly information to be filled in the last level path of the input parameters, the input parameters are filled in the last level path of the configuration input parameters, so as to obtain the interface input parameters that match the input parameter structure of the configuration input parameters, thereby realizing the input parameter structure conversion process. In practical applications, optionally, after filling the input parameters in the last level path of the configuration input parameters, the filling result can be converted into a json string by adding quotation marks and curly braces, and then the json string is converted into an object using JSON.parse() to obtain the interface input parameters.
[0083] On this basis, optionally, at least two input parameter path information may be stored in the input parameter description information; the input parameter final path is obtained according to the input parameter path information in the input parameter description information of the interface to be called, and the input input parameter is filled into the input parameter final path of the configuration input parameter to obtain the interface input parameter, which may include: for each input parameter path information in the input parameter description information of the interface to be called, the input parameter final path is obtained according to the input parameter path information; the matching input parameter in the input input parameter that matches the input parameter path information is filled into the input parameter final path of the configuration input parameter to obtain the filled-in input parameter; each filled-in input parameter is merged to obtain the interface input parameter. Among them, when at least two input parameter path information are stored in the input parameter description information, for each input parameter path information, the matching input parameter in the input input parameter that matches the input parameter path information can be filled into the input parameter final path obtained according to the input parameter path information. After each input parameter path information is processed accordingly, these filling results can be merged to obtain the interface input parameter. Exemplarily, assuming that the fruit object includes apple elements and pear elements, the apple element includes variety attributes, and the pear element includes weight attributes, then the fruit object-apple element-variety attribute is one input parameter path, and the fruit object-pear element-weight attribute is another input parameter path, and each input parameter path corresponds to its own input parameter path information. On this basis, assuming that the input parameters include Red Fuji and 1 kilogram, then Red Fuji can be filled in the path where the variety attribute is located, and 1 kilogram can be filled in the path where the weight attribute is located, and then the two filling results are merged to obtain the interface input parameter.
[0084] It should be noted that the above text uses the structural conversion process of the input parameter as an example to explain, and the structural conversion process of the interface output parameter is similar, for example, the output parameter structure includes a nested structure of the output parameter, and the output parameter description information stores the output parameter path information of the configuration output parameter; based on the output parameter description information of the interface to be called, the interface output parameter is structurally converted to obtain the output parameter, which may include: obtaining the output parameter final path according to the output parameter path information in the output parameter description information of the interface to be called, and using the final output parameter stored under the output parameter final path as the output parameter. On this basis, when at least two output parameter path information are stored in the output parameter description information, the output parameter final path is obtained according to the output parameter path information in the output parameter description information of the interface to be called, and the final output parameter stored under the output parameter final path is used as the output parameter, which may include: for each output parameter path information in the output parameter description information of the interface to be called, the output parameter final path is obtained according to the output parameter path information, and the final output parameter stored under the output parameter final path is obtained; each final output parameter is merged to obtain the output parameter. Compared with the process of converting the input parameter from a flat structure to a nested structure, this is the process of converting the output parameter from a nested structure to a flat structure.
[0085] Another optional technical solution is that an interface call instruction is generated when a bound component that has completed interface binding is triggered; in response to the interface call instruction, the interface to be called is obtained, which may include: in response to the interface call instruction, obtaining the bound component corresponding to the interface call instruction; determining the bound interface bound to the bound component in the process of configuring the interface to be called, and using the bound interface as the interface to be called. Among them, the component that has been pre-bound to the interface to be called is called a bound component. In actual applications, it can be a basic component, or a basic component in a business component composed of at least two basic components, which is not specifically limited here. On this basis, when the interface call instruction is generated when the bound component that has completed interface binding is triggered, the bound component corresponding to the interface call instruction can be obtained, and then the bound interface bound to the bound component in the process of configuring the interface to be called is determined, and the bound interface is used as the interface to be called, thereby achieving the effect of accurately determining the interface to be called.
[0086] On this basis, taking into account the application scenarios that may be involved in the embodiments of the present invention, exemplarily, when the bound components are composed of a search condition input component, a search component, and a search result display component, an interface call instruction is generated when the search component in the bound components is triggered. For example, a user enters a product keyword (i.e., inputs an input parameter) in a search condition input component (e.g., a search box) of an e-commerce platform, and then clicks a search component (e.g., a search button). In this way, after the interface calling device detects a click event of the search component, an interface call instruction for calling the product search interface can be generated, and after obtaining the product information matching the product keyword returned by the product search interface (i.e., outputting an output parameter), it can be displayed in a search result display component (e.g., a search result display list) for the user to view.
[0087] Figure 2 It is a flowchart of another interface calling method provided in an embodiment of the present invention. This embodiment is optimized based on the above-mentioned technical solutions. In this embodiment, optionally, the interface to be called can be configured through the following steps: in response to an interface registration instruction for the interface to be called to be registered, obtaining interface registration information, wherein the interface registration information includes configuration input parameters and configuration output parameters; treating the interface to be called to be registered as the interface to be registered; registering the interface to be registered based on the interface registration information to obtain a registered interface, so as to obtain a configured interface to be called according to the registered interface. Among them, the explanations of the terms that are the same or corresponding to the above-mentioned embodiments are not repeated here.
[0088] See also Figure 2 The method of this embodiment may specifically include the following steps:
[0089] S210. In response to the interface registration instruction, obtain the interface to be registered and the interface registration information of the interface to be registered, wherein the interface registration information includes configuration input parameters and configuration output parameters.
[0090] Among them, in actual applications, if it is necessary to call a certain interface on a certain platform, then the interface can be registered on the platform first, or to be more precise, the information of the interface (i.e., interface registration information) can be registered on the platform first. Specifically, the interface registration instruction can be an instruction for registering the interface to be registered, and in response to the interface registration instruction, the interface to be registered and the interface registration information of the interface to be registered are obtained. In actual applications, optionally, the interface registration information may include configuration input parameters and configuration output parameters. In addition, it may also include interface name and request type, etc., which are not specifically limited here.
[0091] S220. Register the interface to be registered based on the interface registration information to obtain a registered interface, so as to obtain a configured callable interface according to the registered interface.
[0092] Among them, the interface to be registered is registered based on the interface registration information to obtain a registered interface, and then a configured and callable configured interface can be obtained according to the registered interface, thereby completing the interface configuration process. The above-mentioned configured interface can also be called a callable interface. In actual applications, optionally, in order to ensure the security of interface calls, when at least two applications are developed on the platform, an interface registration application can be obtained from at least two applications according to the interface registration instruction, and then the interface to be registered is registered to the interface registration application, so that the callable interface corresponding to the interface to be registered can only be called by the interface registration application, and cannot be called by other applications, thereby ensuring the calling security of the callable interface.
[0093] S230. In response to the interface calling instruction, obtain the interface to be called and input parameters, wherein the interface to be called is a callable interface to be called among the callable interfaces.
[0094] S240. Perform structural conversion on the input parameters based on the input parameter description information to obtain interface input parameters, and pass the interface input parameters to the interface to be called, wherein the input parameter description information is obtained by parsing the configuration input parameters of the interface to be called through the input parameter structure of the interface to be called obtained during the configuration of the interface to be called.
[0095] The configuration input parameters of the interface to be called may be understood as the configuration input parameters of the interface to be registered obtained during the registration process of the interface to be registered corresponding to the interface to be called.
[0096] S250, receiving the interface output parameters returned by the interface to be called based on the received interface input parameters, performing structural conversion on the interface output parameters based on the output parameter description information, and obtaining output output parameters, wherein the output parameter description information of the interface to be called is obtained by parsing the configuration output parameters of the interface to be called through the output parameter structure of the interface to be called obtained in the process of configuring the interface to be called.
[0097] The configuration output parameters of the interface to be called may be understood as the configuration output parameters of the interface to be registered obtained during the registration process of the interface to be registered corresponding to the interface to be called.
[0098] The technical solution of the embodiment of the present invention responds to the interface registration instruction, registers the interface to be registered according to the interface registration information of the interface to be registered, obtains the registered interface, and then obtains the configured callable interface according to the registered interface, thereby realizing the interface configuration process.
[0099] An optional technical solution, registering an interface to be registered based on interface registration information, may include: obtaining an input parameter structure pre-entered for the interface to be registered; in response to verifying that the configuration format of the configuration input parameter is correct based on the input parameter structure, registering the interface to be registered based on the interface registration information. Wherein, the input parameter structure may be an input parameter structure that matches the interface to be registered input by the interface configuration object during the interface configuration process, and is used to verify whether the configuration format of the configuration input parameter subsequently input is correct. Therefore, after obtaining the configuration input parameter, the configuration format of the configuration input parameter can be verified based on the previously obtained input parameter structure, and after the verification is passed, the subsequent interface registration process is executed. Considering the application scenarios that may be involved in the embodiments of the present invention, illustratively, assuming that the configuration input parameter is represented by a Josn object, the pre-entered input parameter structure can be placed in Json Editr, so as to verify whether the configuration format of the Josn object is correct based on the input parameter structure in Json Editr. If the configuration format is incorrect, it can be marked and prompted before the corresponding line number in Json Editr; if the configuration format is correct, the subsequent interface registration process is executed. After the interface registration is completed, the corresponding interface registration information can be stored in the library.
[0100] It should be noted that the above text uses the configuration format verification process of the configuration input parameters as an example to illustrate, and the configuration format verification process of the configuration output parameters is similar. For example, registering the interface to be registered based on the interface registration information may include: obtaining the output parameter structure pre-entered for the interface to be registered; in response to verifying that the configuration format of the configuration output parameters is correct based on the output parameter structure, registering the interface to be registered based on the interface registration information. In actual applications, optionally, the subsequent interface registration process can be executed when the configuration format of the configuration input parameters and the configuration format of the configuration output parameters are both correct.
[0101] On this basis, optionally, in response to verifying that the configuration format of the configuration input parameter is correct based on the input parameter structure, the above-mentioned interface calling method may also include: parsing the configuration input parameter through the input parameter structure to obtain the input parameter description information, and displaying the obtained input parameter description information; in response to the information adjustment instruction acting on the displayed input parameter description information, adjusting the input parameter description information, and updating the input parameter description information according to the adjustment result. Among them, the displayed input parameter description information allows the interface configuration object to very intuitively determine the specific situation of the configuration input parameter input by itself, so that it can adjust the configuration input parameter by adjusting (such as adding, deleting and modifying) the input parameter description information according to its actual configuration needs, which has good flexibility. Exemplarily, when the interface configuration object needs to display the input parameter in bold, the "no" under the bold attribute can be adjusted to "yes", so as to achieve the purpose of displaying the input parameter in bold. In practical applications, the above-mentioned parsing and displaying process can be implemented based on the Json Schema that can be used to describe the data structure of the Json object.
[0102] In order to understand the interface registration process described above more vividly, for example, see Figure 3 The interface registration diagram shown in the figure shows that the upper part of the diagram shows the interface registration information that needs to be entered by the interface configuration object, such as interface name, request type, interface path, configuration input parameters, and configuration output parameters. The lower part of the diagram shows the Json Editr for displaying the input parameter structure, the Json Schema Editor for displaying the configuration input parameters, and the Json Schema View for displaying the input parameter description information.
[0103] Another optional technical solution is that the interface registration information also includes the interface path of the interface to be registered. The above interface calling method may also include: obtaining an interface registration application; registering the interface to be registered based on the interface registration information may include: in response to the interface path not being registered under the interface registration application, registering the interface to be registered based on the interface registration information. Among them, since the interface to be registered only needs to be registered once under the interface registration application, before registering the interface, it is possible to first determine whether the interface path of the interface to be registered has been registered under the interface registration application. If so, a prompt message may be given to avoid repeated registration; otherwise, the subsequent interface registration process may be executed.
[0104] Figure 4It is a flowchart of another interface calling method provided in an embodiment of the present invention. This embodiment is optimized based on the above-mentioned technical solutions. In this embodiment, optionally, to obtain a configured interface to be called according to a registered interface, it may include: in response to an interface binding instruction for a registered interface, obtaining a component to be bound, and binding the component to be bound and the registered interface to obtain a configured interface to be called. Among them, the explanations of the terms that are the same or corresponding to the above-mentioned embodiments are not repeated here.
[0105] See also Figure 4 The method of this embodiment may specifically include the following steps:
[0106] S310. In response to an interface registration instruction, obtain an interface to be registered and interface registration information of the interface to be registered, wherein the interface registration information includes configuration input parameters and configuration output parameters.
[0107] S320: Register the interface to be registered based on the interface registration information to obtain a registered interface.
[0108] S330. In response to the interface binding instruction for the registered interface, obtain the component to be bound, and bind the component to be bound and the registered interface to obtain a configured interface to be called.
[0109] Among them, the interface binding instruction is used to bind the registered interface and the component to be bound. In response to the interface binding instruction, the component to be bound that needs to call the registered interface is obtained, and then the component to be bound and the registered interface are bound to obtain a configured interface to be called. In actual applications, optionally, the component to be bound can be a basic component, or a basic component in a business component composed of at least two basic components. Optionally, when binding the component to be bound and the registered interface, the registered interface can be directly bound to the component to be bound, or it can be bound to a trigger event of the component to be bound, etc., which is not specifically limited here. For example, as in the above-mentioned search example, the product search interface can be bound to the click event of the search component.
[0110] S340. In response to the interface calling instruction, obtain the interface to be called and input parameters, wherein the interface to be called is a callable interface to be called among all callable interfaces.
[0111] S350. Perform structural conversion on the input parameters based on the input parameter description information to obtain interface input parameters, and pass the interface input parameters to the interface to be called, wherein the input parameter description information is obtained by parsing the configuration input parameters of the interface to be called through the input parameter structure of the interface to be called obtained during the configuration of the interface to be called.
[0112] S360, receiving the interface output parameters returned by the interface to be called based on the received interface input parameters, performing structural conversion on the interface output parameters based on the output parameter description information, and obtaining output output parameters, wherein the output parameter description information of the interface to be called is obtained by parsing the configuration output parameters of the interface to be called through the output parameter structure of the interface to be called obtained in the process of configuring the interface to be called.
[0113] The technical solution of the embodiment of the present invention obtains a configured callable interface by binding a registered interface with a component to be bound that needs to call the registered interface.
[0114] Before introducing the following technical solution, its application scenario is first exemplified. For example, in order to implement the interface binding process, the interface configuration object can first determine to which component the registered interface needs to be bound, and then drag these components to the target page, so as to perform interface binding on the components displayed on the target page. The components here can be pre-developed and / or customized components of the interface configuration object, which are not specifically limited here. In order to realize the component dragging function, the first prerequisite is that the component can be browsed by the interface configuration object. In actual applications, optionally, the relevant code of the component can be uploaded to the component library first, and then the component and its component properties can be registered, so that the component can be displayed in the component library, so that the interface configuration object can browse the component. On this basis, in order to realize the security management of components, permission control can also be performed on the components, such as assigning control permissions to components, and associating control permissions with object roles, so that according to the object role of the interface configuration object, it can be determined what control it can perform on what components. For example, see Figure 5 , which shows the component permission control process, where permission control is performed on components by configuring role names, role fields, and selectable component properties for the components.
[0115] An optional technical solution, before responding to the interface binding instruction for the registered interface, the above-mentioned interface calling method may also include: obtaining the object role of the interface configuration object that configures the interface to be called, determining the controllable components that can be controlled by the object role, and displaying the controllable components; in response to the component dragging instruction triggered by the interface configuration object, determining the components to be dragged from the displayed controllable components, and displaying the components to be dragged at the target position of the target page, and the components to be bound belong to the components to be dragged displayed at the target position. Wherein, as described above, in order to achieve the security management of components, control permissions can be assigned to each component, and the control permissions can be associated with the object role. On this basis, after obtaining the object role of the interface configuration object, the controllable components that can be controlled by the object role can be determined, that is, the controllable components that can be controlled by the interface configuration object can be determined, and these controllable components can be displayed so that the interface configuration object can browse and control them. The component dragging instruction can be an instruction triggered by the interface configuration object for dragging the components to be dragged in each controllable component to the target position of the target page, and in response to the component dragging instruction, the components to be dragged are dragged and displayed at the target position. The target page mentioned above can also be understood as a page generated by dragging components. Figure 6 , which is a schematic diagram of dragging and displaying the search condition input component, the search component, and the search result display component to the target page. On this basis, the interface configuration object can perform interface binding for the displayed component to be dragged (i.e., the component to be bound).
[0116] It should be noted that the above expressions such as interface to be called, interface to be registered, and registered interface are essentially interfaces. They are named differently to distinguish interfaces in different application scenarios, and are not specific limitations on their substantive content. The above expressions such as bound components, components to be bound, components to be dragged, and controllable components are essentially components, and the situation is similar.
[0117] In order to better understand the above technical solution as a whole, Figure 7a The flowchart shown and Figure 7b The framework diagram shown in FIG. 1 is used to illustrate the same. It should be noted that, in order to simplify the description, interfaces or components in different application scenarios are no longer distinguished here, and are uniformly described as interfaces or components. For example, see Figure 7a, in order to realize the interface registration function, the interface registration information input by the interface configuration object is obtained, and the configuration input parameters and configuration output parameters in the interface registration information are verified by json. If the verification fails, a prompt message of json format error is output; otherwise, it can be verified whether the interface has been registered based on the interface path in the interface registration information. If yes, a prompt message that the interface has been registered is output; otherwise, the interface is registered in the database, thereby completing the interface registration function. Then, a page is generated based on the components dragged by the interface configuration object, and the interface is bound to the components dragged to the page, thereby completing the interface configuration process. In the interface call process, the input parameters input by the interface call object are obtained, and the input parameters are placed in the whereBy object, and the input parameters in the whereBy object are converted into the interface input parameters actually required by the interface based on the node middleware, and then the interface is called through node. If the interface call fails, a prompt message of interface call error is output; otherwise, the interface output parameters returned by the interface are obtained, and the interface output parameters are flattened based on the middleware, and the processing results are returned to the front end for page rendering, thereby realizing a unified call process for various interfaces. It should be noted that the middleware described in the example can be understood as an intermediate conversion method for performing structural conversion of input and output parameters based on description information.
[0118] For example, Figure 7b As shown, the interface call system includes three parts: the display end, the implementation layer and the database, among which the implementation layer includes the front-end and back-end services. Specifically, in the implementation layer, for the business components and basic components stored in the component library, the drag and drop, visual editing and permission control functions of these components can be triggered based on the relevant operations of the interface configuration objects; in addition, the version management, import and export, and middleware call functions of the interface can also be realized. The database stores interface registration information, which can be used in the interface call process. The output parameters obtained after the interface output parameters returned after the interface call are flattened can be displayed on the PC for users to view. It can be seen that the various parts of the interface call system cooperate with each other to effectively realize the unified call process of various interfaces and the component permission control function.
[0119] Figure 8 This is a structural block diagram of an interface calling device provided in an embodiment of the present invention, and the device is used to execute the interface calling method provided in any of the above embodiments. The device and the interface calling method of the above embodiments belong to the same inventive concept, and the details not described in detail in the embodiment of the interface calling device can refer to the embodiment of the above interface calling method. Figure 8 The device may specifically include: an input parameter acquisition module 410, an interface input parameter transmission module 420, and an output parameter acquisition module 430.
[0120] An input parameter acquisition module 410 is used to obtain the interface to be called and input parameters in response to the interface call instruction;
[0121] The interface input parameter transfer module 420 is used to perform structural conversion on the input parameters based on the input parameter description information of the interface to be called, obtain the interface input parameters, and transfer the interface input parameters to the interface to be called;
[0122] The output parameter obtaining module 430 is used to receive the interface output parameter returned by the interface to be called based on the received interface input parameter, and perform structural conversion on the interface output parameter based on the output parameter description information of the interface to be called to obtain the output parameter;
[0123] Among them, the input parameter structure, configuration input parameters, output parameter structure and configuration output parameters of the interface to be called are obtained in the process of configuring the interface to be called. The input parameter description information is obtained by parsing the input parameter configuration structure, and the output parameter description information is obtained by parsing the output parameter configuration structure.
[0124] Optionally, the input parameter structure includes an input parameter nested structure, and the input parameter description information stores input parameter path information for configuring the input parameter; the interface input parameter transmission module 420 may include:
[0125] The interface input parameter obtaining unit is used to obtain the input parameter final path according to the input parameter path information in the input parameter description information of the interface to be called, and fill the input input parameter into the input parameter final path of the configuration input parameter to obtain the interface input parameter.
[0126] On this basis, optionally, at least two input parameter path information are stored in the input parameter description information;
[0127] The interface input parameters get the unit, which can include:
[0128] The input parameter final level path acquisition subunit is used to acquire the input parameter final level path according to each input parameter path information in the input parameter description information of the interface to be called;
[0129] The input parameter filling subunit is used to fill the matching input parameter that matches the input parameter path information in the input parameter into the input parameter final path of the configuration input parameter to obtain the filled input parameter;
[0130] The interface input parameter obtains a subunit, which is used to merge the various filled-in input parameters to obtain the interface input parameter.
[0131] Optionally, the interface call instruction is generated when a bound component that has completed interface binding is triggered;
[0132] The input parameter acquisition module 410 may include:
[0133] A bound component acquisition unit, used to respond to the interface call instruction and acquire the bound component corresponding to the interface call instruction;
[0134] The first obtaining unit of the interface to be called is used to determine the binding interface bound to the bound component in the process of configuring the interface to be called, and use the binding interface as the interface to be called.
[0135] On this basis, optionally, when the bound component is composed of a search condition input component, a search component, and a search result display component, an interface call instruction is generated when the search component in the bound component is triggered.
[0136] Optionally, the interface to be called is configured through the following modules:
[0137] An interface registration information acquisition module, used to obtain interface registration information in response to an interface registration instruction for an interface to be registered and to be called, wherein the interface registration information includes configuration input parameters and configuration output parameters;
[0138] The module for obtaining the interface to be registered is used to take the interface to be registered and called as the interface to be registered;
[0139] The module for obtaining the interface to be called is used to register the interface to be registered based on the interface registration information to obtain the registered interface, so as to obtain the configured interface to be called according to the registered interface.
[0140] On this basis, an optional module for obtaining the interface to be called may include:
[0141] An input parameter structure acquisition unit, used to acquire an input parameter structure pre-entered for the interface to be registered;
[0142] The first interface registration unit is used to register the interface to be registered based on the interface registration information in response to verifying that the configuration format of the configuration input parameter is correct based on the input parameter structure.
[0143] On this basis, optionally, the module for obtaining the interface to be called may also include:
[0144] An input parameter description information display unit is used to parse the configuration input parameter through the input parameter structure to obtain input parameter description information in response to verifying that the configuration format of the configuration input parameter is correct based on the input parameter structure, and display the obtained input parameter description information;
[0145] The input parameter description information updating unit is used to adjust the input parameter description information in response to the information adjustment instruction acting on the displayed input parameter description information, and update the input parameter description information according to the adjustment result.
[0146] Alternatively, the interface registration information also includes the interface path of the interface to be registered, and the module for obtaining the interface to be called may include:
[0147] An interface registration application acquisition unit, used to acquire an interface registration application;
[0148] The second interface registration unit is used to register the interface to be registered based on the interface registration information in response to the interface path not being registered under the interface registration application.
[0149] Alternatively, the module obtained by the interface to be called may include:
[0150] The second obtaining unit of the interface to be called is used to obtain the component to be bound in response to the interface binding instruction for the registered interface, and bind the component to be bound and the registered interface to obtain the configured interface to be called.
[0151] On this basis, optionally, the module for obtaining the interface to be called may also include:
[0152] A controllable component display unit, used for obtaining an object role of an interface configuration object that configures the interface to be called, determining controllable components that can be controlled by the object role, and displaying the controllable components before responding to an interface binding instruction for a registered interface;
[0153] The component to be dragged display unit is used to respond to the component dragging instruction triggered by the interface configuration object, determine the component to be dragged from the displayed controllable components, and display the component to be dragged at the target position of the target page, wherein the component to be bound belongs to the component to be dragged displayed at the target position.
[0154] The interface calling device provided by the embodiment of the present invention obtains the interface to be called and the input input parameter in response to the interface calling instruction through the input parameter acquisition module; since the input parameter description information of the interface to be called is obtained by parsing the configuration input parameter of the interface to be called through the input parameter structure of the interface to be called, the interface input parameter transmission module performs structural conversion on the input input parameter based on the input parameter description information, thereby obtaining the interface input parameter that can be directly applied by the interface to be called, and the interface input parameter is passed to the interface to be called; the output parameter acquisition module receives the interface output parameter returned by the interface to be called based on the received interface input parameter, and similarly, since the output parameter description information of the interface to be called is obtained by parsing the configuration output parameter of the interface to be called through the output parameter structure of the interface to be called, the interface output parameter is structurally converted based on the output parameter description information, thereby obtaining the output output parameter that can be directly applied by the interface caller of the interface to be called, and the interface calling process is completed. The above device uses the input and output parameter description information as the intermediate medium to realize the structural conversion of the input input parameter and the interface output parameter, thereby realizing the interface calling process, especially when the input and output parameter structures of various interfaces may be different, the unified calling process of various interfaces is realized.
[0155] The interface calling device provided in the embodiment of the present invention can execute the interface calling method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.
[0156] It is worth noting that in the embodiment of the above-mentioned interface calling device, the various units and modules included are only divided according to functional logic, but are not limited to the above-mentioned division, as long as the corresponding functions can be achieved; in addition, the specific names of the functional units are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of the present invention.
[0157] Fig. 9 A schematic diagram of the structure of an electronic device 10 that can be used to implement an embodiment of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.
[0158] like Fig. 9As shown, the electronic device 10 includes at least one processor 11, and a memory connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 to the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.
[0159] A number of components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0160] The processor 11 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 11 executes the various methods and processes described above, such as an interface calling method.
[0161] In some embodiments, the interface calling method may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the interface calling method described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to execute the interface calling method in any other appropriate manner (e.g., by means of firmware).
[0162] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0163] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine as a stand-alone software package and partially on a remote machine, or entirely on a remote machine or server.
[0164] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in combination with an instruction execution system, device or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, 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 foregoing.
[0165] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).
[0166] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.
[0167] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.
[0168] 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.
[0169] 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 can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. An interface calling method, characterized in that: include: In response to the interface call instruction, the interface to be called and the input parameters are obtained, wherein the input parameter structure of the interface to be called includes an input parameter nested structure, the input parameter description information of the interface to be called stores the input parameter path information of the configuration input parameters of the interface to be called, and the input parameter structure is a structure input by the interface configuration object for the configuration input parameters in the process of configuring the interface to be called; According to the input parameter path information, the input parameter final path is obtained, the input parameter is filled into the input parameter final path, the interface input parameter is obtained, and the interface input parameter is passed to the interface to be called; Receiving the interface output parameter returned by the interface to be called based on the received interface input parameter, and performing structural conversion on the interface output parameter based on the output parameter description information of the interface to be called to obtain the output output parameter; Among them, the input parameter structure, configuration input parameters, output parameter structure and configuration output parameters of the interface to be called are obtained in the process of configuring the interface to be called, the input parameter description information is obtained by parsing the configuration input parameters through the input parameter structure, and the output parameter description information is obtained by parsing the configuration output parameters through the output parameter structure.
2. The method according to claim 1, characterized in that At least two pieces of input parameter path information are stored in the input parameter description information; The step of obtaining the input parameter final path according to the input parameter path information, and filling the input input parameter into the input parameter final path to obtain the interface input parameter includes: For each piece of input parameter path information in the input parameter description information, obtaining the input parameter final level path according to the input parameter path information; Fill the matching input parameter in the input parameter that matches the input parameter path information into the input parameter final path to obtain the filled input parameter; The input parameters are combined to obtain the interface input parameters.
3. The method according to claim 1, characterized in that The interface call instruction is generated when a bound component that has completed interface binding is triggered; The step of obtaining the interface to be called in response to the interface calling instruction includes: In response to an interface calling instruction, obtaining the bound component corresponding to the interface calling instruction; Determine a binding interface bound to the bound component in the process of configuring the interface to be called, and use the binding interface as the interface to be called.
4. The method according to claim 3, characterized in that When the bound component is composed of a search condition input component, a search component, and a search result display component, the interface calling instruction is generated when the search component in the bound component is triggered.
5. The method according to claim 1, characterized in that The interface to be called is configured through the following steps: In response to an interface registration instruction for the to-be-called interface to be registered, acquiring interface registration information, wherein the interface registration information includes the configuration input parameter and the configuration output parameter; Taking the interface to be registered and to be called as the interface to be registered; The interface to be registered is registered based on the interface registration information to obtain a registered interface, so as to obtain the configured interface to be called according to the registered interface.
6. The method according to claim 5, characterized in that The registering the interface to be registered based on the interface registration information includes: Obtaining the input parameter structure pre-entered for the interface to be registered; In response to verifying that the configuration format of the configuration input parameter is correct based on the input parameter structure, the interface to be registered is registered based on the interface registration information.
7. The method according to claim 6, characterized in that After verifying that the configuration format of the configuration input parameter is correct based on the input parameter structure in response, the method further includes: Parsing the configuration input parameter through the input parameter structure to obtain the input parameter description information, and displaying the obtained input parameter description information; In response to the information adjustment instruction acting on the displayed input parameter description information, the input parameter description information is adjusted, and the input parameter description information is updated according to the adjustment result.
8. The method according to claim 5, characterized in that The interface registration information also includes the interface path of the interface to be registered, and the method further includes: Get the interface registration application; The registering the interface to be registered based on the interface registration information includes: In response to the interface path not being registered under the interface registration application, registering the interface to be registered based on the interface registration information.
9. The method according to claim 5, characterized in that The interface to be called that is configured according to the registered interface includes: In response to the interface binding instruction for the registered interface, the component to be bound is obtained, and the component to be bound and the registered interface are bound to obtain the configured interface to be called.
10. The method according to claim 9, characterized in that Before responding to the interface binding instruction for the registered interface, the method further includes: Acquire an object role of an interface configuration object that configures the interface to be called, determine a controllable component that can be controlled by the object role, and display the controllable component; In response to a component dragging instruction triggered by the interface configuration object, a component to be dragged is determined from the displayed controllable components, and the component to be dragged is displayed at a target position on a target page, wherein the component to be bound belongs to the component to be dragged displayed at the target position.
11. An interface calling device, characterized in that: include: An input parameter acquisition module is used to obtain the interface to be called and input the input parameters in response to the interface call instruction, wherein the input parameter structure of the interface to be called includes a nested input parameter structure, the input parameter description information of the interface to be called stores the input parameter path information of the configuration input parameters of the interface to be called, and the input parameter structure is a structure input by the interface configuration object for the configuration input parameters during the process of configuring the interface to be called; An interface input parameter transfer module is used to obtain the input parameter final path according to the input parameter path information, fill the input input parameter into the input parameter final path, obtain the interface input parameter, and pass the interface input parameter to the interface to be called; An output parameter obtaining module is used to receive the interface output parameter returned by the interface to be called based on the received interface input parameter, and perform structural conversion on the interface output parameter based on the output parameter description information of the interface to be called to obtain the output parameter; Among them, the input parameter structure, configuration input parameters, output parameter structure and configuration output parameters of the interface to be called are obtained in the process of configuring the interface to be called, the input parameter description information is obtained by parsing the configuration input parameters through the input parameter structure, and the output parameter description information is obtained by parsing the configuration output parameters through the output parameter structure.
12. An electronic device, characterized in that: include: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor executes the interface calling method according to any one of claims 1 to 10.
13. A computer program product, characterized in that The computer program product comprises a computer program, and when the computer program is executed by a processor, the computer program implements the interface calling method according to any one of claims 1 to 10.
Citation Information
Patent Citations
Page generation method and device
CN113467775A
Platform docking method and device
CN113742005A