CN107577622B - Method, device and storage medium for simulating rear-end interface - Google Patents
Method, device and storage medium for simulating rear-end interface Download PDFInfo
- Publication number
- CN107577622B CN107577622B CN201710650299.9A CN201710650299A CN107577622B CN 107577622 B CN107577622 B CN 107577622B CN 201710650299 A CN201710650299 A CN 201710650299A CN 107577622 B CN107577622 B CN 107577622B
- Authority
- CN
- China
- Prior art keywords
- interface
- simulation
- configuration file
- data
- backend
- 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.)
- Active
Links
Images
Landscapes
- User Interface Of Digital Computer (AREA)
- Debugging And Monitoring (AREA)
Abstract
The invention discloses a method, a device and a storage medium for simulating a rear-end interface, wherein the method comprises the following steps: when the interface definition data is monitored, generating a back-end configuration file according to the interface definition data, and generating simulation interface return data according to the back-end configuration file; displaying the data returned by the simulation interface, and transmitting the back-end configuration file to a local simulation back-end so that the local simulation back-end can generate a simulation interface based on the back-end configuration file; and receiving and displaying interface generation information and a simulation interface address returned by the local simulation backend based on the backend configuration file. The invention can effectively avoid code errors caused by manual operation and improve the front-end development efficiency.
Description
Technical Field
The invention relates to the field of internet, in particular to a method, equipment and a storage medium for simulating a back-end interface.
Background
With the rise of different terminals (Pad/Mobile/PC), the requirement on developers is higher, the response type of a pure browser cannot meet the high requirement on user experience, and customized versions are often required to be developed for different terminals. To improve the front-end and back-end development efficiency, the front-end and the back-end are usually separated, the back-end is responsible for the service/data interface, and the front-end is responsible for the presentation/interaction logic. For the front-end development, the data is finally exposed, while the development is often performed synchronously, and in the case that the back-end interface is not completed, the data defined by the back-end interface needs to be simulated.
The existing solution is to provide a fixed data format, and then write more codes according to the fixed data format, so as to obtain analog data. Therefore, the existing interface simulation method of the front end has the problems of fixed data format, easy occurrence of code errors and low front end development efficiency.
The above is only for the purpose of assisting understanding of the technical aspects of the present invention, and does not represent an admission that the above is prior art.
Disclosure of Invention
The invention mainly aims to provide a method, equipment and a storage medium for simulating a back-end interface, aiming at solving the technical problems of fixed data format, easy occurrence of code errors and low front-end development efficiency.
In order to achieve the above object, the present invention provides a method for simulating a backend interface, including the steps of:
when the interface definition data is monitored, generating a back-end configuration file according to the interface definition data, and generating simulation interface return data according to the back-end configuration file;
displaying the data returned by the simulation interface, and transmitting the back-end configuration file to a local simulation back-end so that the local simulation back-end can generate a simulation interface based on the back-end configuration file;
and receiving and displaying interface generation information and a simulation interface address returned by the local simulation backend based on the backend configuration file.
Optionally, the step of generating a backend configuration file according to the interface definition data includes:
acquiring code annotation information from the interface definition data, and filtering the interface definition data according to the code annotation information;
and generating a back-end configuration file according to the filtered interface definition data.
Optionally, before the step of generating a backend configuration file according to the interface definition data and generating simulation interface return data according to the backend configuration file, the backend interface simulation method further includes:
when the interface definition data is monitored, acquiring a data format of the interface definition data;
judging whether the data format is a preset data format or not;
if the data format is a preset data format, executing the step of generating a back-end configuration file according to the interface definition data and generating simulation interface return data according to the back-end configuration file;
and if the data format is not the preset data format, generating format reminding information and displaying the format reminding information.
Optionally, after the step of receiving and displaying the interface generation information and the simulation interface address returned by the local simulation backend based on the backend configuration file, the backend interface simulation method further includes:
judging whether the simulation interface is a historical simulation interface or not according to the simulation interface address;
if the simulation interface is a historical simulation interface, acquiring the historical simulation interface according to the simulation interface address, and covering the historical simulation interface as the simulation interface;
and if the simulation interface is not the historical simulation interface, adding the simulation interface address to a simulation interface list.
Optionally, the backend interface simulation method further includes:
when a triggered simulation interface preview instruction is monitored, displaying each established simulation interface according to the simulation interface preview instruction, and displaying an interface address, a request type, a failure probability and interface data return duration of each simulation interface.
Optionally, the analog interface return data includes a geographic location, an IP address, a character string, a picture, and a number.
In addition, to achieve the above object, the present invention also provides a backend interface simulation apparatus, including: a memory, a processor, and a back-end interface emulator stored on the memory and executable on the processor, the back-end interface emulator when executed by the processor implementing the steps of:
when the interface definition data is monitored, generating a back-end configuration file according to the interface definition data, and generating simulation interface return data according to the back-end configuration file;
displaying the data returned by the simulation interface, and transmitting the back-end configuration file to a local simulation back-end so that the local simulation back-end can generate a simulation interface based on the back-end configuration file;
and receiving and displaying interface generation information and a simulation interface address returned by the local simulation backend based on the backend configuration file.
The present invention also provides a computer-readable storage medium having a backend interface simulation program stored thereon, the backend interface simulation program when executed by a processor implementing the steps of:
when the interface definition data is monitored, generating a back-end configuration file according to the interface definition data, and generating simulation interface return data according to the back-end configuration file;
displaying the data returned by the simulation interface, and transmitting the back-end configuration file to a local simulation back-end so that the local simulation back-end can generate a simulation interface based on the back-end configuration file;
and receiving and displaying interface generation information and a simulation interface address returned by the local simulation backend based on the backend configuration file.
The invention can automatically generate a back-end configuration file according to interface definition data when monitoring the interface definition data, generate simulation interface return data according to the back-end configuration file, display the simulation interface return data, transmit the back-end configuration file to a local simulation back end so that the local simulation back end generates a simulation interface based on the back-end configuration file, and finally receive and display interface generation information and a simulation interface address returned by the local simulation back end based on the back-end configuration file, the scheme can automatically generate the back-end configuration file according to the interface definition data by monitoring the interface definition data, generate the simulation interface return data according to the back-end configuration file, can generate simulation interface return data with different formats according to needs, does not need developers to manually modify and configure data for many times, and effectively avoids code errors caused by manual operation, in addition, the back-end configuration file is transmitted to the local simulation back-end to generate the simulation interface, the simulation interface address is returned, the correctness of the simulation interface is verified, the front-end development without depending on the back-end is realized, and the front-end development efficiency is improved.
Drawings
FIG. 1 is a schematic diagram of an apparatus architecture of a hardware operating environment according to an embodiment of the present invention;
FIG. 2 is a schematic flow chart illustrating a method for simulating a backend interface according to a first embodiment of the present invention;
FIG. 3 is a schematic view of a detailed flow chart of the step of generating a backend profile according to the interface definition data in FIG. 2;
FIG. 4 is a flowchart illustrating a method for simulating a backend interface according to a second embodiment of the present invention;
fig. 5 is a flowchart illustrating a method for simulating a backend interface according to a third embodiment of the present invention.
The implementation, functional features and advantages of the objects of the present invention will be further explained with reference to the accompanying drawings.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
The main solution of the embodiment of the invention is as follows: when the interface definition data is monitored, a back-end configuration file is automatically generated according to the interface definition data, simulation interface return data is generated according to the back-end configuration file, then the simulation interface return data is displayed, the back-end configuration file is transmitted to a local simulation back end so that the local simulation back end can generate a simulation interface based on the back-end configuration file, and finally, interface generation information and a simulation interface address returned by the local simulation back end based on the back-end configuration file are received and displayed.
Because the existing solution usually provides a fixed data format, and then writes more codes according to the fixed data format, so as to obtain the analog data, because the data format of the analog data is fixed and the codes are more, when a plurality of data are needed, developers need to manually modify and configure for many times, code errors are easy to occur, and the front-end development efficiency is low. Therefore, the existing interface simulation method of the front end has the problems of fixed data format, easy occurrence of code errors and low front end development efficiency.
Therefore, according to the scheme, the interface definition data is monitored, the back-end configuration file can be automatically generated according to the interface definition data, the simulation interface return data is generated according to the back-end configuration file, the simulation interface return data with different formats can be generated according to needs, developers do not need to manually modify and repeatedly configure the data, code errors caused by manual operation are effectively avoided, the front-end development efficiency is improved, in addition, the back-end configuration file is transmitted to the local simulation back end to generate the simulation interface, the simulation interface address is returned, the correctness of the simulation interface is verified, the front end is developed without depending on the back end, and the front-end development efficiency is improved.
As shown in fig. 1, fig. 1 is a schematic device structure diagram of a hardware operating environment according to an embodiment of the present invention.
The device of the embodiment of the invention can be a fixed terminal device such as a PC (personal computer) and the like, and can also be a mobile terminal device with a display function such as a smart phone, a tablet computer, a portable computer and the like.
As shown in fig. 1, the apparatus may include: a processor 1001, such as a CPU, a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. Wherein a communication bus 1002 is used to enable connective communication between these components. The user interface 1003 may include a Display screen (Display), an input unit such as a Keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface, a wireless interface. The network interface 1004 may optionally include a standard wired interface, a wireless interface (e.g., WI-FI interface). The memory 1005 may be a high-speed RAM memory or a non-volatile memory (e.g., a magnetic disk memory). The memory 1005 may alternatively be a storage device separate from the processor 1001.
Those skilled in the art will appreciate that the configuration of the apparatus shown in fig. 1 is not intended to be limiting of the apparatus and may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components.
As shown in fig. 1, a memory 1005, which is a kind of computer storage medium, may include therein an operating system, a network communication module, a user interface module, and a backend interface simulation program.
In the device shown in fig. 1, the processor 1001 may be configured to call a backend interface simulation program stored in the memory 1005 and perform the following steps:
when the interface definition data is monitored, generating a back-end configuration file according to the interface definition data, and generating simulation interface return data according to the back-end configuration file;
displaying the data returned by the simulation interface, and transmitting the back-end configuration file to a local simulation back-end so that the local simulation back-end can generate a simulation interface based on the back-end configuration file;
and receiving and displaying interface generation information and a simulation interface address returned by the local simulation backend based on the backend configuration file.
Further, the step of generating a backend configuration file according to the interface definition data includes:
acquiring code annotation information from the interface definition data, and filtering the interface definition data according to the code annotation information;
and generating a back-end configuration file according to the filtered interface definition data.
Further, the processor 1001 may call a backend interface simulation program stored in the memory 1005, and further perform the following steps:
when the interface definition data is monitored, acquiring a data format of the interface definition data;
judging whether the data format is a preset data format or not;
if the data format is a preset data format, generating a back-end configuration file according to the interface definition data, and generating simulation interface return data according to the back-end configuration file;
and if the data format is not the preset data format, generating format reminding information and displaying the format reminding information.
Further, the processor 1001 may call a backend interface simulation program stored in the memory 1005, and further perform the following steps:
judging whether the simulation interface is a historical simulation interface or not according to the simulation interface address;
if the simulation interface is a historical simulation interface, acquiring the historical simulation interface according to the simulation interface address, and covering the historical simulation interface as the simulation interface;
and if the simulation interface is not the historical simulation interface, adding the simulation interface address to a simulation interface list.
Further, the processor 1001 may call a backend interface simulation program stored in the memory 1005, and further perform the following steps:
when a triggered simulation interface preview instruction is monitored, displaying each established simulation interface according to the simulation interface preview instruction, and displaying an interface address, a request type, a failure probability and interface data return duration of each simulation interface.
The specific embodiment of the back-end interface simulation device of the present invention is substantially the same as the specific embodiments of the back-end interface simulation method described below, and will not be described herein again.
The invention also provides a method for simulating the rear-end interface.
Referring to fig. 2, fig. 2 is a flowchart illustrating a method for simulating a backend interface according to a first embodiment of the present invention.
In this embodiment, the method for simulating a backend interface includes:
step S101, when monitoring interface definition data, generating a back-end configuration file according to the interface definition data, and generating simulation interface return data according to the back-end configuration file;
the back-end interface simulation method is applied to back-end interface simulation equipment, the back-end interface simulation equipment comprises a display screen, a local simulation back end and a front-end uploading module, and the back-end interface simulation equipment further comprises a memory, and a back-end interface simulation program is stored in the memory. After the back-end interface simulation equipment runs the back-end simulation program, the display screen display interface defines a data input interface, the interface defines the data input interface and displays an interface address configuration frame, a request method configuration frame and a failure probability configuration frame, a developer can configure an interface address through the interface address configuration frame, configure a request method through the request method configuration frame, configure failure probability through the failure probability configuration frame, the interface address is an access path simulating a real service request, the request method comprises a post, a get, a patch and the like, and the failure probability is a failure condition simulating the real service request; the interface definition data input interface also displays an input box of interface definition data, developers can input the interface definition data through the input box, and the interface definition data are data of interfaces, request and response formats of the interfaces and the like determined by the back end and the front end according to requirements.
The back-end interface simulation equipment runs the back-end simulation program, when monitoring that interface definition data input by a developer based on an input box exists, namely the interface definition data exist in the input box, a back-end configuration file is generated according to the interface definition data, and simulation interface return data are generated according to the configuration file. The back-end configuration file comprises an interface address, a request method, failure probability, interface return data duration and the like, the analog interface return data comprises a geographic position, an IP address, a character string, a picture, numbers and the like, the geographic position, the IP address, the character string, the picture and the numbers are random, but the data range of the geographic position, the IP address, the character string, the picture and the numbers is controllable, and the analog interface return data is used for simulating data returned by a real interface.
Specifically, referring to fig. 3, fig. 3 is a schematic view of a detailed flow of step S101 in fig. 2, where step S101 includes:
step S1011, obtaining code annotation information from the interface definition data, and filtering the interface definition data according to the code annotation information;
step S1012, a back-end configuration file is generated according to the filtered interface definition data.
The back-end interface simulation equipment acquires code annotation information from the interface definition data after acquiring the interface definition data, filters the interface definition data according to the code annotation information, namely filters the code annotation information from the interface definition data to acquire configuration codes, then generates a back-end configuration file according to the filtered interface definition data, namely generates a back-end configuration file according to the configuration codes, and then generates simulation interface return data according to the back-end configuration file. In specific implementation, when the interface definition data is monitored, format verification is performed on the interface definition data, and after the format verification is passed, a back-end configuration file is generated according to the interface definition data.
Step S102, displaying the data returned by the simulation interface, and transmitting the back-end configuration file to a local simulation back-end, so that the local simulation back-end generates a simulation interface based on the back-end configuration file;
after the back-end interface simulation equipment generates simulation interface return data, the simulation interface return data is displayed through a display screen, meanwhile, the back-end configuration file is transmitted to the local simulation back end, and a corresponding simulation interface is generated on the basis of the back-end configuration file through the local back end, namely, the simulation interface is generated according to an interface address, a request method, a failure probability and interface return data time. In specific implementation, after the back-end configuration file is transmitted to the local simulation back-end, the back-end configuration file is stored in the API directory, the local simulation back-end traverses all list files in the API directory, reads each back-end configuration file, and then generates a corresponding simulation interface according to each back-end configuration file.
Step S103, receiving and displaying the interface generation information and the simulation interface address returned by the local simulation backend based on the backend configuration file.
After a local simulation back end in the back end interface simulation equipment generates a simulation interface, a simulation interface address and interface generation information are transmitted to a display screen, and the interface generation information and the simulation interface address are displayed through the display screen, wherein the interface generation information comprises interface generation completion and interface generation incompletion and is used for indicating whether the simulation interface is generated or not. In a specific implementation, the simulation interface address is the same as the configured interface address, which indicates that the interface between the front end and the back end has been debugged, and the simulation interface address is different from the configured interface address, which indicates that the interface between the front end and the back end has not been debugged and needs to be debugged again.
In another specific implementation, the backend interface simulation device further includes an agent simulation server, where the backend configuration file includes a cross-domain backend configuration file and a non-cross-domain backend configuration file, if the backend configuration file is cross-domain, the backend configuration file is stored in an agent API directory, if the backend configuration file is non-cross-domain, the backend configuration file is stored in a non-agent API directory, a directory of the backend configuration file read by the local simulation backend is an agent API directory, a simulation interface is generated according to the backend configuration file, and an interface address and interface generation information of the simulation interface are forwarded by the agent simulation server, so as to simulate a real cross-domain service request, solve a problem that a conventional cross-domain interface needs to be issued to a test environment for debugging, and improve debugging efficiency of the front end and the back end; and generating a simulation interface according to the back-end configuration file by taking the directory of the back-end configuration file read by the local simulation back end as a non-proxy API directory, and transmitting the interface address and interface generation information of the simulation interface to a display screen to simulate a real non-cross-domain service request.
In this embodiment, according to the scheme, by monitoring interface definition data, a back-end configuration file can be automatically generated according to the interface definition data, and simulation interface return data is generated according to the back-end configuration file, simulation interface return data of different formats can be generated as required, and developers do not need to manually modify and repeatedly configure the data, so that code errors caused by manual operation are effectively avoided, and the front-end development efficiency is improved.
Further, referring to fig. 4, a second embodiment of the backend interface simulation method according to the present invention is proposed based on the first embodiment, and the difference from the foregoing embodiment is that before the step S101, the backend interface simulation method further includes:
step S104, when the interface definition data is monitored, acquiring the data format of the interface definition data;
step S105, judging whether the data format is a preset data format;
the back-end interface simulation equipment runs the back-end simulation program, when monitoring that interface definition data input by a developer based on an input box exists in the input box, the back-end interface simulation equipment acquires a data format of the interface definition data and judges whether the data format is a preset data format, wherein the preset data format is a JSON format, namely whether the data format of the interface definition data is the JSON format is judged. In specific implementation, other data formats, such as XML format or XML format, may also be preset.
If the data format is a preset data format, executing step S101, namely generating a back-end configuration file according to the interface definition data, and generating analog interface return data according to the back-end configuration file;
and step S106, if the data format is not the preset data format, generating format reminding information, and displaying the format reminding information.
If the data format is a preset data format, namely the data format is a JSON format, generating a back-end configuration file according to the interface definition data, and generating simulation interface return data according to the configuration file, wherein the back-end configuration file comprises an interface address, a request method, failure probability, interface return data duration and the like, the simulation interface return data comprises a geographic position, an IP address, a character string, a picture, a number and the like, the geographic position, the IP address, the character string, the picture and the number are random, but the data range of the geographic position, the IP address, the character string, the picture and the number is controllable, and the simulation interface return data is used for simulating data returned by a real interface; and if the data format is not the preset data format, namely the data format is not the JSON format, generating format reminding information, and displaying the format reminding information, so that a developer can modify the format of the interface definition data.
In this embodiment, when it is monitored that the interface definition data is not in the preset data format, format prompt information can be displayed, so that developers can process the interface definition data in time.
Further, referring to fig. 5, a third embodiment of the back-end interface simulation method according to the present invention is proposed based on the first or second embodiment, and is different from the previous embodiment in that after step S103, the back-end interface simulation method further includes:
step S107, judging whether the simulation interface is a historical simulation interface or not according to the simulation interface address;
after the back-end interface simulation equipment acquires a simulation interface address returned by a local simulation back-end, whether the simulation interface is a historical simulation interface or not is judged according to the simulation interface address, namely whether the simulation interface address is in a simulation interface list or not is judged, if the simulation interface address is in the simulation interface list, the simulation interface can be judged to be the historical simulation interface, and if the simulation interface address is not in the simulation interface list, the simulation interface can be judged not to be the historical simulation interface.
Step S108, if the simulation interface is a historical simulation interface, acquiring the historical simulation interface according to the simulation interface address, and covering the historical simulation interface as the simulation interface;
step S109, if the simulation interface is not the historical simulation interface, adding the simulation interface address to a simulation interface list.
If the simulation interface is a historical simulation interface, acquiring the historical simulation interface according to the simulation interface address, covering the historical simulation interface as the simulation interface, and if the simulation interface is not the historical simulation interface, adding the simulation interface address to a simulation interface list.
In this embodiment, the present invention can cover the current interface if the existing analog interface exists and the analog interface is added again, so as to avoid the existence of multiple identical interfaces.
Further, when monitoring a triggered simulation interface preview instruction, the backend interface simulation equipment displays each established simulation interface according to the simulation interface preview instruction, and displays an interface address, a request type, a failure probability and interface data return duration of each simulation interface.
In addition, an embodiment of the present invention further provides a computer-readable storage medium, where a backend interface simulation program is stored on the computer-readable storage medium, and when executed by a processor, the backend interface simulation program implements the following steps:
when the interface definition data is monitored, generating a back-end configuration file according to the interface definition data, and generating simulation interface return data according to the back-end configuration file;
displaying the data returned by the simulation interface, and transmitting the back-end configuration file to a local simulation back-end so that the local simulation back-end can generate a simulation interface based on the back-end configuration file;
and receiving and displaying interface generation information and a simulation interface address returned by the local simulation backend based on the backend configuration file.
Further, the step of generating a backend configuration file according to the interface definition data includes:
acquiring code annotation information from the interface definition data, and filtering the interface definition data according to the code annotation information;
and generating a back-end configuration file according to the filtered interface definition data.
Further, when executed by the processor, the backend interface simulation program further implements the following steps:
when the interface definition data is monitored, acquiring a data format of the interface definition data;
judging whether the data format is a preset data format or not;
if the data format is a preset data format, generating a back-end configuration file according to the interface definition data, and generating simulation interface return data according to the back-end configuration file;
and if the data format is not the preset data format, generating format reminding information and displaying the format reminding information.
Further, when executed by the processor, the backend interface simulation program further implements the following steps:
judging whether the simulation interface is a historical simulation interface or not according to the simulation interface address;
if the simulation interface is a historical simulation interface, acquiring the historical simulation interface according to the simulation interface address, and covering the historical simulation interface as the simulation interface;
and if the simulation interface is not the historical simulation interface, adding the simulation interface address to a simulation interface list.
The specific embodiment of the computer-readable storage medium of the present invention is substantially the same as the specific embodiments of the backend interface simulation method described above, and is not described herein again.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or system. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or system that comprises the element.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium (e.g., ROM/RAM, magnetic disk, optical disk) as described above and includes instructions for enabling a terminal device (e.g., a mobile phone, a computer, a server, an air conditioner, or a network device) to execute the method according to the embodiments of the present invention.
The above description is only a preferred embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes, which are made by using the contents of the present specification and the accompanying drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.
Claims (9)
1. A method for simulating a backend interface, the method comprising:
when interface definition data are monitored, generating a back-end configuration file according to the interface definition data, and generating random analog interface return data according to the back-end configuration file, wherein the back-end configuration file comprises an interface address, a request method, a failure probability and interface return data duration, and the analog interface return data comprise a geographic position, an IP address, a character string, a picture and a number;
displaying the data returned by the simulation interface, and transmitting the back-end configuration file to a local simulation back-end so that the local simulation back-end can generate a simulation interface based on the back-end configuration file;
and receiving and displaying interface generation information and a simulation interface address returned by the local simulation backend based on the backend configuration file.
2. The backend interface simulation method of claim 1, wherein the step of generating a backend configuration file from the interface definition data comprises:
acquiring code annotation information from the interface definition data, and filtering the interface definition data according to the code annotation information;
and generating a back-end configuration file according to the filtered interface definition data.
3. The backend interface simulation method of claim 1, wherein prior to the steps of generating a backend configuration file from the interface definition data and generating random simulation interface return data from the backend configuration file, the backend interface simulation method further comprises:
when the interface definition data is monitored, acquiring a data format of the interface definition data;
judging whether the data format is a preset data format or not;
if the data format is a preset data format, executing the step of generating a back-end configuration file according to the interface definition data and generating simulation interface return data according to the back-end configuration file;
and if the data format is not the preset data format, generating format reminding information and displaying the format reminding information.
4. The backend interface simulation method of claim 1, wherein after the step of receiving and displaying interface generation information and simulated interface addresses returned by the local simulation backend based on the backend configuration file, the backend interface simulation method further comprises:
judging whether the simulation interface is a historical simulation interface or not according to the simulation interface address;
if the simulation interface is a historical simulation interface, acquiring the historical simulation interface according to the simulation interface address, and covering the historical simulation interface as the simulation interface;
and if the simulation interface is not the historical simulation interface, adding the simulation interface address to a simulation interface list.
5. The backend interface simulation method of any of claims 1-4, further comprising:
when a triggered simulation interface preview instruction is monitored, displaying each established simulation interface according to the simulation interface preview instruction, and displaying an interface address, a request type, a failure probability and interface data return duration of each simulation interface.
6. A back-end interface simulation device, comprising: a memory, a processor, and a back-end interface emulator stored on the memory and executable on the processor, the back-end interface emulator when executed by the processor implementing the steps of:
when interface definition data are monitored, generating a back-end configuration file according to the interface definition data, and generating random analog interface return data according to the back-end configuration file, wherein the back-end configuration file comprises an interface address, a request method, a failure probability and interface return data duration, and the analog interface return data comprise a geographic position, an IP address, a character string, a picture and a number;
displaying the data returned by the simulation interface, and transmitting the back-end configuration file to a local simulation back-end so that the local simulation back-end can generate a simulation interface based on the back-end configuration file;
and receiving and displaying interface generation information and a simulation interface address returned by the local simulation backend based on the backend configuration file.
7. The backend interface simulation device of claim 6, wherein the step of generating a backend configuration file from the interface definition data comprises:
acquiring code annotation information from the interface definition data, and filtering the interface definition data according to the code annotation information;
and generating a back-end configuration file according to the filtered interface definition data.
8. The back-end interface simulation device of claim 6, wherein the back-end interface simulation program, when executed by the processor, further performs the steps of:
when the interface definition data is monitored, acquiring a data format of the interface definition data;
judging whether the data format is a preset data format or not;
if the data format is a preset data format, generating a back-end configuration file according to the interface definition data, and generating simulation interface return data according to the back-end configuration file;
and if the data format is not the preset data format, generating format reminding information and displaying the format reminding information.
9. A computer readable storage medium having stored thereon a backend interface simulation program, which when executed by a processor, performs the steps of:
when interface definition data are monitored, generating a back-end configuration file according to the interface definition data, and generating random analog interface return data according to the back-end configuration file, wherein the back-end configuration file comprises an interface address, a request method, a failure probability and interface return data duration, and the analog interface return data comprise a geographic position, an IP address, a character string, a picture and a number;
displaying the data returned by the simulation interface, and transmitting the back-end configuration file to a local simulation back-end so that the local simulation back-end can generate a simulation interface based on the back-end configuration file;
and receiving and displaying interface generation information and a simulation interface address returned by the local simulation backend based on the backend configuration file.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710650299.9A CN107577622B (en) | 2017-08-01 | 2017-08-01 | Method, device and storage medium for simulating rear-end interface |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710650299.9A CN107577622B (en) | 2017-08-01 | 2017-08-01 | Method, device and storage medium for simulating rear-end interface |
Publications (2)
Publication Number | Publication Date |
---|---|
CN107577622A CN107577622A (en) | 2018-01-12 |
CN107577622B true CN107577622B (en) | 2020-06-16 |
Family
ID=61034228
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201710650299.9A Active CN107577622B (en) | 2017-08-01 | 2017-08-01 | Method, device and storage medium for simulating rear-end interface |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN107577622B (en) |
Families Citing this family (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108829383A (en) * | 2018-05-31 | 2018-11-16 | 达飞云贷科技(北京)有限公司 | A kind of data processing method and device of interface separation |
CN109726108B (en) * | 2018-06-04 | 2023-09-22 | 成都美满科技有限责任公司 | Front-end code testing method, device, system and medium based on analog data |
CN110489101B (en) * | 2019-07-15 | 2023-08-25 | 北京字节跳动网络技术有限公司 | Interface simulation method, system, medium and electronic equipment |
CN111045756B (en) * | 2019-12-10 | 2024-01-09 | 中国工商银行股份有限公司 | Method, apparatus, computing device and medium for generating interface service |
CN111209161B (en) * | 2020-01-02 | 2023-10-17 | 广东金赋科技股份有限公司 | Method and system for automatically generating configuration file based on interface monitoring |
CN111752644A (en) * | 2020-06-18 | 2020-10-09 | 北京字节跳动网络技术有限公司 | Interface simulation method, device, equipment and storage medium |
CN112052038B (en) * | 2020-09-09 | 2024-06-28 | 云账户技术(天津)有限公司 | Method and device for generating front-end interface |
CN115277408B (en) * | 2022-07-27 | 2024-04-02 | 中国平安财产保险股份有限公司 | Agent configuration information updating method, device, equipment and storage medium |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103473045A (en) * | 2013-08-27 | 2013-12-25 | 广州华多网络科技有限公司 | Method and device for generating interface documents |
CN105278928A (en) * | 2014-06-11 | 2016-01-27 | 中兴通讯股份有限公司 | IVR external interface configuration method and IVR external interface configuration device |
CN106484421A (en) * | 2016-10-11 | 2017-03-08 | 武汉斗鱼网络科技有限公司 | A kind of method and system quickly generating api interface |
CN106776345A (en) * | 2017-01-16 | 2017-05-31 | 北京恒华伟业科技股份有限公司 | A kind of interface delivery system and interface docking method of testing |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US8196047B2 (en) * | 2009-01-20 | 2012-06-05 | Microsoft Corporation | Flexible visualization for services |
-
2017
- 2017-08-01 CN CN201710650299.9A patent/CN107577622B/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103473045A (en) * | 2013-08-27 | 2013-12-25 | 广州华多网络科技有限公司 | Method and device for generating interface documents |
CN105278928A (en) * | 2014-06-11 | 2016-01-27 | 中兴通讯股份有限公司 | IVR external interface configuration method and IVR external interface configuration device |
CN106484421A (en) * | 2016-10-11 | 2017-03-08 | 武汉斗鱼网络科技有限公司 | A kind of method and system quickly generating api interface |
CN106776345A (en) * | 2017-01-16 | 2017-05-31 | 北京恒华伟业科技股份有限公司 | A kind of interface delivery system and interface docking method of testing |
Also Published As
Publication number | Publication date |
---|---|
CN107577622A (en) | 2018-01-12 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN107577622B (en) | Method, device and storage medium for simulating rear-end interface | |
CN106933722B (en) | Webpage application monitoring method, server and system | |
CN109725901B (en) | Front-end code development method, device, equipment and computer storage medium | |
CN105354014B (en) | Application interface renders methods of exhibiting and device | |
CN102567198B (en) | System and method for testing application program in physical system environment | |
CN106878361B (en) | Debugging method and device for terminal application page and client | |
CN108255701B (en) | Scene testing method and mobile terminal | |
CN107688529B (en) | Component debugging method and device | |
EP2736008A1 (en) | Dynamic tag generating apparatus and dynamic tag generating method thereof for use in display apparatus | |
CN105335132B (en) | Method, device and system for customizing application program function | |
CN109726108B (en) | Front-end code testing method, device, system and medium based on analog data | |
CN113741898B (en) | Form generation method, device and equipment | |
CN107729246A (en) | For the auxiliary test methods of intended application, device, equipment and storage medium | |
CN112866312A (en) | Script generation method, remote operation method and related equipment | |
CN111666199B (en) | Debugging method executed on intelligent terminal and software debugger | |
CN107577589A (en) | The method and device of fixed time test advertisement putting interface | |
CN116823537A (en) | Insurance report processing method and device, storage medium and electronic equipment | |
CN110674023B (en) | Interface testing method and device | |
CN105893235A (en) | Simulation testing method and apparatus, and server | |
CN106919375B (en) | Screen self-adaption method and system on mobile terminal equipment | |
CN113626744A (en) | Data processing method and device, computer equipment and storage medium | |
CN109656826B (en) | Application testing method, system, device and computer readable storage medium | |
CN117151786A (en) | Advertisement landing page generation method, device, equipment and storage medium | |
CN104601616B (en) | A kind of methods, devices and systems logging in Wireless Application Protocol website | |
CN109144841B (en) | Method and device for identifying advertisement application, 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 | ||
CB02 | Change of applicant information |
Address after: 510000 Guangzhou City, Guangzhou, Guangdong, Whampoa Avenue, No. 315, self - made 1-17 Applicant after: Guangzhou KuGou Networks Co., Ltd. Address before: 510000 Guangzhou City, Guangzhou, Guangdong Province, Tianhe District Ke Yun Road, No. 16 self compiled 2 rooms (the residence limit for this residence) Applicant before: Guangzhou KuGou Networks Co., Ltd. |
|
CB02 | Change of applicant information | ||
GR01 | Patent grant | ||
GR01 | Patent grant |