CN116339862A - Interface configuration method, device, computer equipment and storage medium - Google Patents

Interface configuration method, device, computer equipment and storage medium Download PDF

Info

Publication number
CN116339862A
CN116339862A CN202310401648.9A CN202310401648A CN116339862A CN 116339862 A CN116339862 A CN 116339862A CN 202310401648 A CN202310401648 A CN 202310401648A CN 116339862 A CN116339862 A CN 116339862A
Authority
CN
China
Prior art keywords
interface
parameter
configuration
information
visual
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202310401648.9A
Other languages
Chinese (zh)
Inventor
经亦纬
郑金钰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
DBAPPSecurity Co Ltd
Original Assignee
DBAPPSecurity Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by DBAPPSecurity Co Ltd filed Critical DBAPPSecurity Co Ltd
Priority to CN202310401648.9A priority Critical patent/CN116339862A/en
Publication of CN116339862A publication Critical patent/CN116339862A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44505Configuring for program initiating, e.g. using registry, configuration files
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • User Interface Of Digital Computer (AREA)

Abstract

The application relates to an interface configuration method, an interface configuration device, computer equipment and a storage medium. The method comprises the following steps: generating a plurality of visual interface components on the canvas based on the component generation request sent by the user; the visual interface component comprises interface parameter information; determining execution sequence information of the plurality of visual interface components based on connection relations among the plurality of visual interface components; and generating an interface configuration file based on the interface parameter information and the execution sequence information. By adopting the method, the visualization of the interface calling combination configuration and the automation of the interface configuration file generation can be realized, so that the development cost of the configuration of technicians on the interface execution sequence is reduced, and the effect of improving the configuration efficiency is achieved.

Description

Interface configuration method, device, computer equipment and storage medium
Technical Field
The present invention relates to the field of data reporting technologies, and in particular, to an interface configuration method, an apparatus, a computer device, and a storage medium.
Background
Data reporting refers to the process of transferring downstream data to upstream data. With the development of information technology, various industries need to analyze a large amount of data, so as to mine valuable information to promote production activities, and the data reporting work is more important. Current data reporting is often performed through two forms of Kafka or REST APIs. However, both of the above data reporting forms only support simple data reporting. When there is a dependency relationship between different interfaces or a single interface call cannot achieve the purpose of reporting data, a complex interface call combination is needed for processing.
In the traditional technology, complicated data reporting needs to be customized and developed by technicians, and the customization and development need the technicians to have certain expertise, so that the problems of high development cost, long development period and low configuration efficiency exist.
Therefore, the interface configuration of the current data reporting still has the problems of high development cost and low efficiency.
Disclosure of Invention
In view of the foregoing, it is desirable to provide an interface configuration method, apparatus, computer device, and computer-readable storage medium that can reduce development costs and improve configuration efficiency.
In a first aspect, the present embodiment provides an interface configuration method, where the method includes:
generating a plurality of visual interface components on the canvas based on the component generation request sent by the user; the visual interface component comprises interface parameter information;
determining execution sequence information of the plurality of visual interface components based on connection relations among the plurality of visual interface components;
and generating an interface configuration file based on the interface parameter information and the execution sequence information.
In one embodiment, the interface parameter information includes a global function and/or a reference to a global parameter, and the generating an interface configuration file based on the interface parameter information and the execution sequence information further includes:
And if the global function and/or the global parameter do not exist, setting the reference character string of the global function and/or the global parameter as an empty character string.
In one embodiment, the execution sequence information includes a series execution step and/or a parallel execution step of the plurality of visual interface components.
In one embodiment, generating the interface configuration file based on the interface parameter information and the execution order information includes:
executing the interface configuration file;
and determining an output result based on the parameters acquired by executing the interface configuration file.
In one embodiment, executing the interface profile includes:
judging whether response data of the current interface is abnormal or not;
if so, calling the current interface to acquire response data again;
if so, executing the step of the next interface.
In some embodiments, the interface parameter information includes a pre-interface parameter, and executing the interface profile further includes:
detecting whether a valid period exists in a preposed interface parameter of a current interface;
and if the validity period exists and the pre-interface parameter is expired, re-acquiring the pre-interface parameter based on the validity period.
In one embodiment, the interface parameter information further includes page turning configuration information, the current interface includes a plurality of pages, and executing the interface configuration file further includes:
sending a page turning request based on the page turning configuration information to obtain response data of the multiple pages;
and assembling the response data of the multiple pages to obtain the response data of the current interface.
In a second aspect, the present embodiment provides an interface configuration apparatus, including:
the component generating module is used for generating a plurality of visual interface components on the canvas based on the component generating request sent by the user; the visual interface component comprises interface parameter information;
the order determining module is used for determining execution order information of the plurality of visual interface components based on the position information of the visual interface components on the canvas and the connection relation among the plurality of visual interface components;
and the configuration generation module is used for generating an interface configuration file based on the interface parameter information and the execution sequence information.
In a third aspect, the present embodiment provides a computer device comprising a memory storing a computer program and a processor implementing the steps of the above method when the processor executes the computer program.
In a fourth aspect, the present embodiment provides a computer readable storage medium having stored thereon a computer program which when executed by a processor performs the steps of the above method.
The interface configuration method, the interface configuration device, the computer equipment and the storage medium generate a plurality of visual interface components on the canvas through generating requests based on components sent by a user; the visual interface component comprises interface parameter information; determining execution sequence information of the plurality of visual interface components based on connection relations among the plurality of visual interface components; based on the interface parameter information and the execution sequence information, an interface configuration file is generated, a visual interface configuration interface is provided, based on the setting of the position of the component and the setting of the connection relation by a user, the visualization of the interface call combination configuration is realized, and based on the interface parameter information and the execution sequence information, the interface configuration file is generated, the automation of the generation of the interface configuration file can be realized, so that the development cost of the configuration of technicians on the execution sequence of the interface is reduced, and the configuration efficiency is improved.
Drawings
FIG. 1 is an application environment diagram of an interface configuration method in one embodiment;
FIG. 2 is a flow chart of an interface configuration method in one embodiment;
FIG. 3 is a schematic diagram of a visual interface component configuration interface in one embodiment;
FIG. 4 is a schematic diagram of an interface parameter information configuration interface in one embodiment;
FIG. 5 is a flow chart of an interface configuration method according to another embodiment;
FIG. 6 is a schematic diagram of a global variable configuration interface in one embodiment;
FIG. 7 is a schematic diagram of a global function configuration interface in one embodiment;
FIG. 8 is a schematic diagram of a pre-execution configuration interface in one embodiment;
FIG. 9 is a schematic diagram of a post-execution configuration interface in one embodiment;
FIG. 10 is a schematic diagram of a page-flip configuration information configuration interface in one embodiment;
FIG. 11 is a block diagram of an interface configuration device in one embodiment;
fig. 12 is an internal structural diagram of a computer device in one embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application will be further described in detail with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the present application.
The interface configuration method provided by the embodiment of the application can be applied to an application environment shown in fig. 1. Wherein the terminal 102 communicates with the server 104 via a network. The data storage system may store data that the server 104 needs to process. The data storage system may be integrated on the server 104 or may be located on a cloud or other network server. The terminal 102 is configured to generate a plurality of visual interface components on a canvas based on a component generation request sent by a user, where the visual interface components include interface parameter information, the canvas and the visual interface components may be acquired from the server 104 and are displayed to the user by a display device, after the user adjusts the position and connection relationship of the visual interface components, the terminal 102 records the position information of the visual interface components on the canvas and the connection relationship between the components, determines execution sequence information of the visual interface components, acquires interface parameter information configured by the user, and generates an interface configuration file based on the interface parameter information and the execution sequence information. After the interface configuration file is generated, the interface configuration file may be sent to the server 104 for storage. The server 104 may be implemented as a stand-alone server or a server cluster including a plurality of servers.
In one embodiment, as shown in fig. 2, an interface configuration method is provided, and the method is applied to the terminal in fig. 1 for illustration, and includes the following steps:
step S100, generating a plurality of visual interface components on a canvas based on a component generation request sent by a user; the visual interface component includes interface parameter information.
The canvas is a drawing area for drawing visual interface components and connection relations among the components, and the width and the height of the canvas can be set based on actual requirements. The visual interface component is an element drawn in the canvas in the form of a bitmap or vector diagram. A visual interface component may correspond to an interface that may implement a preset function.
The canvas and the visual interface components may be displayed in the same interface configuration interface, which may also include a list of components that may include multiple types of component templates. The sending condition of the component generating request may be based on a click event sending when the user clicks on a component in the component list; the request sending condition may be generated based on a mouse drag event when the user drags the components in the component list to the canvas, or may be generated by other components, which is not limited herein. Accordingly, the visual interface component is generated on the canvas based on the component generation request sent by the user, which may be obtained by instantiating the component template in the component list.
The interface parameter information refers to parameters required by the interface call, and the parameters are set based on understanding of the interface document and actual needs of the user, which is not limited herein.
Step S200, determining execution sequence information of the plurality of visual interface components based on connection relations among the plurality of visual interface components.
The connection relationship between the plurality of visual interface components can include a calling relationship between the components, and also can include a sequence of calling each component. In the configuration interface, the connection relationship may be represented by a line, that is, two or more components are connected by a line. In some of these embodiments, one or both ends of the line may also include an arrow. The connection relationship may be configured by a user, i.e., when a user connects two or more components in a configuration interface, the connection relationship between the components is determined based on the connection behavior.
Determining the execution order information of the plurality of visual interface components may be determining the call order information of the plurality of interfaces based on the connection relationship between the plurality of visual interface components.
And step S300, generating an interface configuration file based on the interface parameter information and the execution sequence information.
And generating an interface configuration file based on the interface parameter information and the execution sequence information, wherein the interface configuration file can be obtained by carrying out configuration combination on interfaces based on the interface parameter information and the execution sequence information.
According to the interface configuration method provided by the embodiment, a plurality of visual interface components are generated on a canvas through a component generation request sent by a user; the visual interface component comprises interface parameter information; determining execution sequence information of the plurality of visual interface components based on connection relations among the plurality of visual interface components; based on the interface parameter information and the execution sequence information, an interface configuration file is generated, a visual interface configuration interface is provided, based on the setting of the position of the component and the setting of the connection relation by a user, the visualization of the interface call combination configuration is realized, and based on the interface parameter information and the execution sequence information, the interface configuration file is generated, the automation of the generation of the interface configuration file can be realized, so that the development cost of the configuration of technicians on the execution sequence of the interface is reduced, and the configuration efficiency is improved.
In one embodiment, configuring the interface further comprises updating and exposing the location information of the visual interface component on the canvas.
It can be appreciated that in the visual configuration interface, if the position of the interface component on the canvas is established, the user configures only the connection relationship of each interface component, and thus a configuration error problem may occur. By updating and displaying the position information of the visual interface component, the user can visually classify the interface component, so that the connection relation of the interface component on the visual level is clearer, and the effect of improving the configuration efficiency can be achieved.
The position information of the visual interface component on the canvas can be determined by taking any point or points in the area where the component is located as reference points and based on the coordinate position of the reference points in the canvas.
The position information of the visual interface component on the canvas may be changed in response to a mouse dragging event of the user, may be changed in response to a keyboard event of the user, for example, may be changed in response to a direction key trigger of the user, or may be changed in other manners, which are not limited herein.
In one embodiment, the interface parameter information includes a global function and/or a reference to a global parameter, and the generating an interface configuration file based on the interface parameter information and the execution sequence information further includes:
And if the global function and/or the global parameter do not exist, setting the reference character string of the global function and/or the global parameter as an empty character string.
It can be understood that, besides parameter inheritance in the interface calling process, global parameters or global functions can be set to realize multiplexing of multiple interfaces. However, in the process of setting the interface parameter information by the user, the global parameter or the global function referred by the current interface may not exist due to the occurrence of input errors or the error of the call result of the front interface, and the like, and if the reference to the global parameter or the global function is used, an abnormal call request may be generated, so that a program is in error, or the server side returns error response data.
The interface parameter information may include only a reference to the global function, may include only a reference to the global parameter, and may include a common reference to the global function and the global parameter, which is not limited herein. Taking the reference to the global function in the interface parameter information as an example, when the interface configuration file is generated, if the global function in the interface parameter information does not exist, that is, the global function does not include the function name referenced in the interface parameter information, the character string referencing the global function is replaced by the empty character string, so that the problem that the error result is output due to the fact that the non-existing function is referenced is avoided.
According to the interface configuration method provided by the embodiment, when the referenced global function or the referenced global parameter does not exist, the character string of the referenced part is replaced by the empty character string, so that errors caused by the fact that the function or the parameter does not exist can be avoided, further, occupation of resources of a server caused by the fact that the parameter errors exist can be reduced, and the effect of improving stability of executing steps of the interface configuration file is achieved.
In one embodiment, the execution sequence information includes a series execution step and/or a parallel execution step of the plurality of visual interface components.
The step of performing in series may be sequentially performing the call of the plurality of interfaces according to the sequential connection relationship, and the step of performing in parallel may be performing the call of two interfaces in parallel, where the call of the parallel interface may be performed on the premise that the front interface obtains response data, may be performing the call by inheriting parameters of the front interface, may be performing the call according to a time point when the call of the front interface ends, and may also be performing other call conditions corresponding to the response data obtained based on the front interface, which is not limited herein; the calling of the parallel interfaces may also be based on a preset time, that is, two or more interfaces called in parallel have no inter-dependency relationship, and the preset time may be set based on actual needs, which is not limited herein.
Accordingly, the series execution step and the parallel execution step may be obtained by analyzing a connection relationship configured by a user, for example, the series execution step may be determined based on a connection relationship of one interface to two or more interfaces, and the series execution step may be determined based on a connection relationship of one interface to another interface.
The interface configuration method provided by the embodiment includes that the execution sequence information includes a serial execution step and/or a parallel execution step of the plurality of visual interface components, and through configuration of the serial step and the parallel step, the serial execution and parallel execution capabilities of the plurality of back-end service interfaces can be realized, the interdependence among interfaces is reduced, the time required by a user to call the interfaces to acquire results is reduced, and the technical effect of improving the data reporting efficiency is achieved.
In one embodiment, generating the interface configuration file based on the interface parameter information and the execution order information includes:
executing the interface configuration file;
and determining an output result based on the parameters acquired by executing the interface configuration file.
The execution of the interface configuration file refers to sequentially calling the included interfaces based on the interface calling combination in the interface configuration file. In a specific embodiment, the sequentially calling the included interfaces may include sequentially calling the interfaces in the serial execution step, and further include calling the interfaces in the parallel execution step.
The output result may be determined based on the parameters obtained by executing the interface configuration file, and may be obtained by combining data obtained by calling each interface, or may be obtained by combining results obtained by calling the last interface in the interface combination, or may be obtained by combining call results of individual interfaces based on preset settings, which is not limited herein.
According to the interface configuration method, the interface configuration file is executed, the output result is determined based on the parameters acquired by executing the interface configuration file, the interface calling result can be combined, and automation of data reporting is achieved.
In one embodiment, the executing the interface profile includes:
judging whether response data of the current interface is abnormal or not;
if so, calling the current interface to acquire response data again;
if so, executing the step of the next interface.
The determining whether the response data of the current interface is abnormal may be checking the response data returned by the interface, and checking the response data may be checking parameters known to be unchanged in the response data, checking a format of the response data, or other known response data checking methods, which are not limited herein.
Judging whether the response data of the current interface is abnormal or not based on the verification result of the response data, and if so, calling the current interface to acquire the response data again; and if the interface is normal, executing the calling step of the next interface.
Further, the interface parameter information may also include pre-execution scripts and/or post-execution scripts, i.e. steps executed before or after the invocation of the current interface. The abnormality judgment of the response data of the current interface may be performed in a post execution script of the current interface or in a pre execution script of the next interface.
According to the interface configuration method, whether the response value obtained by calling the interface is abnormal or not is judged, and the step of re-acquiring the response data or executing the next interface is determined based on the judgment result, so that interface calling errors caused by abnormal response values can be avoided, occupation of server resources caused by parameter errors can be further reduced, and the effect of improving stability of executing steps of interface configuration files is achieved.
In some embodiments, the interface parameter information includes a pre-interface parameter, and executing the interface profile further includes:
Detecting whether a valid period exists in a preposed interface parameter of a current interface;
and if the validity period exists and the pre-interface parameter is expired, re-acquiring the pre-interface parameter based on the validity period.
It will be appreciated that the invocation of the current interface may reference response data returned by the preceding interface, e.g. in a complex interface combination, a request to acquire a password interface is required, the password parameter in the returned value is taken to be used as the request header parameter in the subsequent request interface.
The parameters of the front-end interface are the parameters referenced by the current interface and inherited from the front-end interface. The detecting whether the validity period exists in the pre-interface parameter of the current interface may be detecting the type of the pre-interface parameter, for example, when the type of the pre-interface parameter is token password, determining that the validity period exists in the pre-interface parameter.
The existence of the validity period of the pre-interface parameter means that the pre-interface parameter needs to be reacquired after being expired so as to ensure the normal call of the interface. Thus, if the validity period exists and the preamble interface parameters have expired, the preamble interface parameters are reacquired based on the validity period. The pre-interface parameter is retrieved, and the pre-interface may be recalled.
Further, in this embodiment, the detection of the validity period of the pre-interface parameter and the re-acquisition of the pre-interface parameter may be performed in the pre-execution script of the current interface.
According to the interface configuration method provided by the embodiment, when the interface parameter information comprises the preposed interface parameter and the preposed interface parameter is out of date, the preposed parameter is acquired again by calling the interface, so that the effect of improving the stability of the executing step of the interface configuration file can be achieved.
In one embodiment, the interface parameter information further includes page turning configuration information, the current interface includes a plurality of pages, and executing the interface configuration file further includes:
sending a page turning request based on the page turning configuration information to obtain response data of the multiple pages;
and assembling the response data of the multiple pages to obtain the response data of the current interface.
It can be understood that, in the process of calling the interface, the response data returned by the server or other requested party devices is divided into a plurality of pages, and the obtained response data of the current page is incomplete, and then a page turning request needs to be sent according to the information such as the page number contained in the page pointed by the current interface, so as to collect the response data of the plurality of pages, and obtain a complete response data result.
The page turning configuration information may include a reference to a pre-interface parameter, a preset parameter name, and related data obtained based on the current page by referring to an existing parameter, such as judgment of a page number field, total number of pages, and the like.
And sending a page turning request based on the page turning configuration information, wherein the page turning request can be a call request for a specified page after modification based on the page turning configuration information, and when the response data of all pages are read completely, the call of the current interface is considered to be ended.
Furthermore, in the embodiment, an interface for page turning configuration can be provided in the visual configuration interface, and for the parameters set by user, the user can fill in the user-defined parameters in the parameter name and the parameter value; for parameters to be determined based on real-time conditions or page conditions, the embodiment provides a drop-down frame of a self-selection function in an operation column, and a user can select a corresponding function based on the requirements; if the parameters to be set are parameters of the front-end interface, the drop-down frame of the self-selection function also comprises a front-end mapping parameter, when the user selects the front-end mapping parameter, the column of the parameter name is changed into the drop-down frame, and all or part of the parameters which can be quoted in the front-end interface are provided in the drop-down frame. Based on the method, the time required by the user in the page turning configuration process can be reduced, and the effects of saving time cost and improving efficiency are achieved.
According to the interface configuration method provided by the embodiment, the page turning request is sent based on the page turning configuration information, so that response data of the multiple pages are obtained; and assembling the response data of the multiple pages to obtain the response data of the current interface, and realizing the acquisition and assembly of the response data of the multiple pages under the condition that the interface call needs to turn pages.
In order to more clearly illustrate the technical solution of the present application, the present application further provides a detailed embodiment, where the present embodiment is applicable to multiple scenarios such as pedestrian data reporting, data reporting in the communication industry, and big data reporting, and most reporting scenarios currently require two forms of Kafka or REST API to report, where reporting by the two forms in a complex combination includes, but is not limited to, the following situations: (1) Firstly requesting to acquire a password interface, and taking the password parameter in the return value as a request header parameter of a subsequent request interface; (2) The password obtained through the password interface has a valid period and needs to be obtained again at fixed time; (3) The interface call has front-back interface dependence, if the second interface is requested, the first interface is requested to acquire the response header parameter or the response parameter, and one or some parameters are taken as the request header parameter or the request parameter of the second interface; (4) the interface return value has a condition that page turning is needed. The method of the embodiment comprises the following steps:
As shown in fig. 3, the embodiment provides a visual configuration interface, which includes a component list and an interface canvas, wherein the component list includes an interface, configures and outputs three columns, one column of the interface includes an interface template, that is, the visual interface component template, one column of the configuration includes global parameters, and one column of the output includes a resource catalog.
The global parameter refers to a value which takes a current interface set canvas as a range and allows a cross-over interface to quote or set the parameter; the interface is used for sending a request to a specific URL and acquiring a corresponding result.
The interface set canvas is characterized in that a diagram is taken as a full view angle, all interfaces are dragged to a page in a visual mode and connected in series and parallel, the whole interface layout diagram is an interface set, and the interface set is used for completing a complex interface calling requirement; the interface canvas comprises interface ordering of each visual interface component, namely the positions and the connection relations of the visual interface components, and also comprises the connection relations of each interface and output results; each visual interface component may include an interface name, an interface icon, and an interface address.
The front interface in this embodiment refers to a specific interface that needs to acquire parameters for the current interface by calling the interface, relative to the current interface; the output result is to take the parameter or the fixed value obtained from the previous interface as the output result.
Fig. 4 shows a configuration interface of interface parameter information in this embodiment, where pre-execution refers to that a running user performs some custom commands in advance before the interface is called, and performs operations such as parameter assignment, parameter acquisition, etc.; the post execution refers to executing some user-defined commands after the interface call by the operation user, and performing operations such as parameter assignment, parameter acquisition and the like. The parameter rules of the configuration interface are as follows:
Figure BDA0004180061400000111
as shown in fig. 5, the interface configuration method of the present embodiment includes:
and step 1, analyzing an interface document. The user reads and analyzes the provided interface document, clears the calling relation and the calling sequence in the interface document, and confirms the data source and the type of the calling parameter and the related structure.
And 2, visually configuring interface parameters and sequences. In the visual interface configuration interface, the connection relation of each interface is determined in an interface set canvas, and interface parameter information is filled in the interface parameter information configuration interface of each interface, wherein the interface parameter information can comprise configuration request header parameters (request headers), request parameters (request param, request body), reference global parameters (global param), response header parameters (response header), response parameters (response body) and the like.
The request header parameter may include several attributes, and the format is "attribute name: attribute value ", the server side obtains the information of the client side according to the attribute value".
The request parameters include a Param parameter and a Body parameter, where Param parameter may include a query parameter, i.e., in the URL address "? "parameters after characters; the Body parameters may include parameters such as none, form-data, x-www-form-urlencoded, json, xml, binary, and raw, where none represents no Body parameter, and form-data supports a form Type of an uploaded file, corresponding to a Content-Type in an http request: multipart/form-data, x-www-form-url coded corresponds to the form Type of interface request, corresponds to the Content-Type in the http request: application/x-www-form-url coded, json, content-Type, application/json, xml, content-Type, application/xml, binary for use in sending file-Type data, and raw for use in sending other text-Type data.
The response header parameter includes several attributes in the format of "attribute name: attribute value ", the client obtains the information of the server according to the attribute value".
The response data format of the response parameters may include JSON, XML, HTML, raw, binary, and the response value is parsed according to the data format.
Step 3, checking whether each interface component has a front interface, if part of interfaces call the front interface, for example, the token password value needs to be obtained in advance as the request header parameter or the request parameter of the next interface, determining whether periodic re-acquisition is needed based on the validity period of the value.
In a specific embodiment, whether a pre-interface exists in the current interface is judged, if so, whether the pre-interface parameter has a valid period is judged, if not, the pre-interface parameter can be directly called, if so, whether the pre-interface parameter is out of date is judged, if so, the pre-interface is called to obtain the pre-interface parameter, and then a calling request of the current interface is sent.
And step 4, sequentially calling interfaces according to the interface sequence configured in the step 2, judging whether the return value passes to the next interface or not, and inputting the response value of the previous interface into the next interface as a parameter.
And 5, finishing the complete interface call, and outputting the spliced interface call result to the unified outlet.
Fig. 6 and 7 show a configuration interface for global management in this embodiment, where:
in the configuration interface of the global variables, manual filling of parameter names, parameter values and parameter descriptions is allowed. The parameter name does not allow repetition and only allows entry of strings of letters and numbers only, up to 32 bits. The parameter can only be referenced in the API set. The reference expression "% { globals. Key }" is "% { globals. Key }" such as "% { globals. Key1}", which is prefixed with "globals.
Further, when the user deletes the related parameter information or deletes the interface, the pop-up prompt box asks the user to confirm whether to delete for the second time.
Further, the left column of the function name also includes whether the parameter is enabled, defaults to an on state, and when the button is directed to the right, the representative is in an enabled state, and when the button is directed to the left, the representative is in an off state, and cannot be referenced.
Further, if an inexistent global variable is referenced in the interface parameter information, the referenced string is replaced with an empty string.
In the configuration interface of the global function, the function name, the selection calling function and the manual function description are allowed to be manually filled in. The function name does not allow repetition and only allows entry of strings of letters and numbers only, up to 32 bits. The function can only be referenced in the API set. "functions" are prefixed when referring to the expression "% { functions.functional name } ()", such as "% { functions.md5enc } (% { globals 1} +" _ "+% { globals 2 }").
Further, when the global function is not configured, the configuration button is gray, the corresponding configuration bullet frame is popped up after the configuration is clicked, parameters which are needed to be filled are configured and stored, and after the bullet frame is closed and the configuration button is lightened.
Further, the left column of the function name also includes whether the global function is enabled, defaults to an off state, and when the button is directed to the right, the representative is in an enabled state, and when the button is directed to the left, the representative is in an off state and cannot be referenced.
Further, if the non-existing global function is referenced in the interface parameter information, the referenced string is replaced with an empty string.
The following are call expressions for the parameters and functions in this embodiment:
Figure BDA0004180061400000141
fig. 8 is a schematic diagram of a pre-execution configuration interface in the present application, where the expression in the figure is an expression in a specific embodiment, where "@ { req. Body. Name }" is a body parameter of a request parameter, and a global variable "@ { global. Key1}" is used to perform assignment, that is, interface call is performed by using the global variable as the body parameter. Fig. 9 is a schematic diagram of a post-execution configuration interface in the present application, where the expression in the figure is an expression in a specific embodiment, where "@ { global. Temp1}" is a global variable, and a partial parameter "@ { res. Json. Key1.Key2}" of a response json parameter is used to assign the partial parameter value in the response data to a global variable for multiplexing by other interfaces.
As shown in fig. 10, an interface of the page turning configuration in this embodiment is used for setting page turning configuration information when the interface calls a page to be turned, and for a parameter set by user, a user may fill in a user-defined parameter in a "parameter name" and a "parameter value"; for parameters to be determined based on real-time conditions or page conditions, the embodiment provides a drop-down frame of a self-selection function in an operation column, and a user can select a corresponding function based on the requirements; if the parameters to be set are parameters of the front-end interface, the drop-down frame of the self-selection function also comprises a front-end mapping parameter, when the user selects the front-end mapping parameter, the column of the parameter name is changed into the drop-down frame, and all or part of the parameters which can be quoted in the front-end interface are provided in the drop-down frame.
According to the interface configuration method, through visual interface configuration, the connection relation of the interface components on the visual level is clearer, development cost of configuration of technicians on the interface execution sequence is reduced, and configuration efficiency is improved; by replacing the character strings of the quoted part with empty character strings when the quoted global function or the global parameter does not exist, errors caused by the absence of the function or the parameter can be avoided, further, the occupation of resources of a server caused by the parameter errors can be reduced, and the effect of improving the stability of the execution steps of the interface configuration file is achieved; through configuration of serial steps and parallel steps, the capability of serial execution and parallel execution of a plurality of back-end service interfaces can be realized, the interdependence among the interfaces is reduced, the time required by a user for calling the interfaces to acquire results is reduced, and the technical effect of improving the data reporting efficiency is achieved; judging whether the response value obtained by calling the interface is abnormal or not, and determining the step of re-acquiring the response data or executing the next interface based on the judging result, so that interface calling errors caused by abnormal response value can be avoided; when the interface parameter information comprises the preposed interface parameter and the preposed interface parameter is out of date, the preposed parameter is obtained again by calling the interface, so that the effect of improving the stability of the execution step of the interface configuration file can be achieved; obtaining response data of the multiple pages by sending a page turning request based on the page turning configuration information; and assembling the response data of the multiple pages to obtain the response data of the current interface, and realizing the acquisition and assembly of the response data of the multiple pages under the condition that the interface call needs to turn pages.
It should be understood that, although the steps in the flowcharts related to the embodiments described above are sequentially shown as indicated by arrows, these steps are not necessarily sequentially performed in the order indicated by the arrows. The steps are not strictly limited to the order of execution unless explicitly recited herein, and the steps may be executed in other orders. Moreover, at least some of the steps in the flowcharts described in the above embodiments may include a plurality of steps or a plurality of stages, which are not necessarily performed at the same time, but may be performed at different times, and the order of the steps or stages is not necessarily performed sequentially, but may be performed alternately or alternately with at least some of the other steps or stages.
Based on the same inventive concept, the embodiment of the application also provides an interface configuration device for realizing the above-mentioned interface configuration method. The implementation of the solution provided by the device is similar to the implementation described in the above method, so the specific limitation in the embodiments of one or more interface configuration devices provided below may refer to the limitation of the interface configuration method hereinabove, and will not be repeated herein.
In one embodiment, as shown in fig. 11, there is provided an interface configuration apparatus including: the device comprises a component generation module, a sequence determination module and a configuration generation module, wherein:
the component generating module is used for generating a plurality of visual interface components on the canvas based on the component generating request sent by the user; the visual interface component comprises interface parameter information;
the order determining module is used for determining execution order information of the plurality of visual interface components based on the connection relation among the plurality of visual interface components;
and the configuration generation module is used for generating an interface configuration file based on the interface parameter information and the execution sequence information.
In one embodiment, the interface parameter information includes a global function and/or a reference to a global parameter, and the configuration generation module is further configured to:
and if the global function and/or the global parameter do not exist, setting the reference character string of the global function and/or the global parameter as an empty character string.
In one embodiment, the execution sequence information includes a series execution step and/or a parallel execution step of the plurality of visual interface components.
In one embodiment, the interface configuration device includes an execution module for: executing the interface configuration file; and determining an output result based on the parameters acquired by executing the interface configuration file.
In one embodiment, the execution module is further to:
judging whether response data of the current interface is abnormal or not;
if so, calling the current interface to acquire response data again;
if so, executing the step of the next interface.
In some embodiments, the interface parameter information includes a preamble interface parameter, and the execution module is further configured to:
detecting whether a valid period exists in a preposed interface parameter of a current interface;
and if the validity period exists and the pre-interface parameter is expired, re-acquiring the pre-interface parameter based on the validity period.
In one embodiment, the interface parameter information further includes page turning configuration information, the current interface includes a plurality of pages, and the execution module is further configured to:
sending a page turning request based on the page turning configuration information to obtain response data of the multiple pages;
and assembling the response data of the multiple pages to obtain the response data of the current interface.
The respective modules in the above-described interface configuration apparatus may be implemented in whole or in part by software, hardware, and combinations thereof. The above modules may be embedded in hardware or may be independent of a processor in the computer device, or may be stored in software in a memory in the computer device, so that the processor may call and execute operations corresponding to the above modules.
In one embodiment, a computer device is provided, which may be a terminal, and the internal structure thereof may be as shown in fig. 12. The computer device includes a processor, a memory, a communication interface, a display screen, and an input device connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The communication interface of the computer device is used for carrying out wired or wireless communication with an external terminal, and the wireless mode can be realized through WIFI, a mobile cellular network, NFC (near field communication) or other technologies. The computer program is executed by a processor to implement an interface configuration method. The display screen of the computer equipment can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer equipment can be a touch layer covered on the display screen, can also be keys, a track ball or a touch pad arranged on the shell of the computer equipment, and can also be an external keyboard, a touch pad or a mouse and the like.
It will be appreciated by those skilled in the art that the structure shown in fig. 12 is merely a block diagram of some of the structures associated with the present application and is not limiting of the computer device to which the present application may be applied, and that a particular computer device may include more or fewer components than shown, or may combine certain components, or have a different arrangement of components.
In one embodiment, a computer device is provided comprising a memory and a processor, the memory having stored therein a computer program, the processor when executing the computer program performing the steps of:
generating a plurality of visual interface components on the canvas based on the component generation request sent by the user; the visual interface component comprises interface parameter information;
determining execution sequence information of the plurality of visual interface components based on connection relations among the plurality of visual interface components;
and generating an interface configuration file based on the interface parameter information and the execution sequence information.
In one embodiment, a computer readable storage medium is provided having a computer program stored thereon, which when executed by a processor, performs the steps of:
Generating a plurality of visual interface components on the canvas based on the component generation request sent by the user; the visual interface component comprises interface parameter information;
determining execution sequence information of the plurality of visual interface components based on connection relations among the plurality of visual interface components;
and generating an interface configuration file based on the interface parameter information and the execution sequence information.
It should be noted that, user information (including but not limited to user equipment information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, presented data, etc.) referred to in the present application are information and data authorized by the user or sufficiently authorized by each party.
Those skilled in the art will appreciate that implementing all or part of the above described methods may be accomplished by way of a computer program stored on a non-transitory computer readable storage medium, which when executed, may comprise the steps of the embodiments of the methods described above. Any reference to memory, database, or other medium used in the various embodiments provided herein may include at least one of non-volatile and volatile memory. The nonvolatile Memory may include Read-Only Memory (ROM), magnetic tape, floppy disk, flash Memory, optical Memory, high density embedded nonvolatile Memory, resistive random access Memory (ReRAM), magnetic random access Memory (Magnetoresistive Random Access Memory, MRAM), ferroelectric Memory (Ferroelectric Random Access Memory, FRAM), phase change Memory (Phase Change Memory, PCM), graphene Memory, and the like. Volatile memory can include random access memory (Random Access Memory, RAM) or external cache memory, and the like. By way of illustration, and not limitation, RAM can be in the form of a variety of forms, such as static random access memory (Static Random Access Memory, SRAM) or dynamic random access memory (Dynamic Random Access Memory, DRAM), and the like. The databases referred to in the various embodiments provided herein may include at least one of relational databases and non-relational databases. The non-relational database may include, but is not limited to, a blockchain-based distributed database, and the like. The processors referred to in the embodiments provided herein may be general purpose processors, central processing units, graphics processors, digital signal processors, programmable logic units, quantum computing-based data processing logic units, etc., without being limited thereto.
The technical features of the above embodiments may be arbitrarily combined, and all possible combinations of the technical features in the above embodiments are not described for brevity of description, however, as long as there is no contradiction between the combinations of the technical features, they should be considered as the scope of the description.
The above examples only represent a few embodiments of the present application, which are described in more detail and are not to be construed as limiting the scope of the present application. It should be noted that it would be apparent to those skilled in the art that various modifications and improvements could be made without departing from the spirit of the present application, which would be within the scope of the present application. Accordingly, the scope of protection of the present application shall be subject to the appended claims.

Claims (10)

1. An interface configuration method, the method comprising:
generating a plurality of visual interface components on the canvas based on the component generation request sent by the user; the visual interface component comprises interface parameter information;
determining execution sequence information of the plurality of visual interface components based on connection relations among the plurality of visual interface components;
And generating an interface configuration file based on the interface parameter information and the execution sequence information.
2. Interface configuration method according to claim 1, characterized in that the interface parameter information comprises a global function and/or a reference to a global parameter, the generating an interface configuration file based on the interface parameter information and the execution order information further comprising:
and if the global function and/or the global parameter do not exist, setting the reference character string of the global function and/or the global parameter as an empty character string.
3. Interface configuration method according to claim 1, characterized in that the execution sequence information comprises a serial execution step and/or a parallel execution step of the plurality of visual interface components.
4. The interface configuration method according to claim 1, wherein generating an interface configuration file based on the interface parameter information and the execution order information comprises:
executing the interface configuration file;
and determining an output result based on the parameters acquired by executing the interface configuration file.
5. The interface configuration method according to claim 4, wherein said executing the interface configuration file includes:
Judging whether response data of the current interface is abnormal or not;
if so, calling the current interface to acquire response data again;
if so, executing the step of the next interface.
6. The interface configuration method according to claim 4, wherein the interface parameter information includes a pre-interface parameter, and the executing the interface configuration file further includes:
detecting whether a valid period exists in a preposed interface parameter of a current interface;
and if the validity period exists and the pre-interface parameter is expired, re-acquiring the pre-interface parameter based on the validity period.
7. The interface configuration method according to claim 4, wherein the interface parameter information further includes page turning configuration information, the current interface includes a plurality of pages, and executing the interface configuration file further includes:
sending a page turning request based on the page turning configuration information to obtain response data of the multiple pages;
and assembling the response data of the multiple pages to obtain the response data of the current interface.
8. An interface configuration apparatus, the apparatus comprising:
the component generating module is used for generating a plurality of visual interface components on the canvas based on the component generating request sent by the user; the visual interface component comprises interface parameter information;
The order determining module is used for determining execution order information of the plurality of visual interface components based on the position information of the visual interface components on the canvas and the connection relation among the plurality of visual interface components;
and the configuration generation module is used for generating an interface configuration file based on the interface parameter information and the execution sequence information.
9. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor implements the steps of the method of any one of claims 1 to 7 when the computer program is executed.
10. A computer readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, implements the steps of the method of any one of claims 1 to 7.
CN202310401648.9A 2023-04-07 2023-04-07 Interface configuration method, device, computer equipment and storage medium Pending CN116339862A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310401648.9A CN116339862A (en) 2023-04-07 2023-04-07 Interface configuration method, device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310401648.9A CN116339862A (en) 2023-04-07 2023-04-07 Interface configuration method, device, computer equipment and storage medium

Publications (1)

Publication Number Publication Date
CN116339862A true CN116339862A (en) 2023-06-27

Family

ID=86882360

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310401648.9A Pending CN116339862A (en) 2023-04-07 2023-04-07 Interface configuration method, device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN116339862A (en)

Similar Documents

Publication Publication Date Title
US10705942B1 (en) Simulated testing of API
EP2732388B1 (en) Method for associating third party content with online document signing
US11797273B2 (en) System and method for enhancing component based development models with auto-wiring
US10417317B2 (en) Web page profiler
CN112800371A (en) Method and device for processing spreadsheet data in web page
CN112613275A (en) Receipt generation method and device, computer equipment and storage medium
US10884765B1 (en) Object configuration dynamic graphical user interface
CN116339862A (en) Interface configuration method, device, computer equipment and storage medium
US9384284B2 (en) Value-added usage of process-oriented extension fields in business mashups
US20230419220A1 (en) Change log processing for chained workflows
CN117130606A (en) Front-end page configuration method, front-end page configuration device, computer equipment and storage medium
CN116701178A (en) Interface test method, device, computer equipment and storage medium
CN117522296A (en) Auditing flow generation method, auditing flow generation device, computer equipment and storage medium
CN117271449A (en) Batch file generation method, apparatus, device, storage medium and program product
CN116893811A (en) Processing method and device of man-machine interaction event, computer equipment and storage medium
CN116737140A (en) Business component construction method, device, computer equipment and storage medium
CN117389605A (en) Service interface configuration method, device, equipment, storage medium and program product
CN113885853A (en) Operation method, device and equipment of business analysis model
CN106687999B (en) Generating a set of instructions implementing rules designed to update objects specified according to an application data model
CN116860576A (en) Method, device, computer equipment and storage medium for recording operation log
CN117311686A (en) Application generation method, device, apparatus, medium and program product
CN118052218A (en) Electronic certificate data processing method, electronic certificate data processing device, computer equipment and storage medium
CN117312159A (en) Test data construction method and device and storage medium
CN116304407A (en) Page rendering method, device, computer equipment and storage medium
WO2024010662A1 (en) Tenant configuration state extraction and variance detection

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination