CN108551410A - Interface return method and terminal device - Google Patents

Interface return method and terminal device Download PDF

Info

Publication number
CN108551410A
CN108551410A CN201810260218.9A CN201810260218A CN108551410A CN 108551410 A CN108551410 A CN 108551410A CN 201810260218 A CN201810260218 A CN 201810260218A CN 108551410 A CN108551410 A CN 108551410A
Authority
CN
China
Prior art keywords
interconnected system
interface
domain name
operation flow
interconnected
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.)
Granted
Application number
CN201810260218.9A
Other languages
Chinese (zh)
Other versions
CN108551410B (en
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 Puhui Enterprise Management Co Ltd
Original Assignee
Ping An Puhui Enterprise Management 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 Puhui Enterprise Management Co Ltd filed Critical Ping An Puhui Enterprise Management Co Ltd
Priority to CN201810260218.9A priority Critical patent/CN108551410B/en
Publication of CN108551410A publication Critical patent/CN108551410A/en
Application granted granted Critical
Publication of CN108551410B publication Critical patent/CN108551410B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/08Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/02Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]

Abstract

The present invention is suitable for interface testing technical field, provides a kind of interface return method and terminal device.The method includes:In interface testing, it whether there is interconnected system in the operation flow executed with the presence or absence of interconnected system or target network end in the operation flow that detection destination application executes;If detection exists, the domain name of above-mentioned interconnected system is called;The domain name is redirected to Nginx proxy server;The interface that Nginx proxy server returns is received, by Nginx proxy server after judging that above-mentioned interconnected system is unimpeded, the return interface that above-mentioned interconnected system is simulated according to the domain name of above-mentioned interconnected system obtains the interface;Above-mentioned interface is sent to destination application or target network end continues to execute the operation flow, it can support the analogue data in Nginx proxy server, the flexibly return interface of simulation interconnected system, ensures that interface testing is smoothed out, meets existing interface test request.

Description

Interface return method and terminal device
Technical field
The invention belongs to interface testing technical field more particularly to a kind of interface return methods and terminal device.
Background technology
Interface testing is a kind of test of test system components interface, interface testing mainly for detection of external system with Interaction point between system and between internal subsystems, the emphasis of test is the exchange of data to be checked, transmits and controls Mutual logic dependencies etc. between management process and system processed.
SoapUI is used to carry out interface testing in the prior art, SoapUI passes through access system procotol (Internet Protocol, IP) address simulation system return interface, but when there are interconnected system, due to the IP address of interconnected system Association, the IP address that SoapUI accesses interconnected system is difficult, can not simulate the return interface of interconnected system, cause in interface testing It is disconnected, it cannot be satisfied existing interface test request.
Invention content
The embodiment of the present invention provides a kind of interface return method and terminal device, existing there are interconnected systems to solve When, the IP address that SoapUI accesses interconnected system is difficult, can not simulate the return interface of interconnected system, interface testing is caused to interrupt The problem of.
The first aspect of the embodiment of the present invention provides a kind of interface return method, including:
In interface testing, it whether there is interconnected system or target network in the operation flow that detection destination application executes It whether there is interconnected system in the operation flow that network end executes;
If detecting, there are interconnected system or the target network ends in the operation flow that the destination application executes There are interconnected systems in the operation flow of execution, then call the domain name of the interconnected system detected;
The domain name of the interconnected system detected is redirected to Nginx proxy server;
The interface that the Nginx proxy server returns is received, the interface that the Nginx proxy server returns is by described Nginx proxy server is simulated according to the domain name of the interconnected system detected and is examined after the interconnected system that judgement detects is unimpeded The return interface of the interconnected system measured obtains;
The interface that the Nginx proxy server returns is sent to the destination application or the target network end Continue to execute the operation flow.
Optionally, it whether there is interconnected system or target network in the operation flow that the detection destination application executes It holds in the operation flow executed and includes with the presence or absence of interconnected system:
It detects and whether there is the inconsistent system of domain name or the mesh in the operation flow that the destination application executes It marks in the operation flow that network-side executes with the presence or absence of the system that domain name is inconsistent;
If detecting, there are the inconsistent system of domain name or the mesh in the operation flow that the destination application executes Mark network-side execute operation flow in there are the inconsistent systems of domain name, then using the inconsistent system of the domain name detected as Interconnected system.
Optionally, the domain name by the interconnected system detected is redirected to Nginx proxy server and includes:
Obtain the correspondence of the domain name and IP address that are recorded in the host files of interconnected system detected and described The IP address of Nginx proxy server;
According to the IP address of the correspondence and the Nginx proxy server, by the domain of the interconnected system detected Name is redirected to Nginx proxy server.
Optionally, above-mentioned interface return method further includes:
The interface that emulating server returns is received, the interface that the emulating server returns is by the Nginx agency services Device is when the interconnected system that judgement detects is not smooth, by calling the emulating server using the interconnected system detected The return interface for the interconnected system that domain name analog detection arrives obtains;
The interface that the emulating server returns is sent to the destination application or the target network end is continued Execute the operation flow.
The second aspect of the embodiment of the present invention provides a kind of interface return method, including:
Judge whether interconnected system is unimpeded, the interconnected system, in interface testing, is detecting that target answers by server After in the operation flow executed there are interconnected system or target network end in the operation flow of program execution there are interconnected system, The domain name of the interconnected system detected is called, and the domain name of the interconnected system detected is redirected into acquisition;
If it is determined that the interconnected system is unimpeded, then the return of the interconnected system is simulated according to the domain name of the interconnected system Interface;
The return interface of simulation is sent to the destination application or the target network end by the server Continue to execute the operation flow.
Optionally, above-mentioned interface return method further includes:
If it is determined that the interconnected system is not smooth, then domain name simulation institute of the emulating server using the interconnected system is called State the return interface of interconnected system, and by the return interface of simulation by the server be sent to the destination application or The target network end continues to execute the operation flow.
Optionally, described to judge whether interconnected system is unimpeded and include:
Service order is sent to the interconnected system, if receiving the system error message that the interconnected system returns, Judge that the interconnected system is not smooth;
Or
Whether detection and the Connection Time of the interconnected system are more than preset time threshold, if detecting the Connection Time More than the preset time threshold, then judge that the interconnected system is not smooth.
The third aspect of the embodiment of the present invention provide a kind of interface return terminal device, including memory, processor with And it is stored in the computer program that can be run in the memory and on the processor, the processor executes the calculating Following steps are realized when machine program:
In interface testing, it whether there is interconnected system or target network in the operation flow that detection destination application executes It whether there is interconnected system in the operation flow that network end executes;
If detecting, there are interconnected system or the target network ends in the operation flow that the destination application executes There are interconnected systems in the operation flow of execution, then call the domain name of the interconnected system detected;
The domain name of the interconnected system detected is redirected to Nginx proxy server;
The interface that the Nginx proxy server returns is received, the interface that the Nginx proxy server returns is by described Nginx proxy server is simulated according to the domain name of the interconnected system detected and is examined after the interconnected system that judgement detects is unimpeded The return interface of the interconnected system measured obtains;
The interface that the Nginx proxy server returns is sent to the destination application or the target network end Continue to execute the operation flow.
The fourth aspect of the embodiment of the present invention provide a kind of interface return terminal device, including memory, processor with And it is stored in the computer program that can be run in the memory and on the processor, the processor executes the calculating Following steps are realized when machine program:
Judge whether interconnected system is unimpeded, the interconnected system, in interface testing, is detecting that target answers by server After in the operation flow executed there are interconnected system or target network end in the operation flow of program execution there are interconnected system, The domain name of the interconnected system detected is called, and the domain name of the interconnected system detected is redirected into acquisition;
If it is determined that the interconnected system is unimpeded, then the return of the interconnected system is simulated according to the domain name of the interconnected system Interface;
The return interface of simulation is sent to the destination application or the target network end by the server Continue to execute the operation flow.
5th aspect of the embodiment of the present invention provides a kind of computer readable storage medium, the computer-readable storage Media storage has computer program, and the step such as above-mentioned interface return method is realized when the computer program is executed by processor Suddenly.
Existing advantageous effect is the embodiment of the present invention compared with prior art:The embodiment of the present invention in interface testing, In detecting the operation flow that destination application or target network end execute there are interconnected system after, call the interconnected system Domain name, the domain name of the interconnected system is redirected to Nginx proxy server, receives Nginx proxy server in judgement State interconnected system it is unimpeded after, according to the domain name of above-mentioned interconnected system simulation interconnected system return interface, which is sent Above-mentioned operation flow is continued to execute to above-mentioned destination application or above-mentioned target network end, is supported in Nginx proxy server Middle analogue data flexibly simulates the return interface of interconnected system, ensures that interface testing is smoothed out, and solves existing in the presence of association When system, the IP address that SoapUI accesses interconnected system is difficult, can not simulate the return interface of interconnected system, cause interface testing The problem of interruption, meets existing interface test request.
Description of the drawings
It to describe the technical solutions in the embodiments of the present invention more clearly, below will be to embodiment or description of the prior art Needed in attached drawing be briefly described, it should be apparent that, the accompanying drawings in the following description be only the present invention some Embodiment for those of ordinary skill in the art without having to pay creative labor, can also be according to these Attached drawing obtains other attached drawings.
Fig. 1 is a kind of schematic flow diagram of interface return method provided in an embodiment of the present invention;
Fig. 2 is a kind of schematic flow diagram for interface return method that another embodiment of the present invention provides;
Fig. 3 is a kind of schematic flow diagram for interface return method that yet another embodiment of the invention provides;
Fig. 4 is a kind of schematic flow diagram for interface return method that further embodiment of this invention provides;
Fig. 5 is a kind of schematic flow diagram for interface return method that further embodiment of this invention provides;
Fig. 6 is a kind of schematic flow diagram for interface return method that further embodiment of this invention provides;
Fig. 7 is a kind of schematic flow diagram for interface return method that further embodiment of this invention provides;
Fig. 8 is a kind of schematic flow diagram for interface return method that further embodiment of this invention provides;
Fig. 9 is the schematic block diagram that a kind of interface provided in an embodiment of the present invention returns to program;
Figure 10 is the schematic block diagram that a kind of interface provided in an embodiment of the present invention returns to terminal device;
Figure 11 is the schematic block diagram that a kind of interface that another embodiment of the present invention provides returns to terminal device.
Specific implementation mode
In being described below, for illustration and not for limitation, it is proposed that such as tool of particular system structure, technology etc Body details, to understand thoroughly the embodiment of the present invention.However, it will be clear to one skilled in the art that there is no these specific The present invention can also be realized in the other embodiments of details.In other situations, it omits to well-known system, device, electricity The detailed description of road and method, in case unnecessary details interferes description of the invention.
In order to illustrate technical solutions according to the invention, illustrated below by specific embodiment.
It is a kind of schematic flow diagram of interface return method provided in an embodiment of the present invention referring to Fig. 1, Fig. 1, in the implementation In example, illustrated by taking the triggering of the angle of server as an example.As shown in Figure 1, in this embodiment, the processing procedure of server can To include the following steps:
S101:In interface testing, in the operation flow that detection destination application executes with the presence or absence of interconnected system or It whether there is interconnected system in the operation flow that target network end executes.
Here, either with or without interconnected system, or detection target in the operation flow that detection destination application itself executes It needs to carry out to be any one or more either with or without interconnected system, destination application in the operation flow that network-side itself executes The application program of interface testing, target network end are any one or more network-sides for needing to carry out interface testing.In interface When test, application program or network-side start to execute operation flow, such as flow of providing a loan, and insure, insure in loan The IP address of system is associated with, and system of insuring here just belongs to interconnected system.Server detects above application program or network-side is held It whether there is interconnected system in capable operation flow.
S102:If detecting, there are interconnected system or the target networks in the operation flow that the destination application executes There are interconnected systems in the operation flow that network end executes, then call the domain name of the interconnected system detected.
Specifically, it if detecting in the operation flow that the destination application executes there is no interconnected system, can adopt Interface testing is carried out with SoapUI, similarly, if detecting in the operation flow that the target network end executes there is no interconnected system, SoapUI then may be used and carry out interface testing.
S103:The domain name of the interconnected system detected is redirected to Nginx proxy server.
Here, redirect is exactly that a fixed direction goes to Nginx agencies to the domain name by interconnected system again by various methods The domain name of the interconnected system of calling can be configured to Nginx agency's clothes by server by the host files of interconnected system first It is engaged on device, Virtual Service is then configured in Nginx proxy server.
S104:Receive the interface that the Nginx proxy server returns, the interface that the Nginx proxy server returns By the Nginx proxy server after the interconnected system that judgement detects is unimpeded, according to the domain name of the interconnected system detected The return interface for the interconnected system that analog detection arrives obtains.
Specifically, Nginx proxy server judges whether above-mentioned interconnected system is unimpeded, is judging that above-mentioned interconnected system is unimpeded Afterwards, the domain name for directly invoking above-mentioned interconnected system, the return that above-mentioned interconnected system is simulated by the domain name of above-mentioned interconnected system connect Mouthful, and the return interface of simulation is returned into above-mentioned server.
Here, Nginx proxy server judges whether above-mentioned interconnected system is unimpeded and includes:Nginx proxy server is sent Service order judges that above-mentioned interconnected system is unsmooth to above-mentioned interconnected system if above-mentioned interconnected system return system error message It is logical.Alternatively, whether Nginx proxy server detection and the Connection Time of above-mentioned interconnected system are more than preset time threshold, if More than preset time threshold, judge that above-mentioned interconnected system is not smooth.
S105:The interface that the Nginx proxy server returns is sent to the destination application or the target Network-side continues to execute the operation flow.
Specifically, if there are interconnected systems in the operation flow that above-mentioned destination application executes, above-mentioned interface is sent out It send to destination application and continues to execute operation flow, if there is association system in the operation flow that above-mentioned target network end executes Above-mentioned interface is sent to target network end and continues to execute operation flow by system, and number is simulated in support in Nginx proxy server According to the interface for flexibly simulating interconnected system returns, and ensures that interface testing is smoothed out.
It is evidenced from the above discussion that the interface return method of the embodiment of the present invention, solution is existing when there are interconnected system, The IP address that SoapUI accesses interconnected system is difficult, can not simulate the return interface of interconnected system, and interface testing is caused to interrupt Problem meets existing interface test request.
Referring to Fig. 2, Fig. 2 is a kind of schematic flow diagram for interface return method that another embodiment of the present invention provides.With The corresponding embodiments of Fig. 1 difference lies in:It is described in interface testing, detection destination application execute operation flow in be With the presence or absence of interconnected system may include S201 in the no operation flow executed there are interconnected system or target network end.Wherein S202~S205 is identical as S102~S105 in a upper embodiment, referring specifically to the phase of S102~S105 in above-described embodiment Description is closed, is not repeated herein.Specifically, S201 may include S2011~S2012:
S2011:In interface testing, detects in the operation flow that the destination application executes and whether there is domain name not With the presence or absence of the inconsistent system of domain name in the operation flow that consistent system or the target network end execute.
S2012:If detect in the operation flow that the destination application executes there are the inconsistent system of domain name or There are the inconsistent systems of domain name in the operation flow that the target network end executes, then by the domain name detected it is inconsistent be System is used as interconnected system.
Here, server is inconsistent with the presence or absence of domain name by detecting the operation flow that above-mentioned destination application executes The operation flow that system or target network end execute detects destination application itself with the presence or absence of the inconsistent system of domain name Either with or without in the system that domain name is inconsistent, or the operation flow of detection target network end itself execution in the operation flow of execution Either with or without the inconsistent system of domain name, if it does, the inconsistent system of the domain name confirmly detected is interconnected system, letter It is single, accurate, it is suitble to practical application.
Referring to Fig. 3, Fig. 3 is a kind of schematic flow diagram for interface return method that yet another embodiment of the invention provides.With The corresponding embodiments of Fig. 1 difference lies in:The domain name by the interconnected system detected is redirected to Nginx proxy server May include S303.Wherein S301~S302 is identical as S101~S102 in a upper embodiment, and S304~S305 is real with upper one S104~the S105 applied in example is identical, is retouched referring specifically to S101~S102 in above-described embodiment is related to S104~S105's It states, does not repeat herein.Specifically, S303 may include S3031~S3032:
S3031:The correspondence for obtaining the domain name and IP address that are recorded in the host files of the interconnected system detected, with And the IP address of the Nginx proxy server.
Here, host files are the system files of a not no extension name, can use the tool open such as notepad, are acted on The corresponding IP address of some common network address domain names is exactly established into an association " database ".
S3032:According to the IP address of the correspondence and the Nginx proxy server, the association system that will be detected The domain name of system is redirected to Nginx proxy server.
Specifically, the correspondence of host file records domain name and IP address, server is according to above-mentioned correspondence, calling Interconnected system domain name and Nginx proxy server IP address, the domain name of the interconnected system of calling is redirected to Nginx Proxy server.
Here, by the way that the domain name of above-mentioned interconnected system is redirected to Nginx proxy server, make Nginx agency services Device can further simulate the return interface of interconnected system according to the domain name of interconnected system, ensure that interface testing is smoothed out.
Referring to Fig. 4, Fig. 4 is a kind of schematic flow diagram for interface return method that further embodiment of this invention provides.This Embodiment and above-described embodiment difference lies in S406~S407, wherein S401~S405 and the S101 in a upper embodiment~ S105 is identical, referring specifically to the associated description of S101~S105 in above-described embodiment, does not repeat herein.Connecing in the present embodiment Mouthful return method can also include:
S406:The interface that emulating server returns is received, the interface that the emulating server returns is acted on behalf of by the Nginx Server is when the interconnected system that judgement detects is not smooth, by calling the emulating server using the association system detected The return interface for the interconnected system that the domain name analog detection of system arrives obtains.
S407:The interface that the emulating server returns is sent to the destination application or the target network end Continue to execute the operation flow.
Here, if Nginx proxy server judges that above-mentioned interconnected system is not smooth, Nginx proxy server calls mould Quasi- server, emulating server is forwarded to by the domain name of interconnected system.Emulating server is simulated according to the domain name of interconnected system to close The return interface of system is contacted, emulating server can be returned with self defined interface, wherein may include:Precentagewise returns, by fixed Adopted sequence is returned and is returned by input value.
Specifically, precentagewise returns:The return interface difference that emulating server obtains simulation returns to situation corresponding hundred It can actual conditions be that the different situations that return for returning to interface of simulation are arranged according to divide ratio, this percent value Percent value, then precentagewise value give the return interface be arranged weight, return to different return the above-mentioned of situation according to weight and return Tieback mouth.For example, it is successfully, percentage 50% to be arranged that interface 1, which returns to situation 1,;It is failure to return to situation 2, and setting percentage is 30%, then can weight be set according to above-mentioned percent value, such as the bigger weight of percent value is bigger or percent value is got over Small weight is smaller, and the different interfaces 1 for returning to situation are returned according to the weight of setting.
Sequence returns by definition:State setting sequence is returned to according to interface, interconnected system has a variety of return states, just Be the sequence of return state to be arranged, for example the different return states of interface 1 have successfully, unsuccessfully etc., can be arranged return it is suitable Sequence first succeeds to fail afterwards, returns to the interface 1 of different return states.
It is returned by input value:Above two return the mode of interface all with interconnected system to enter ginseng value not related, now Being returned by input value is entered in the way of ginseng is worth related return interface with interconnected system, i.e., enters ginseng value according to interconnected system, Determine interconnected system goes out ginseng value, can preset into ginseng value and go out the correspondence of ginseng value here, according to the relationship be associated with system System enters ginseng value, and determine interconnected system goes out ginseng value, and interface, such as the difference of interface 1 are returned according to the ginseng value that goes out of interconnected system Going out ginseng value has A, B, and the size that ginseng value can be gone out according to difference returns to interface 1.
Here, return state can be customized through the above way there are when a variety of return states in interface.
Fig. 5 is referred to, Fig. 5 is a kind of schematic flow diagram for interface return method that further embodiment of this invention provides, In the embodiment, illustrated by taking the triggering of the angle of Nginx proxy server as an example, wherein Nginx proxy server is one High performance HTTP and Reverse Proxy and an IMAP/POP3/SMTP server.As shown in figure 5, in the implementation In example, the processing procedure of Nginx proxy server may comprise steps of:
S501:Judge whether interconnected system is unimpeded, the interconnected system, in interface testing, is detecting mesh by server It marks and there is association system in the operation flow executed there are interconnected system or target network end in the operation flow that application program executes After system, the domain name of the interconnected system detected is called, and the domain name of the interconnected system detected is redirected into acquisition.
Here, in interface testing, application program or network-side start to execute operation flow, and server detects above application With the presence or absence of the inconsistent system of domain name in the operation flow that program or network-side execute, if detecting above application program or net There are the inconsistent systems of domain name in the operation flow that network end executes, then using the inconsistent system of domain name as the association System calls the domain name of the interconnected system, and the domain name of the interconnected system is redirected to Nginx proxy server, that is, is obtained Take the correspondence of the domain name and IP address that are recorded in the host files of the interconnected system and the Nginx agency services The IP address of device, according to the IP address of the correspondence and the Nginx proxy server, by the domain name of the interconnected system It is redirected to Nginx proxy server.
S502:If it is determined that the interconnected system is unimpeded, then the interconnected system is simulated according to the domain name of the interconnected system Return interface.
Specifically, Nginx proxy server judges whether above-mentioned interconnected system is unimpeded, is judging that above-mentioned interconnected system is unimpeded Afterwards, the domain name for directly invoking above-mentioned interconnected system, the return that above-mentioned interconnected system is simulated by the domain name of above-mentioned interconnected system connect Mouthful, and the return interface of simulation is returned into above-mentioned server.
S503:The return interface of simulation is sent to the destination application or the target network by the server Network end continues to execute the operation flow.
It is evidenced from the above discussion that the interface return method of the embodiment of the present invention, solution is existing when there are interconnected system, The IP address that SoapUI accesses interconnected system is difficult, can not simulate the return interface of interconnected system, and interface testing is caused to interrupt Problem meets existing interface test request.
Referring to Fig. 6, Fig. 6 is a kind of schematic flow diagram for interface return method that further embodiment of this invention provides.This Difference lies in S604, wherein S601~S603 and S501~S503 phases in a upper embodiment for embodiment and above-described embodiment Together, it referring specifically to the associated description of S501~S503 in above-described embodiment, does not repeat herein.Interface in the present embodiment returns Method can also include:
S604:If it is determined that the interconnected system is not smooth, then emulating server is called to utilize the domain name of the interconnected system The return interface of the interconnected system is simulated, and the return interface of simulation is sent to the intended application by the server Program or the target network end continue to execute the operation flow.
Here, if Nginx proxy server judges that above-mentioned interconnected system is not smooth, Nginx proxy server calls mould Quasi- server, emulating server is forwarded to by the domain name of interconnected system.Emulating server is simulated according to the domain name of interconnected system to close The return interface of system is contacted, emulating server can be returned with self defined interface, wherein may include:Precentagewise returns, by fixed Adopted sequence is returned and is returned by input value.
Referring to Fig. 7, Fig. 7 is a kind of schematic flow diagram for interface return method that further embodiment of this invention provides.With The corresponding embodiments of Fig. 5 difference lies in:It is described judge interconnected system it is whether unimpeded may include S701.Wherein S702~S703 It is identical as S502~S503 in a upper embodiment, referring specifically to the associated description of S502~S503 in above-described embodiment, this Place does not repeat.Specifically, S701 may include S7011~S7012:
S7011:Service order is sent to the interconnected system, if receiving the system mistake letter that the interconnected system returns Breath, then judge that the interconnected system is not smooth, the interconnected system, in interface testing, is detecting intended application by server In the operation flow executed there are interconnected system or target network end in the operation flow that program executes there are interconnected system after, adjust With the domain name of the interconnected system detected, and the domain name of the interconnected system detected is redirected into acquisition.
S7012:Whether detection and the Connection Time of the interconnected system are more than preset time threshold, if detecting the company It is more than the preset time threshold to connect the time, then judges that the interconnected system is not smooth.
The above method in order to better understand, the application example of an interface return method of the present invention detailed below. In conjunction with above-mentioned each embodiment, in the present embodiment, with destination application, server, Nginx proxy server and simulation suit It is illustrated for interactive process between business device, this explanation does not limit to be constituted to the present invention program.
As shown in figure 8, this application example may include:
S801:In interface testing, destination application starts to execute operation flow.
S802:Server, which detects, whether there is interconnected system in the operation flow that above-mentioned destination application executes, if Relevant system is detected, interconnected system domain name is called.
S803:The domain name of above-mentioned interconnected system is redirected to Nginx proxy server by server.
S804:Nginx proxy server judges whether above-mentioned interconnected system is unimpeded.
S805:If Nginx proxy server judges that above-mentioned interconnected system is unimpeded, Nginx proxy server directly invokes The domain name of above-mentioned interconnected system simulates the return interface of interconnected system by the domain name of interconnected system.
S806:The return interface of simulation is sent to above-mentioned intended application by Nginx proxy server by above-mentioned server Program.
S807:If Nginx proxy server judges that above-mentioned interconnected system is not smooth, Nginx proxy server calls mould Quasi- server, emulating server is forwarded to by the domain name of above-mentioned interconnected system.
S808:Emulating server simulates the return interface of interconnected system according to the domain name of interconnected system.
S809:The return interface of simulation is sent to above-mentioned destination application by emulating server by above-mentioned server.
It is evidenced from the above discussion that the present embodiment, in interface testing, destination application executes operation flow, server exists Detect destination application execute operation flow in there are interconnected system after, the domain name of the interconnected system is called, by the pass The domain name of contact system is redirected to Nginx proxy server, Nginx proxy server after judging that above-mentioned interconnected system is unimpeded, According to the return interface of the interconnected system of the domain name of above-mentioned interconnected system simulation, above-mentioned target is sent to by above-mentioned server and is answered Emulating server is called to simulate association system according to the domain name of interconnected system after judging that above-mentioned interconnected system is not smooth with program The return interface of system is sent to above-mentioned destination application by above-mentioned server, supports in Nginx proxy server or mould Analogue data in quasi- server flexibly simulates the return interface of interconnected system, ensures that interface testing is smoothed out, solve it is existing There are when interconnected system, the IP address that SoapUI accesses interconnected system is difficult, can not simulate the return interface of interconnected system, cause The problem of interface testing interrupts, meets existing interface test request.
It should be understood that the size of the serial number of each step is not meant that the order of the execution order in above-described embodiment, each process Execution sequence should be determined by its function and internal logic, the implementation process without coping with the embodiment of the present invention constitutes any limit It is fixed.
Corresponding to the interface return method described in foregoing embodiments, Fig. 9 shows that interface provided in an embodiment of the present invention returns The running environment schematic diagram of backhaul sequence.For convenience of description, only the parts related to this embodiment are shown.
In the present embodiment, the interface returns to program 900 and installs and run in terminal device 90.The terminal device 90 can be mobile terminal, palm PC, server etc..The terminal device 90 may include, but be not limited only to, memory 901, place Manage device 902 and display 903.Fig. 9 illustrates only the terminal device 90 with component 901-903, it should be understood that not It is required that implement all components shown, the implementation that can be substituted is more or less component.
The memory 901 can be the internal storage unit of the terminal device 90 in some embodiments, such as should The hard disk or memory of terminal device 90.The memory 901 can also be the terminal device 90 in further embodiments The plug-in type hard disk being equipped on External memory equipment, such as the terminal device 90, intelligent memory card (Smart Media Card, SMC), secure digital (Secure Digital, SD) card, flash card (Flash Card) etc..Further, described to deposit Reservoir 901 can also both include the terminal device 90 internal storage unit and also including External memory equipment.The memory 901 are used to store the application software and Various types of data for being installed on the terminal device 90, such as the interface returns to program 900 Program code etc..The memory 901 can be also used for temporarily storing the data that has exported or will export.
The processor 902 can be a central processing unit (Central Processing in some embodiments Unit, CPU), microprocessor or other data processing chips, for run the program code stored in the memory 901 or Data are handled, such as executes the interface and returns to program 900 etc..
The display 903 can be that light-emitting diode display, liquid crystal display, touch control type LCD are shown in some embodiments Device and Organic Light Emitting Diode (Organic Light-Emitting Diode, OLED) touch device etc..The display 903 For being shown in the information handled in the terminal device 90 and for showing visual user interface, such as application menu Interface, application icon interface etc..The component 901-903 of the terminal device 90 is in communication with each other by system bus.
Referring to Fig. 10, being the functional block diagram that interface provided in an embodiment of the present invention returns to program 900.In the present embodiment In, the interface, which returns to program 900, can be divided into one or more modules, and one or more of modules are stored In the memory 901, and it is performed by one or more processors (the present embodiment is the processor 902), to complete The present invention.For example, in Fig. 10, the interface, which returns to program 900, can be divided into interconnected system detection unit 1001, domain Name call unit 1002 redirects unit 1003, first interface receiving unit 1004 and first interface transmission unit 1005.This hair Bright so-called unit is the series of computation machine program instruction section for referring to complete specific function, than program more suitable for describing institute It states interface and returns to implementation procedure of the program 900 in the terminal device 90.The module 1001- will specifically be introduced by being described below 1005 function.
Wherein, interconnected system detection unit 1001, for the business that in interface testing, detection destination application executes It whether there is interconnected system in the operation flow executed with the presence or absence of interconnected system or target network end in flow.Domain name is called single Member 1002, if there are interconnected system or the target networks in operation flow that the destination application executes for detecting There are interconnected systems in the operation flow that end executes, then call the domain name of the interconnected system detected.Unit 1003 is redirected, is used In the domain name of the interconnected system detected is redirected to Nginx proxy server.First interface receiving unit 1004, for connecing The interface that the Nginx proxy server returns is received, the interface that the Nginx proxy server returns is acted on behalf of by the Nginx Server is after the interconnected system that detects of judgement is unimpeded, the association arrived according to the domain name analog detection of the interconnected system detected The return interface of system obtains.First interface transmission unit 1005, the interface hair for returning to the Nginx proxy server It send to the destination application or the target network end and continues to execute the operation flow.
Optionally, the interconnected system detection unit 1001 can be divided into detection unit 1011 and interconnected system is true Order member 1012.
Wherein, detection unit 1011 whether there is domain for detecting in the operation flow that the destination application executes With the presence or absence of the inconsistent system of domain name in the operation flow that the inconsistent system of name or the target network end execute.Association system Unite determination unit 1012, if for detect in operation flow that the destination application executes there are domain name it is inconsistent be It is there are the inconsistent system of domain name in the operation flow that system or the target network end execute, then the domain name detected is inconsistent System as interconnected system.
Optionally, the redirection unit 1003 can be divided into information acquisition unit 1031 and information process unit 1032。
Wherein, information acquisition unit 1031, the domain name recorded in the host files for obtaining the interconnected system detected With the correspondence of IP address and the IP address of the Nginx proxy server.Information process unit 1032 is used for basis The domain name of the interconnected system detected is redirected to by the IP address of the correspondence and the Nginx proxy server Nginx proxy server.
Optionally, the interface, which returns to program 900, can also be divided into second interface receiving unit 1006 and second Interface transmission unit 1007.
Wherein, second interface receiving unit 1006, the interface for receiving emulating server return, the emulating server The interface of return, when the interconnected system that judgement detects is not smooth, passes through the calling mould by the Nginx proxy server The return interface for the interconnected system that the domain name analog detection for the interconnected system that quasi- server by utilizing detects arrives obtains.Second interface Transmission unit 1007, the interface for returning to the emulating server are sent to the destination application or the target network Network end continues to execute the operation flow.
1 is please referred to Fig.1, is that the interface that another embodiment of the present invention provides returns to the functional block diagram of program 900.In this reality It applies in example, the interface, which returns to program 900, can be divided into unimpeded judging unit 1101, interface analogue unit 1102 and the Three interface transmission units 1103.The function of the module 1101-1103 will specifically be introduced by being described below.
Wherein, unimpeded judging unit 1101, for judging whether interconnected system is unimpeded, the interconnected system is existed by server When interface testing, executed there are interconnected system or target network end in detecting the operation flow that destination application executes In operation flow there are interconnected system after, call the domain name of the interconnected system detected, and by the domain of the interconnected system detected Name redirects acquisition.Interface analogue unit 1102 is used for if it is determined that the interconnected system is unimpeded, then according to association system The domain name of system simulates the return interface of the interconnected system.Third interface transmission unit 1103, the return interface for that will simulate It is sent to the destination application by the server or the target network end continues to execute the operation flow.
Optionally, the interface, which returns to program 900, can also be divided into the 4th interface transmission unit 1104.
Wherein, the 4th interface transmission unit 1104 is used to if it is determined that the interconnected system is not smooth, then call analog service Device simulates the return interface of the interconnected system using the domain name of the interconnected system, and by the return interface of simulation described in Server is sent to the destination application or the target network end continues to execute the operation flow.
Optionally, it is single can be divided into the judgement of the first judging unit 1111 and second for the unimpeded judging unit 1101 Member 1112.
Wherein, the first judging unit 1111, for sending service order to the interconnected system, if receiving the association The system error message that system returns, then judge that the interconnected system is not smooth.Second judgment unit 1112, for detection and institute Whether the Connection Time for stating interconnected system is more than preset time threshold, if detecting, the Connection Time is more than the preset time Threshold value then judges that the interconnected system is not smooth.
It is apparent to those skilled in the art that for convenience of description and succinctly, only with above-mentioned each work( Can unit, module division progress for example, in practical application, can be as needed and by above-mentioned function distribution by different Functional unit, module are completed, i.e., the internal structure of described device are divided into different functional units or module, more than completion The all or part of function of description.Each functional unit, module in embodiment can be integrated in a processing unit, also may be used It, can also be above-mentioned integrated during two or more units are integrated in one unit to be that each unit physically exists alone The form that hardware had both may be used in unit is realized, can also be realized in the form of SFU software functional unit.In addition, each function list Member, the specific name of module are also only to facilitate mutually distinguish, the protection domain being not intended to limit this application.Above system The specific work process of middle unit, module, can refer to corresponding processes in the foregoing method embodiment, and details are not described herein.
In the above-described embodiments, it all emphasizes particularly on different fields to the description of each embodiment, is not described in detail or remembers in some embodiment The part of load may refer to the associated description of other embodiments.
Those of ordinary skill in the art may realize that lists described in conjunction with the examples disclosed in the embodiments of the present disclosure Member and algorithm steps can be realized with the combination of electronic hardware or computer software and electronic hardware.These functions are actually It is implemented in hardware or software, depends on the specific application and design constraint of technical solution.Professional technician Each specific application can be used different methods to achieve the described function, but this realization is it is not considered that exceed The scope of the present invention.
In embodiment provided by the present invention, it should be understood that disclosed device/terminal device and method, it can be with It realizes by another way.For example, device described above/terminal device embodiment is only schematical, for example, institute The division of module or unit is stated, only a kind of division of logic function, formula that in actual implementation, there may be another division manner, such as Multiple units or component can be combined or can be integrated into another system, or some features can be ignored or not executed.Separately A bit, shown or discussed mutual coupling or direct-coupling or communication connection can be by some interfaces, device Or INDIRECT COUPLING or the communication connection of unit, can be electrical, machinery or other forms.
The unit illustrated as separating component may or may not be physically separated, aobvious as unit The component shown may or may not be physical unit, you can be located at a place, or may be distributed over multiple In network element.Some or all of unit therein can be selected according to the actual needs to realize the mesh of this embodiment scheme 's.
In addition, each functional unit in each embodiment of the present invention can be integrated in a processing unit, it can also It is that each unit physically exists alone, it can also be during two or more units be integrated in one unit.Above-mentioned integrated list The form that hardware had both may be used in member is realized, can also be realized in the form of SFU software functional unit.
If the integrated module/unit be realized in the form of SFU software functional unit and as independent product sale or In use, can be stored in a computer read/write memory medium.Based on this understanding, the present invention realizes above-mentioned implementation All or part of flow in example method, can also instruct relevant hardware to complete, the meter by computer program Calculation machine program can be stored in a computer readable storage medium, the computer program when being executed by processor, it can be achieved that on The step of stating each embodiment of the method.Wherein, the computer program includes computer program code, the computer program generation Code can be source code form, object identification code form, executable file or certain intermediate forms etc..The computer-readable medium May include:Any entity or device, recording medium, USB flash disk, mobile hard disk, magnetic of the computer program code can be carried Dish, CD, computer storage, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), electric carrier signal, telecommunication signal and software distribution medium etc..It should be noted that the meter The content that calculation machine readable medium includes can carry out increase and decrease appropriate according to legislation in jurisdiction and the requirement of patent practice, Such as in certain jurisdictions, according to legislation and patent practice, computer-readable medium does not include electric carrier signal and telecommunications Signal.
Embodiment described above is merely illustrative of the technical solution of the present invention, rather than its limitations;Although with reference to aforementioned reality Applying example, invention is explained in detail, it will be understood by those of ordinary skill in the art that:It still can be to aforementioned each Technical solution recorded in embodiment is modified or equivalent replacement of some of the technical features;And these are changed Or replace, the spirit and scope for various embodiments of the present invention technical solution that it does not separate the essence of the corresponding technical solution should all It is included within protection scope of the present invention.

Claims (10)

1. a kind of interface return method, which is characterized in that including:
In interface testing, it whether there is interconnected system or target network end in the operation flow that detection destination application executes It whether there is interconnected system in the operation flow of execution;
If detecting, there are interconnected systems or the target network end to execute in the operation flow that the destination application executes Operation flow in there are interconnected systems, then call the domain name of the interconnected system detected;
The domain name of the interconnected system detected is redirected to Nginx proxy server;
The interface that the Nginx proxy server returns is received, the interface that the Nginx proxy server returns is by described Nginx proxy server is simulated according to the domain name of the interconnected system detected and is examined after the interconnected system that judgement detects is unimpeded The return interface of the interconnected system measured obtains;
The interface that the Nginx proxy server returns is sent to the destination application or the target network end is continued Execute the operation flow.
2. interface return method as described in claim 1, which is characterized in that the business that the detection destination application executes Include with the presence or absence of interconnected system in the operation flow executed with the presence or absence of interconnected system or target network end in flow:
It detects and whether there is the inconsistent system of domain name or the target network in the operation flow that the destination application executes With the presence or absence of the system that domain name is inconsistent in the operation flow that network end executes;
If detecting, there are the inconsistent system of domain name or the target networks in the operation flow that the destination application executes There are the inconsistent systems of domain name in the operation flow that network end executes, then using the inconsistent system of the domain name detected as association System.
3. interface return method as described in claim 1, which is characterized in that the domain name weight by the interconnected system detected Being directed to Nginx proxy server includes:
The correspondence of the domain name and network protocol IP address that are recorded in the host files of the interconnected system detected is obtained, and The IP address of the Nginx proxy server;
According to the IP address of the correspondence and the Nginx proxy server, by the domain name weight of the interconnected system detected It is directed to Nginx proxy server.
4. interface return method as described in claim 1, which is characterized in that further include:
The interface that emulating server returns is received, the interface that the emulating server returns is existed by the Nginx proxy server When judging that the interconnected system detected is not smooth, by calling the emulating server using the domain name of the interconnected system detected The return interface for the interconnected system that analog detection arrives obtains;
The interface that the emulating server returns is sent to the destination application or the target network end continues to execute The operation flow.
5. a kind of interface return method, which is characterized in that including:
Judge whether interconnected system is unimpeded, the interconnected system, in interface testing, is detecting intended application journey by server In the operation flow executed there are interconnected system or target network end in the operation flow that sequence executes there are interconnected system after, call The domain name of the interconnected system detected, and the domain name of the interconnected system detected is redirected into acquisition;
If it is determined that the interconnected system is unimpeded, then the return that the interconnected system is simulated according to the domain name of the interconnected system connects Mouthful;
The return interface of simulation is sent to the destination application by the server or the target network end is continued Execute the operation flow.
6. interface return method as claimed in claim 5, which is characterized in that further include:
If it is determined that the interconnected system is not smooth, then emulating server is called to simulate the pass using the domain name of the interconnected system The return interface of system is contacted, and the return interface of simulation is sent to the destination application or described by the server Target network end continues to execute the operation flow.
7. interface return method as claimed in claim 5, which is characterized in that described to judge whether interconnected system is unimpeded and include:
Service order is sent to the interconnected system, if receiving the system error message that the interconnected system returns, is judged The interconnected system is not smooth;
Or
Whether detection and the Connection Time of the interconnected system are more than preset time threshold, if detecting, the Connection Time is more than The preset time threshold then judges that the interconnected system is not smooth.
8. a kind of interface returns to terminal device, which is characterized in that including memory, processor and be stored in the memory And the computer program that can be run on the processor, the processor realize following step when executing the computer program Suddenly:
In interface testing, it whether there is interconnected system or target network end in the operation flow that detection destination application executes It whether there is interconnected system in the operation flow of execution;
If detecting, there are interconnected systems or the target network end to execute in the operation flow that the destination application executes Operation flow in there are interconnected systems, then call the domain name of the interconnected system detected;
The domain name of the interconnected system detected is redirected to Nginx proxy server;
The interface that the Nginx proxy server returns is received, the interface that the Nginx proxy server returns is by described Nginx proxy server is simulated according to the domain name of the interconnected system detected and is examined after the interconnected system that judgement detects is unimpeded The return interface of the interconnected system measured obtains;
The interface that the Nginx proxy server returns is sent to the destination application or the target network end is continued Execute the operation flow.
9. a kind of interface returns to terminal device, which is characterized in that including memory, processor and be stored in the memory And the computer program that can be run on the processor, the processor realize following step when executing the computer program Suddenly:
Judge whether interconnected system is unimpeded, the interconnected system, in interface testing, is detecting intended application journey by server In the operation flow executed there are interconnected system or target network end in the operation flow that sequence executes there are interconnected system after, call The domain name of the interconnected system detected, and the domain name of the interconnected system detected is redirected into acquisition;
If it is determined that the interconnected system is unimpeded, then the return that the interconnected system is simulated according to the domain name of the interconnected system connects Mouthful;
The return interface of simulation is sent to the destination application by the server or the target network end is continued Execute the operation flow.
10. a kind of computer readable storage medium, the computer-readable recording medium storage has computer program, feature to exist In the step of realization interface return method as described in any one of Claims 1-4 when the computer program is executed by processor Suddenly.
CN201810260218.9A 2018-03-27 2018-03-27 Interface returning method and terminal equipment Active CN108551410B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810260218.9A CN108551410B (en) 2018-03-27 2018-03-27 Interface returning method and terminal equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810260218.9A CN108551410B (en) 2018-03-27 2018-03-27 Interface returning method and terminal equipment

Publications (2)

Publication Number Publication Date
CN108551410A true CN108551410A (en) 2018-09-18
CN108551410B CN108551410B (en) 2021-06-15

Family

ID=63517411

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810260218.9A Active CN108551410B (en) 2018-03-27 2018-03-27 Interface returning method and terminal equipment

Country Status (1)

Country Link
CN (1) CN108551410B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110618924A (en) * 2019-09-19 2019-12-27 浙江诺诺网络科技有限公司 Link pressure testing method of web application system

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6785540B1 (en) * 1999-11-30 2004-08-31 Agilent Technologies, Inc. Monitoring system and method implementing test configuration logic
CN107179984A (en) * 2016-03-10 2017-09-19 北京京东尚科信息技术有限公司 A kind of interface mock methods and interface test method
CN107294808A (en) * 2017-07-05 2017-10-24 网易(杭州)网络有限公司 The methods, devices and systems of interface testing
CN107547312A (en) * 2017-09-21 2018-01-05 广州四三九九信息科技有限公司 Applied program testing method and system

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6785540B1 (en) * 1999-11-30 2004-08-31 Agilent Technologies, Inc. Monitoring system and method implementing test configuration logic
CN107179984A (en) * 2016-03-10 2017-09-19 北京京东尚科信息技术有限公司 A kind of interface mock methods and interface test method
CN107294808A (en) * 2017-07-05 2017-10-24 网易(杭州)网络有限公司 The methods, devices and systems of interface testing
CN107547312A (en) * 2017-09-21 2018-01-05 广州四三九九信息科技有限公司 Applied program testing method and system

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110618924A (en) * 2019-09-19 2019-12-27 浙江诺诺网络科技有限公司 Link pressure testing method of web application system
CN110618924B (en) * 2019-09-19 2023-06-23 浙江诺诺网络科技有限公司 Link pressure testing method of web application system

Also Published As

Publication number Publication date
CN108551410B (en) 2021-06-15

Similar Documents

Publication Publication Date Title
CN109741087A (en) The management method and device of electronic coupons
CN108520454A (en) The method and system of readjustment order in real time
CN108427644A (en) Service test method, service testing system and service testing device
CN108365961A (en) The response method and server that interface call method and terminal device, interface call
CN110517138A (en) Intelligent contract processing method, device, computer equipment and storage medium
CN102834806A (en) System structure managing device, method of managing system structure, and program
CN108769179A (en) A kind of service health state evaluation method and device
CN103927216A (en) Method And System For Managing Virtual Devices
CN110442502A (en) A kind of method, apparatus buried a little, equipment and storage medium
CN107886361A (en) A kind of method and server for assessing ad conversion rates prediction model
CN109976823A (en) A kind of application program launching method, device and terminal device
CN109787864A (en) A kind of network automatic test approach, device, terminal and storage medium based on Netperf
CN108112038A (en) A kind of method and device for controlling flowing of access
CN110310100A (en) Project management method, device, electronic equipment and storage medium
CN109582569A (en) Lending platforms test method, device, terminal device and readable storage medium storing program for executing
CN108763051A (en) Electronic device, transaction software operation risk method for early warning and storage medium
CN108551410A (en) Interface return method and terminal device
CN110244963A (en) Data-updating method, device and terminal device
Lutter et al. Using VHDL for simulation of SDL specifications
CN108459960A (en) Method of automatic configuration, device, equipment and the storage medium of test environment
CN110362294A (en) Development task executes method, apparatus, electronic equipment and storage medium
CN110147294A (en) Acquisition methods, device, terminal and the computer readable storage medium of Debugging message
CN105487884B (en) Upgrade processing method and relevant device
AU2018250278B2 (en) System and method for self-deploying and self-adapting contact center components
CN108810230A (en) A kind of method, apparatus and equipment obtaining incoming call prompting information

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
GR01 Patent grant
GR01 Patent grant