CN110109656A - Interface analogy method, device, computer equipment and storage medium - Google Patents

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

Info

Publication number
CN110109656A
CN110109656A CN201910228302.7A CN201910228302A CN110109656A CN 110109656 A CN110109656 A CN 110109656A CN 201910228302 A CN201910228302 A CN 201910228302A CN 110109656 A CN110109656 A CN 110109656A
Authority
CN
China
Prior art keywords
interface
configuration data
request
name
database
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
CN201910228302.7A
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.)
Ping An Technology Shenzhen Co Ltd
Original Assignee
Ping An 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 Ping An Technology Shenzhen Co Ltd filed Critical Ping An Technology Shenzhen Co Ltd
Priority to CN201910228302.7A priority Critical patent/CN110109656A/en
Publication of CN110109656A publication Critical patent/CN110109656A/en
Priority to PCT/CN2019/118071 priority patent/WO2020192141A1/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • G06F8/44Encoding
    • G06F8/447Target code generation

Abstract

This application involves research and development management domains, provide a kind of interface analogy method, device, computer equipment and storage medium.Method includes: to obtain to the corresponding interface configuration data of analog interface, and interface configuration data is saved as the record of an interface configuration data in database, includes configuration interface file-name field, request parameters field and return parameters field in interface configuration data record;Receive the interface simulation request for treating analog interface that terminal is sent;The interface simulation request received is parsed, to obtain first object interface name and destination request parameter;Ergodic data library, the interface configuration data record that query configuration interface file-name field and request parameters field match with first object interface name and destination request parameter respectively from database;Return parameters field in the interface configuration data inquired record is determined as interface simulation and requests corresponding first object return parameters;First object return parameters are sent to terminal.

Description

Interface analogy method, device, computer equipment and storage medium
Technical field
This application involves Internet technical field, more particularly to a kind of interface analogy method, device, computer equipment and Storage medium.
Background technique
In the exploitation of web project, frequently refer to front end exploitation and rear end exploitation, in traditional technology, front end exploitation with Rear end exploitation usually carries out stand-alone development by different developers.But in the development process of front end, often to be mentioned with rear end Based on the interface for carrying out service logic supplied, in the case where interface exploitation is not completed in rear end, front end can not be opened Hair, the coupling for causing front-end and back-end to work is very high, seriously reduces the development efficiency of front end.
Summary of the invention
Based on this, it is necessary in view of the above technical problems, provide a kind of interface simulation that can be improved front end development efficiency Method, apparatus, computer equipment and storage medium.
A kind of interface analogy method, which comprises
It obtains to the corresponding interface configuration data of analog interface, the interface configuration data is saved as to one in database Interface configuration data record includes configuration interface file-name field, request parameters field in the interface configuration data record and is returned Return parameter field;
Receive terminal transmission simulates request to the interface to analog interface;
The interface simulation request received is parsed, to obtain first object interface name and destination request ginseng Number;
Traverse the database, from the database query configuration interface file-name field and request parameters field respectively with institute State the interface configuration data record that first object interface name and the destination request parameter match;
Return parameters field in the interface configuration data inquired record is determined as the interface simulation request pair The first object return parameters answered;
The first object return parameters are sent to terminal.
It in one embodiment, further include relying on interface file-name field in the interface configuration data record;
It is determined as the interface in the return parameters field by the interface configuration data inquired record to simulate After requesting corresponding first object return parameters, further includes:
Dependence interface file-name field in the interface configuration data inquired record is determined as the second target interface name;
Traverse the database, from the database query configuration interface file-name field and request parameters field respectively with institute State the interface configuration data record that the second target interface name and the destination request parameter match;
Return parameters field in the interface configuration data inquired record is determined as the interface simulation request pair The the second target return parameters answered;
It is described that the first object return parameters are sent to terminal, comprising:
The first object return parameters and the second target return parameters are sent to terminal.
In one embodiment, the acquisition is to the corresponding interface configuration data of analog interface, comprising:
The interface configuration data that terminal is sent is received, the interface configuration data is that the terminal passes through visual configuration circle The data that face obtains.
In one embodiment, the interface configuration data is being saved as into the note of an interface configuration data in database Before record, further includes:
Obtain the corresponding data format of the interface configuration data;
It is described that the interface configuration data is saved as into the record of an interface configuration data in database, comprising:
When the data format is preset format, the interface configuration data is saved as to an interface in database Configuration data record;
When the data format is not preset format, form modifying prompting message is generated, by form modifying prompting message It is sent to the terminal.
In one embodiment, it saves by the interface configuration data to database, further includes:
The inquiry request that terminal is sent is received, carries query interface name in the inquiry request;
The database is traversed, query configuration interface file-name field matches with the query interface name from the database Interface configuration data record;
Inquired interface configuration data record is returned to terminal;
It receives terminal to request the modification of the interface configuration data record inquired, according to the use carried in modification request Family mark inquires corresponding user right;
When the user right inquired meets preset condition, corresponding modification data are requested to update institute according to the modification State database.
A kind of interface simulator, described device include:
Interface configuration data obtains module, for obtaining to the corresponding interface configuration data of analog interface, by the interface Configuration data saves as the record of an interface configuration data in database, includes that configuration connects in the interface configuration data record Mouth file-name field, request parameters field and return parameters field;
Interface simulates request receiving module, for receiving asking to the interface simulation to analog interface for terminal transmission It asks;
Parsing module, for being parsed to the interface simulation request received, to obtain first object interface name And destination request parameter;
Enquiry module, for traversing the database, query configuration interface file-name field and request are joined from the database The interface configuration data record that digital section matches with the first object interface name and the destination request parameter respectively;
First object return parameters determining module, for the return parameters in recording the interface configuration data inquired Field, which is determined as the interface simulation, requests corresponding first object return parameters;
Sending module, for the first object return parameters to be sent to terminal.
It in one embodiment, further include relying on interface file-name field in the interface configuration data record;Described device is also Include:
Second target return parameters determining module, for the dependence interface in recording the interface configuration data inquired File-name field is determined as the second target interface name;Traverse the database, from the database query configuration interface file-name field and The interface configuration data note that request parameters field matches with the second target interface name and the destination request parameter respectively Record;Return parameters field in the interface configuration data inquired record is determined as interface simulation request corresponding the Two target return parameters;
The sending module is also used to for the first object return parameters and the second target return parameters being sent to Terminal.
In one embodiment, interface configuration data obtain module be also used to receive terminal transmission pass through visual configuration The interface configuration data that interface obtains.
A kind of computer equipment, including memory and processor, the memory are stored with computer program, the processing Device realizes step described in interface analogy method described in above-mentioned any embodiment when executing the computer program.
A kind of computer readable storage medium, is stored thereon with computer program, and the computer program is held by processor Step described in interface analogy method described in above-mentioned any embodiment is realized when row.
Above-mentioned interface analogy method, device, computer equipment and storage medium are matched by obtaining to the interface of analog interface It sets data and is saved in database, when receiving the interface simulation request to this when analog interface, inquired from database This waits for the return parameters of analog interface, and return parameters are back to terminal, so that the simulation to interface function is realized, so that preceding Hold developer that can be called to interface when interface does not complete exploitation, realize the decoupling of front and back end development, mention The high efficiency of front end development.
Detailed description of the invention
Fig. 1 is the application scenario diagram of interface analogy method in one embodiment;
Fig. 2 is the flow diagram of interface analogy method in one embodiment;
Fig. 3 is the structural block diagram of interface simulator in one embodiment;
Fig. 4 is the internal structure chart of computer equipment in one embodiment.
Specific embodiment
It is with reference to the accompanying drawings and embodiments, right in order to which the objects, technical solutions and advantages of the application are more clearly understood The application is further elaborated.It should be appreciated that specific embodiment described herein is only used to explain the application, not For limiting the application.
Interface analogy method provided by the present application, can be applied in application environment as shown in Figure 1.Wherein, terminal 102 It is communicated by network with server 104.Server 104 obtains interface configuration data from terminal 102 first, and these are connect Mouth configuration data saves as the record of an interface configuration data in database, when the interface simulation that subsequently received terminal is sent When request, request can be simulated to the interface and parsed, to obtain the target interface name and destination request parameter that wherein carry, Then it according to the target interface name and destination request parameter traversals database, query configuration interface file-name field and is asked from database The interface configuration data record for asking parameter field to match respectively with target interface name and destination request parameter, by what is inquired Return parameters field in interface configuration data record, which is determined as interface simulation, requests corresponding target return parameters, and target is returned It returns parameter and is sent to terminal, to realize the simulation to interface.
Wherein, terminal 102 can be, but not limited to be various personal computers, laptop, smart phone, plate electricity Brain, server 104 can be realized with the server cluster of the either multiple server compositions of independent server.
In one embodiment, as shown in Fig. 2, providing a kind of interface analogy method, it is applied in Fig. 1 in this way It is illustrated for server, comprising the following steps:
Step S202 obtains to the corresponding interface configuration data of analog interface, interface configuration data is saved as database In an interface configuration data record.
Wherein, the interface simulated is referred to analog interface, interface configuration data is front end developer root The interface data configured according to interface specification, wherein interface specification can be front end developer and rear end developer and need The interface document formulated according to demand after deciding is sought, interface configuration data includes interface name, interface IP address, request method, asks Ask parameter, return parameters etc., wherein configuration interface name refer to the corresponding interface name of analog interface, request method include but Be not limited to post request and get request, required parameter refer to when analog interface when being called required incoming parameter, return It returns parameter and refers to the parameter returned when analog interface when being called.
Specifically, server is obtained from terminal to the corresponding interface configuration data of analog interface, is getting interface configuration After data, interface configuration data can be saved to database.When saving interface configuration data to database, can will match The interface configuration data that interface name, request method, required parameter, return parameters etc. save as in database is set to record, In, interface configuration data is recorded as the data line in tables of data, including configuration interface file-name field, request parameters field and return Parameter field, configuration interface file-name field is for the configuration interface name in saving interface configuration data, and request parameters field is for protecting The required parameter in interface configuration data is deposited, return parameters field is for the return parameters in saving interface configuration data.It can be with Understand, can also include other fields in interface configuration data record, for example, interface IP address field, request method field etc.. It will also be appreciated that may be recorded comprising a plurality of interface configuration data for the same interface, comprising not in each record Same required parameter and different return parameters.In one embodiment, interface name and required parameter can be set as combining Major key is convenient for subsequent data query.
In one embodiment, it includes: to receive matching by visualization for terminal transmission that server, which obtains interface configuration data, Set the interface configuration data of interface acquisition.Specifically, terminal can show a visual configuration interface, the visual configuration interface In may include interface name configuration block, required parameter configuration block, interface IP address configuration block, return parameters configuration block etc., front end is opened Hair personnel can configure interface in each configuration block.In one embodiment, in the visualization interface of terminal display also It may include custom-configuring frame, front end developer can custom-configure frame according to this and match to interface progress self-defining data It sets.
Step S204 receives the interface simulation request for treating analog interface that terminal is sent.
Specifically, when front end, exploitation needs interface that is untapped to some or being in exploitation to simulate, can lead to The simulation request of terminal to server transmission interface is crossed, is carried in interface simulation request to the corresponding interface name of analog interface, request The data such as mode, required parameter.
Step S206 parses the interface simulation request received, is asked with obtaining first object interface name and target Seek parameter.
Specifically, after server receives interface simulation request, corresponding request method is requested to be docked according to interface simulation Mouth mold is planned to invite to ask and be parsed, to obtain first object interface name and destination request parameter.For example, when request method is asked for get It when asking, requests parsing in corresponding URL to obtain interface name and required parameter from interface simulation, obtained interface name will be parsed and asked Parameter is asked to be determined as first object interface name and destination request parameter;When request method is that post is requested, asked from interface simulation It asks in corresponding request body parsing to obtain interface name and required parameter, interface name that parsing obtains and required parameter is determined as the One target interface name and destination request parameter.
Step S208, ergodic data library, from database query configuration interface file-name field and request parameters field respectively with The interface configuration data record that first object interface name and destination request parameter match.
Return parameters field in the interface configuration data inquired record is determined as interface simulation and asked by step S210 Seek corresponding first object return parameters.
First object return parameters are sent to terminal by step S212.
Specifically, after server gets first object interface name and destination request parameter, according to first object interface name With current required parameter ergodic data library, judge in each interface configuration data record of database, if there are configurations to connect Interface configuration data identical with first object interface name and destination request parameter is remembered simultaneously for mouth file-name field and request parameters field Record, and if it exists, the return parameters in can then being recorded according to this are that corresponding first object return parameters are requested in interface simulation, And the first object return parameters are sent to terminal.
Further, if in database there is no configuration interface file-name field and request parameters field simultaneously with first object interface When name record identical with destination request parameter, miscue information can be sent to terminal.
In above-mentioned interface analogy method, by obtaining the interface configuration data to analog interface and being saved in database, When receiving the interface simulation request to this when analog interface, the return parameters for waiting for analog interface are inquired from database, Return parameters are back to terminal, to realize the simulation to interface function, allow front end developer interface not When completing exploitation, interface is called, the decoupling of front and back end development is realized, improves the effect of front end development Rate.
In one embodiment, further include relying on interface file-name field in above-mentioned interface configuration data record, will inquired To interface configuration data record in return parameters field be determined as interface simulation and request corresponding first object return parameters Later, the above method further include: the dependence interface file-name field in the interface configuration data inquired record is determined as second Target interface name;Ergodic data library, from database query configuration interface file-name field and request parameters field respectively with the second mesh The interface configuration data record that tag splice mouth name and destination request parameter match;It will be in the interface configuration data that inquired record Return parameters field be determined as interface simulation and request corresponding second target return parameters;First object return parameters are sent To terminal, comprising: first object return parameters and the second target return parameters are sent to terminal.
Specifically, since rear end is when carrying out interface exploitation, the partial function of some interfaces have with other interfaces it is overlapping, In this case, in order to reduce development cost, the dependence between interface is can be set in reduction code redundancy, for example, If containing the function of interface B in interface A, settable interface A depends on interface B, at this point, the dependence that interface B is interface A connects Mouthful, the corresponding dependence interface name of the entitled interface A of the corresponding interface of interface B.In the present embodiment, front end developer is treating simulation When interface is configured, can also configure to the corresponding dependence interface name of analog interface, in this way, server receive wait simulate It is contained in the interface configuration data of interface and relies on interface name, server, which will rely on interface name and save to interface configuration data, to be remembered Dependence interface file-name field in record.
Further, it is taken when server receives to treat the interface simulation request of analog interface and simulated in request according to interface The first object interface name and destination request parameter of band, can be from being inquired when query interface configuration data records from database To interface configuration data record in obtain rely on interface name, then by rely on interface name be determined as the second target interface name, after Continuous ergodic data library is asked with the second target interface name and target respectively with inquiring configuration interface file-name field and request parameters field The interface configuration data record for asking parameter to match, obtains the return of the second target again from the interface configuration data inquired Parameter, the second target return parameters and the interface inquired from database according to first object interface name and destination request parameter First object return parameters in configuration data record have collectively constituted interface simulation and have requested corresponding return parameters, obtain final To return parameters be sent to terminal.
In one embodiment, it is recorded interface configuration data is saved as an interface configuration data in database Before, the above method further include: obtain the corresponding data format of interface configuration data;Interface configuration data is saved as in database An interface configuration data record, comprising: when data format be preset format when, interface configuration data is saved as into database In an interface configuration data record;When data format is not preset format, form modifying prompting message is generated, by format Modification prompting message is sent to terminal.
Wherein, preset format is the format that front end developer, rear end developer arrange according to demand, such as can be with It is JSON format, XML format etc..In the present embodiment, after server gets interface configuration data, it is necessary first to obtain interface and match The format for setting each item data in data, judge the format of all data in interface configuration data whether all for preset format, If so, each field by the corresponding preservation of interface configuration data into database, if any one of its data are not default Format, then server fails to the preservation of configuration interface data, and server can generate form modifying prompting message, and be sent to end End, terminal is shown form modifying prompting message, to remind user to modify corresponding data.
It is appreciated that modified interface configuration data can be sent to service again by terminal after the completion of data modification Device, server judges whether the format of interface configuration data is preset format again, if so, can be reserved for pair into database The field answered.
In the present embodiment, school is carried out to the format of interface configuration data before saving interface configuration data to database It tests, it is ensured that the correctness and consistency of data format in database, to improve accuracy when interface simulation.
In one embodiment, it saves by interface configuration data to database, further includes: receive what terminal was sent Inquiry request carries query interface name in inquiry request;Ergodic data library, from database query configuration interface file-name field with look into Ask the matched interface configuration data record of interface famous prime minister;Inquired interface configuration data record is returned to terminal;It receives eventually It holds the modification to the interface configuration data record inquired to request, is corresponded to according to the user identifier inquiry carried in modification request User right;When the user right inquired meets preset condition, corresponding modification data are requested to update number according to modification According to library.
It specifically, can when the corresponding user of terminal needs to modify to the interface configuration data saved in database Inquiry request is sent by terminal to server first, and carries query interface name in inquiry request, wherein query interface name Refer to the corresponding interface name of interface to be checked, server is after receiving inquiry request, according to query interface name ergodic data Library returns to terminal and inquires when inquiring configuration interface field and the matched interface configuration data of query interface famous prime minister is recorded The interface configuration data record arrived, the interface configuration data that end-on receives are shown that the corresponding user of terminal can be to end The interface configuration data of end display is modified, and sends modification request to server,
It further, is the accuracy for guaranteeing data in database, server needs after receiving modification request to modification It requests corresponding user right to be verified, when being verified, can be corresponded to according to the user identifier inquiry carried in modification request User right, then judge whether the user right inquired meets preset condition, if satisfied, then being matched with modified interface Set the interface configuration data before the corresponding modification of the interface to be checked of this in data replacement data library;If not satisfied, then to terminal Return to the prompt information of modification failure.Wherein, what preset condition referred to pre-set can modify to the data in database User right.
It should be understood that although each step in the flow chart of Fig. 2 is successively shown according to the instruction of arrow, this A little steps are not that the inevitable sequence according to arrow instruction successively executes.Unless expressly state otherwise herein, these steps It executes there is no the limitation of stringent sequence, these steps can execute in other order.Moreover, at least part in Fig. 2 Step may include that perhaps these sub-steps of multiple stages or stage are executed in synchronization to multiple sub-steps It completes, but can execute at different times, the execution sequence in these sub-steps or stage, which is also not necessarily, successively to be carried out, But it can be executed in turn or alternately at least part of the sub-step or stage of other steps or other steps.
In one embodiment, as shown in figure 3, providing a kind of interface simulator 300, comprising:
Interface configuration data obtains module 302, and for obtaining to the corresponding interface configuration data of analog interface, interface is matched It sets the interface configuration data that data save as in database to record, includes configuration interface name in interface configuration data record Section, request parameters field and return parameters field;
Interface simulates request receiving module 304, for receiving the interface simulation request for treating analog interface of terminal transmission;
Parsing module 306, for receive interface simulation request parse, with obtain first object interface name and Destination request parameter;
Enquiry module 308 is used for ergodic data library, query configuration interface file-name field and request parameters field from database The interface configuration data record to match respectively with first object interface name and destination request parameter;
First object return parameters determining module 310, for the return in recording the interface configuration data inquired Parameter field, which is determined as interface simulation, requests corresponding first object return parameters;
Sending module 312, for first object return parameters to be sent to terminal.
It further include in one of the embodiments, relying on interface file-name field in interface configuration data record;Above-mentioned apparatus is also It include: the second target return parameters determining module, for the dependence interface name in recording the interface configuration data inquired Field is determined as the second target interface name;Ergodic data library, query configuration interface file-name field and required parameter word from database The interface configuration data record that section matches with the second target interface name and destination request parameter respectively;The interface that will be inquired Return parameters field in configuration data record, which is determined as interface simulation, requests corresponding second target return parameters;Sending module It is also used to first object return parameters and the second target return parameters being sent to terminal.
In one of the embodiments, interface configuration data obtain module be also used to receive terminal transmission pass through visualization The interface configuration data that configuration interface obtains.
Above-mentioned apparatus in one of the embodiments, further include: data format obtains module, for obtaining interface configuration number According to corresponding data format;Interface configuration data obtains module and is also used to configure interface when data format is preset format Data save as the record of an interface configuration data in database;When data format is not preset format, generates format and repair Change prompting message, form modifying prompting message is sent to terminal.
Above-mentioned apparatus in one of the embodiments, further include: interface configuration data modified module, for receiving terminal hair The inquiry request sent carries query interface name in inquiry request;Ergodic data library, the query configuration interface file-name field from database It is recorded with the matched interface configuration data of query interface famous prime minister;Inquired interface configuration data record is returned to terminal;It connects It receives terminal to request the modification of the interface configuration data record inquired, be inquired according to the user identifier carried in modification request Corresponding user right;When the user right inquired meets preset condition, corresponding modification data are requested more according to modification New database.
Specific about interface simulator limits the restriction that may refer to above for interface analogy method, herein not It repeats again.Modules in above-mentioned interface simulator can be realized fully or partially through software, hardware and combinations thereof.On Stating each module can be embedded in the form of hardware or independently of in the processor in computer equipment, can also store in a software form In memory in computer equipment, the corresponding operation of the above modules is executed in order to which processor calls.
In one embodiment, a kind of computer equipment is provided, which can be server, internal junction Composition can be as shown in Figure 4.The computer equipment include by system bus connect processor, memory, network interface and Database.Wherein, the processor of the computer equipment is for providing calculating and control ability.The memory packet of the computer equipment Include non-volatile memory medium, built-in storage.The non-volatile memory medium is stored with operating system, computer program and data Library.The built-in storage provides environment for the operation of operating system and computer program in non-volatile memory medium.The calculating The database of machine equipment is used for memory interface configuration data.The network interface of the computer equipment is used to pass through with external terminal Network connection communication.To realize a kind of interface analogy method when the computer program is executed by processor.
It will be understood by those skilled in the art that structure shown in Fig. 4, only part relevant to application scheme is tied The block diagram of structure does not constitute the restriction for the computer equipment being applied thereon to application scheme, specific computer equipment It may include perhaps combining certain components or with different component layouts than more or fewer components as shown in the figure.
In one embodiment, a kind of computer equipment, including memory and processor are provided, which is stored with Computer program, the processor perform the steps of acquisition to analog interface corresponding interface configuration when executing computer program Interface configuration data is saved as the record of an interface configuration data in database, wrapped in interface configuration data record by data Include configuration interface file-name field, request parameters field and return parameters field;Receive the interface for treating analog interface that terminal is sent Simulation request;The interface simulation request received is parsed, to obtain first object interface name and destination request parameter;Time Go through database, from database query configuration interface file-name field and request parameters field respectively with first object interface name and target The interface configuration data record that required parameter matches;By the return parameters field in the interface configuration data inquired record It is determined as interface simulation and requests corresponding first object return parameters;First object return parameters are sent to terminal.
It in one embodiment, further include relying on interface file-name field in interface configuration data record;It will be inquired Return parameters field in interface configuration data record is determined as after the corresponding first object return parameters of interface simulation request, Processor is also performed the steps of when executing computer program by the dependence interface in the interface configuration data inquired record File-name field is determined as the second target interface name;Ergodic data library, query configuration interface file-name field and required parameter from database The interface configuration data record that field matches with the second target interface name and destination request parameter respectively;It is connect what is inquired Return parameters field in mouth configuration data record, which is determined as interface simulation, requests corresponding second target return parameters;By first Target return parameters are sent to terminal, comprising: first object return parameters and the second target return parameters are sent to terminal.
In one embodiment, it obtains to the corresponding interface configuration data of analog interface, comprising: receive connecing for terminal transmission Mouth configuration data, interface configuration data are the data that terminal is obtained by visual configuration interface.
In one embodiment, it is recorded interface configuration data is saved as an interface configuration data in database Before, processor also performs the steps of when executing computer program obtains the corresponding data format of interface configuration data;By interface Configuration data saves as the record of an interface configuration data in database, comprising: when data format is preset format, will connect Mouth configuration data saves as the record of an interface configuration data in database;When data format is not preset format, generate Form modifying prompting message is sent to terminal by form modifying prompting message.
In one embodiment, it saves by interface configuration data to database, processor executes computer program When also perform the steps of and receive the inquiry request that terminal is sent, query interface name is carried in inquiry request;Ergodic data library, Query configuration interface file-name field and the matched interface configuration data of query interface famous prime minister record from database;Institute is returned to terminal The interface configuration data record inquired;Terminal is received to request the modification of the interface configuration data record inquired, according to The user identifier carried in modification request inquires corresponding user right;When the user right inquired meets preset condition, Corresponding modification data more new database is requested according to modification.
In one embodiment, a kind of computer readable storage medium is provided, computer program is stored thereon with, is calculated Machine program performs the steps of acquisition to analog interface corresponding interface configuration data when being executed by processor, interface is configured Data save as the record of an interface configuration data in database, include configuration interface name in interface configuration data record Section, request parameters field and return parameters field;Receive the interface simulation request for treating analog interface that terminal is sent;To reception To interface simulation request parsed, to obtain first object interface name and destination request parameter;Ergodic data library, from data Query configuration interface file-name field and request parameters field match with first object interface name and destination request parameter respectively in library Interface configuration data record;Return parameters field in the interface configuration data inquired record is determined as interface simulation Request corresponding first object return parameters;First object return parameters are sent to terminal.
It in one embodiment, further include relying on interface file-name field in interface configuration data record;It will be inquired Return parameters field in interface configuration data record is determined as after the corresponding first object return parameters of interface simulation request, It is also performed the steps of when computer program is executed by processor and connects the dependence in the interface configuration data inquired record Mouth file-name field is determined as the second target interface name;Ergodic data library, query configuration interface file-name field and request ginseng from database The interface configuration data record that digital section matches with the second target interface name and destination request parameter respectively;By what is inquired Return parameters field in interface configuration data record, which is determined as interface simulation, requests corresponding second target return parameters;By One target return parameters are sent to terminal, comprising: first object return parameters and the second target return parameters are sent to terminal.
In one embodiment, it obtains to the corresponding interface configuration data of analog interface, comprising: receive connecing for terminal transmission Mouth configuration data, interface configuration data are the data that terminal is obtained by visual configuration interface.
In one embodiment, it is recorded interface configuration data is saved as an interface configuration data in database Before, it is also performed the steps of when computer program is executed by processor and obtains the corresponding data format of interface configuration data;It will connect Mouth configuration data saves as the record of an interface configuration data in database, comprising:, will when data format is preset format Interface configuration data saves as the record of an interface configuration data in database;It is raw when data format is not preset format At form modifying prompting message, form modifying prompting message is sent to terminal.
In one embodiment, it saves by interface configuration data to database, computer program is held by processor It is also performed the steps of when row and receives the inquiry request that terminal is sent, carry query interface name in inquiry request;Ergodic data Library, query configuration interface file-name field and the matched interface configuration data of query interface famous prime minister record from database;It is returned to terminal Return inquired interface configuration data record;Terminal is received to request the modification of the interface configuration data record inquired, Corresponding user right is inquired according to the user identifier carried in modification request;When the user right inquired meets preset condition When, corresponding modification data more new database is requested according to modification.
Those of ordinary skill in the art will appreciate that realizing all or part of the process in above-described embodiment method, being can be with Relevant hardware is instructed to complete by computer program, the computer program can be stored in a non-volatile computer In read/write memory medium, the computer program is when being executed, it may include such as the process of the embodiment of above-mentioned each method.Wherein, To any reference of memory, storage, database or other media used in each embodiment provided herein, Including non-volatile and/or volatile memory.Nonvolatile memory may include read-only memory (ROM), programming ROM (PROM), electrically programmable ROM (EPROM), electrically erasable ROM (EEPROM) or flash memory.Volatile memory may include Random access memory (RAM) or external cache.By way of illustration and not limitation, RAM is available in many forms, Such as static state RAM (SRAM), dynamic ram (DRAM), synchronous dram (SDRAM), double data rate sdram (DDRSDRAM), enhancing Type SDRAM (ESDRAM), synchronization link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic ram (DRDRAM) and memory bus dynamic ram (RDRAM) etc..
Each technical characteristic of above embodiments can be combined arbitrarily, for simplicity of description, not to above-described embodiment In each technical characteristic it is all possible combination be all described, as long as however, the combination of these technical characteristics be not present lance Shield all should be considered as described in this specification.
The several embodiments of the application above described embodiment only expresses, the description thereof is more specific and detailed, but simultaneously It cannot therefore be construed as limiting the scope of the patent.It should be pointed out that coming for those of ordinary skill in the art It says, without departing from the concept of this application, various modifications and improvements can be made, these belong to the protection of the application Range.Therefore, the scope of protection shall be subject to the appended claims for the application patent.

Claims (10)

1. a kind of interface analogy method, which comprises
It obtains to the corresponding interface configuration data of analog interface, one interface configuration data saved as in database connects Mouth configuration data records, and includes that configuration interface file-name field, request parameters field and return are joined in the interface configuration data record Digital section;
Receive terminal transmission simulates request to the interface to analog interface;
The interface simulation request received is parsed, to obtain first object interface name and destination request parameter;
The database is traversed, query configuration interface file-name field and request parameters field are respectively with described from the database The interface configuration data record that one target interface name and the destination request parameter match;
It is corresponding that return parameters field in the interface configuration data inquired record is determined as the interface simulation request First object return parameters;
The first object return parameters are sent to terminal.
2. the method according to claim 1, wherein further including relying on interface in interface configuration data record File-name field;
It is determined as the interface simulation request in the return parameters field by the interface configuration data inquired record After corresponding first object return parameters, further includes:
Dependence interface file-name field in the interface configuration data inquired record is determined as the second target interface name;
The database is traversed, query configuration interface file-name field and request parameters field are respectively with described from the database The interface configuration data record that two target interface names and the destination request parameter match;
It is corresponding that return parameters field in the interface configuration data inquired record is determined as the interface simulation request Second target return parameters;
It is described that the first object return parameters are sent to terminal, comprising:
The first object return parameters and the second target return parameters are sent to terminal.
3. the method according to claim 1, wherein described obtain configures number to the corresponding interface of analog interface According to, comprising:
The interface configuration data that terminal is sent is received, the interface configuration data is that the terminal is obtained by visual configuration interface The data taken.
4. according to claim 1 to method described in 3 any one, which is characterized in that saved by the interface configuration data Before the interface configuration data record in database, further includes:
Obtain the corresponding data format of the interface configuration data;
It is described that the interface configuration data is saved as into the record of an interface configuration data in database, comprising:
When the data format is preset format, the interface configuration data is saved as into the configuration of an interface in database Data record;
When the data format is not preset format, form modifying prompting message is generated, form modifying prompting message is sent To the terminal.
5. the method according to claim 1, wherein by the interface configuration data save to database it Afterwards, further includes:
The inquiry request that terminal is sent is received, carries query interface name in the inquiry request;
Traverse the database, from the database query configuration interface file-name field with the query interface famous prime minister is matched connects Mouth configuration data record;
Inquired interface configuration data record is returned to terminal;
It receives terminal to request the modification of the interface configuration data record inquired, be marked according to the user carried in modification request Know and inquires corresponding user right;
When the user right inquired meets preset condition, corresponding modification data are requested to update the number according to the modification According to library.
6. a kind of interface simulator, which is characterized in that described device includes:
Interface configuration data obtains module, and for obtaining to the corresponding interface configuration data of analog interface, the interface is configured Data save as the record of an interface configuration data in database, include configuration interface name in the interface configuration data record Field, request parameters field and return parameters field;
Interface simulates request receiving module, for receiving requesting the interface simulation to analog interface for terminal transmission;
Parsing module, for being parsed to the interface simulation request received, to obtain first object interface name and mesh Mark required parameter;
Enquiry module, for traversing the database, query configuration interface file-name field and required parameter word from the database The interface configuration data record that section matches with the first object interface name and the destination request parameter respectively;
First object return parameters determining module, for the return parameters field in recording the interface configuration data inquired It is determined as the interface simulation and requests corresponding first object return parameters;
Sending module, for the first object return parameters to be sent to terminal.
7. device according to claim 6, which is characterized in that further include relying on interface in the interface configuration data record File-name field;Described device further include:
Second target return parameters determining module, for the dependence interface name in recording the interface configuration data inquired Section is determined as the second target interface name;The database is traversed, from the database query configuration interface file-name field and request The interface configuration data record that parameter field matches with the second target interface name and the destination request parameter respectively;It will The return parameters field in interface configuration data record inquired, which is determined as the interface simulation, requests corresponding second mesh Mark return parameters;
The sending module is also used to the first object return parameters and the second target return parameters being sent to terminal.
8. device according to claim 6, which is characterized in that interface configuration data obtains module and is also used to receive terminal hair The interface configuration data obtained by visual configuration interface sent.
9. a kind of computer equipment, including memory and processor, the memory are stored with computer program, feature exists In the step of processor realizes any one of claims 1 to 5 the method when executing the computer program.
10. a kind of computer readable storage medium, is stored thereon with computer program, which is characterized in that the computer program The step of method described in any one of claims 1 to 5 is realized when being executed by processor.
CN201910228302.7A 2019-03-25 2019-03-25 Interface analogy method, device, computer equipment and storage medium Pending CN110109656A (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201910228302.7A CN110109656A (en) 2019-03-25 2019-03-25 Interface analogy method, device, computer equipment and storage medium
PCT/CN2019/118071 WO2020192141A1 (en) 2019-03-25 2019-11-13 Method and device for simulating interface, computer apparatus, and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910228302.7A CN110109656A (en) 2019-03-25 2019-03-25 Interface analogy method, device, computer equipment and storage medium

Publications (1)

Publication Number Publication Date
CN110109656A true CN110109656A (en) 2019-08-09

Family

ID=67484566

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910228302.7A Pending CN110109656A (en) 2019-03-25 2019-03-25 Interface analogy method, device, computer equipment and storage medium

Country Status (2)

Country Link
CN (1) CN110109656A (en)
WO (1) WO2020192141A1 (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110955712A (en) * 2019-11-26 2020-04-03 北京天元创新科技有限公司 Development API processing method and device based on multiple data sources
CN111352610A (en) * 2020-03-03 2020-06-30 五八有限公司 Interface return value modification method and device, electronic equipment and storage medium
WO2020192141A1 (en) * 2019-03-25 2020-10-01 平安科技(深圳)有限公司 Method and device for simulating interface, computer apparatus, and storage medium
CN112035282A (en) * 2020-09-01 2020-12-04 北京百度网讯科技有限公司 API management method, device, equipment and storage medium applied to cloud platform
CN112925803A (en) * 2021-04-09 2021-06-08 泰康保险集团股份有限公司 Data processing method and device of interface

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104881343A (en) * 2014-02-27 2015-09-02 北京京东尚科信息技术有限公司 Testing method and testing system
CN106155891A (en) * 2015-04-02 2016-11-23 阿里巴巴集团控股有限公司 Interface test method, interface description data library generating method and device
CN107480053A (en) * 2017-07-21 2017-12-15 杭州销冠网络科技有限公司 A kind of Software Test Data Generation Method and device
CN108268253A (en) * 2017-05-05 2018-07-10 平安科技(深圳)有限公司 Interface code generation method and terminal device
CN108268570A (en) * 2017-01-04 2018-07-10 武汉斗鱼网络科技有限公司 A kind of method and device of development interface
CN108427631A (en) * 2017-02-14 2018-08-21 北京京东尚科信息技术有限公司 A kind of application test systems, method, electronic equipment and readable storage medium storing program for executing
CN109446063A (en) * 2018-09-18 2019-03-08 深圳壹账通智能科技有限公司 Interface test method, device, computer equipment and storage medium

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108255905B (en) * 2017-05-04 2019-10-01 平安科技(深圳)有限公司 Interface calls data processing method, device and computer equipment
CN108804336A (en) * 2018-06-15 2018-11-13 深圳壹账通智能科技有限公司 Interactive system test method, device, computer equipment and storage medium
CN110109656A (en) * 2019-03-25 2019-08-09 平安科技(深圳)有限公司 Interface analogy method, device, computer equipment and storage medium

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104881343A (en) * 2014-02-27 2015-09-02 北京京东尚科信息技术有限公司 Testing method and testing system
CN106155891A (en) * 2015-04-02 2016-11-23 阿里巴巴集团控股有限公司 Interface test method, interface description data library generating method and device
CN108268570A (en) * 2017-01-04 2018-07-10 武汉斗鱼网络科技有限公司 A kind of method and device of development interface
CN108427631A (en) * 2017-02-14 2018-08-21 北京京东尚科信息技术有限公司 A kind of application test systems, method, electronic equipment and readable storage medium storing program for executing
CN108268253A (en) * 2017-05-05 2018-07-10 平安科技(深圳)有限公司 Interface code generation method and terminal device
CN107480053A (en) * 2017-07-21 2017-12-15 杭州销冠网络科技有限公司 A kind of Software Test Data Generation Method and device
CN109446063A (en) * 2018-09-18 2019-03-08 深圳壹账通智能科技有限公司 Interface test method, device, computer equipment and storage medium

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2020192141A1 (en) * 2019-03-25 2020-10-01 平安科技(深圳)有限公司 Method and device for simulating interface, computer apparatus, and storage medium
CN110955712A (en) * 2019-11-26 2020-04-03 北京天元创新科技有限公司 Development API processing method and device based on multiple data sources
CN111352610A (en) * 2020-03-03 2020-06-30 五八有限公司 Interface return value modification method and device, electronic equipment and storage medium
CN112035282A (en) * 2020-09-01 2020-12-04 北京百度网讯科技有限公司 API management method, device, equipment and storage medium applied to cloud platform
CN112035282B (en) * 2020-09-01 2023-07-25 北京百度网讯科技有限公司 API management method, device and equipment applied to cloud platform and storage medium
CN112925803A (en) * 2021-04-09 2021-06-08 泰康保险集团股份有限公司 Data processing method and device of interface

Also Published As

Publication number Publication date
WO2020192141A1 (en) 2020-10-01

Similar Documents

Publication Publication Date Title
CN110109656A (en) Interface analogy method, device, computer equipment and storage medium
CN111625452B (en) Flow playback method and system
CN108897691A (en) Data processing method, device, server and medium based on interface analog service
CN108573371A (en) The data measures and procedures for the examination and approval, device, computer equipment and storage medium
CN108234641A (en) Data read-write method and device based on distributed consensus protocol realization
CN111221726A (en) Test data generation method and device, storage medium and intelligent equipment
CN109788032A (en) Acquisition methods, device, computer equipment and the storage medium of image file
CN109586948A (en) Update method, apparatus, computer equipment and the storage medium of system configuration data
CN110209652A (en) Tables of data moving method, device, computer equipment and storage medium
CN109816563A (en) Electronic contract template circulation method, apparatus, computer equipment and storage medium
CN109788031A (en) Business datum acquisition methods, device, computer equipment and storage medium
CN110069297A (en) Abnormality eliminating method, device, computer equipment and storage medium based on Spring MVC
CN108491367A (en) Method, apparatus, computer equipment and the storage medium that report file generates
CN109614147A (en) A kind of PHY register reading/writing method and device
CN109785024A (en) Invoice data processing method, device, computer equipment and storage medium
CN110474959A (en) Data interactive method, device, computer equipment and storage medium
CN109492181A (en) Method for page jump, device, computer equipment and storage medium
CN109816364A (en) Transaction data processing method, device, computer equipment and storage medium
CN109814917A (en) Micro services dissemination method, device, computer equipment and storage medium
CN112559635A (en) Service processing method, device, equipment and medium for Ether house alliance link node
CN109767316A (en) Regular configuration method, device, computer equipment and storage medium
CN109325058A (en) Regular batch comparison method, device, computer equipment and storage medium
CN106990974B (en) APP updating method and device and electronic equipment
CN110275703A (en) Assignment method, device, computer equipment and the storage medium of key-value pair data
CN109299875A (en) Data tracking processing method, device, computer equipment 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