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

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

Info

Publication number
CN113900725A
CN113900725A CN202010640800.5A CN202010640800A CN113900725A CN 113900725 A CN113900725 A CN 113900725A CN 202010640800 A CN202010640800 A CN 202010640800A CN 113900725 A CN113900725 A CN 113900725A
Authority
CN
China
Prior art keywords
interface
interface configuration
interface unit
configuration
metadata
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
CN202010640800.5A
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.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen 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 Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN202010640800.5A priority Critical patent/CN113900725A/en
Publication of CN113900725A publication Critical patent/CN113900725A/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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/34Graphical or visual programming
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/38Creation or generation of source code for implementing user interfaces

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (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: displaying an interface configuration page; responding to the trigger operation of adding a control to the data structure in the interface configuration page, and adding the data structure in the data structure enumeration set displayed by the interface configuration page; responding to the trigger operation of adding a control to the interface unit in the interface configuration page, and adding the interface unit in the interface unit set displayed by the interface configuration page; acquiring interface configuration parameters input by the added interface unit in a parameter input area of the interface configuration page; and mapping the interface configuration parameters into metadata according to the data structure enumeration set, and generating interface codes according to the metadata and a pre-configured interface code template. By adopting the method, the development period can be shortened, and the development efficiency of the interface code is effectively improved.

Description

Interface configuration method and device, computer equipment and storage medium
Technical Field
The present application relates to the field of computer technologies, and in particular, to an interface configuration method and apparatus, a computer device, and a storage medium.
Background
An API (Application Programming Interface) refers to a contract for linking different components of a software system to provide a set of routines that an Application and a developer can access based on certain software or hardware. With the wide popularization of internet-based applications, more and more sites open their own resources to developers for invocation, and the content relevance and interactivity between sites can be improved.
In a traditional mode, a developer is generally required to compile corresponding calling interface codes for corresponding interfaces, and the developer is required to compile corresponding calling interfaces respectively for different service requirements, so that the compiling complexity of the mode is high, the process is complex, and the development efficiency of the interface codes is low.
Disclosure of Invention
Therefore, in order to solve the above technical problems, it is necessary to provide a visual interface configuration method, device, computer device, and storage medium, which can effectively improve the development efficiency of interface codes.
A method of interface configuration, the method comprising:
displaying an interface configuration page;
responding to the trigger operation of adding a control to the data structure in the interface configuration page, and adding the data structure in the data structure enumeration set displayed by the interface configuration page;
responding to the trigger operation of adding a control to the interface unit in the interface configuration page, and adding the interface unit in the interface unit set displayed by the interface configuration page;
acquiring interface configuration parameters input by the added interface unit in a parameter input area of the interface configuration page;
and mapping the interface configuration parameters into metadata according to the data structure enumeration set, and generating interface codes according to the metadata and a pre-configured interface code template.
An interface configuration apparatus, the apparatus comprising:
the page display module is used for displaying an interface configuration page;
the data adding module is used for responding to the triggering operation of adding the control to the data structure in the interface configuration page and adding the data structure in the data structure enumeration set displayed by the interface configuration page; responding to the trigger operation of adding a control to the interface unit in the interface configuration page, and adding the interface unit in the interface unit set displayed by the interface configuration page;
the parameter input module is used for acquiring interface configuration parameters input by the added interface unit in a parameter input area of the interface configuration page;
and the interface code generation module is used for mapping the interface configuration parameters into metadata according to the data structure enumeration set and generating interface codes according to the metadata and a pre-configured interface code template.
In one embodiment, the parameter entry module is further configured to display a server configuration option in a parameter entry area of the interface configuration page in response to a trigger operation on the server option in the interface configuration page; acquiring a server access parameter input by editing the server configuration option; the interface code generation module is further configured to map the server access parameter and the interface configuration parameter into metadata according to the data structure enumeration set.
In one embodiment, the parameter entry module is further configured to, in response to a selection operation on an interface unit in the interface unit set, present an interface configuration item corresponding to the selected interface unit in a parameter entry area in the interface configuration page; and acquiring the interface configuration parameters which are input by editing the interface configuration items and correspond to the selected interface units.
In one embodiment, the interface unit comprises at least one main interface unit and at least one sub-interface unit belonging to the main interface unit; the data adding module is further used for responding to the triggering operation of adding the control to the interface unit in the interface configuration page when the root index of the interface unit set in the interface configuration page is in a selected state, and adding the main interface unit under the root index of the interface unit set; and when the main interface unit under the root index of the interface unit set is in a selected state, responding to the triggering operation of adding the control to the interface unit in the interface configuration page, and adding the sub-interface unit under the main interface unit in the selected state.
In one embodiment, the parameter entry module is further configured to obtain, in a parameter entry area of the interface configuration page, entered field configuration information corresponding to the added interface unit; responding to attribute configuration operation of the selected field configuration information, and displaying an attribute interface corresponding to the selected field configuration information; acquiring the input field attribute information corresponding to the configuration field information on an attribute interface of the configuration field information; obtaining interface configuration parameters corresponding to the added interface unit based on the field configuration information and the field attribute information.
In one embodiment, the interface configuration apparatus further includes a document generation module, configured to obtain template information of the interface code template; acquiring document attribute information of an interface document where the interface code is located; and adding the template information and the document attribute information into annotation information of the interface document.
In one embodiment, the page display module is further configured to display the interface code in an interface code display area in the interface configuration page in response to a document display operation triggered in the interface configuration page; the document generation module is further used for responding to the editing operation of the interface code and updating the interface code; and when the editing operation is finished, generating an updated interface document based on the updated interface code.
In one embodiment, the interface configuration apparatus further includes a tool pack generation module, configured to obtain a service function code corresponding to each interface unit in the interface unit set; and generating a service development toolkit based on the interface code and the service function code.
In one embodiment, the interface code generation module is further configured to map and encode the interface configuration parameter based on the enumeration set of data structures, and generate metadata corresponding to the interface configuration parameter; and filling the metadata into a pre-configured interface code template in a data rendering mode to generate the interface code.
In one embodiment, the interface code generation module is further configured to convert the interface configuration parameters into parameter data in a preset format based on a predefined mapping rule in the data structure enumeration set; encoding the parameter data into corresponding metadata based on predefined data structures in the enumeration set of data structures.
In one embodiment, the interface code generation module is further configured to obtain a service type corresponding to an interface unit in the interface unit set; calling a pre-configured interface code template matched with the service type; and filling the metadata corresponding to the interface unit into the called interface code template in a data rendering mode to generate the interface code.
In one embodiment, the interface code generation module is further configured to match the keyword identifier in the interface code template based on the keyword identifier of the metadata, and determine a mapping position of the metadata in the interface code template; and filling the key values in the metadata into the interface code template according to the mapping positions to generate interface codes.
A computer device comprising a memory and a processor, the memory storing a computer program, the processor implementing the following steps when executing the computer program:
displaying an interface configuration page;
responding to the trigger operation of adding a control to the data structure in the interface configuration page, and adding the data structure in the data structure enumeration set displayed by the interface configuration page;
responding to the trigger operation of adding a control to the interface unit in the interface configuration page, and adding the interface unit in the interface unit set displayed by the interface configuration page;
acquiring interface configuration parameters input by the added interface unit in a parameter input area of the interface configuration page;
and mapping the interface configuration parameters into metadata according to the data structure enumeration set, and generating interface codes according to the metadata and a pre-configured interface code template.
A computer-readable storage medium, on which a computer program is stored which, when executed by a processor, carries out the steps of:
displaying an interface configuration page;
responding to the trigger operation of adding a control to the data structure in the interface configuration page, and adding the data structure in the data structure enumeration set displayed by the interface configuration page;
responding to the trigger operation of adding a control to the interface unit in the interface configuration page, and adding the interface unit in the interface unit set displayed by the interface configuration page;
acquiring interface configuration parameters input by the added interface unit in a parameter input area of the interface configuration page;
and mapping the interface configuration parameters into metadata according to the data structure enumeration set, and generating interface codes according to the metadata and a pre-configured interface code template.
According to the interface configuration method, the interface configuration device, the computer equipment and the storage medium, through displaying the interface configuration page, a user can directly add the data structure to the data structure enumeration set through the data structure addition control in the interface configuration page, and add the interface unit to the interface unit set through the interface unit addition control. And displaying a parameter entry area of the interface configuration page to enable a user to directly enter interface configuration parameters corresponding to the added interface units. The terminal further maps the interface configuration parameters into metadata according to the data structure enumeration set, and generates interface codes according to the metadata and the pre-configured interface code template, so that interface configuration is realized, a user can automatically generate custom interface codes without compiling the codes, code compiling errors can be avoided, the development period is shortened, and the development efficiency of the interface codes is effectively improved.
Drawings
FIG. 1 is a diagram of an application environment of a method for interface configuration in one embodiment;
FIG. 2 is a flow diagram illustrating a method for interface configuration according to one embodiment;
FIG. 3 is a flow chart illustrating a method for configuring an interface according to another embodiment;
FIG. 4 is a schematic diagram of an interface for server configuration options in an interface configuration page in one embodiment;
FIG. 5 is a schematic diagram of an interface element configuration item in the interface configuration page in one embodiment;
FIG. 6 is a diagram illustrating an interface of a set of interface elements in an interface configuration page in one embodiment;
FIG. 7 is a diagram illustrating an interface for configuring properties of fields in an interface configuration page in one embodiment;
FIG. 8 is an interface diagram that illustrates an interface document in one embodiment;
FIG. 9 is a flowchart illustrating a method for configuring an interface according to another embodiment;
FIG. 10 is a flowchart illustrating a specific interface configuration method according to an embodiment;
FIG. 11 is a block diagram showing the structure of an interface configuration apparatus according to an embodiment;
FIG. 12 is a diagram illustrating an internal structure of a computer device according to an embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
The interface configuration method provided by the application can be applied to the application environment shown in fig. 1. Wherein the terminal 102 communicates with the server 104 via a network. The terminal 102 displays an interface configuration page, and the terminal 102 responds to a trigger operation of adding a control to a data structure in the interface configuration page and adds the data structure in a data structure enumeration set displayed by the interface configuration page; responding to the trigger operation of adding a control to the interface unit in the interface configuration page, and adding the interface unit in the interface unit set displayed by the interface configuration page; the terminal 102 acquires interface configuration parameters recorded corresponding to the added interface unit in a parameter recording area of the interface configuration page; then, the terminal 102 sends the interface configuration parameters to the server 104, and the server 104 maps the interface configuration parameters into metadata according to the data structure enumeration set, and generates interface codes according to the metadata and the preconfigured interface code template. The terminal 102 may be, but not limited to, various personal computers, notebook computers, smart phones, tablet computers, and portable wearable devices, and the server 104 may be implemented by an independent server or a server cluster formed by a plurality of servers.
In an embodiment, as shown in fig. 2, an interface configuration method is provided, which is described by taking the method as an example applied to the terminal in fig. 1, and includes the following steps:
s202, displaying an interface configuration page.
The interface refers to an Application Programming Interface (API), which is a predefined function or a convention for linking different components of a software system, and is used to provide a set of routines that an application program and a developer can access based on certain software or hardware without accessing the original code or understanding the details of the internal working mechanism. For example, the services of the website can be packaged into a series of computer-recognizable data interfaces to be opened for the third-party developers, and this behavior is called as an API of an open website, and in correspondence with this, the opened API is called as an OpenAPI (open interface).
The interface configuration page refers to a visual configuration interface for configuring an interface, and a user can implement configuration of an application interface on the interface configuration page, for example, the interface configuration page may be a configurable front-end page. The interface configuration page comprises preset interface elements, such as various function controls, parameter entry areas, configuration items and other interface elements.
Specifically, the user may perform interface configuration through an interface configuration tool deployed in the terminal. When the user triggers the interface configuration operation, the terminal displays an interface configuration page, and the user can directly configure a corresponding application interface in the interface configuration page.
In one embodiment, the user may configure the application through an interface installed in the terminal, or the user may configure the application through a web page version of the interface to perform an interface configuration operation. The interface configuration application comprises an interface configuration page and an interface configuration function, and a user can realize interface configuration through the interface configuration application.
In this embodiment, interface elements such as various predefined function controls, parameter entry areas, configuration items, and the like are deployed in the interface configuration page. When configuring the application interface, the user only needs to enter the required interface configuration parameters in the interface configuration page.
S204, responding to the trigger operation of adding the control to the data structure in the interface configuration page, and adding the data structure in the data structure enumeration set displayed by the interface configuration page.
Wherein a control refers to the packaging of data and methods, a control is an object with which a user can interact to input or manipulate data. Controls typically appear in a dialog box or on a toolbar, and may be particularly in the toolbar region of the interface configuration page. The control can be a complete functional module, or an extension or combination of basic elements, and can be used for adding a preset functional object.
A data structure is a way in which a computer stores, organizes data by, and refers to a collection of data elements with structural properties that have one or more specific relationships with each other. The data structure adding control is a control used for adding a data structure in the interface configuration page, and the data structure adding control can be used for adding a data structure required by the configuration interface so as to configure a predefined data structure required by the interface.
Specifically, the terminal displays an interface configuration page, a user can trigger a data structure adding control in the interface configuration page of the terminal, a required data structure is added through the data structure adding control, a predefined data structure list can be obtained through the data structure adding control, and the user can select the required data structure in the data structure list. And the terminal responds to the selection operation of the data structure in the data structure list, and then adds the selected data structure to the data structure enumeration set displayed by the interface configuration page. The added at least one predefined data structure is included in the data structure enumeration set.
In this embodiment, the triggering operation and the selecting operation include, but are not limited to, long press, click, slide, move, and multi-touch operation.
S206, responding to the trigger operation of adding the control to the interface unit in the interface configuration page, and adding the interface unit in the interface unit set displayed by the interface configuration page.
The interface unit refers to a unit body corresponding to the application interface, and may be used to represent an interface unit of the interface, that is, one application interface corresponds to one interface unit. Unlike the hardware interface unit, the interface unit in this embodiment is an interface unit corresponding to a software application interface.
The interface unit adding control is used for adding the interface unit in the interface configuration page, and the interface unit adding control can add the application interface required by the configuration interface.
Specifically, a user may trigger the interface unit addition control in an interface configuration page of the terminal, add a required interface unit through the interface unit addition control, specifically obtain a predefined interface creation interface through the interface unit addition control, and enter basic information of the interface unit to be created in the interface creation interface, for example, parameter information such as an interface name, an interface type, and the like. And the terminal responds to the creation operation of the interface unit in the interface creation interface, and further adds the created interface unit to the interface unit set displayed on the interface configuration page. The interface unit set comprises at least one added interface unit.
S208, acquiring the interface configuration parameters recorded corresponding to the added interface units in the parameter recording area of the interface configuration page.
The interface configuration page comprises a parameter entry area, and the parameter entry area is used for a user to directly input required parameter information in the interface configuration page displayed by the terminal.
Specifically, the user can input corresponding interface configuration parameters for the added interface unit in a parameter entry area in an interface configuration page displayed by the terminal. And the terminal responds to the input operation of the interface configuration parameters corresponding to the interface units and acquires the interface configuration parameters input corresponding to the added interface units.
In one embodiment, the parameter entry area may also include a set of fields required to configure the interface. Where fields are variables associated with an object or class, the collection of fields constitutes records, each field describes a characteristic, i.e., a data item, and has a unique field identifier for computer identification. The user can enter corresponding field information through the field set in the parameter entry area, so that the required interface configuration parameters are entered.
S210, mapping the interface configuration parameters into metadata according to the data structure enumeration set, and generating interface codes according to the metadata and a pre-configured interface code template.
Metadata (Metadata), also called intermediary data and relay data, is data describing data, mainly information describing data attributes, and structural data for providing information about a certain resource, and can effectively establish a machine understandable framework for digital information resources.
Specifically, after the terminal obtains the interface configuration parameters entered through the interface configuration page, the interface configuration parameters are mapped into metadata according to the data structure enumeration set. Wherein the enumeration set of data structures includes the added predefined data structures. And when the terminal maps the interface configuration parameters into metadata, converting the interface configuration parameters into the metadata of a corresponding data structure according to the data structure in the data structure enumeration set. Thereby, the interface configuration parameters can be efficiently mapped to the metadata of the preset data structure.
The terminal further generates an interface code according to the metadata and the pre-configured interface code template. Specifically, after mapping the interface configuration parameters to metadata, the terminal obtains a pre-configured interface code template, and fills the metadata corresponding to the interface configuration parameters into the interface code template, thereby generating the interface code.
In this embodiment, the interface code template is pre-configured, and the interface code can be directly generated according to the metadata and the pre-configured interface code template, so that a developer does not need to write a code, the interface configuration can be quickly and effectively realized by directly performing parameter configuration on an interface configuration page, and the required interface code is automatically generated.
In the interface configuration method, by displaying the interface configuration page, a user can directly add the data structure to the data structure enumeration set through the data structure addition control in the interface configuration page, and add the interface unit to the interface unit set through the interface unit addition control. And displaying a parameter entry area of the interface configuration page to enable a user to directly enter interface configuration parameters corresponding to the added interface units. The terminal further maps the interface configuration parameters into metadata according to the data structure enumeration set, and generates interface codes according to the metadata and the pre-configured interface code template, so that interface configuration is realized, a user can automatically generate custom interface codes without compiling the codes, code compiling errors can be avoided, the development period is shortened, and the development efficiency of the interface codes is effectively improved.
In one embodiment, as shown in fig. 3, another interface configuration method is provided, including the steps of:
s302, displaying an interface configuration page.
S304, responding to the trigger operation of adding the control to the data structure in the interface configuration page, and adding the data structure in the data structure enumeration set displayed by the interface configuration page.
S306, responding to the triggering operation of the server options in the interface configuration page, and displaying the server configuration options in the parameter entry area of the interface configuration page.
S308, obtaining the server access parameters input by the configuration options of the editing server.
S310, responding to the trigger operation of adding the control to the interface unit in the interface configuration page, and adding the interface unit in the interface unit set displayed by the interface configuration page.
S312, in the parameter input area of the interface configuration page, the interface configuration parameters input corresponding to the added interface units are obtained.
And S314, mapping the server access parameters and the interface configuration parameters into metadata respectively according to the data structure enumeration set, and generating interface codes according to the metadata and a pre-configured interface code template.
Mapping the interface configuration parameters to metadata according to the data structure enumeration set comprises: and mapping the server access parameters and the interface configuration parameters into metadata respectively according to the data structure enumeration set.
The server access parameter refers to a server parameter of a target server to which the application interface needs to access. For example, the server access parameter may include parameter information such as a binding domain name, a URL prefix, a server program hump name, a default interface parameter type, a default interface return type, a login status message, and a port number.
When the user configures the application interface through the interface configuration page, corresponding server access parameters can be input in the interface configuration page so as to configure the server access parameters of the interface.
In particular, a parameter entry area in the interface configuration page may present server options. And the terminal responds to the triggering operation of the server options in the interface configuration page and displays the server configuration options in a parameter entry area of the interface configuration page. The server configuration options are configuration items for configuring server access parameters. The user can enter the required server access parameters by carrying out selection operation or data input operation on the server configuration options.
Further, a user adds a data structure in the data structure enumeration set through the interface configuration page, acquires interface configuration parameters which are input by the corresponding added interface unit in a parameter input area of the interface configuration page, then maps the server access parameters and the interface configuration parameters into metadata according to the data structure enumeration set, and generates interface codes according to the metadata and a preconfigured interface code template.
In the embodiment, through the interface configuration page, the user can directly configure the server access parameters and the interface configuration parameters in the interface configuration page in an input mode, so that the terminal can directly generate the interface codes according to the parameter information input by the user, and the efficiency of interface development is effectively improved.
FIG. 4 is a schematic interface diagram illustrating server configuration options in an interface configuration page in one embodiment. Referring to FIG. 4, the top of the interface configuration page is a toolbar that includes various functionality controls. For example, may include multiple categories of functionality controls. For example, the engineering class includes controls such as "new", "open history", "save", "close", "generate", "offline document", etc.; the view class may include controls such as "editor," "source code," "document," "OpenAPI," etc.; controls such as a resource manager, a field attribute and the like can be included in the editing pane class; the add class may include controls for "message/enumeration", "sub-module", etc.
After a user creates an interface configuration task on an interface configuration page, the terminal can display a resource management area in the interface configuration page by triggering a resource manager control in a toolbar, referring to the left area of the interface configuration page in fig. 4. The resource management area may include a server option and an external reference type option, and the server option further includes a message/enumeration and sub-module. The user can add the data structure in the data structure enumeration set displayed on the interface configuration page by triggering a 'message/enumeration' addition control. The sub-module is an interface unit set, and a user can add an interface unit in the interface unit set displayed on the interface configuration page by triggering the sub-module addition control. After the data structure and the interface unit are added, the added data structure enumeration set and the added interface unit set can be displayed in the resource management area. And the interface unit set comprises indexes corresponding to the added interface units.
After a user triggers the server option in the resource management area, the terminal responds to the triggering operation of the server option in the interface configuration page, referring to the right area of the interface configuration page in fig. 4, and the terminal displays the server configuration option in the parameter entry area of the interface configuration page. The server configuration options may include, but are not limited to, various text entry boxes, selection boxes, and the like, for entering server access parameters.
In the embodiment, the server options and the corresponding server options are displayed in the interface configuration page, so that a user can directly enter the parameters in the parameter entry area and access the parameters of the server entered by editing the server configuration options, the operation mode is simple and convenient, and the user does not need to write codes.
In one embodiment, the interface configuration method further includes: responding to the selection operation of the interface units in the interface unit set, and displaying interface configuration items corresponding to the selected interface units in a parameter entry area in an interface configuration page; and acquiring interface configuration parameters which are input through the editing interface configuration items and correspond to the selected interface units.
The configuration item is an item for configuring the displayed information in the configuration management process. The parameter entry area in the interface configuration page can also display interface configuration items.
Specifically, the user may trigger an interface unit option on the interface configuration page, and after the terminal responds to the operation of selecting an interface unit in the interface unit set, the terminal displays an interface configuration item corresponding to the selected interface unit in the parameter entry area in the interface configuration page. The user may then enter the desired interface configuration parameters in a parameter entry area in the interface configuration page.
The interface configuration items in the parameter entry area can also comprise various types of interface configuration items. The user can trigger the selected interface unit, the terminal displays the corresponding interface configuration item in the parameter entry area, and the corresponding interface configuration item is edited and input, so that the interface configuration parameters corresponding to the corresponding interface unit are respectively entered.
Fig. 5 is an interface diagram of interface unit configuration items in an interface configuration page in an embodiment. The interface configuration parameters may also include various types of interface configuration items, for example, interface configuration items of "interface option", "document", "frequency limit", "request message", "return message", "login state plug-in", "error code report", "interceptor", "process arrangement", "interface debugging", and the like. Each interface configuration item includes a corresponding specific configuration parameter item below.
Referring to FIG. 5, when the user selects the "document" type in the interface configuration item, the parameter entry area of the document interface configuration item is presented. The user may then enter interface specification parameters, such as document title parameters and document description parameters, in the field to enter the desired interface configuration parameters.
In the embodiment, the interface configuration items corresponding to the interface units are displayed in the parameter entry area, so that a user can directly enter corresponding interface configuration parameters in the parameter entry area, the configuration processing of the interface can be quickly realized without compiling corresponding codes by the user, and the development efficiency is effectively improved.
In one embodiment, the interface unit comprises at least one main interface unit and at least one sub-interface unit belonging to the main interface unit;
responding to the triggering operation of adding a control to the interface unit in the interface configuration page, adding the interface unit in the interface unit set displayed by the interface configuration page, and the method comprises the following steps: when the root index of the interface unit set in the interface configuration page is in a selected state, responding to the triggering operation of adding a control to the interface unit in the interface configuration page, and adding a main interface unit under the root index of the interface unit set; and when the main interface unit under the root index of the interface unit set is in a selected state, responding to the triggering operation of adding the control to the interface unit in the interface configuration page, and adding the sub-interface unit under the main interface unit in the selected state.
The interface unit comprises at least one main interface unit and at least one sub-interface unit belonging to the main interface unit. An interface unit may be a main interface unit, and the sub-interface units are a plurality of logical interfaces that virtualize a main interface unit. For example, if a service item needs to implement a function, a corresponding interface may be configured. When the function also comprises a plurality of sub-function modules, corresponding sub-interfaces can be established, and each sub-interface can inherit the function of the main interface.
Specifically, in the process of creating the interface unit through the interface configuration page, a user can add a control by triggering the interface unit shown in the toolbar, so that the terminal adds the interface unit in the interface unit set shown in the interface configuration page. Specifically, the user may continue to add a plurality of interface units in the interface unit set in this manner, where the added interface unit is the main interface unit.
Then, the user can select the corresponding main interface unit in the interface unit set, and further can create a corresponding sub-interface unit under the corresponding main interface unit. Specifically, the interface unit set includes an interface index. When a user selects the root index of the interface unit set in the interface configuration page, the control is added by triggering the interface unit in the interface configuration page, and then the main interface unit is added under the root index of the interface unit set.
Further, the user can also select the main interface unit under the root index in the interface unit set, add the control by triggering the interface unit in the interface configuration page, and further add the sub-interface unit under the main interface unit under the selected root index, thereby creating the required interface unit.
FIG. 6 is a diagram illustrating an interface of a set of interface elements in an interface configuration page in one embodiment. Referring to fig. 6, the left area in the interface configuration page is a resource manager area, which includes a set of interface units. For example, the interface unit set includes a main interface unit of "order", the main interface unit also includes a plurality of sub-interface units of "create order", "query order", "cancel order", and "modify order", and an index of each interface unit is shown in the interface unit set.
In the embodiment, the main interface unit and the corresponding sub-interface unit required by the service are directly created in the interface configuration page, so that the coupling is reduced, the corresponding interface configuration parameters can be directly input, the corresponding interface is configured, and the development efficiency of the interface code is improved.
In one embodiment, acquiring, in a parameter entry area of an interface configuration page, an interface configuration parameter entered corresponding to the added interface unit includes: acquiring field configuration information which is input and corresponds to the added interface unit in a parameter input area of the interface configuration page; responding to attribute configuration operation of the selected field configuration information, and displaying an attribute interface corresponding to the selected field configuration information; acquiring the input field attribute information corresponding to the configuration field information on an attribute interface of the configuration field information; based on the field configuration information and the field attribute information, interface configuration parameters corresponding to the added interface unit are obtained.
The parameter entry area may further include a field set required for configuring the interface, and the interface configuration parameters may further include a plurality of field configuration information. Where a field is a variable associated with an object or class, and the set of fields constitutes a field information record. When the user inputs the interface configuration parameters, the corresponding field configuration information can be input through the field set in the parameter input area, so that the required interface configuration parameters can be input.
Specifically, a user can select an interface unit to be configured in an interface unit set of the interface configuration page, and the terminal displays field configuration information corresponding to the interface unit in the parameter entry area. The user can further directly select corresponding field configuration information in the parameter entry area for entry configuration.
Further, the user can also select the field configuration information, and further perform attribute configuration on the selected field configuration information. The terminal displays the attribute interface corresponding to the selected field configuration information, and the user can further enter the field attribute information of the field configuration information in the attribute interface. And the terminal further obtains the interface configuration parameters of the interface unit according to the field configuration information and the corresponding field attribute information which are input by the user in the parameter input area.
FIG. 7 is a diagram illustrating an interface for configuring properties of fields in an interface configuration page according to an embodiment. Referring to fig. 7, a property interface of field configuration information may also be shown in the parameter entry area in the interface configuration page. For example, when the user selects an interface configuration item of the "return message" class, a plurality of interface configuration items may also be displayed under the interface configuration item. Wherein, the interface configuration item includes field configuration information. Such as various items of field configuration information may be presented below the "field list". The field list also comprises an operation control, and a user can add or delete field items through the operation control. Each item of field information may also exhibit corresponding field attribute information.
When a user selects one of the field items, the terminal displays the attribute interface corresponding to the selected field item in the parameter entry area. For example, the attribute interface includes field attribute parameters such as "multiplicity", "type", "default value", "format", "name", "number", "alias", "encryption/decryption", "field name", "field description", "example value", "user identification", "dye identification", "as a request packet", and the like.
In one embodiment, after the field list option is selected by the user, the user can perform corresponding operations by triggering the function control of the interface configuration page, and further, the corresponding operations can be realized by operating the shortcut key. Taking the terminal including a keyboard as an example, the "Ctrl + 1" may implement "add unit64 field"; "Ctrl + 2" may implement the "add unit32 field"; "Ctrl + 3" may implement "add int64 field"; "Ctrl + 4" may implement "add int32 field"; "Ctrl + Insert" may effect "clone the current line"; "Ctrl + Delete" may effect "Delete current row"; "Tab/Shift + Tab" can realize "move edit point left and right", and so on. The operation indication columns capable of displaying the shortcut keys in the interface configuration page are numerous, so that shortcut operation indication information can be displayed for a user, the user can quickly and conveniently perform corresponding operation processing, and the input efficiency of interface configuration parameters can be effectively improved.
In the embodiment, the field configuration information and the corresponding field attribute information corresponding to the interface unit are directly configured in the interface configuration page, so that the interface configuration parameters corresponding to the interface unit can be conveniently and effectively input, and the development time of the interface code can be effectively shortened.
In one embodiment, the interface configuration method further includes: acquiring template information of an interface code template; acquiring document attribute information of an interface document where an interface code is located; the template information and the document attribute information are added to annotation information of the interface document.
The interface document is a file for converting the generated interface code into a document form. The interface document includes content corresponding to the interface code, and further, the interface document may further include annotation information. The comment information refers to interpretation information, description information, and the like of the generated interface code.
Specifically, the terminal inputs a data structure enumeration set and interface configuration parameters through an interface configuration page, maps the interface configuration parameters into metadata according to the data structure enumeration set, and can further convert the interface codes into corresponding interface documents after generating the interface codes according to the metadata and a preconfigured interface code template.
Further, the terminal can also obtain the document attribute information of the interface document where the interface code is located, and add the template information and the document attribute information to the annotation information of the interface document, so as to generate the corresponding interface document.
In one embodiment, the terminal may further present the interface document page in response to a document presentation operation on the configuration page; and displaying the interface document in a document display area of the interface document page.
FIG. 8 is a diagram illustrating an interface of an interface document in one embodiment. Referring to FIG. 8, the document presentation area may also present a detail page and a global thumbnail page of the interface document, as shown in the right portion of the global thumbnail page document presentation area. In the first part of the detail page of the interface document, the annotation information of the interface document is shown and marked in the form of annotations.
In the embodiment, the corresponding interface document is generated according to the interface code obtained by configuration, the interface document can be automatically and intelligently configured, and corresponding annotation information is automatically generated in the interface document, so that the complete interface document with high usability can be automatically generated, and the development efficiency can be efficiently improved.
In one embodiment, the interface configuration method further includes: responding to a document display operation triggered by an interface configuration page, and displaying an interface code in an interface code display area in the interface configuration page; updating the interface code in response to an editing operation on the interface code; when the editing operation is finished, an updated interface document is generated based on the updated interface code.
The toolbar of the interface configuration page further comprises a document display control used for triggering display of the generated interface document.
Specifically, a user can perform a document display operation by triggering a document display control in the interface configuration page, and the terminal displays the content of the generated interface code in an interface code display area in the interface configuration page.
Furthermore, the user can directly edit the content of the interface code in the interface code display area so as to edit and modify the content of the interface code. And after the terminal responds to the editing operation of the user on the interface code, updating the interface code. The user can save the editing operation through a holding control in a toolbar of the interface configuration page. And after the editing operation of the user is finished, the terminal further generates an updated interface document according to the updated interface code.
In this embodiment, the user can edit the interface code in the interface code display area and manually update the interface code, so that the user can specifically edit and update the interface code according to the specific requirement, and thus, the mode of automatically generating the interface code and the mode of manually updating the interface code can be effectively combined, and the flexibility of interface configuration is higher.
In one embodiment, as shown in fig. 9, another interface configuration method is provided, including the steps of:
and S902, displaying an interface configuration page.
And S904, responding to the trigger operation of adding the control to the data structure in the interface configuration page, and adding the data structure in the data structure enumeration set displayed by the interface configuration page.
S906, responding to the trigger operation of adding the control to the interface unit in the interface configuration page, and adding the interface unit in the interface unit set displayed by the interface configuration page.
S908, in the parameter entry area of the interface configuration page, the interface configuration parameters entered corresponding to the added interface unit are obtained.
S910, mapping the interface configuration parameters into metadata according to the data structure enumeration set, and generating interface codes according to the metadata and a pre-configured interface code template.
S912, acquiring the service function code corresponding to each interface unit in the interface unit set.
And S914, generating a service development toolkit based on the interface code and the service function code.
Among them, the service Development kit, sdk (software Development kit), refers to a collection of related documents, paradigms and tools that assist in developing a certain type of software. A software development kit is generally a collection of development tools used by developers to build application software for a particular software package, software framework, hardware platform, operating system, etc. Generally, the SDK is an SDK used for developing an application program under the Windows platform, and can simply provide an application program interface for a certain programming language.
Specifically, the terminal enters a data structure enumeration set and interface configuration parameters through an interface configuration page, maps the interface configuration parameters into metadata according to the data structure enumeration set, and generates interface codes according to the metadata and a preconfigured interface code template, and then can further acquire service function codes corresponding to each interface unit in the interface unit set. And the terminal further generates a corresponding service development kit according to the interface code and the acquired service function code. Thus, the application interface file of the interface corresponding to each service required by the service function can be generated efficiently.
In the embodiment, after the interface code is automatically generated according to the interface configuration parameter entered in the interface configuration page, the corresponding service function code is further acquired according to the interface code, so that the corresponding service development kit is automatically generated, the service development kit can be efficiently generated, and the development efficiency is effectively improved.
In one embodiment, mapping the interface configuration parameters to metadata according to a data structure enumeration set, and generating interface codes according to the metadata and a preconfigured interface code template includes: based on the data structure enumeration set, mapping and coding the interface configuration parameters to generate metadata corresponding to the interface configuration parameters; and filling the metadata into a pre-configured interface code template in a data rendering mode to generate the interface code.
The mapping coding is to code the data into another corresponding form according to a preset rule. Data rendering refers to rendering background data into a page or corresponding content, for example, the data rendering mode includes string concatenation, Dom loop element filling, string template filling, document fragmentation (data rearrangement), and the like.
The method comprises the steps that a user adds a data structure enumeration and interface unit in an interface configuration page of a terminal, and inputs interface configuration parameters through a parameter input area of the interface configuration page, and then the terminal further automatically generates an interface code based on a pre-configured interface code template according to the input interface configuration parameters and a data structure enumeration set.
Specifically, the terminal maps the interface configuration parameters into metadata according to the data structure enumeration set. Wherein the enumeration set of data structures includes the added predefined data structures. When the terminal maps the interface configuration parameters into metadata, mapping and coding the interface configuration parameters according to the data structure in the data structure enumeration set, thereby converting the interface configuration parameters into the metadata of the corresponding data structure.
The terminal further populates the metadata to the preconfigured interface code template, in particular, the terminal populates the metadata to the preconfigured interface code template by way of data rendering, thereby generating the interface code.
In this embodiment, the interface configuration parameters are mapped and encoded, so that the interface configuration parameters can be effectively mapped to metadata of the preset data structure. Through a data rendering mode, metadata can be accurately filled in a pre-configured interface code template, so that interface codes can be efficiently and automatically generated, a user does not need to manually write the codes, and the development efficiency of the interface codes is greatly improved.
In one embodiment, mapping and encoding the interface configuration parameters based on the data structure enumeration set to generate metadata corresponding to the interface configuration parameters includes: converting the interface configuration parameters into parameter data in a preset format based on a predefined mapping rule in the data structure enumeration set; the parameter data is encoded into corresponding metadata based on predefined data structures in the data structure enumeration set.
The data structure in the data structure enumeration set defines a corresponding mapping rule in advance, and the mapping rule may be a series of predefined functions defining the corresponding relationship between the interface configuration parameters and the data structure. The data structure can be a data structure template which is predefined by a user, and when the interface is configured, a predefined data structure can be directly added in the interface configuration page.
Specifically, in the process that the terminal maps the interface configuration parameters into the metadata, the data structures in the data structure enumeration set are obtained, the corresponding predefined mapping rules in each data structure are identified, and then the interface configuration parameters are converted into the parameter data in the preset format according to the predefined mapping rules. The predefined data structures in the set are further enumerated according to the data structure, so that the parameter data are automatically encoded into corresponding metadata.
For example, the terminal may convert the interface configuration parameters into json-format metadata, and the specific form of the converted metadata may be as follows:
Figure BDA0002571393390000181
in the embodiment, after the predefined data structure is directly added to the interface configuration page, the interface configuration page can be automatically converted into the corresponding metadata according to the mapping rule and the preset data structure in the data structure set directly, and the user does not need to manually convert the input interface configuration parameters, so that the development time is effectively shortened, and the labor cost is effectively saved.
In one embodiment, the generating of the interface code by populating the metadata into the pre-configured interface code template by way of data rendering comprises: acquiring a service type corresponding to an interface unit in an interface unit set; calling a pre-configured interface code template matched with the service type; and filling the metadata corresponding to the interface unit into the called interface code template in a data rendering mode to generate the interface code.
The interface code template comprises a pre-configured interface code and a character identifier. The character identifications are used to populate the metadata to the corresponding locations in the interface code template.
The user adds a data structure enumeration and interface unit in an interface configuration page of the terminal, and after interface configuration parameters are input in a parameter input area, the terminal further maps the interface configuration parameters into metadata according to the input interface configuration parameters and a data structure enumeration set, and automatically generates interface codes based on a preconfigured interface code template.
Specifically, the interface unit set includes one or more interface units, and the interface units correspond to corresponding service types. When the terminal fills the metadata into the pre-configured interface code template, firstly, the service type corresponding to the interface unit in the interface unit set is obtained, and then the pre-configured interface code template matched with the service type is called.
And the terminal further fills the metadata corresponding to the interface unit into the called interface code template in a data rendering mode according to the character identifier in the metadata, and specifically fills the metadata corresponding to the interface unit into the corresponding position in the interface code template, thereby generating the interface code.
In this embodiment, the metadata is filled into the pre-configured interface code template in a data rendering manner, so that the terminal can automatically generate the required interface code according to the metadata corresponding to the interface configuration parameter, and thus the interface code can be efficiently and accurately generated.
In one embodiment, the generating of the interface code by populating the metadata into the pre-configured interface code template by way of data rendering comprises: matching the keyword identification of the metadata with the keyword identification in the interface code template, and determining the mapping position of the metadata in the interface code template; and filling the key values in the metadata into the interface code template according to the mapping positions to generate the interface code.
The metadata includes a key identifier and a corresponding key value, for example, data in the form of key-value in the metadata.
After the terminal calls a pre-configured interface code template matched with the service type according to the service type corresponding to the interface unit in the interface unit set, the terminal matches with a keyword identifier in the interface code template according to the keyword identifier included in the metadata, and specifically, character string matching can be performed according to the keyword identifier. And after the corresponding key word identification is matched in the interface code template, determining the corresponding mapping position of the key value corresponding to the key word identification in the interface code template according to the matched key word identification, thereby determining the mapping position of the metadata in the interface code template.
And the terminal respectively fills the key values in the metadata into the interface code template according to the determined mapping positions, so that the metadata is filled into the interface code template in a data rendering mode to generate the interface codes.
For example, the metadata includes version number information, such as "{" version ": 1.0.0" } ", indicating that the version number is" 1.0.0 ". The partial code templates in the interface code template may be as follows:
Figure BDA0002571393390000201
the terminal further determines the position of the corresponding field name in the interface code template according to the field identifier, for example, the field identifier can be the field name, and then directly fills the value of 1.0.0 into the field identifier of version in the interface code template, thereby realizing the rendering of the metadata into the interface code template.
In the embodiment, the metadata is filled in the corresponding mapping position in the interface code template through the keyword identifier, so that a user does not need to manually write codes, and only needs to enter the required interface configuration parameters in the interface configuration page, so that the interface codes can be accurately and efficiently generated, and the development efficiency is effectively improved.
In a specific embodiment, as shown in fig. 10, a specific interface configuration method is provided, which includes the following steps:
s1002, displaying an interface configuration page.
S1004, responding to the trigger operation of adding the control to the data structure in the interface configuration page, and adding the data structure in the data structure enumeration set displayed by the interface configuration page.
S1006, in response to the trigger operation of adding the control to the interface unit in the interface configuration page, adding the interface unit in the interface unit set displayed in the interface configuration page.
S1008, acquiring the interface configuration parameters recorded corresponding to the added interface units in the parameter recording area of the interface configuration page.
S1010, converting the interface configuration parameters into parameter data in a preset format based on the predefined mapping rule in the data structure enumeration set.
S1012, encoding the parameter data into corresponding metadata based on the predefined data structure in the data structure enumeration set.
S1014, acquiring the service type corresponding to the interface unit in the interface unit set.
And S1016, calling a pre-configured interface code template matched with the service type.
And S1018, matching the keyword identification of the metadata with the keyword identification in the interface code template, and determining the mapping position of the metadata in the interface code template.
And S1020, filling the key values in the metadata into the interface code template according to the mapping positions to generate the interface codes.
In this embodiment, by displaying the interface configuration page, the user may directly add the data structure to the data structure enumeration set through the data structure addition control in the interface configuration page, and add the interface unit to the interface unit set through the interface unit addition control. And displaying a parameter entry area of the interface configuration page to enable a user to directly enter interface configuration parameters corresponding to the added interface units. The terminal further maps the interface configuration parameters into metadata according to the enumeration set of the data structure, the metadata is filled into corresponding mapping positions in the interface code template through the keyword identifiers, therefore, a user does not need to manually write codes, only required interface configuration parameters are input into an interface configuration page, and the self-defined interface codes can be automatically generated to realize interface configuration, so that the interface codes can be accurately and efficiently generated, code writing errors can be avoided, the development period is shortened, and further the development efficiency is effectively improved.
The application also provides an application scene, and the application scene applies the interface configuration method. Specifically, the application of the interface configuration method in the application scenario is as follows:
the user can log in a webpage version interface configuration application through the terminal to perform interface configuration, for example, the interface configuration application can be a webpage interface tool based on XCGI. The interface configuration application includes an interface configuration page. When a user needs to configure a development interface of the payment service, after the user enters the interface configuration application, the terminal displays an interface configuration page. And the user adds the data structure and the interface unit on the interface configuration page, and displays the data structure set and the interface unit set in a preset area. For example, the payment service includes a main interface unit of "order", the main interface unit also includes a plurality of sub-interface units of "create order", "query order", "cancel order", and "modify order", and an index of each interface unit is shown in the interface unit set.
Furthermore, the user can select each interface unit, and the terminal displays the interface configuration item corresponding to the selected interface unit in the parameter entry area. The user may enter the desired interface configuration parameters by entering the desired parameter information in the parameter entry area. And the terminal maps the interface configuration parameters into metadata according to the data structure enumeration set and generates an interface code of the payment service according to the metadata and a pre-configured interface code template.
The user can directly input the interface configuration parameters corresponding to the added interface unit in the interface configuration page and the corresponding parameter input area of the interface configuration application through the interface configuration application in the terminal. Therefore, the user can automatically generate the self-defined interface code without writing the code, so as to realize interface configuration, shorten the development period and effectively improve the development efficiency of the interface code.
It should be understood that although the steps in the flowcharts of fig. 2, 3, 8, 9, 10 are shown in order as indicated by the arrows, the steps are not necessarily performed in order as indicated by the arrows. The steps are not performed in the exact order shown and described, and may be performed in other orders, unless explicitly stated otherwise. Moreover, at least some of the steps in fig. 2, 3, 8, 9, and 10 may include multiple steps or multiple stages, which are not necessarily performed at the same time, but may be performed at different times, and the order of performing the steps or stages is not necessarily sequential, but may be performed alternately or alternatingly with other steps or at least some of the other steps or stages.
In one embodiment, as shown in fig. 11, there is provided an interface configuration apparatus 1100, which may be a part of a computer device using a software module or a hardware module, or a combination of the two, the apparatus specifically includes: a page presentation module 1102, a data adding module 1104, a parameter entry module 1106 and an interface code generating module 1108, wherein:
a page display module 1102, configured to display an interface configuration page;
the data adding module 1104 is configured to add a data structure in a data structure enumeration set displayed on the interface configuration page in response to a trigger operation for adding a control to the data structure in the interface configuration page; responding to the triggering operation of adding a control to the interface unit in the interface configuration page, and adding the interface unit in the interface unit set displayed by the interface configuration page;
a parameter entry module 1106, configured to obtain, in a parameter entry area of the interface configuration page, an interface configuration parameter entered corresponding to the added interface unit;
an interface code generation module 1108, configured to map the interface configuration parameters into metadata according to the data structure enumeration set, and generate an interface code according to the metadata and a preconfigured interface code template.
In one embodiment, the parameter entry module 1106 is further configured to display the server configuration options in a parameter entry area of the interface configuration page in response to a triggering operation on the server options in the interface configuration page; acquiring a server access parameter input by an editing server configuration option; the interface code generation module 1108 is further configured to map the server access parameters and the interface configuration parameters into metadata according to the data structure enumeration set.
In one embodiment, the parameter entry module 1106 is further configured to present, in response to a selected operation on an interface unit in the set of interface units, an interface configuration item corresponding to the selected interface unit in a parameter entry area in the interface configuration page; and acquiring interface configuration parameters which are input through the editing interface configuration items and correspond to the selected interface units.
In one embodiment, the interface unit comprises at least one main interface unit and at least one sub-interface unit belonging to the main interface unit; the data adding module 1104 is further configured to, when the root index of the interface unit set in the interface configuration page is in a selected state, add a main interface unit under the root index of the interface unit set in response to a trigger operation for adding a control to the interface unit in the interface configuration page; and when the main interface unit under the root index of the interface unit set is in a selected state, responding to the triggering operation of adding the control to the interface unit in the interface configuration page, and adding the sub-interface unit under the main interface unit in the selected state.
In one embodiment, the parameter entry module 1106 is further configured to obtain, in a parameter entry area of the interface configuration page, entered field configuration information corresponding to the added interface unit; responding to attribute configuration operation of the selected field configuration information, and displaying an attribute interface corresponding to the selected field configuration information; acquiring the input field attribute information corresponding to the configuration field information on an attribute interface of the configuration field information; based on the field configuration information and the field attribute information, interface configuration parameters corresponding to the added interface unit are obtained.
In one embodiment, the interface configuration apparatus 1100 further includes a document generating module, configured to obtain template information of the interface code template; acquiring document attribute information of an interface document where an interface code is located; the template information and the document attribute information are added to annotation information of the interface document.
In one embodiment, the page display module 1102 is further configured to display the interface code in an interface code display area in the interface configuration page in response to a document display operation triggered in the interface configuration page; the document generation module 1110 is further configured to update the interface code in response to an editing operation on the interface code; when the editing operation is finished, an updated interface document is generated based on the updated interface code.
In an embodiment, the interface configuration apparatus 1000 further includes a tool package generating module, configured to obtain a service function code corresponding to each interface unit in the interface unit set; and generating a service development toolkit based on the interface codes and the service function codes.
In one embodiment, the interface code generation module 1108 is further configured to perform mapping coding on the interface configuration parameters based on the data structure enumeration set, and generate metadata corresponding to the interface configuration parameters; and filling the metadata into a pre-configured interface code template in a data rendering mode to generate the interface code.
In one embodiment, the interface code generation module 1108 is further configured to convert the interface configuration parameters into parameter data in a preset format based on a predefined mapping rule in the data structure enumeration set; the parameter data is encoded into corresponding metadata based on predefined data structures in the data structure enumeration set.
In one embodiment, the interface code generating module 1108 is further configured to obtain a service type corresponding to an interface unit in the interface unit set; calling a pre-configured interface code template matched with the service type; and filling the metadata corresponding to the interface unit into the called interface code template in a data rendering mode to generate the interface code.
In one embodiment, the interface code generation module 1108 is further configured to match the keyword identifier in the interface code template based on the keyword identifier of the metadata, and determine a mapping position of the metadata in the interface code template; and filling the key values in the metadata into the interface code template according to the mapping positions to generate the interface code.
For specific definition of the interface configuration device, reference may be made to the definition of the interface configuration method in the foregoing, and details are not described here. The modules in the interface configuration device can be wholly or partially implemented by software, hardware and a combination thereof. The modules can be embedded in a hardware form or independent from a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the modules.
In one embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram 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 comprises a nonvolatile 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 an operating system and computer programs in the non-volatile storage medium. The communication interface of the computer device is used for carrying out wired or wireless communication with an external terminal, and the wireless communication can be realized through WIFI, an operator 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, a key, a track ball or a touch pad arranged on the shell of the computer equipment, an external keyboard, a touch pad or a mouse and the like.
Those skilled in the art will appreciate that the architecture shown in fig. 12 is merely a block diagram of some of the structures associated with the disclosed aspects and is not intended to limit the computing devices to which the disclosed aspects apply, as particular computing devices may include more or less components than those shown, or may combine certain components, or have a different arrangement of components.
In one embodiment, a computer device is further provided, which includes a memory and a processor, the memory stores a computer program, and the processor implements the steps of the above method embodiments when executing the computer program.
In an embodiment, a computer-readable storage medium is provided, in which a computer program is stored which, when being executed by a processor, carries out the steps of the above-mentioned method embodiments.
In one embodiment, a computer program product or computer program is provided that includes computer instructions stored in a computer-readable storage medium. The computer instructions are read by a processor of a computer device from a computer-readable storage medium, and the computer instructions are executed by the processor to cause the computer device to perform the steps in the above-mentioned method embodiments.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, storage, database or other medium used in the embodiments provided herein can include at least one of non-volatile and volatile memory. Non-volatile Memory may include Read-Only Memory (ROM), magnetic tape, floppy disk, flash Memory, optical storage, or the like. Volatile Memory can include Random Access Memory (RAM) or external cache Memory. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM), among others.
The technical features of the above embodiments can be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the above embodiments are not described, but should be considered as the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above-mentioned embodiments only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present patent shall be subject to the appended claims.

Claims (15)

1. A method for configuring an interface, the method comprising:
displaying an interface configuration page;
responding to the trigger operation of adding a control to the data structure in the interface configuration page, and adding the data structure in the data structure enumeration set displayed by the interface configuration page;
responding to the trigger operation of adding a control to the interface unit in the interface configuration page, and adding the interface unit in the interface unit set displayed by the interface configuration page;
acquiring interface configuration parameters input by the added interface unit in a parameter input area of the interface configuration page;
and mapping the interface configuration parameters into metadata according to the data structure enumeration set, and generating interface codes according to the metadata and a pre-configured interface code template.
2. The method of claim 1, further comprising:
responding to the triggering operation of the server options in the interface configuration page, and displaying the server configuration options in a parameter entry area of the interface configuration page;
acquiring a server access parameter input by editing the server configuration option;
mapping the interface configuration parameters to metadata according to the data structure enumeration set comprises:
and mapping the server access parameters and the interface configuration parameters into metadata respectively according to the data structure enumeration set.
3. The method according to claim 1, wherein the obtaining, in a parameter entry area of the interface configuration page, the interface configuration parameters entered corresponding to the added interface unit includes:
responding to the selected operation of the interface unit in the interface unit set, and displaying an interface configuration item corresponding to the selected interface unit in a parameter entry area in the interface configuration page;
and acquiring the interface configuration parameters which are input by editing the interface configuration items and correspond to the selected interface units.
4. The method of claim 1, wherein the interface units comprise at least one main interface unit and at least one sub-interface unit attributed to the main interface unit;
the adding of the interface unit in the interface unit set shown in the interface configuration page in response to the triggering operation of adding the control to the interface unit in the interface configuration page includes:
when the root index of an interface unit set in the interface configuration page is in a selected state, responding to the triggering operation of adding a control to the interface unit in the interface configuration page, and adding a main interface unit under the root index of the interface unit set;
and when the main interface unit under the root index of the interface unit set is in a selected state, responding to the triggering operation of adding the control to the interface unit in the interface configuration page, and adding the sub-interface unit under the main interface unit in the selected state.
5. The method according to claim 1, wherein the obtaining, in a parameter entry area of the interface configuration page, the interface configuration parameters entered corresponding to the added interface unit includes:
acquiring field configuration information which is input and corresponds to the added interface unit in a parameter input area of the interface configuration page;
responding to attribute configuration operation of the selected field configuration information, and displaying an attribute interface corresponding to the selected field configuration information;
acquiring the input field attribute information corresponding to the configuration field information on an attribute interface of the configuration field information;
obtaining interface configuration parameters corresponding to the added interface unit based on the field configuration information and the field attribute information.
6. The method of claim 1, further comprising:
acquiring template information of the interface code template;
acquiring document attribute information of an interface document where the interface code is located;
and adding the template information and the document attribute information into annotation information of the interface document.
7. The method of claim 1, further comprising:
responding to a document display operation triggered by the interface configuration page, and displaying the interface codes in an interface code display area in the interface configuration page;
updating the interface code in response to an editing operation on the interface code;
and when the editing operation is finished, generating an updated interface document based on the updated interface code.
8. The method of claim 1, further comprising:
acquiring a service function code corresponding to each interface unit in the interface unit set;
and generating a service development toolkit based on the interface code and the service function code.
9. The method of any one of claims 1 to 8, wherein mapping the interface configuration parameters to metadata according to the enumeration set of data structures, and generating interface codes according to the metadata and a preconfigured interface code template comprises:
mapping and coding the interface configuration parameters based on the data structure enumeration set to generate metadata corresponding to the interface configuration parameters;
and filling the metadata into a pre-configured interface code template in a data rendering mode to generate the interface code.
10. The method according to claim 9, wherein the mapping and encoding the interface configuration parameter based on the enumeration set of data structures to generate metadata corresponding to the interface configuration parameter includes:
converting the interface configuration parameters into parameter data in a preset format based on a predefined mapping rule in the data structure enumeration set;
encoding the parameter data into corresponding metadata based on predefined data structures in the enumeration set of data structures.
11. The method of claim 9, wherein the populating the metadata into a preconfigured interface code template by way of data rendering to generate interface code comprises:
acquiring a service type corresponding to an interface unit in the interface unit set;
calling a pre-configured interface code template matched with the service type;
and filling the metadata corresponding to the interface unit into the called interface code template in a data rendering mode to generate the interface code.
12. The method of claim 9, wherein the populating the metadata into a preconfigured interface code template by way of data rendering to generate interface code comprises:
matching the keyword identification of the metadata with the keyword identification in the interface code template, and determining the mapping position of the metadata in the interface code template;
and filling the key values in the metadata into the interface code template according to the mapping positions to generate interface codes.
13. An interface configuration apparatus, the apparatus comprising:
the page display module is used for displaying an interface configuration page;
the data adding module is used for responding to the triggering operation of adding the control to the data structure in the interface configuration page and adding the data structure in the data structure enumeration set displayed by the interface configuration page; responding to the trigger operation of adding a control to the interface unit in the interface configuration page, and adding the interface unit in the interface unit set displayed by the interface configuration page;
the parameter input module is used for acquiring interface configuration parameters input by the added interface unit in a parameter input area of the interface configuration page;
and the interface code generation module is used for mapping the interface configuration parameters into metadata according to the data structure enumeration set and generating interface codes according to the metadata and a pre-configured interface code template.
14. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor, when executing the computer program, implements the steps of the method of any of claims 1 to 12.
15. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the steps of the method according to any one of claims 1 to 12.
CN202010640800.5A 2020-07-06 2020-07-06 Interface configuration method and device, computer equipment and storage medium Pending CN113900725A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010640800.5A CN113900725A (en) 2020-07-06 2020-07-06 Interface configuration method and device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010640800.5A CN113900725A (en) 2020-07-06 2020-07-06 Interface configuration method and device, computer equipment and storage medium

Publications (1)

Publication Number Publication Date
CN113900725A true CN113900725A (en) 2022-01-07

Family

ID=79186761

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010640800.5A Pending CN113900725A (en) 2020-07-06 2020-07-06 Interface configuration method and device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN113900725A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114840199A (en) * 2022-05-30 2022-08-02 重庆忽米网络科技有限公司 Dragging type equipment data forwarding configuration method
CN117435177A (en) * 2023-12-20 2024-01-23 浙江寰福科技有限公司 Application program interface construction method, system, equipment and storage medium

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114840199A (en) * 2022-05-30 2022-08-02 重庆忽米网络科技有限公司 Dragging type equipment data forwarding configuration method
CN117435177A (en) * 2023-12-20 2024-01-23 浙江寰福科技有限公司 Application program interface construction method, system, equipment and storage medium
CN117435177B (en) * 2023-12-20 2024-03-26 浙江寰福科技有限公司 Application program interface construction method, system, equipment and storage medium

Similar Documents

Publication Publication Date Title
CN109074537B (en) Electronic system, computing device and method in computing device
CN107644286B (en) Workflow processing method and device
CN108255709A (en) Script tests method, apparatus, terminal device and the storage medium of written in code
US20170357486A1 (en) Enhancing a crowdsourced integrated development environment application
CN111061475B (en) Software code generating method, device, computer equipment and storage medium
US20190340230A1 (en) System and method for generating websites from predefined templates
CN112287013B (en) Data conversion method and adapter
CN111666740A (en) Flow chart generation method and device, computer equipment and storage medium
CN111596911B (en) Method, device, computer equipment and storage medium for generating control
JP2018520452A (en) Techniques for constructing generic programs using controls
CN110297636A (en) A kind of automatic production of HTML page and parameter management method based on page configuration file, system and device
CN113900725A (en) Interface configuration method and device, computer equipment and storage medium
CN110941428A (en) Website creation method and device
CN110187874B (en) Rule configuration method and device executed in computer equipment
CN116738954A (en) Report export method, report template configuration device and computer equipment
CN110968311B (en) Front-end page construction method and device and electronic equipment
JP7014960B2 (en) Information processing equipment, servers, their processing methods and programs
CN104156209B (en) Cross-platform interface modeling method and device
CN107368557B (en) Page editing method and device
CN115629763A (en) Target code generation method and NPU instruction display method and device
CN113485746B (en) Method and device for generating application program interface document
CN114253536A (en) Calling method of interface design component, terminal device and readable storage medium
CN114625372A (en) Automatic component compiling method and device, computer equipment and storage medium
US11526336B2 (en) Community-oriented, cloud-based digital annealing platform
WO2019019377A1 (en) Method and device for configuring security keyboard, terminal, and storage medium

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