CN110109826A - For method for early warning and relevant apparatus on the line of interface - Google Patents

For method for early warning and relevant apparatus on the line of interface Download PDF

Info

Publication number
CN110109826A
CN110109826A CN201910296080.2A CN201910296080A CN110109826A CN 110109826 A CN110109826 A CN 110109826A CN 201910296080 A CN201910296080 A CN 201910296080A CN 110109826 A CN110109826 A CN 110109826A
Authority
CN
China
Prior art keywords
interface
data
tested
interface testing
test
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201910296080.2A
Other languages
Chinese (zh)
Inventor
朱峰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ping An 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 CN201910296080.2A priority Critical patent/CN110109826A/en
Publication of CN110109826A publication Critical patent/CN110109826A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3692Test management for test results analysis

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Test And Diagnosis Of Digital Computers (AREA)

Abstract

This application involves the improvement of the testing process of interface testing technical field, and in particular to method for early warning and relevant apparatus on a kind of line for interface, method includes: that data i to be tested is obtained from data set to be tested when interface testing function is in starting state;If data i to be tested is interface data, treats test data i and carry out interface testing, obtain the corresponding interface testing result of data i to be tested;If the corresponding interface testing result of data i to be tested is that interface is abnormal, early warning operation on the line for interface is executed.The efficiency of early warning on the line for interface can be improved using the embodiment of the present application.

Description

For method for early warning and relevant apparatus on the line of interface
Technical field
This application involves interface testing technical fields, and in particular to method for early warning and related dress on a kind of line for interface It sets.
Background technique
It refers to when detecting that interface testing result is interface exception for early warning on the line of interface using the side on line Formula executes early warning operation (such as sending warning information, transmitting pre-warning signal etc.).Currently, due to being adopted for early warning on the line of interface Mode manually, therefore it is directed to the early warning low efficiency of interface.
Summary of the invention
The embodiment of the present application provides method for early warning and relevant apparatus on a kind of line for interface, is directed to interface for improving Line on early warning efficiency.
In a first aspect, the embodiment of the present application provides method for early warning on a kind of line for interface, which comprises
When interface testing function is in starting state, data i to be tested is obtained from data set to be tested;
If the data i to be tested is interface data, interface testing is carried out to the data i to be tested, is obtained described The corresponding interface testing result of data i to be tested;
If the corresponding interface testing result of the data i to be tested is that interface is abnormal, execute pre- on the line for interface Alert operation.
Second aspect, the embodiment of the present application provide prior-warning device on a kind of line for interface, and described device includes:
Acquiring unit, for being obtained from data set to be tested to be tested when interface testing function is in starting state Data i;
First execution unit carries out the data i to be tested if being interface data for the data i to be tested Interface testing obtains the corresponding interface testing result of the data i to be tested;
Second execution unit executes if being used for the corresponding interface testing result of the data i to be tested is that interface is abnormal It is operated for early warning on the line of interface.
The third aspect, the embodiment of the present application provide a kind of electronic device, including processor, memory, communication interface, and One or more programs, said one or multiple programs are stored in above-mentioned memory, and are configured by above-mentioned processor It executes, above procedure is included the steps that for executing the instruction in method described in the embodiment of the present application first aspect.
Fourth aspect, the embodiment of the present application provide a kind of computer readable storage medium, above-mentioned computer-readable storage For storing computer program, above-mentioned computer program is executed by processor medium, to realize such as the embodiment of the present application first party Step some or all of described in method described in face.
5th aspect, the embodiment of the present application provide a kind of computer program product, and above-mentioned computer program product includes The non-transient computer readable storage medium of computer program is stored, above-mentioned computer program is operable to hold computer Step some or all of described in method of the row as described in the embodiment of the present application first aspect.The computer program product can Think a software installation packet.
As can be seen that in the embodiment of the present application, data i to be tested is obtained from data set to be tested, when number to be tested According to i be interface data when, treat test data i carry out interface testing, obtain the corresponding interface testing of data i to be tested as a result, If the corresponding interface testing result of data i to be tested is that interface is abnormal, early warning operation on the line for interface is executed.Compared to Early warning on line for interface is carried out using manual type, improves the efficiency of early warning on the line for interface.
These aspects or other aspects of the application can more straightforward in the following description.
Detailed description of the invention
Technical solution in ord to more clearly illustrate embodiments of the present application or in background technique below will be implemented the application Attached drawing needed in example or background technique is illustrated.
Fig. 1 is the flow diagram of method for early warning on a kind of line for interface provided by the embodiments of the present application;
Fig. 2 is the flow diagram of method for early warning on another line for interface provided by the embodiments of the present application;
Fig. 3 is the flow diagram of method for early warning on another line for interface provided by the embodiments of the present application;
Fig. 4 is the functional unit composition block diagram of prior-warning device on a kind of line for interface provided by the embodiments of the present application;
Fig. 5 is a kind of structural schematic diagram of electronic device provided by the embodiments of the present application.
Specific implementation
In order to make those skilled in the art more fully understand application scheme, below in conjunction in the embodiment of the present application Attached drawing, the technical scheme in the embodiment of the application is clearly and completely described, it is clear that described embodiment is only The embodiment of the application a part, instead of all the embodiments.Based on the embodiment in the application, ordinary skill people Member's every other embodiment obtained without making creative work, all should belong to the model of the application protection It encloses.
It is described in detail separately below.
The description and claims of this application and term " first ", " second ", " third " and " in the attached drawing Four " etc. are not use to describe a particular order for distinguishing different objects.In addition, term " includes " and " having " and it Any deformation, it is intended that cover and non-exclusive include.Such as it contains the process, method of a series of steps or units, be System, product or equipment are not limited to listed step or unit, but optionally further comprising the step of not listing or list Member, or optionally further comprising other step or units intrinsic for these process, methods, product or equipment.
Referenced herein " embodiment " is it is meant that a particular feature, structure, or characteristic described can wrap in conjunction with the embodiments It is contained at least one embodiment of the application.Each position in the description occur the phrase might not each mean it is identical Embodiment, nor the independent or alternative embodiment with other embodiments mutual exclusion.Those skilled in the art explicitly and Implicitly understand, embodiment described herein can be combined with other embodiments.
Electronic device involved by the embodiment of the present application is interface test device, which can be integrated in shifting In dynamic terminal.
It describes in detail below to the embodiment of the present application.
Referring to Fig. 1, Fig. 1 is the process signal of method for early warning on a kind of line for interface provided by the embodiments of the present application Figure, should be directed to method for early warning on the line of interface include:
Step 101: when interface testing function is in starting state, electronic device obtains to be measured from data set to be tested Try data i.
Wherein, data i to be tested is any one data to be tested in data set to be tested.
In a possible example, electronic device is before obtaining data i to be tested in data set to be tested, the side Method further include:
Electronic device obtains multiple data to be tested;
Electronic device initializes the multiple data to be tested, multiple data to be tested after being initialized;
Electronic device is based on the multiple data to be tested and test profile generation data to be tested after the initialization Collection.
Wherein, multiple data to be tested are what tester inputted in Excel.
Specifically, electronic device initializes multiple data to be tested, multiple numbers to be tested after being initialized According to embodiment can be with are as follows: be in the case that M M is integer greater than 1 in the quantity of multiple data to be tested, to m-th to Test data, which executes, corrects operation;It is a to be tested to (m+1) after executing correction operation to m-th of data to be tested Data, which execute, corrects operation;Until m=M, stopping treats test data and executes correction operation, and M after being corrected are to be tested Data, m be initial value be 1, with 1 for interval incrementing integers;Using M data to be tested after correction as more after initialization A data to be tested.
Specifically, electronic device m-th of data to be tested is executed correct the embodiment of operation can be with are as follows: determine test Identical as m-th of data to be tested with the presence or absence of test data in data set, test data set includes multiple test datas, test Data set is pre-stored in electronic device;If test data is concentrated, that there are test datas is identical as m-th of data to be tested, Keep m-th of data to be tested constant;If it is identical as m-th of data to be tested that test data is not present in test data concentration, It is concentrated from test data and chooses P test data, each test data in P test data and m-th data to be tested Length is all the same;The matching degree for determining each test data and m-th data to be tested in P test data obtains P survey Try the corresponding P matching degree of data;M-th of data to be tested is substituted in P matching degree the corresponding test of maximum matching degree Data.
Specifically, electronic device determines the matching of each test data and m-th of data to be tested in P test data The embodiment of degree can be with are as follows: read test data n obtains corresponding first data sequence of test data n, and test data n is P Any one in a test data, the first data sequence may include letter, number, symbol etc.;Read m-th of number to be tested According to obtaining corresponding second data sequence of m-th of data to be tested, the second data sequence may include letter, number, symbol Deng;Determine that position and data content data amount check all the same are target number in the first data sequence and the second data sequence; Using the ratio of target number and the data amount check of m-th of data to be tested as of test data n and m-th of data to be tested With degree;Identical operation is executed to (P-1) a test data in P test data in addition to test data n, obtains P survey Try the corresponding P matching degree of data.
Wherein, test profile is what electronic device was generated based on Creative Driven xml Data.jar.
Specifically, electronic device is based on the multiple data to be tested and test profile generation number to be tested after initialization It can be with according to the embodiment of collection are as follows: in the quantity of multiple data to be tested be in the case that M M is integer greater than 1, to obtain M The generation time of each data to be tested in data to be tested obtains the M data to be tested corresponding M generation time;According to M data to be tested are ranked up by chronological order, obtain third data sequence;Using third data sequence as to be tested Data set.
Specifically, electronic device is based on the multiple data to be tested and test profile generation number to be tested after initialization It may is that according to the embodiment integrated in the case where the quantity of multiple data to be tested is the integer that M M is greater than 1, obtain M The generation time of each data to be tested and data class in data to be tested, when obtaining M data to be tested and corresponding to M generation Between and M data class, data class can be text data, image data, video data etc.;M data to be tested are drawn It is divided into Q data subsets to be tested, each data subset to be tested includes at least one data to be tested, at least one is to be tested The type of data is identical;According to chronological order by each of Q data subset to be tested data subset to be tested It is sorted for the first time, the Q after being sorted for the first time data subsets to be tested;Obtain pre-stored number in test profile It puts in order according to type, and is put in order based on data class and determine that Q data subsets to be tested after sorting for the first time are corresponding Goal ordering;Q data subsets to be tested after being sorted for the first time based on goal ordering carry out minor sort again, are arranged again Q data subsets to be tested after sequence;Using Q data subsets to be tested after minor sort again as data set to be tested.
In a possible example, electronic device is after obtaining data i to be tested in data set to be tested, the side Method further include:
Electronic device determines whether the data i to be tested is interface data.
In a possible example, electronic device determines whether the data i to be tested is interface data, comprising:
Electronic device reads the data i to be tested, obtain the checkpoint title of the data i to be tested, test-types, Test domain, expected time-out, expectation state code, characteristic information;
Electronic device determines whether the checkpoint title of the data i to be tested is non-empty, whether test-types are transmission Whether request or reception request, test domain are started with hypertext transfer protocol;
If the entitled non-empty in checkpoint of the data i to be tested, test-types are to send request or reception request, test Domain is started with hypertext transfer protocol, then electronic device determines whether the expected time-out of the data i to be tested is number, is expected Whether state code is non-empty;
If the expected time-out of the data i to be tested is number, expecting state code is non-empty, electronic device determines institute Whether the characteristic information for stating data i to be tested includes interface characteristics;
If the characteristic information of the data i to be tested includes interface characteristics, electronic device determines the data i to be tested For interface data.
Step 102: if the data i to be tested is interface data, electronic device meets the data i to be tested Mouth test, obtains the corresponding interface testing result of the data i to be tested.
Wherein, interface refers to entity oneself being supplied to a kind of extraneous abstract compound (can be another entity), to External communication method is isolated by inside operation, the side that can be interacted by internal modification without influencing other extraneous entities Formula.
In a possible example, electronic device carries out interface testing to the data i to be tested, obtains described to be measured Try the corresponding interface testing result of data i, comprising:
Electronic device carries out jth time interface testing to the data i to be tested, the interface after obtaining jth time interface testing Test result;
If the interface testing result after the jth time interface testing is that interface is abnormal, electronic device is after preset duration (j+1) secondary interface testing is carried out to the data i to be tested, the interface testing result after obtaining (j+1) secondary interface testing;
Until j=N, electronic device stops carrying out interface testing to the data i to be tested, obtains n-th interface testing Rear interface testing as a result, it is 1 that j, which is initial value, with 1 for interval incrementing integers, the N is the integer greater than 1;
If the interface testing result after the n-th interface testing is that interface is normal, electronic device determines described to be measured Trying the corresponding interface testing result of data i is that interface is normal.
Wherein, it is customized to can be tester for preset duration, and it is customized to be also possible to electronic device.
Further, the method also includes:
If the interface testing result after the n-th interface testing is that interface is abnormal, electronic device determines described to be measured Trying the corresponding interface testing result of data i is that interface is abnormal.
As an example it is assumed that N=3, preset duration 0.5s, electronic device treats test data i and carries out the 1st interface survey Examination, the interface testing after obtaining the 1st interface testing is as a result, if the interface testing result after the 1st interface testing is that interface is different Often, then test data i is treated after 0.5s carries out the 2nd interface testing, the interface testing knot after obtaining the 2nd interface testing Fruit treats test data i after 0.5s and carries out the 3rd time if the interface testing result after the 2nd interface testing is that interface is abnormal Interface testing, the interface testing after obtaining the 3rd interface testing is as a result, if the interface testing result after the 3rd interface testing is Interface is normal, it is determined that the corresponding interface testing result of data i to be tested is that interface is normal;If connecing after the 3rd interface testing Mouthful test result is that interface is abnormal, it is determined that the corresponding interface testing result of data i to be tested is that interface is abnormal.
In a possible example, electronic device carries out jth time interface testing to the data i to be tested, obtains jth Interface testing result after secondary interface testing, comprising:
Electronic device is to first interface transmission interface test request, and when obtaining the first load of the first interface Long, the first return code and the first return value;
Electronic device determines whether the first load duration is less than or equal to first threshold;
If the first load duration is less than or equal to the first threshold, electronic device determines the test configurations text It is identical as first return code with the presence or absence of status code in part;
If existence code is identical as first return code in the test profile, described in electronic device determination Whether the first return value is identical as the first setting value;
If first return value is identical as first setting value, electronic device determines the jth time interface testing Interface testing result afterwards is that interface is normal.
Wherein, first interface is the corresponding test interface of data i to be tested.
Further, electronic device is to before first interface transmission interface test request, the method also includes: parsing to Test data i obtains the corresponding target ip address of data i to be tested;It is determined based on IP address and the mapping relations of test interface The corresponding target detection interface of target ip address;Using target detection interface as first interface.
Wherein, first interface refers to the test interface of server, and interface testing request is used to indicate server feedback the Load duration, return code and the return value of one interface.
In a possible example, electronic device carries out jth time interface testing to the data i to be tested, obtains jth Interface testing result after secondary interface testing, comprising:
Electronic device is to second interface transmission interface test request, and when obtaining the second load of the second interface Long, the second return code and the second return value;
Electronic device determines whether the second load duration is less than or equal to second threshold, in the test profile It is identical with the presence or absence of status code and second return code, whether second return value identical as the second setting value;
If it is not, then electronic device determines that the interface testing result after the jth time interface testing is that interface is abnormal.
Wherein, second interface is the corresponding test interface of data i to be tested.
Wherein, above-mentioned to include the following three types situation if not: 1) the second load duration is greater than second threshold;2) when the second load It is long identical as the second return code less than or equal to status code is not present in second threshold, test profile;3) when the second load It is long to be less than or equal to that second threshold, existence code is identical with the second return code in test profile, the second return value and the Two setting values are not identical.
Step 103: if the corresponding interface testing result of the data i to be tested is that interface is abnormal, electronic device is executed It is operated for early warning on the line of interface.
It wherein, can be sending warning information for early warning operation on the line of interface, or transmitting pre-warning signal.
As can be seen that in the embodiment of the present application, data i to be tested is obtained from data set to be tested, when number to be tested According to i be interface data when, treat test data i carry out interface testing, obtain the corresponding interface testing of data i to be tested as a result, If the corresponding interface testing result of data i to be tested is that interface is abnormal, early warning operation on the line for interface is executed.Compared to Early warning on line for interface is carried out using manual type, improves the efficiency of early warning on the line for interface.In addition, using fixed The test profile of inhibition and generation improves the speed of interface testing;Using repeated authentication mechanism (n times interface testing) to be tested Data i carries out interface testing, improves the accuracy of interface testing.
It is consistent with above-mentioned embodiment shown in FIG. 1, referring to Fig. 2, Fig. 2 is another needle provided by the embodiments of the present application To the flow diagram of method for early warning on the line of interface, should include: for method for early warning on the line of interface
Step 201: when interface testing function is in starting state, electronic device obtains to be measured from data set to be tested Try data i.
Step 202: electronic device determines whether the data i to be tested is interface data.
Step 203: if the data i to be tested is interface data, electronic device carries out the to the data i to be tested J interface testing, the interface testing result after obtaining jth time interface testing.
Step 204: if the interface testing result after the jth time interface testing is that interface is abnormal, electronic device is pre- If carrying out (j+1) secondary interface testing to the data i to be tested after duration, the interface after obtaining (j+1) secondary interface testing Test result.
Step 205: until j=N, electronic device stops carrying out interface testing to the data i to be tested, obtains n-th Interface testing after interface testing as a result, it is 1 that j, which is initial value, with 1 for interval incrementing integers, the N is the integer greater than 1.
Step 206: if the interface testing result after the n-th interface testing is that interface is abnormal, electronic device is determined The corresponding interface testing result of the data i to be tested is that interface is abnormal, and executes early warning operation on the line for interface.
It should be noted that the specific implementation process of each step of method shown in Fig. 2 can be found in described in the above method Specific implementation process, no longer describe herein.
It is consistent with above-mentioned Fig. 1 and embodiment shown in Fig. 2, referring to Fig. 3, Fig. 3 is provided by the embodiments of the present application another The flow diagram of method for early warning on a kind of line for interface should include: for method for early warning on the line of interface
Step 301: electronic device obtains multiple data to be tested.
Step 302: electronic device initializes the multiple data to be tested, multiple to be measured after being initialized Try data.
Step 303: electronic device based on after the initialization multiple data to be tested and test profile generate to Test data set.
Step 304: when interface testing function is in starting state, electronic device obtains to be measured from data set to be tested Try data i.
Step 305: electronic device determines whether the data i to be tested is interface data.
Step 306: if the data i to be tested is interface data, electronic device carries out the to the data i to be tested J interface testing, the interface testing result after obtaining jth time interface testing.
Step 307: if the interface testing result after the jth time interface testing is that interface is abnormal, electronic device is pre- If carrying out (j+1) secondary interface testing to the data i to be tested after duration, the interface after obtaining (j+1) secondary interface testing Test result.
Step 308: until j=N, electronic device stops carrying out interface testing to the data i to be tested, obtains n-th Interface testing after interface testing as a result, it is 1 that j, which is initial value, with 1 for interval incrementing integers, the N is the integer greater than 1.
Step 309: if the interface testing result after the n-th interface testing is that interface is abnormal, electronic device is determined The corresponding interface testing result of the data i to be tested is that interface is abnormal, and executes early warning operation on the line for interface.
It should be noted that the specific implementation process of each step of method shown in Fig. 3 can be found in described in the above method Specific implementation process, no longer describe herein.
It is above-mentioned that mainly the scheme of the embodiment of the present application is described from the angle of method side implementation procedure.It is understood that , in order to realize the above functions for prior-warning device on the line of interface, it comprises execute each corresponding hardware knot of function Structure and/or software module.Those skilled in the art should be readily appreciated that, described in conjunction with the examples disclosed in this document Each exemplary unit and algorithm steps, the application can be realized with the combining form of hardware or hardware and computer software.Certain A function is executed in a manner of hardware or computer software driving hardware actually, depending on technical solution specific application and Design constraint.Professional technician specifically can realize described function using distinct methods to each, But this realization is it is not considered that exceed scope of the present application.
The embodiment of the present application can carry out functional unit to for prior-warning device on the line of interface according to above method example Division two or more functions can also be integrated for example, each functional unit of each function division can be corresponded to In one processing unit.Above-mentioned integrated unit both can take the form of hardware realization, can also use software function list The form of member is realized.It should be noted that being schematical, only a kind of logic to the division of unit in the embodiment of the present application Function division, there may be another division manner in actual implementation.
Referring to Fig. 4, Fig. 4 is the function of prior-warning device 400 on a kind of line for interface provided by the embodiments of the present application Unit composition block diagram should include acquiring unit 401, the first execution unit 402 and second for prior-warning device 400 on the line of interface Execution unit 403, in which:
Acquiring unit 401, for being obtained from data set to be tested to be measured when interface testing function is in starting state Try data i;
First execution unit 402, if for the data i to be tested be interface data, to the data i to be tested into Line interface test, obtains the corresponding interface testing result of the data i to be tested;
Second execution unit 403, if being used for the corresponding interface testing result of the data i to be tested is that interface is abnormal, Execute early warning operation on the line for interface.
As can be seen that in the embodiment of the present application, data i to be tested is obtained from data set to be tested, when number to be tested According to i be interface data when, treat test data i carry out interface testing, obtain the corresponding interface testing of data i to be tested as a result, If the corresponding interface testing result of data i to be tested is that interface is abnormal, early warning operation on the line for interface is executed.Compared to Early warning on line for interface is carried out using manual type, improves the efficiency of early warning on the line for interface.
In a possible example, prior-warning device 400 on the above-mentioned line for interface further include:
First acquisition unit 404, for obtaining multiple data to be tested;
Third execution unit 405, it is multiple after being initialized for being initialized to the multiple data to be tested Data to be tested;
Generation unit 406, for based on after the initialization multiple data to be tested and test profile generate to Test data set.
In a possible example, interface testing is being carried out to the data i to be tested, is obtaining the data to be tested In terms of the corresponding interface testing result of i, above-mentioned first execution unit 402 is specifically used for:
Jth time interface testing is carried out to the data i to be tested, the interface testing result after obtaining jth time interface testing;
If the interface testing result after the jth time interface testing is that interface is abnormal, after preset duration to it is described to Test data i carries out (j+1) secondary interface testing, the interface testing result after obtaining (j+1) secondary interface testing;
Until j=N, stop carrying out interface testing to the data i to be tested, the interface after obtaining n-th interface testing Test result, j are that initial value is 1, with 1 for interval incrementing integers, the N is integer greater than 1;
If the interface testing result after the n-th interface testing is that interface is normal, it is determined that described i pairs of data to be tested The interface testing result answered is that interface is normal.
In a possible example, jth time interface testing is being carried out to the data i to be tested, is obtaining jth time interface In terms of interface testing result after test, above-mentioned first execution unit 402 is specifically used for:
To first interface transmission interface test request, and obtains the first load duration of the first interface, first returns Return code and the first return value;
Determine whether the first load duration is less than or equal to first threshold;
If it is described first load duration be less than or equal to the first threshold, it is determined that in the test profile whether Existence code is identical as first return code;
If existence code is identical as first return code in the test profile, it is determined that described first returns Whether identical as the first setting value it is worth;
If first return value is identical as first setting value, it is determined that the interface after the jth time interface testing Test result is that interface is normal.
In a possible example, jth time interface testing is being carried out to the data i to be tested, is obtaining jth time interface In terms of interface testing result after test, above-mentioned first execution unit 402 is specifically used for:
To second interface transmission interface test request, and obtains the second load duration of the second interface, second returns Return code and the second return value;
Determine whether the second load duration is less than or equal to second threshold, whether there is in the test profile Status code and second return code is identical, whether second return value is identical as the second setting value;
If not, it is determined that the interface testing result after the jth time interface testing is that interface is abnormal.
In a possible example, prior-warning device 400 on the above-mentioned line for interface further include:
Determination unit 407, for determining whether the data i to be tested is interface data.
It is above-mentioned determining single in terms of determining whether the data i to be tested is interface data in a possible example Member 407 is specifically used for:
Read the data i to be tested, obtain the checkpoint title of the data i to be tested, test-types, test domain, It is expected that time-out, expectation state code, characteristic information;
Determine whether the checkpoint title of the data i to be tested is non-empty, whether test-types are to send request or connect Receive request, whether test domain is started with hypertext transfer protocol;
If the entitled non-empty in checkpoint of the data i to be tested, test-types are to send request or reception request, test Domain is started with hypertext transfer protocol, it is determined that whether the expected time-out of the data i to be tested is number, expecting state code It whether is non-empty;
If the expected time-out of the data i to be tested is number, expecting state code is non-empty, it is determined that described to be tested Whether the characteristic information of data i includes interface characteristics;
If the characteristic information of the data i to be tested includes interface characteristics, it is determined that the data i to be tested is number of ports According to.
It is consistent with above-mentioned Fig. 1, Fig. 2 and embodiment shown in Fig. 3, referring to Fig. 5, Fig. 5 is that the embodiment of the present application provides A kind of electronic device structural schematic diagram, which includes processor, memory, communication interface and one or more A program, said one or multiple programs are stored in above-mentioned memory, and are configured to be executed by above-mentioned processor, above-mentioned Program includes the instruction for executing following steps:
When interface testing function is in starting state, data i to be tested is obtained from data set to be tested;
If the data i to be tested is interface data, interface testing is carried out to the data i to be tested, is obtained described The corresponding interface testing result of data i to be tested;
If the corresponding interface testing result of the data i to be tested is that interface is abnormal, execute pre- on the line for interface Alert operation.
As can be seen that in the embodiment of the present application, data i to be tested is obtained from data set to be tested, when number to be tested According to i be interface data when, treat test data i carry out interface testing, obtain the corresponding interface testing of data i to be tested as a result, If the corresponding interface testing result of data i to be tested is that interface is abnormal, early warning operation on the line for interface is executed.Compared to Early warning on line for interface is carried out using manual type, improves the efficiency of early warning on the line for interface.
In a possible example, above procedure further includes the instruction for executing following steps:
Obtain multiple data to be tested;
The multiple data to be tested are initialized, multiple data to be tested after being initialized;
Based on the multiple data to be tested and test profile generation data set to be tested after the initialization.
In a possible example, interface testing is being carried out to the data i to be tested, is obtaining the data to be tested In terms of the corresponding interface testing result of i, above procedure includes the instruction specifically for executing following steps:
Jth time interface testing is carried out to the data i to be tested, the interface testing result after obtaining jth time interface testing;
If the interface testing result after the jth time interface testing is that interface is abnormal, after preset duration to it is described to Test data i carries out (j+1) secondary interface testing, the interface testing result after obtaining (j+1) secondary interface testing;
Until j=N, stop carrying out interface testing to the data i to be tested, the interface after obtaining n-th interface testing Test result, j are that initial value is 1, with 1 for interval incrementing integers, the N is integer greater than 1;
If the interface testing result after the n-th interface testing is that interface is normal, it is determined that described i pairs of data to be tested The interface testing result answered is that interface is normal.
In a possible example, jth time interface testing is being carried out to the data i to be tested, is obtaining jth time interface In terms of interface testing result after test, above procedure includes the instruction specifically for executing following steps:
To first interface transmission interface test request, and obtains the first load duration of the first interface, first returns Return code and the first return value;
Determine whether the first load duration is less than or equal to first threshold;
If it is described first load duration be less than or equal to the first threshold, it is determined that in the test profile whether Existence code is identical as first return code;
If existence code is identical as first return code in the test profile, it is determined that described first returns Whether identical as the first setting value it is worth;
If first return value is identical as first setting value, it is determined that the interface after the jth time interface testing Test result is that interface is normal.
In a possible example, jth time interface testing is being carried out to the data i to be tested, is obtaining jth time interface In terms of interface testing result after test, above procedure includes the instruction specifically for executing following steps:
To second interface transmission interface test request, and obtains the second load duration of the second interface, second returns Return code and the second return value;
Determine whether the second load duration is less than or equal to second threshold, whether there is in the test profile Status code and second return code is identical, whether second return value is identical as the second setting value;
If not, it is determined that the interface testing result after the jth time interface testing is that interface is abnormal.
In a possible example, above procedure further includes the instruction for executing following steps:
Determine whether the data i to be tested is interface data.
In a possible example, in terms of determining whether the data i to be tested is interface data, above procedure packet Include the instruction for being specifically used for executing following steps:
Read the data i to be tested, obtain the checkpoint title of the data i to be tested, test-types, test domain, It is expected that time-out, expectation state code, characteristic information;
Determine whether the checkpoint title of the data i to be tested is non-empty, whether test-types are to send request or connect Receive request, whether test domain is started with hypertext transfer protocol;
If the entitled non-empty in checkpoint of the data i to be tested, test-types are to send request or reception request, test Domain is started with hypertext transfer protocol, it is determined that whether the expected time-out of the data i to be tested is number, expecting state code It whether is non-empty;
If the expected time-out of the data i to be tested is number, expecting state code is non-empty, it is determined that described to be tested Whether the characteristic information of data i includes interface characteristics;
If the characteristic information of the data i to be tested includes interface characteristics, it is determined that the data i to be tested is number of ports According to.
The embodiment of the present application also provides a kind of computer storage medium, and the computer storage medium is for storing computer journey Sequence, above-mentioned computer program are executed by processor, with realize part as either recorded method in above method embodiment or Overall Steps.
The embodiment of the present application also provides a kind of computer program product, and above-mentioned computer program product includes storing calculating The non-transient computer readable storage medium of machine program, above-mentioned computer program are operable to that computer is made to execute such as above-mentioned side Some or all of either record method step in method embodiment.The computer program product can be a software installation Packet.
It should be noted that for the various method embodiments described above, for simple description, therefore, it is stated as a series of Combination of actions, but those skilled in the art should understand that, the application is not limited by the described action sequence because According to the application, some steps may be performed in other sequences or simultaneously.Secondly, those skilled in the art should also know It knows, the embodiments described in the specification are all preferred embodiments, related actions and modules not necessarily the application It is necessary.
In the above-described embodiments, it all emphasizes particularly on different fields to the description of each embodiment, there is no the portion being described in detail in some embodiment Point, reference can be made to the related descriptions of other embodiments.
In several embodiments provided herein, it should be understood that disclosed device, it can be by another way It realizes.For example, the apparatus embodiments described above are merely exemplary, such as the division of said units, it is only a kind of Logical function partition, there may be another division manner in actual implementation, such as multiple units or components can combine or can To be integrated into another system, or some features can be ignored or not executed.Another point, shown or discussed is mutual Coupling, direct-coupling or communication connection can be through some interfaces, the indirect coupling or communication connection of device or unit, It can be electrical or other forms.
Above-mentioned unit as illustrated by the separation member may or may not be physically separated, aobvious as unit The component shown may or may not be physical unit, it can and it is in one place, or may be distributed over multiple In network unit.It can select some or all of unit therein according to the actual needs to realize the mesh of this embodiment scheme 's.
It, can also be in addition, each functional unit in each embodiment of the application can integrate in one processing unit It is that each unit physically exists alone, can also be integrated in one unit with two or more units.Above-mentioned integrated list Member both can take the form of hardware realization, can also realize in the form of software functional units.
If above-mentioned integrated unit is realized in the form of SFU software functional unit and sells or use as independent product When, it can store in a computer-readable access to memory.Based on this understanding, the technical solution of the application substantially or Person says that all or part of the part that contributes to existing technology or the technical solution can body in the form of software products Reveal and, which is stored in a memory, including some instructions are used so that a computer equipment (can be personal computer, server or network equipment etc.) executes all or part of each embodiment above method of the application Step.And memory above-mentioned includes: USB flash disk, read-only memory (ROM, Read-Only Memory), random access memory The various media that can store program code such as (RAM, Random Access Memory), mobile hard disk, magnetic or disk.
Those of ordinary skill in the art will appreciate that all or part of the steps in the various methods of above-described embodiment is can It is completed with instructing relevant hardware by program, which can store in a computer-readable memory, memory May include: flash disk, read-only memory (English: Read-Only Memory, referred to as: ROM), random access device (English: Random Access Memory, referred to as: RAM), disk or CD etc..
The embodiment of the present application is described in detail above, specific case used herein to the principle of the application and Embodiment is expounded, the description of the example is only used to help understand the method for the present application and its core ideas; At the same time, for those skilled in the art can in specific implementation and application range according to the thought of the application There is change place, to sum up above-mentioned, the contents of this specification should not be construed as limiting the present application.

Claims (10)

1. method for early warning on a kind of line for interface, which is characterized in that the described method includes:
When interface testing function is in starting state, data i to be tested is obtained from data set to be tested;
If the data i to be tested is interface data, interface testing is carried out to the data i to be tested, is obtained described to be measured Try the corresponding interface testing result of data i;
If the corresponding interface testing result of the data i to be tested is that interface is abnormal, early warning behaviour on the line for interface is executed Make.
2. the method according to claim 1, wherein described obtain data i to be tested from data set to be tested Before, the method also includes:
Obtain multiple data to be tested;
The multiple data to be tested are initialized, multiple data to be tested after being initialized;
Based on the multiple data to be tested and test profile generation data set to be tested after the initialization.
3. method according to claim 1 or 2, which is characterized in that described to carry out interface survey to the data i to be tested Examination, obtains the corresponding interface testing result of the data i to be tested, comprising:
Jth time interface testing is carried out to the data i to be tested, the interface testing result after obtaining jth time interface testing;
If the interface testing result after the jth time interface testing is that interface is abnormal, to described to be tested after preset duration Data i carries out (j+1) secondary interface testing, the interface testing result after obtaining (j+1) secondary interface testing;
Until j=N, stop carrying out interface testing to the data i to be tested, the interface testing after obtaining n-th interface testing As a result, it is 1 that j, which is initial value, with 1 for interval incrementing integers, the N is integer greater than 1;
If the interface testing result after the n-th interface testing is that interface is normal, it is determined that the data i to be tested is corresponding Interface testing result is that interface is normal.
4. according to the method described in claim 3, it is characterized in that, described carry out jth time interface survey to the data i to be tested Examination, the interface testing result after obtaining jth time interface testing, comprising:
To first interface transmission interface test request, and obtain the first load duration, the first return code of the first interface With the first return value;
Determine whether the first load duration is less than or equal to first threshold;
If the first load duration is less than or equal to the first threshold, it is determined that whether there is in the test profile Status code is identical as first return code;
If existence code is identical as first return code in the test profile, it is determined that first return value is It is no identical as the first setting value;
If first return value is identical as first setting value, it is determined that the interface testing after the jth time interface testing As a result normal for interface.
5. according to the method described in claim 3, it is characterized in that, described carry out jth time interface survey to the data i to be tested Examination, the interface testing result after obtaining jth time interface testing, comprising:
To second interface transmission interface test request, and obtain the second load duration, the second return code of the second interface With the second return value;
Determine whether the second load duration is less than or equal to second threshold, in the test profile with the presence or absence of state Code and second return code is identical, whether second return value is identical as the second setting value;
If not, it is determined that the interface testing result after the jth time interface testing is that interface is abnormal.
6. method according to claim 4 or 5, which is characterized in that described to obtain number to be tested from data set to be tested After i, the method also includes:
Determine whether the data i to be tested is interface data.
7. according to the method described in claim 6, it is characterized in that, whether the determination data i to be tested is number of ports According to, comprising:
The data i to be tested is read, checkpoint title, test-types, the test domain, expection of the data i to be tested is obtained Time-out, expectation state code, characteristic information;
Determine whether the checkpoint title of the data i to be tested is non-empty, whether test-types are to send request or receive to ask It asks, whether test domain is started with hypertext transfer protocol;
If the entitled non-empty in checkpoint of the data i to be tested, test-types be send request or receive request, test domain with Hypertext transfer protocol beginning, it is determined that the expected time-out of the data i to be tested whether be number, expecting state code whether For non-empty;
If the expected time-out of the data i to be tested is number, expecting state code is non-empty, it is determined that the data to be tested Whether the characteristic information of i includes interface characteristics;
If the characteristic information of the data i to be tested includes interface characteristics, it is determined that the data i to be tested is interface data.
8. prior-warning device on a kind of line for interface, which is characterized in that described device includes:
Acquiring unit, for obtaining data to be tested from data set to be tested when interface testing function is in starting state i;
First execution unit carries out interface to the data i to be tested if being interface data for the data i to be tested Test, obtains the corresponding interface testing result of the data i to be tested;
Second execution unit, if being used for the corresponding interface testing result of the data i to be tested is that interface is abnormal, execution is directed to Early warning operates on the line of interface.
9. a kind of electronic device, which is characterized in that including processor, memory, communication interface, and one or more programs, One or more of programs are stored in the memory, and are configured to be executed by the processor, described program packet Include the instruction for executing the step in the method according to claim 1 to 7.
10. a kind of computer readable storage medium, which is characterized in that the computer readable storage medium is for storing computer Program, the computer program are executed by processor, to realize the method according to claim 1 to 7.
CN201910296080.2A 2019-04-12 2019-04-12 For method for early warning and relevant apparatus on the line of interface Pending CN110109826A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910296080.2A CN110109826A (en) 2019-04-12 2019-04-12 For method for early warning and relevant apparatus on the line of interface

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910296080.2A CN110109826A (en) 2019-04-12 2019-04-12 For method for early warning and relevant apparatus on the line of interface

Publications (1)

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

Family

ID=67483873

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910296080.2A Pending CN110109826A (en) 2019-04-12 2019-04-12 For method for early warning and relevant apparatus on the line of interface

Country Status (1)

Country Link
CN (1) CN110109826A (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104360920A (en) * 2014-12-02 2015-02-18 微梦创科网络科技(中国)有限公司 Automatic testing method and device for interface
CN105759785A (en) * 2016-02-16 2016-07-13 珠海格力电器股份有限公司 Test equipment control method and device
CN108600048A (en) * 2018-04-12 2018-09-28 平安科技(深圳)有限公司 Interface test method, device, equipment and computer readable storage medium
CN109274526A (en) * 2018-08-31 2019-01-25 平安科技(深圳)有限公司 Test defect automatic early warning method, device, computer equipment and storage medium
CN109597729A (en) * 2018-10-29 2019-04-09 深圳壹账通智能科技有限公司 A kind of monitoring method and device based on analog subscriber test

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104360920A (en) * 2014-12-02 2015-02-18 微梦创科网络科技(中国)有限公司 Automatic testing method and device for interface
CN105759785A (en) * 2016-02-16 2016-07-13 珠海格力电器股份有限公司 Test equipment control method and device
CN108600048A (en) * 2018-04-12 2018-09-28 平安科技(深圳)有限公司 Interface test method, device, equipment and computer readable storage medium
CN109274526A (en) * 2018-08-31 2019-01-25 平安科技(深圳)有限公司 Test defect automatic early warning method, device, computer equipment and storage medium
CN109597729A (en) * 2018-10-29 2019-04-09 深圳壹账通智能科技有限公司 A kind of monitoring method and device based on analog subscriber test

Similar Documents

Publication Publication Date Title
CN106095673A (en) Automated testing method based on WEB interface and system
CN106991040A (en) Data-interface method of testing and device
CN103970614B (en) A kind of service test method and device
US10452725B2 (en) Web page recognizing method and apparatus
CN105955890B (en) A kind of generation method and device of functional test case
CN103885876B (en) Method of testing and equipment
CN109815321A (en) Question answering method, device, equipment and storage medium
CN109460353A (en) UDS auto-check system
CN109167812A (en) Evaluation services quality, the method for determining adjustable strategies, server and storage medium
CN109634841A (en) Electronic device, automatic interface testing method and storage medium
TW201216048A (en) Test system
CN109073537A (en) A kind of method, apparatus, terminal and the readable storage medium storing program for executing of substance detection
CN106844423A (en) A kind of method and device of Data Detection
CN110908892A (en) Interface data testing method and device and readable storage medium
CN108985379B (en) Method and device for evaluating performance of classifier and computer readable storage medium
CN109885444A (en) Test method, device, storage medium and terminal device based on gesture identification
CN106294106B (en) The test method and device of Web application system
CN110109826A (en) For method for early warning and relevant apparatus on the line of interface
CN111008130B (en) Intelligent question-answering system testing method and device
CN110109827A (en) For method for early warning and relevant apparatus on the line of the page
CN105244040B (en) A kind of audio signal consistency control methods
CN106682434A (en) Method and device for assessing disease risk
CN109033078B (en) The recognition methods of sentence classification and device, storage medium, processor
CN108419199A (en) Fault detection method, device and the equipment of acoustic signals, readable medium
CN110109825A (en) Method for early warning and relevant apparatus on line

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