CN113515270A - Interface configuration method and device, electronic equipment and computer readable medium - Google Patents
Interface configuration method and device, electronic equipment and computer readable medium Download PDFInfo
- Publication number
- CN113515270A CN113515270A CN202110823685.XA CN202110823685A CN113515270A CN 113515270 A CN113515270 A CN 113515270A CN 202110823685 A CN202110823685 A CN 202110823685A CN 113515270 A CN113515270 A CN 113515270A
- Authority
- CN
- China
- Prior art keywords
- filtering
- statement
- interface
- condition
- filtering condition
- 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
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/30—Creation or generation of source code
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- General Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Stored Programmes (AREA)
Abstract
The invention discloses a method and a device for interface configuration, electronic equipment and a computer readable medium, and relates to the technical field of automatic program design. One embodiment of the method comprises: acquiring a parameter set corresponding to an interface to be set; the parameter set comprises one or more parameters; determining a filtering condition corresponding to the input parameter according to the one or more input parameters and a preset filtering condition mapping table; generating a target filtering statement corresponding to the interface to be set according to the filtering condition; and configuring the interface according to the target filtering statement. The method provided by the invention automatically analyzes and generates the corresponding target filtering statement by identifying the access name so as to realize query condition assembly by zero code after receiving the query request, thereby greatly improving the efficiency of back-end development and simultaneously reducing the occurrence frequency of BUG.
Description
Technical Field
The present invention relates to the field of automatic programming technologies, and in particular, to a method and an apparatus for interface configuration, an electronic device, and a computer-readable medium.
Background
In the software development process, the configuration of the software interface is crucial, and different software interfaces can implement services of different services, such as a service data query interface, a service data update interface, and the like.
In the existing research and development process of the query interface, different entries are often set for different filter conditions, and corresponding filter fields and query conditions corresponding to the filter fields are spliced respectively in a code writing mode. When the filtering condition is more, the research and development process of the query interface involves more mechanical and repetitive work and is easy to make mistakes.
Disclosure of Invention
In view of this, embodiments of the present invention provide a method and an apparatus for interface configuration, an electronic device, and a computer-readable medium, which automatically analyze and generate a corresponding target filter statement through the identification of an entry parameter, so that in the research and development process of a query interface, the query condition assembly can be realized with zero codes without writing different codes for different filter fields, thereby greatly improving the research and development efficiency of the query interface, further improving the efficiency of back-end development, and reducing the occurrence frequency of a BUG.
To achieve the above object, according to a first aspect of embodiments of the present invention, a method for interface configuration is provided.
The interface configuration method of the embodiment of the invention comprises the following steps: acquiring a parameter set corresponding to an interface to be set; the parameter set comprises one or more parameters; determining a filtering condition corresponding to the input parameter according to the one or more input parameters and a preset filtering condition mapping table; generating a target filtering statement corresponding to the interface to be set according to the filtering condition; and configuring the interface according to the target filtering statement.
Optionally, the filtering condition mapping table includes: the mapping relation between the filtering condition identification and the filtering condition; the determining of the filtering condition corresponding to the input parameter includes: and identifying a filtering condition identifier from the input parameter, and determining a filtering condition corresponding to the input parameter according to the mapping relation between the filtering condition identifier and the filtering condition.
Optionally, the entry comprises an entry name; before identifying the filtering condition identification from the input parameter, the method further comprises the following steps: confirming that the entry name comprises a filtering field identification and a filtering field; otherwise, determining that the corresponding filtering condition does not exist in the input parameter.
Optionally, before determining the filtering condition corresponding to the input parameter according to the mapping relationship between the filtering condition identifier and the filtering condition, the method includes: confirming that the filtering field identification exists in the filtering condition mapping table; otherwise, determining that the corresponding filtering condition does not exist in the input parameter
Optionally, the parameter further comprises a parameter value; generating a target filtering statement corresponding to the interface to be set according to the filtering condition, wherein the target filtering statement comprises: generating an intermediate filtering statement corresponding to the parameter according to the parameter value, the parameter name and the filtering condition corresponding to the parameter; and generating the target filtering statement according to the intermediate filtering statement corresponding to each input parameter in the input parameter set.
Optionally, the generating the target filtering statement according to the intermediate filtering statement corresponding to each entry in the entry set includes: AND aiming at the entries of the same subset, connecting the intermediate filtering statements corresponding to the entries by adopting AND connectors so as to generate the target filtering statement corresponding to the interface to be set according to the connected intermediate filtering statements.
Optionally, the generating the target filtering statement according to the intermediate filtering statement corresponding to each entry in the entry set further includes: and aiming at the input parameters which do not belong to the same subset, adopting an OR connector to connect the intermediate filtering statements corresponding to the input parameters, and generating the target filtering statement corresponding to the interface to be set according to the connected intermediate filtering statements.
Optionally, in the filtering condition mapping table, the filtering condition identifiers correspond to filtering conditions one to one.
Optionally, the method further comprises: and updating the filtering condition mapping table periodically.
Optionally, the method further comprises: receiving a query request through the interface; generating a query statement according to the entry of the query request and a target filtering statement corresponding to the interface; executing the query statement in response to the query request.
To achieve the above object, according to a second aspect of an embodiment of the present invention, there is provided an apparatus of an interface configuration.
The interface configuration device of the embodiment of the invention comprises: the acquisition module is used for acquiring a parameter set corresponding to an interface to be set; the parameter set comprises one or more parameters; the generating module is used for determining the filtering condition corresponding to the input parameter according to the one or more input parameters and a preset filtering condition mapping table; generating a target filtering statement corresponding to the interface to be set according to the filtering condition; and the configuration module is used for configuring the interface according to the target filtering statement.
Optionally, the filtering condition mapping table includes: the mapping relation between the filtering condition identification and the filtering condition; the determining of the filtering condition corresponding to the input parameter includes: and identifying a filtering condition identifier from the input parameter, and determining a filtering condition corresponding to the input parameter according to the mapping relation between the filtering condition identifier and the filtering condition.
Optionally, the entry comprises an entry name; the obtaining module is further configured to, before identifying a filtering condition identifier from the entry, confirm that the entry name includes a filtering field identifier and a filtering field; otherwise, determining that the corresponding filtering condition does not exist in the input parameter.
Optionally, the obtaining module is further configured to confirm that the filtering field identifier exists in the filtering condition mapping table before determining the filtering condition corresponding to the entry parameter according to the mapping relationship between the filtering condition identifier and the filtering condition; otherwise, determining that the corresponding filtering condition does not exist in the input parameter.
Optionally, the parameter further comprises a parameter value; generating a target filtering statement corresponding to the interface to be set according to the filtering condition, wherein the target filtering statement comprises: generating an intermediate filtering statement corresponding to the parameter according to the parameter value, the parameter name and the filtering condition corresponding to the parameter; and generating the target filtering statement according to the intermediate filtering statement corresponding to each input parameter in the input parameter set.
Optionally, the generating the target filtering statement according to the intermediate filtering statement corresponding to each entry in the entry set includes: AND aiming at the entries of the same subset, connecting the intermediate filtering statements corresponding to the entries by adopting AND connectors so as to generate the target filtering statement corresponding to the interface to be set according to the connected intermediate filtering statements.
Optionally, the generating the target filtering statement according to the intermediate filtering statement corresponding to each entry in the entry set further includes: and aiming at the input parameters which do not belong to the same subset, adopting an OR connector to connect the intermediate filtering statements corresponding to the input parameters, and generating the target filtering statement corresponding to the interface to be set according to the connected intermediate filtering statements.
Optionally, in the filtering condition mapping table, the filtering condition identifiers correspond to filtering conditions one to one.
Optionally, the apparatus further includes an updating module, configured to update the filtering condition mapping table periodically.
Optionally, the apparatus further comprises a query module, configured to receive a query request through the interface; generating a query statement according to the entry of the query request and a target filtering statement corresponding to the interface; executing the query statement in response to the query request.
To achieve the above object, according to a third aspect of embodiments of the present invention, there is provided an electronic device of an interface configuration.
The interface configuration device of the embodiment of the invention comprises: one or more processors; a storage system for storing one or more programs; when the one or more programs are executed by the one or more processors, the one or more processors are caused to implement the method for interface configuration provided by the first aspect.
To achieve the above object, according to a fourth aspect of embodiments of the present invention, there is provided a computer-readable medium.
The computer readable medium of the embodiment of the present invention stores thereon a computer program, which when executed by a processor implements the method for interface configuration provided by the first aspect.
One embodiment of the above invention has the following advantages or benefits: in the embodiment of the invention, through identifying the input parameters, automatically analyzing and generating the corresponding target filtering statements, the query condition assembly can be realized by zero codes in the research and development process of the query type interface without compiling different codes aiming at different filtering fields, so that the research and development efficiency of the query type interface is greatly improved, the efficiency of back-end development is improved, and the occurrence frequency of BUG is reduced.
Further effects of the above-mentioned non-conventional alternatives will be described below in connection with the embodiments.
Drawings
The drawings are included to provide a better understanding of the invention and are not to be construed as unduly limiting the invention. Wherein:
fig. 1 is a schematic diagram of a main flow of an interface configuration method according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of the main flow of generating a target filter statement according to an embodiment of the present invention;
FIG. 3 is a schematic diagram of a subset interface configuration flow of an embodiment of the invention;
FIG. 4 is a diagram illustrating a main flow of processing a query request after interface configuration is completed according to an embodiment of the present invention;
FIG. 5 is a schematic diagram of the major modules of an interface configured apparatus according to an embodiment of the present invention;
FIG. 6 is an exemplary system architecture diagram in which embodiments of the present invention may be employed;
fig. 7 is a schematic block diagram of a computer system suitable for use in implementing a terminal device or server of an embodiment of the invention.
Detailed Description
Exemplary embodiments of the present invention are described below with reference to the accompanying drawings, in which various details of embodiments of the invention are included to assist understanding, and which are to be considered as merely exemplary. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the invention. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
According to a first aspect of the embodiments of the present invention, a method applied to interface configuration of a server is provided.
Fig. 1 is a schematic diagram of a main flow of an interface configuration method according to an embodiment of the present invention.
As shown in fig. 1, the method mainly includes:
step S101: acquiring a parameter set corresponding to an interface to be set; the parameter set comprises one or more parameters;
step S102: determining a filtering condition corresponding to the access parameter according to one or more access parameters and a preset filtering condition mapping table;
step S103: generating a target filtering statement corresponding to an interface to be set according to the filtering condition;
step S104: and configuring the interface according to the target filtering statement.
In general, the parameter set includes a plurality of parameters, each parameter may correspond to the same or different filtering conditions, and the target filtering statement is a filtering statement obtained by using all parameters as reference conditions.
In an alternative embodiment, the filtering condition mapping table includes: the mapping relation between the filtering condition identification and the filtering condition; the specific implementation of the step S102 may include: and identifying a filtering condition identifier from the input parameter, and determining a filtering condition corresponding to the input parameter according to the mapping relation between the filtering condition identifier and the filtering condition.
The mapping relationship between the filtering condition identifier and the filtering condition may be preconfigured according to actual situations, and in an alternative embodiment, is shown in table 1. The fuzzy matching can be used for fuzzy search, for example, fuzzy matching of the 'jade' word, that is, all target objects with the 'jade' word can be found within a range to be searched. A left match indicates that the term is beginning with the query, e.g., all names beginning with the "li" word in the name can be found by left matching. Likewise, a right match indicates that the term is the end of the query, e.g., all names in the name that end in the "Van" word can be found by right matching.
Table 1 filtering condition mapping table
The corresponding relationship between the filtering condition identifier and the filtering condition may be set to a one-to-one relationship or a many-to-one relationship. In an optional embodiment, in the filtering condition mapping table, the filtering condition identifiers and the filtering conditions are in one-to-one correspondence, so that the accuracy of the query can be ensured.
In an alternative embodiment, the reference includes a reference name; before identifying the filtering condition identification from the input parameter, the method further comprises the following steps: confirming that the entry name comprises a filtering field identifier and a filtering field; otherwise, determining that the corresponding filtering condition does not exist in the input parameter.
The precondition for identifying the filtering condition identifier from the entry necessarily includes the filtering field identifier in the entry name, and in an alternative embodiment, the entry name may be composed of two parts, namely a filtering field and a filtering field identifier, wherein a connector is selected between the filtering field and the filtering condition identifier for connection so as to distinguish the two parts. For example, if the filtering field is id and the filtering condition is eq, the reference name is "id _ eq".
If the entry name is not in the format of "filter field _ filter condition identification", the entry name cannot be recognized by the system, and the entry is considered to have no corresponding filter condition.
In an optional embodiment, before determining, according to the mapping relationship between the filtering condition identifier and the filtering condition, the method includes: confirming that a filter field identification exists in the filter condition mapping table; otherwise, determining that the corresponding filtering condition does not exist in the input parameter
When there is no filter field identification in the filter condition mapping table, which may be caused by the fact that the filter condition mapping table is not updated in time, in an alternative embodiment, the filter condition mapping table needs to be updated periodically to ensure timeliness and accuracy of the filter condition mapping table.
The target filter statement is typically derived based on a plurality of entries, which in an alternative embodiment further comprise entry values; then, the specific implementation of step S103 may include the steps shown in fig. 2:
step S201: generating an intermediate filtering statement corresponding to the input parameter according to the input parameter value, the input parameter name and the filtering condition corresponding to the input parameter;
step S202: and generating a target filtering statement according to the intermediate filtering statement corresponding to each input parameter in the input parameter set.
And each input parameter corresponds to one intermediate filtering statement, and the plurality of intermediate filtering statements are arranged and combined to obtain the target filtering statement. In an optional embodiment, the participating set includes one or more subsets, and the generating of the target filtering statement according to the intermediate filtering statement corresponding to each participating in the participating set includes: AND aiming at the entries of the same subset, connecting the intermediate filtering statements corresponding to the entries by adopting AND connectors so as to generate target filtering statements corresponding to the interfaces to be set according to the connected intermediate filtering statements.
AND connecting all intermediate filtering statements corresponding to the entries in each subset by adopting AND connectors under the condition that one subset comprises a plurality of entries to obtain a target filtering statement. The target filtering statement at this time indicates that the condition of all the intermediate filtering statements needs to be satisfied simultaneously by searching, and the condition is not satisfied by any one of the missing.
In another optional embodiment, generating the target filter statement according to the intermediate filter statement corresponding to each entry in the entry set, further includes: and aiming at the input parameters which do not belong to the same subset, connecting the intermediate filtering statements corresponding to the input parameters by adopting an OR connector, and generating target filtering statements corresponding to the interface to be set according to the connected intermediate filtering statements.
For example, all entries in the same subset may be processed first, and then entries in different subsets may be processed. For example, the argument set is a List < Map < String, Object > > type, the subset is a Map, there may be multiple maps in a List, and each Map includes at least one argument. The method comprises the steps of firstly connecting all intermediate filtering statements corresponding to all input parameters in the same Map by using AND connectors to obtain a first target filtering statement, AND then connecting the first target filtering statements between different maps by using OR connectors to obtain a target filtering statement.
Fig. 3 is a schematic diagram illustrating a configuration flow of the subset interface according to the embodiment of the present invention, as shown in fig. 3, including MapA and MapB in listone. The MapA has a plurality of interfaces for entering the reference, including reference 1, reference 2 and reference 3, and each reference comprises a reference name and a reference value. The name of the input reference 1 is firstly judged, and whether the format of the input reference name meets the preset format rule, such as the format of 'filter field + _ + filter condition identifier' is judged. And further analyzing the entry name under the condition of meeting the preset format rule to obtain a filtering field and a filtering field identifier. After the filtering field identification is obtained, whether the filtering field identification has a corresponding filtering condition in the filtering condition mapping table is judged, and the corresponding filtering condition, the filtering field and the filtering value (namely the parameter value) are combined to obtain an intermediate filtering statement 1 corresponding to the current parameter. AND obtaining an intermediate filtering statement 2 AND an intermediate filtering statement 3 corresponding to the input parameter 2 AND the input parameter 3 by adopting the same steps, AND connecting the intermediate filtering statements 1, 2 AND 3 by adopting AND to obtain a single-set filtering statement 1 corresponding to MapA.
And sequentially processing each entry in the MapB to obtain a single-set filtering statement 2 corresponding to the MapB. And for the single-set filtering statements 1 and 2, performing connection between the statements by adopting OR to obtain a target filtering statement. And if other maps exist in the List, configuring in the same way to obtain a plurality of single-set filter statements and finally obtain a target filter statement. Further, executing the generated target filter statement may obtain data satisfying the condition.
In an optional embodiment, after the target filtering statement is obtained and the interface is configured according to the target filtering statement, when the query request is received, the target filtering statement corresponding to the query request can be automatically generated, so as to improve the response rate of the query request. Specifically, as shown in fig. 4, the process may include the steps of:
step S401: receiving a query request through an interface;
step S402: generating a query statement according to the input parameter of the query request and a target filtering statement corresponding to the interface;
step S403: the query statement is executed in response to the query request.
According to the interface configuration method provided by the embodiment of the invention, the corresponding target filtering statement can be automatically analyzed and generated through identifying the access name, code development and code management are not needed, and the negative effects of high cost, high error rate, low reaction speed and the like caused by manual coding are avoided.
According to a second aspect of the embodiments of the present invention, an apparatus for interface configuration applied to a server is provided.
Fig. 5 is a schematic diagram of main modules of an interface configuration apparatus 500 according to a second aspect of the embodiment of the present invention. As shown in fig. 5, includes: an obtaining module 501, configured to obtain a parameter set corresponding to an interface to be set; the parameter set comprises one or more parameters; a generating module 502, configured to determine, according to the one or more input parameters and a preset filtering condition mapping table, a filtering condition corresponding to the input parameter; generating a target filtering statement corresponding to the interface to be set according to the filtering condition; a configuration module 503, configured to configure the interface according to the target filter statement.
Optionally, the filtering condition mapping table includes: the mapping relation between the filtering condition identification and the filtering condition; the determining of the filtering condition corresponding to the input parameter includes: and identifying a filtering condition identifier from the input parameter, and determining a filtering condition corresponding to the input parameter according to the mapping relation between the filtering condition identifier and the filtering condition.
Optionally, the entry comprises an entry name; the obtaining module is further configured to, before identifying a filtering condition identifier from the entry, confirm that the entry name includes a filtering field identifier and a filtering field; otherwise, determining that the corresponding filtering condition does not exist in the input parameter.
Optionally, the obtaining module 501 is further configured to confirm that the filtering field identifier exists in the filtering condition mapping table before determining the filtering condition corresponding to the entry according to the mapping relationship between the filtering condition identifier and the filtering condition; otherwise, determining that the corresponding filtering condition does not exist in the input parameter.
Optionally, the parameter further comprises a parameter value; generating a target filtering statement corresponding to the interface to be set according to the filtering condition, wherein the target filtering statement comprises: generating an intermediate filtering statement corresponding to the parameter according to the parameter value, the parameter name and the filtering condition corresponding to the parameter; and generating the target filtering statement according to the intermediate filtering statement corresponding to each input parameter in the input parameter set.
Optionally, the generating the target filtering statement according to the intermediate filtering statement corresponding to each entry in the entry set includes: AND aiming at the entries of the same subset, connecting the intermediate filtering statements corresponding to the entries by adopting AND connectors so as to generate the target filtering statement corresponding to the interface to be set according to the connected intermediate filtering statements.
Optionally, the generating the target filtering statement according to the intermediate filtering statement corresponding to each entry in the entry set further includes: and aiming at the input parameters which do not belong to the same subset, adopting an OR connector to connect the intermediate filtering statements corresponding to the input parameters, and generating the target filtering statement corresponding to the interface to be set according to the connected intermediate filtering statements.
Optionally, in the filtering condition mapping table, the filtering condition identifiers correspond to filtering conditions one to one.
Optionally, the apparatus further includes an updating module, configured to update the filtering condition mapping table periodically.
Optionally, the apparatus further comprises a query module, configured to receive a query request through the interface; generating a query statement according to the entry of the query request and a target filtering statement corresponding to the interface; executing the query statement in response to the query request.
According to the interface configuration device provided by the embodiment of the invention, the corresponding target filtering statement can be automatically analyzed and generated through identifying the access name, code development and code management are not needed, and the negative effects of high cost, high error rate, low reaction speed and the like caused by manual coding are avoided.
Fig. 6 illustrates an exemplary system architecture 600 of an interface configuration system or method to which the interface configuration of embodiments of the invention may be applied.
As shown in fig. 6, the system architecture 600 may include terminal devices 601, 602, 603, a network 604, and a server 605. The network 604 serves to provide a medium for communication links between the terminal devices 601, 602, 603 and the server 605. Network 604 may include various types of connections, such as wire, wireless communication links, or fiber optic cables, to name a few.
A user may use the terminal devices 601, 602, 603 to interact with the server 605 via the network 604 to receive or send messages or the like. For example, the terminal devices 601, 602, 603 may send the query request to the server 605 through the network 604, the server 605 may receive the query request through the query class interface, and after the server processes the result of the query request, the result of the query request may be fed back to the terminals 601, 602, 603 through the query class interface or other interfaces. Various communication client applications, such as shopping applications, web browser applications, search applications, instant messaging tools, mailbox clients, social platform software, and the like, may be installed on the terminal devices 601, 602, and 603.
The terminal devices 601, 602, 603 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop portable computers, desktop computers, and the like.
The server 605 may be a server that provides various services, such as a background management server that supports shopping websites browsed by users using the terminal devices 601, 602, and 603. The background management server may analyze and perform other processing on the received data such as the product information query request, and feed back a processing result (e.g., target push information and product information) to the terminal device.
It should be noted that the method for configuring the interface provided in the first aspect of the embodiment of the present invention is generally executed by the server 605, and accordingly, the apparatus for configuring the interface provided in the second aspect of the embodiment of the present invention is generally disposed in the server 605.
It should be understood that the number of terminal devices, networks, and servers in fig. 6 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
Referring now to FIG. 7, shown is a block diagram of a computer system 700 suitable for use with a terminal device implementing an embodiment of the present invention. The terminal device shown in fig. 7 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present invention.
As shown in fig. 7, the computer system 700 includes a Central Processing Unit (CPU)701, which can perform various appropriate actions and processes in accordance with a program stored in a Read Only Memory (ROM)702 or a program loaded from a storage section 708 into a Random Access Memory (RAM) 703. In the RAM 703, various programs and data necessary for the operation of the system 700 are also stored. The CPU 701, the ROM 702, and the RAM 703 are connected to each other via a bus 704. An input/output (I/O) interface 705 is also connected to bus 704.
The following components are connected to the I/O interface 705: an input portion 706 including a keyboard, a mouse, and the like; an output section 705 including a display such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker; a storage section 708 including a hard disk and the like; and a communication section 709 including a network interface card such as a LAN card, a modem, or the like. The communication section 709 performs communication processing via a network such as the internet. A drive 710 is also connected to the I/O interface 705 as needed. A removable medium 711 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 710 as necessary, so that a computer program read out therefrom is mounted into the storage section 708 as necessary.
In particular, according to the embodiments of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In such an embodiment, the computer program can be downloaded and installed from a network through the communication section 709, and/or installed from the removable medium 711. The computer program performs the above-described functions defined in the system of the present invention when executed by the Central Processing Unit (CPU) 701.
It should be noted that the computer readable medium shown in the present invention can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present invention, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, or device. In the present invention, however, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The modules described in the embodiments of the present invention may be implemented by software or hardware. The described modules may also be provided in a processor, which may be described as: a processor includes an acquisition module, a generation module, and a configuration module. The names of the modules do not form a limitation on the modules themselves in some cases, for example, the acquiring module may also be described as a module that acquires an entry set corresponding to an interface to be set.
As another aspect, the present invention also provides a computer-readable medium that may be contained in the apparatus described in the above embodiments; or may be separate and not incorporated into the device. The computer readable medium carries one or more programs which, when executed by a device, cause the device to comprise:
acquiring a parameter set corresponding to an interface to be set; the parameter set comprises one or more parameters; determining a filtering condition corresponding to the access parameter according to one or more access parameters and a preset filtering condition mapping table; generating a target filtering statement corresponding to an interface to be set according to the filtering condition; and configuring the interface according to the target filtering statement.
According to the interface configuration method and device, the corresponding target filtering statement is automatically analyzed and generated through the identification of the access name, so that risks and problems caused by manual coding work are reduced, the configured query interface can realize query condition assembly through zero codes after receiving a query request, the efficiency of back-end development is greatly improved, and the occurrence frequency of BUG is reduced.
The above-described embodiments should not be construed as limiting the scope of the invention. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions can occur, depending on design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims (13)
1. A method of interface configuration, comprising:
acquiring a parameter set corresponding to an interface to be set; the parameter set comprises one or more parameters;
determining a filtering condition corresponding to the input parameter according to the one or more input parameters and a preset filtering condition mapping table;
generating a target filtering statement corresponding to the interface to be set according to the filtering condition;
and configuring the interface according to the target filtering statement.
2. The method of claim 1, wherein the filter condition mapping table comprises: the mapping relation between the filtering condition identification and the filtering condition; the determining of the filtering condition corresponding to the input parameter includes:
and identifying a filtering condition identifier from the input parameter, and determining a filtering condition corresponding to the input parameter according to the mapping relation between the filtering condition identifier and the filtering condition.
3. The method of claim 2, wherein the entry comprises an entry name; before identifying the filtering condition identification from the input parameter, the method further comprises the following steps:
confirming that the entry name comprises a filtering field identification and a filtering field; otherwise, determining that the corresponding filtering condition does not exist in the input parameter.
4. The method according to claim 3, wherein before determining the filtering condition corresponding to the entry according to the mapping relationship between the filtering condition identifier and the filtering condition, the method comprises:
confirming that the filtering field identification exists in the filtering condition mapping table; otherwise, determining that the corresponding filtering condition does not exist in the input parameter.
5. The method of claim 1, wherein the entries further comprise entry values; generating a target filtering statement corresponding to the interface to be set according to the filtering condition, wherein the target filtering statement comprises:
generating an intermediate filtering statement corresponding to the parameter according to the parameter value, the parameter name and the filtering condition corresponding to the parameter;
and generating the target filtering statement according to the intermediate filtering statement corresponding to each input parameter in the input parameter set.
6. The method of claim 5, wherein the parameter set comprises one or more subsets, and wherein generating the target filter statement according to the intermediate filter statement corresponding to each parameter in the parameter set comprises:
AND aiming at the entries of the same subset, connecting the intermediate filtering statements corresponding to the entries by adopting AND connectors so as to generate the target filtering statement corresponding to the interface to be set according to the connected intermediate filtering statements.
7. The method according to claim 6, wherein the generating the target filter statement according to the intermediate filter statement corresponding to each entry in the entry set further comprises:
and aiming at the input parameters which do not belong to the same subset, adopting an OR connector to connect the intermediate filtering statements corresponding to the input parameters, and generating the target filtering statement corresponding to the interface to be set according to the connected intermediate filtering statements.
8. The method according to claim 2, wherein the filter condition identifier and the filter condition are in one-to-one correspondence in the filter condition mapping table.
9. The method of claim 1, further comprising: and updating the filtering condition mapping table periodically.
10. The method of claim 1, further comprising:
receiving a query request through the interface;
generating a query statement according to the entry of the query request and a target filtering statement corresponding to the interface;
executing the query statement in response to the query request.
11. An apparatus for interface configuration, the apparatus comprising:
the acquisition module is used for acquiring a parameter set corresponding to an interface to be set; the parameter set comprises one or more parameters;
the generating module is used for determining the filtering condition corresponding to the input parameter according to the one or more input parameters and a preset filtering condition mapping table; generating a target filtering statement corresponding to the interface to be set according to the filtering condition;
and the configuration module is used for configuring the interface according to the target filtering statement.
12. An interface configured electronic device, comprising: one or more processors;
a storage system for storing one or more programs,
when executed by the one or more processors, cause the one or more processors to implement the method of any one of claims 1-10.
13. A computer-readable medium, on which a computer program is stored, which, when being executed by a processor, carries out the method according to any one of claims 1-10.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110823685.XA CN113515270A (en) | 2021-07-21 | 2021-07-21 | Interface configuration method and device, electronic equipment and computer readable medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110823685.XA CN113515270A (en) | 2021-07-21 | 2021-07-21 | Interface configuration method and device, electronic equipment and computer readable medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN113515270A true CN113515270A (en) | 2021-10-19 |
Family
ID=78067571
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110823685.XA Pending CN113515270A (en) | 2021-07-21 | 2021-07-21 | Interface configuration method and device, electronic equipment and computer readable medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113515270A (en) |
-
2021
- 2021-07-21 CN CN202110823685.XA patent/CN113515270A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110555030B (en) | SQL sentence processing method and device | |
CN111190888A (en) | Method and device for managing graph database cluster | |
CN111460129A (en) | Method and device for generating identification, electronic equipment and storage medium | |
CN110689268A (en) | Method and device for extracting indexes | |
CN108959294B (en) | Method and device for accessing search engine | |
CN110764770A (en) | Method and device for conversion and assignment between objects | |
CN113760969A (en) | Data query method and device based on elastic search | |
CN110109912A (en) | A kind of identifier generation method and device | |
CN112948138A (en) | Method and device for processing message | |
CN113515270A (en) | Interface configuration method and device, electronic equipment and computer readable medium | |
CN110806967A (en) | Unit testing method and device | |
CN113742321A (en) | Data updating method and device | |
CN113448652A (en) | Request processing method and device | |
CN113283991A (en) | Processing method and device for transaction data on block chain | |
CN113268417B (en) | Task execution method and device | |
CN110874302A (en) | Method and device for determining buried point configuration information | |
CN115309612B (en) | Method and device for monitoring data | |
CN113065920B (en) | Data processing method and system | |
CN113900643A (en) | Method and device for generating code | |
CN115712744A (en) | Picture data processing method and device, electronic equipment and storage medium | |
CN113760745A (en) | Interface automation test case generation method and device | |
CN113535163A (en) | Method and device for generating message | |
CN118331970A (en) | Icon data processing method and device, electronic equipment and storage medium | |
CN113760921A (en) | Method and device for creating dictionary value | |
CN114816798A (en) | Interface calling method and device |
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 |