CN110262933A - Test method, test device and storage medium - Google Patents
Test method, test device and storage medium Download PDFInfo
- Publication number
- CN110262933A CN110262933A CN201910199403.6A CN201910199403A CN110262933A CN 110262933 A CN110262933 A CN 110262933A CN 201910199403 A CN201910199403 A CN 201910199403A CN 110262933 A CN110262933 A CN 110262933A
- Authority
- CN
- China
- Prior art keywords
- call request
- state
- scheduled field
- data
- tables
- 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
Links
Landscapes
- Monitoring And Testing Of Exchanges (AREA)
- Debugging And Monitoring (AREA)
Abstract
A kind of test method, test device and storage medium are provided in the embodiment of the present application, this method comprises: receiving the first call request, wherein, scheduled field is provided with first state in the first call request for corresponding to non-test flow, and scheduled field is provided with the second state in the first call request for corresponding to test flow, the second state is different from first state;The thread in respective thread pond is called according to the state of the scheduled field in the first call request.Using the scheme in the embodiment of the present application, different threads is called according to different types of call request, to realize being isolated for test flow and general flow.
Description
Present patent application is application No. is 201510574104.8, and the applying date is on September 10th, 2015, denomination of invention
For the divisional application of the Chinese invention patent application of " a kind of flow partition method and device ".
Technical field
This application involves measuring technologies, more particularly to a kind of test method and dress for realizing flow isolation during the test
It sets.
Background technique
Production environment, which refers to, provides service to the computer system that real user on line uses, and is different from for developing and testing
Personnel such as are for example developed, are tested at the nonproductive environment that nonproductive activity uses.
Computer system refers to that the computer cluster for providing certain service e.g. provides article details browse page service
Computer cluster be known as a computer system, a computer system is made of multiple applications.
The subsystems of entire computer system are formed using being, such as article application relevant with article, and transaction
Relevant transaction application.Using can directly provide service, the service that other application provides also may rely on;Each application is logical
Cross the complementary function of calling and complete entire computer system together.
Calling mutually between each application and completing some function is exactly a calling link, applies B for example, calling using A
Service, complete the service using B, and need to call the service for applying C, such A calls B, triggering B to call C;A->B->
C is exactly a calling link.
User accesses system to request a calling link, the flow of referred to as one unit to computer system.
In the prior art, it in order to find the problems in production environment, needs to keep nonproductive environment and production environment
Height is consistent, it is common practice to the nonproductive activity such as directly be researched and developed or be tested in production environment.
But had the following problems using scheme in the prior art: the flow that nonproductive activity is generated with production activity without
Method isolation causes the flow of different purposes to generate cross influence.For example, the test data of tester's construction and user are using
The data generated when service cannot be distinguished, and user data is caused to pollute, it is also possible to cause user to see test data, and then generate
Failure in business dispute or line.
Summary of the invention
A kind of test method and device are provided in the embodiment of the present application, for solving the stream of different purposes in the prior art
The problem of amount can not be isolated.
According to the embodiment of the present application in a first aspect, providing a kind of test method, comprising: the first call request is received,
Wherein, scheduled field is provided with first state in the first call request for corresponding to non-test flow, and is surveyed corresponding to
It tries to be provided with scheduled field in the first call request of flow with the second state, the second state is different from first state;And root
The thread in respective thread pond is called according to the state of the scheduled field in the first call request.
Optionally, according to the state of the scheduled field in the first call request call respective thread pond in thread it
Before, further includes: creation first thread pond and the second thread pool, wherein first thread pond and the second thread pool equity.
Optionally, the step of thread in respective thread pond being called according to the state of the scheduled field in the first call request
In the case where including: that scheduled field in the first call request is in first state, the thread in first thread pond is called;?
In the case that scheduled field in first call request is in the second state, the thread in the second thread pool is called.
Optionally, this method can also include: the second call request of creation;According to the scheduled field in the first call request
Corresponding scheduled field in second call request is set;And send the second call request.
Optionally, this method can also include: the third call request that creation is directed to database;According to the first call request
In scheduled field setting third call request in corresponding scheduled field;And according to the scheduled field in third call request
State third call request is routed into corresponding tables of data in database.
Optionally, third call request is being routed to by database according to the state of the scheduled field in third call request
In before corresponding tables of data, further includes: the first tables of data of creation and the second tables of data, wherein the second tables of data is the first number
According to the mapping table of table.
Optionally, third call request is routed in database according to the state of the scheduled field in third call request
In the case that the step of corresponding tables of data includes: that the scheduled field in third call request is in first state, by third
Call request routes to the first tables of data;In the case that scheduled field in third call request is in the second state, then will
Third call request routes to the second tables of data.
Optionally, first state is to be not provided with scheduled field, and the second state is provided with scheduled field;Or
Under one state and the second state, respectively scheduled field is provided with different values.
According to the second aspect of the embodiment of the present application, a kind of test method is provided, comprising: the first call request is received,
Wherein, scheduled field is provided with first state in the first call request for corresponding to non-test flow, and is surveyed corresponding to
It tries to be provided with scheduled field in the first call request of flow with the second state, the second state is different from first state;Creation the
Two call requests;According to the scheduled field in the first call request, the corresponding scheduled field in the second call request is set;And
Send the second call request.
Optionally, first state is to be not provided with scheduled field, and the second state is provided with scheduled field;Or
Under one state and the second state, respectively scheduled field is provided with different values.
According to the third aspect of the embodiment of the present application, provide a kind of test method, comprising: creation for database the
Three call requests, wherein scheduled field is provided with first state in the third call request for corresponding to non-test flow, and
Scheduled field is provided with the second state in the third call request for corresponding to test flow, the second state is different from the first shape
State;And third call request is routed in database according to the state of the scheduled field in third call request and is counted accordingly
According to table.
Optionally, this method can also include: to receive the first call request, wherein correspond to the of non-test flow
Scheduled field is provided with first state in one call request, and with second in the first call request for corresponding to test flow
State is provided with scheduled field, and the second state is different from first state;And it is set according to the scheduled field in the first call request
Set the corresponding scheduled field in third call request.
Optionally, third call request is being routed to by database according to the state of the scheduled field in third call request
In before corresponding tables of data, further includes: the first tables of data of creation and the second tables of data, wherein the second tables of data is the first number
According to the mapping table of table.
Optionally, third call request is routed in database according to the state of the scheduled field in third call request
In the case that the step of corresponding tables of data includes: that the scheduled field in the first call request is in first state, by third
Call request routes to the first tables of data;In the case that scheduled field in the first call request is in the second state, then will
Third call request routes to the second tables of data.
Optionally, first state is to be not provided with scheduled field, and the second state is provided with scheduled field;Or
Under one state and the second state, respectively scheduled field is provided with different values.
According to the fourth aspect of the embodiment of the present application, a kind of test device is provided, comprising: receiving module, for receiving
First call request, wherein scheduled field is provided with first state in the first call request for corresponding to non-test flow,
And scheduled field is provided with the second state in the first call request for corresponding to test flow, the second state is different from first
State;And first calling module, for being called in respective thread pond according to the state of the scheduled field in the first call request
Thread.
Optionally, which can also include: thread creation module, for creating first thread pond and the second thread pool,
Wherein, first thread pond and the second thread pool equity.
Optionally, the first calling module includes: that first thread calls submodule, for predetermined in the first call request
In the case that field is in first state, the thread in first thread pond is called;And the second thread dispatching submodule, for
In the case that scheduled field in first call request is in the second state, the thread in the second thread pool is called.
Optionally, which can also include: the second call request creation module, for creating the second call request;The
One field setup module, the corresponding reserved word for being arranged in the second call request according to the scheduled field in the first call request
Section;And sending module, for sending the second call request.
Optionally, which can also include: third call request creation module, for creating the third for being directed to database
Call request;Second field setup module, for according in the scheduled field setting third call request in the first call request
Corresponding scheduled field;And routing module, for third to be called according to the state of the scheduled field in third call request
Request routes to corresponding tables of data in database.
Optionally, which can also include: tables of data creation module, for creating the first tables of data and the second data
Table, wherein the second tables of data is the mapping table of the first tables of data.
Optionally, routing module includes: the first via by submodule, is in for the scheduled field in third call request
In the case where first state, third call request is routed into the first tables of data;Secondary route submodule, for being called in third
In the case that scheduled field in request is in the second state, third call request is routed into the second tables of data.
Optionally, first state is to be not provided with scheduled field, and the second state is provided with scheduled field;Or
Under one state and the second state, respectively scheduled field is provided with different values.
According to the 5th of the embodiment of the present application the aspect, a kind of test device is provided, comprising: receiving module, for receiving
First call request, wherein scheduled field is provided with first state in the first call request for corresponding to non-test flow,
And scheduled field is provided with the second state in the first call request for corresponding to test flow, the second state is different from first
State;Second call request creation module, for creating the second call request;First field setup module, for according to first
The corresponding scheduled field in the second call request is arranged in scheduled field in call request;And sending module, for sending the
Two call requests.
According to the 6th of the embodiment of the present application the aspect, a kind of test device is provided, comprising: third call request creates mould
Block, for create be directed to database third call request, wherein correspond to non-test flow third call request in
First state is provided with scheduled field, and is provided with and is made a reservation for the second state in the third call request for corresponding to test flow
Field, the second state are different from first state;And routing module, for the shape according to the scheduled field in third call request
Third call request is routed to corresponding tables of data in database by state.
Optionally, which can also include: receiving module, for receiving the first call request, wherein non-corresponding to
It tests in the first call request of flow and scheduled field is provided with first state, and called in correspond to test flow first
Scheduled field is provided with the second state in request, the second state is different from first state;And the second field setup module, it uses
According to the corresponding scheduled field in the scheduled field setting third call request in the first call request.
Optionally, which can also include: tables of data creation module, for creating the first tables of data and the second data
Table, wherein the second tables of data is the mapping table of the first tables of data.
Optionally, routing module includes: the first via by submodule, is in for the scheduled field in third call request
In the case where first state, third call request is routed into the first tables of data;Secondary route submodule, for being called in third
In the case that scheduled field in request is in the second state, third call request is routed into the second tables of data.
According to the 7th of the embodiment of the present application the aspect, a kind of full link test method is provided, is applied to production environment, it is raw
Producing environment includes at least one application characterized by comprising at least one application receives call request, and call request includes
The call request that the call request and tester that user sends are initiated, the call request and tester's hair that wherein user sends
The call request risen has different states in identical scheduled field;At least one application passes through the thread in first thread pond
Handle the call request that user sends;And at least one application passes through the thread process tester initiation in the second thread
Call request.
Optionally, this method can also include: creation for the next call request for calling next application in link;According to
For the scheduled field in the call request of current application in calling link, the corresponding scheduled field in next call request is set;
And next call request is sent to next application.
Optionally, next call request includes HSF call request.
Optionally, this method can also include: next application according to corresponding predetermined in next call request
The state of field calls the thread in respective thread pond.
Optionally, this method can also include: to call the current application creation of link end for wide area information server
Call request;According to corresponding predetermined in being requested for the scheduled field setting data base call in the call request of current application
Field;And according to data base call request in scheduled field state by data base call request route to phase in database
The tables of data answered.
Optionally, the data base call request includes that JDBC is requested.
Optionally, this method can also include: the state according to the scheduled field in data base call request by institute
It states data base call request and routes to corresponding tables of data in the database.
According to the eighth aspect of the embodiment of the present application, a kind of computer readable storage medium is provided, being stored thereon with can
Execute code, when executable code is executed by the processor of electronic equipment, make processor execute such as above-mentioned the first to three and
The test method of 7th aspect.
According to the 9th of the embodiment of the present application the aspect, a kind of flow partition method is provided, comprising: receive the first calling and ask
It asks;Search the scheduled field in the first call request, wherein scheduled field is arranged according to the type of the first call request
's;And the thread in respective thread pond is called according to the state of the scheduled field in the first call request.
According to the tenth of the embodiment of the present application the aspect, a kind of flow isolating device is provided, comprising: receiving module is used for
Receive the first call request;Searching module, for searching the scheduled field in the first call request, wherein scheduled field is root
It is arranged according to the type of the first call request;First calling module, for according to the scheduled field in the first call request
State calls the thread in respective thread pond.
Using the test method and device in the embodiment of the present application, by searching for the class in call request according to call request
The scheduled field of type setting, and respective thread is called according to the state of the scheduled field, so that using can be according to inhomogeneity
Different threads is called in the call request of type, to realize the isolation of test flow and general flow.
Detailed description of the invention
Disclosure illustrative embodiments are described in more detail in conjunction with the accompanying drawings, the disclosure above-mentioned and its
Its purpose, feature and advantage will be apparent, wherein in disclosure illustrative embodiments, identical reference label
Typically represent same parts.
Fig. 1 is the method flow diagram that flow isolation is realized in test method shown in the embodiment of the present application one;
Fig. 2 is the structural representation of the device in test device shown in the embodiment of the present application two for realizing flow isolation
Figure;
Fig. 3 is the structural schematic diagram according to the computer system using flow isolating device of the embodiment of the present application three;
Fig. 4 is according to the data using A in the computer system using flow isolating device of the embodiment of the present application three
Process flow diagram;
Fig. 5 is according to the data using B in the computer system using flow isolating device of the embodiment of the present application three
Process flow diagram.
Specific embodiment
The preferred embodiment of the disclosure is more fully described below with reference to accompanying drawings.Although showing the disclosure in attached drawing
Preferred embodiment, however, it is to be appreciated that may be realized in various forms the disclosure without the embodiment party that should be illustrated here
Formula is limited.On the contrary, these embodiments are provided so that this disclosure will be more thorough and complete, and can be by the disclosure
Range is completely communicated to those skilled in the art.
In order to which technical solution in the embodiment of the present application and advantage is more clearly understood, below in conjunction with attached drawing to the application
Exemplary embodiment be described in more detail, it is clear that described embodiment be only the application a part implement
Example, rather than the exhaustion of all embodiments.It should be noted that in the absence of conflict, embodiment and reality in the application
The feature applied in example can be combined with each other.
During realizing the application, inventors have found that in the prior art, in order to find asking in production environment
Topic needs that nonproductive environment is made to keep height consistent with production environment, it is common practice to directly be ground in production environment
The nonproductive activity such as hair or test.
But had the following problems using scheme in the prior art: the flow that nonproductive activity is generated with production activity without
Method isolation causes the flow of different purposes to generate cross influence.For example, the test data of tester's construction and user are using
The data generated when service cannot be distinguished, and user data is caused to pollute, it is also possible to cause user to see test data, and then generate
Failure in business dispute or line;If either pressure verification flow and normal users flowing of access cannot distinguish between isolation,
Upper user resources that pressure verification flow can rob that the line is busy, cause user resources on line to exhaust and cannot provide normal service, influence be
Failure in the availability and then generation line of system.
In order to solve the problems, such as data contamination, relevant solution is also provided in the related technology, for example, in production ring
A nonproductive environment is built except border again, functional test and pressure verification work are done using another computer system, still
It is inconsistent with true production environment due to being the environment built, the problem of can not discovery inside some true environments, and take
It is also very high to build Environmental costs.
In view of the above-mentioned problems, a kind of test method provided herein and device, core concept are, in production environment
It is each application in, create multiple threads, different threads then called according to the type of call request, so that using being capable of root
Respective thread can be called according to scheduled field calling, to realize the isolation of flow.
The scheme provided in the embodiment of the present application can be applied on production environment line in the test products such as full link pressure survey.
Fig. 1 is the method flow diagram that flow isolation is realized in test method shown in the embodiment of the present application one.
As shown in Figure 1, the flow partition method according to shown in the embodiment of the present application one the following steps are included:
Step 102, the first call request is received;
Step 104, the scheduled field in the first call request is searched, wherein the scheduled field is to call to ask according to first
The type asked and be arranged;
Step 106, the thread in respective thread pond is called according to the state of the scheduled field in the first call request.
In the specific implementation, the type of the first call request may include generally calling, i.e. ordinary user, and such as buyer sells
The calling of the initiations such as family;It also may include that the test initiated such as tester is called;It can also include as research staff initiates
Research and development calling etc.;Specific type the application is with no restriction.
In the specific implementation, which can be HTTP (the HyperText Transfer of user's transmission
Protocol, hypertext transfer protocol) request, be also possible to upstream application be sent to downstream application, based on TCP
The remote method call frame HSF (High of (Transmission Control Protocol, transmission control protocol) long connection
Speed Framework, service call framework agreement) request, the application to this with no restriction.
In the specific implementation, the state of the scheduled field is corresponding with the type of the first call request, and can basis
The type adaptability of first call request is arranged;For example, (being removed if the first call request is divided into general call with special calling
It is general call other than calling), then can set the scheduled field of general call request to empty or be 0, and by special tune
It is set as 1 etc. with the scheduled field of request, general call request can also be set to not carrying scheduled field, and special calling
Request carries scheduled field etc.;If the first call request is divided into general calling, test is called and research and development are called;It can then incite somebody to action
The scheduled field of general call request is set as sky or 0, sets 1 for the scheduled field for testing call request, and research and development are called
The scheduled field of request is set as 2 etc.;It shows, and does not have to it will be appreciated by those skilled in the art that above are only exemplary purpose
In limitation the application.
In the specific implementation, the scheduled field of first call request can be the specific field in the call request, example
Such as, if first call request is HTTP request, which can be a certain special field in URL, such as flag
=test;If first call request is HSF request, which can be customized a certain special field, such as
Flag=test;The application to this with no restriction.
In the specific implementation, can be before receiving the first call request, it can also be in searching the first call request
Scheduled field before create corresponding with the type of the first call request thread pool.For example, if by the first call request
It is divided into general calling and special calling two types, then two thread pools can be pre-created;If by the first call request point
Three types are called generally to call, testing to call and research and develop, then three thread pools etc. can be pre-created;The application to this not
It is restricted.
In the specific implementation, the corresponding thread pool of different types of call request can be set as different size on demand
, it may be set to be equity, the application is without limitation.
Preferably, which is test call request, which carries scheduled field.
In the specific implementation, for the test call request received, using according to being carried in the test call request
Scheduled field judges that the call request received for test call request, is then called in the respective thread pond being pre-created
Thread, and thereby test call request can be isolated with general call request.
For example, user and tester send HTTP request to application A respectively, do not carried in the request that user sends predetermined
Field, tester send request in carry scheduled field;Judge using A predetermined without carrying in the request of user's transmission
Field is then put into the request of user in first thread pool;Judge to carry in the request of tester's transmission using A pre-
Determine field, then the request of tester is put into another thread pool;So that the flow of user and tester can
Different thread pools is called, is not interfere with each other, to realize the isolation between different types of flow.
Using the flow partition method in the embodiment of the present application, by searching for the type in call request according to call request
The scheduled field of setting, and the respective thread being pre-created is called according to the scheduled field, so that using can be according to difference
Different threads is called in the call request of type, to realize the isolation of flow.
Preferably, it is called in the respective thread pond being pre-created according to the state of the scheduled field in the first call request
Thread before, further includes: creation first thread pond and the second thread pool, wherein first thread pond and the second thread pool equity.
It in the specific implementation, can be by the class of the first call request to avoid test flow from seizing the flow of ordinary user
Type is set as two kinds, i.e., generally calls and test is called;Correspondingly, two thread pools can be created before calling thread pool.
Meanwhile in order to keep the environment for testing flow and general flow more consistent, two reciprocity thread pools can be created.
Preferably, it is called according to the state of the scheduled field in the first call request in the respective thread pond being pre-created
Thread specifically includes: judging whether carry scheduled field in the first call request;If it is judged that be it is no, then call First Line
The thread of Cheng Chizhong;If it is judged that be it is yes, then call the thread in the second thread pool.
To save system resource, it can only change other kinds of calling using a certain call request is remained unchanged
The mode of request distinguishes different types of call request;I.e., it is possible to which it is pre- not carry the first call request of a certain seed type
Determine field, and increases scheduled field in other kinds of first call request.
In addition to pressure test, common test flow is still less than general flow, therefore, general calling can be made to ask
Scheduled field is not carried in asking, and only carries scheduled field in the call request of the special flows such as test flow.
Preferably, it is called in the respective thread pond being pre-created according to the state of the scheduled field in the first call request
Thread after, further includes: creation the second call request;It is called and is asked according to the scheduled field setting second in the first call request
Corresponding scheduled field in asking;Send the second call request.
Call the application in link except the corresponding line of state calling according to scheduled field in the first call request received
Except the thread of Cheng Chizhong, also the state of the scheduled field further will be transferred to the next application called in link, so that
Next application can continue to isolation flow.
In the specific implementation, which can be HSF request, be also possible to adjust using the application of other agreements
With request, the application is with no restriction.
Preferably, it is called in the respective thread pond being pre-created according to the state of the scheduled field in the first call request
Thread after, further includes: creation third call request;It is called and is asked according to the scheduled field setting third in the first call request
Corresponding scheduled field in asking;Third call request is routed to accordingly according to the state of the scheduled field in third call request
Tables of data.
In the specific implementation, in the application for calling link end, except according to predetermined in the first call request received
The state of field is called except the thread in respective thread pond, and also further the scheduled field will be arranged to the to database
In three call requests, so that database can continue to isolation flow.
In the specific implementation, the third call request can be JDBC (Java Data Base Connectivity,
The connection of java database) request, be also possible to the request using other data base call agreements, the application to this with no restriction.
In the specific implementation, the scheduled field in the third call request can be the table name in SQL syntax, for example, right
In the general calling that ordinary user initiates, A is set by the table name;The test initiated for tester is called, and table name is set
It is set to B etc.;Those skilled in the art should can, as long as the type of calling can be distinguished by the scheduled field.
Preferably, third call request is routed to accordingly according to the state of the scheduled field in third call request
Before tables of data, further includes: the first tables of data of creation and the second tables of data, wherein the second tables of data is reflecting for the first tables of data
Firing table.
For flow is further isolated, when it is implemented, can be created in database one it is complete with the table structure of original table C
Complete consistent mapping table D, for convenient for distinguishing, the table name of mapping table D can be different with the table name of original table C.
Preferably, third call request is routed to by corresponding number according to the state of the scheduled field in third call request
It is specifically included according to table: judging whether carry scheduled field in third call request;If it is judged that be it is no, then third is called
Request routes to the first tables of data (for example, original table);If it is judged that be it is yes, then third call request is routed to second
Tables of data (for example, mapping table D of original table).
In the specific implementation, the applying after calling corresponding thread pool of link end is called, needs further call
Request routes to tables of data, before being routed to tables of data, it can be determined that and whether the scheduled field in JDBC request is empty, if it is
Sky then directly routes requests to original table C;The test call request initiated for tester, it can be determined that go out JDBC and ask
Scheduled field in asking is not sky, then routes requests to mapping table D, the directly table name in replacement SQL statement.
Using the test method in the embodiment of the present application, general call request and special call request can be calculated at one
It is processed in machine system, and data are completely stored in a database, and general normal data storage is surveyed in original table
It tries data storage in the mapping table, has accomplished to be mutually isolated between flow not influencing, the isolation between data does not influence mutually, Ke Yiyou
The completion functional test of effect and pressure verification test.
Based on the same inventive concept, a kind of test device is additionally provided in the embodiment of the present application, since device solution is asked
The principle of topic is similar to method provided by the embodiment of the present application, therefore the implementation of the device may refer to the implementation of method, weight
Multiple place repeats no more.
Fig. 2 is the structural schematic diagram of the device in test device shown in the embodiment of the present application two for realizing flow isolation.
As shown in Fig. 2, the flow isolating device 200 according to the embodiment of the present application two, comprising: receiving module 202 is used for
Receive the first call request;Searching module 204, for searching the scheduled field in the first call request, wherein scheduled field is
It is arranged according to the type of the first call request;First calling module 206, for according to the reserved word in the first call request
The state of section calls the thread in the respective thread pond being pre-created.
Preferably, the flow isolating device 200 according to the embodiment of the present application two further include: thread creation module 208 is used
In creation first thread pond and the second thread pool, wherein first thread pond and second thread pool equity.
Preferably, the first calling module specifically includes: the first judging submodule, for judge in the first call request whether
Carry scheduled field;First thread calls submodule, for when the judgment result is No, calling the thread in first thread pond;
Second thread dispatching submodule, for when the judgment result is yes, calling the thread in the second thread pool.
Preferably, the flow isolating device 200 according to the embodiment of the present application two further include: the second call request creates mould
Block, for creating the second call request;First field setup module, for being arranged according to the scheduled field in the first call request
Corresponding scheduled field in second call request;Sending module, for sending the second call request.
Preferably, the flow isolating device 200 according to the embodiment of the present application two further include: third call request creates mould
Block, for creating third call request;Second field setup module, for being arranged according to the scheduled field in the first call request
Corresponding scheduled field in third call request;Routing module, for the state according to the scheduled field in third call request
Third call request is routed into corresponding tables of data.
Preferably, the flow isolating device 200 according to the embodiment of the present application two further include: tables of data creation module is used
In the first tables of data of creation and the second tables of data, wherein the second tables of data is the mapping table of the first tables of data.
Preferably, routing module specifically includes: second judgment submodule, for judging whether carry in third call request
Scheduled field;The first via is by submodule, for when the judgment result is No, third call request being routed to the first tables of data;
Secondary route submodule, for when the judgment result is yes, third call request being routed to the second tables of data.
Preferably, which is test call request, which carries scheduled field.
Using the flow isolating device in the embodiment of the present application, general call request and special call request can be at one
It is processed in computer system, and data are completely stored in a database, and general normal data storage is in original table
In, test data stores in the mapping table, has accomplished to be mutually isolated between flow not influencing, and the isolation between data does not influence mutually,
Functional test and pressure verification test can effectively be completed.
Fig. 3 is the structural schematic diagram according to the computer system using flow isolating device of the embodiment of the present application three.
Fig. 4 is according to the data using A in the computer system using flow isolating device of the embodiment of the present application three
Process flow diagram.
Fig. 5 is according to the data using B in the computer system using flow isolating device of the embodiment of the present application three
Process flow diagram.
As shown in figure 3, in the computer system using flow isolating device according to the embodiment of the present application three, current
Link is called to include two application A and apply B, respectively there are two reciprocity thread pools to be used to handle not for creation using in A and application B
Same flow;Tables of data C and tables of data D are stored in database;Tables of data D is the mapping table of C.
There is first flow isolating device provided by the embodiments of the present application using increasing newly in A, including receiving module, lookup mould
Block, the first calling module, the first call request creation module, the first field setup module and sending module, searching module are used for
The call request received is put into thread pool if nothing with the presence or absence of scheduled field in identification http protocol and HSF agreement
1, if so, call request is then put into thread pool 2, accomplish that flow is isolated;First call request creation module, the first field are set
It sets module and sending module is used to scheduled field being transferred to next application.The flow partition method process such as Fig. 4 executed using A
It is shown.
There is second flow isolating device provided by the embodiments of the present application using increasing newly in B, comprising: receiving module searches mould
Block, the first calling module, third call request creation module, the second field setup module and routing module, searching module are used for
The call request received is put into thread pool 2 if nothing with the presence or absence of scheduled field in identification HSF agreement, if so,
Call request is then put into thread pool 4, accomplishes that flow is isolated;Third call request creation module, the second field setup module and
Routing module is used to route to different tables of data according to by different requests.For example, the common tune initiated for general user
With request, it is not provided with scheduled field, routing module finds that scheduled field is not present in JDBC agreement, directly routes requests to original
Beginning table C;When tester initiates test request, special scheduled field is set to request, routing module recognizes the reserved word
Section, directly replacement table name, route requests to mapping table D.The flow partition method process difference executed using B is as shown in Figure 5.
Using the testing scheme in the embodiment of the present application, request is completely processed in a system and computer cluster,
Normal data storage is in original table, and test data stores in the mapping table, and data are completely stored in a database, are accomplished
Being mutually isolated the isolation not influenced between data between flow does not influence mutually, can effectively complete functional test and pressure
Validation test.
It should be understood by those skilled in the art that, embodiments herein can provide as method, system or computer program
Product.Therefore, complete hardware embodiment, complete software embodiment or reality combining software and hardware aspects can be used in the application
Apply the form of example.Moreover, it wherein includes the computer of computer usable program code that the application, which can be used in one or more,
The computer program implemented in usable storage medium (including but not limited to magnetic disk storage, CD-ROM, optical memory etc.) produces
The form of product.
The application is referring to method, the process of equipment (system) and computer program product according to the embodiment of the present application
Figure and/or block diagram describe.It should be understood that every one stream in flowchart and/or the block diagram can be realized by computer program instructions
The combination of process and/or box in journey and/or box and flowchart and/or the block diagram.It can provide these computer programs
Instruct the processor of general purpose computer, special purpose computer, Embedded Processor or other programmable data processing devices to produce
A raw machine, so that being generated by the instruction that computer or the processor of other programmable data processing devices execute for real
The device for the function of being specified in present one or more flows of the flowchart and/or one or more blocks of the block diagram.
These computer program instructions, which may also be stored in, is able to guide computer or other programmable data processing devices with spy
Determine in the computer-readable memory that mode works, so that it includes referring to that instruction stored in the computer readable memory, which generates,
Enable the manufacture of device, the command device realize in one box of one or more flows of the flowchart and/or block diagram or
The function of being specified in multiple boxes.
These computer program instructions also can be loaded onto a computer or other programmable data processing device, so that counting
Series of operation steps are executed on calculation machine or other programmable devices to generate computer implemented processing, thus in computer or
The instruction executed on other programmable devices is provided for realizing in one or more flows of the flowchart and/or block diagram one
The step of function of being specified in a box or multiple boxes.
Although the preferred embodiment of the application has been described, it is created once a person skilled in the art knows basic
Property concept, then additional changes and modifications may be made to these embodiments.So it includes excellent that the following claims are intended to be interpreted as
It selects embodiment and falls into all change and modification of the application range.
Obviously, those skilled in the art can carry out various modification and variations without departing from the essence of the application to the application
Mind and range.In this way, if these modifications and variations of the application belong to the range of the claim of this application and its equivalent technologies
Within, then the application is also intended to include these modifications and variations.
Claims (36)
1. a kind of test method characterized by comprising
Receive the first call request, wherein be provided in the first call request for corresponding to non-test flow with first state
Scheduled field, and the scheduled field is provided with the second state in the first call request for corresponding to test flow, it is described
Second state is different from the first state;And
The thread in respective thread pond is called according to the state of the scheduled field in first call request.
2. according to the method described in claim 1, calling phase according to the state of the scheduled field in first call request
Before answering the thread in thread pool, further includes:
Create first thread pond and the second thread pool, wherein the first thread pond and second thread pool equity.
3. according to the method described in claim 2, being called according to the state of the scheduled field in first call request corresponding
The step of thread in thread pool includes:
In the case that scheduled field in first call request is in first state, the line in first thread pond is called
Journey;
In the case that scheduled field in first call request is in the second state, the line in the second thread pool is called
Journey.
4. according to the method described in claim 1, further include:
Create the second call request;
According to the scheduled field in first call request, the corresponding scheduled field in second call request is set;And
Send second call request.
5. according to the method described in claim 1, further include:
Creation is directed to the third call request of database;
According to the scheduled field in first call request, the corresponding scheduled field in the third call request is set;And
The third call request is routed into the database according to the state of the scheduled field in the third call request
In corresponding tables of data.
6. according to the method described in claim 5, will be described according to the state of the scheduled field in the third call request
Third call request routes in the database before corresponding tables of data, further includes:
Create the first tables of data and the second tables of data, wherein second tables of data is the mapping table of first tables of data.
7. according to the method described in claim 6, according to the state of the scheduled field in the third call request by described
Three call requests route to the step of corresponding tables of data in the database and include:
In the case that scheduled field in the third call request is in first state, the third call request is routed
To the first tables of data;
In the case that scheduled field in the third call request is in the second state, then by third call request road
By to the second tables of data.
8. method according to any one of claim 1 to 7, wherein
The first state is to be not provided with the scheduled field, and second state is provided with the scheduled field;Or
Person
Under the first state and second state, the respectively described scheduled field is provided with different values.
9. a kind of test method characterized by comprising
Receive the first call request, wherein be provided in the first call request for corresponding to non-test flow with first state
Scheduled field, and the scheduled field is provided with the second state in the first call request for corresponding to test flow, it is described
Second state is different from the first state;
Create the second call request;
According to the scheduled field in first call request, the corresponding scheduled field in second call request is set;And
Send second call request.
10. according to the method described in claim 9, wherein,
The first state is to be not provided with the scheduled field, and second state is provided with the scheduled field;Or
Person
Under the first state and second state, the respectively described scheduled field is provided with different values.
11. a kind of test method characterized by comprising
Creation is directed to the third call request of database, wherein with the in the third call request for corresponding to non-test flow
One state is provided with scheduled field, and with the second state provided with described pre- in the third call request for corresponding to test flow
Determine field, second state is different from the first state;And
The third call request is routed into the database according to the state of the scheduled field in the third call request
In corresponding tables of data.
12. according to the method for claim 11, further includes:
Receive the first call request, wherein be provided in the first call request for corresponding to non-test flow with first state
Scheduled field, and the scheduled field is provided with the second state in the first call request for corresponding to test flow, it is described
Second state is different from the first state;And
According to the scheduled field in first call request, the corresponding scheduled field in the third call request is set.
13. according to the method for claim 11, according to the state of the scheduled field in the third call request by institute
Third call request is stated to route in the database before corresponding tables of data, further includes:
Create the first tables of data and the second tables of data, wherein second tables of data is the mapping table of first tables of data.
14. according to the method for claim 13, will be described according to the state of the scheduled field in the third call request
Third call request routes to the step of corresponding tables of data in the database and includes:
In the case that scheduled field in first call request is in first state, the third call request is routed
To the first tables of data;
In the case that scheduled field in first call request is in the second state, then by third call request road
By to the second tables of data.
15. method described in any one of 1 to 14 according to claim 1, wherein
The first state is to be not provided with the scheduled field, and second state is provided with the scheduled field;Or
Person
Under the first state and second state, the respectively described scheduled field is provided with different values.
16. a kind of test device characterized by comprising
Receiving module, for receiving the first call request, wherein with the in the first call request for corresponding to non-test flow
One state is provided with scheduled field, and with the second state provided with described pre- in the first call request for corresponding to test flow
Determine field, second state is different from the first state;And
First calling module, for being called in respective thread pond according to the state of the scheduled field in first call request
Thread.
17. device according to claim 16, further includes:
Thread creation module, for creating first thread pond and the second thread pool, wherein the first thread pond and described second
Thread pool equity.
18. device according to claim 17, first calling module include:
The case where first thread calls submodule, is in first state for the scheduled field in first call request
Under, call the thread in first thread pond;And
Second thread dispatching submodule, the case where being in the second state for the scheduled field in first call request
Under, call the thread in the second thread pool.
19. device according to claim 16, further includes:
Second call request creation module, for creating the second call request;
First field setup module, for second call request to be arranged according to the scheduled field in first call request
In corresponding scheduled field;And
Sending module, for sending second call request.
20. device according to claim 16, further includes:
Third call request creation module, for creating the third call request for being directed to database;
Second field setup module, for the third call request to be arranged according to the scheduled field in first call request
In corresponding scheduled field;And
Routing module, for being routed the third call request according to the state of the scheduled field in the third call request
To corresponding tables of data in the database.
21. device according to claim 20, further includes:
Tables of data creation module, for creating the first tables of data and the second tables of data, wherein second tables of data is described the
The mapping table of one tables of data.
22. device according to claim 21, the routing module include:
The first via is by submodule, will in the case where being in first state for the scheduled field in the third call request
The third call request routes to the first tables of data;
Secondary route submodule will in the case where being in the second state for the scheduled field in the third call request
The third call request routes to the second tables of data.
23. device described in any one of 6 to 22 according to claim 1, wherein
The first state is to be not provided with the scheduled field, and second state is provided with the scheduled field;Or
Person
Under the first state and second state, the respectively described scheduled field is provided with different values.
24. a kind of test device characterized by comprising
Receiving module, for receiving the first call request, wherein with the in the first call request for corresponding to non-test flow
One state is provided with scheduled field, and with the second state provided with described pre- in the first call request for corresponding to test flow
Determine field, second state is different from the first state;
Second call request creation module, for creating the second call request;
First field setup module, for second call request to be arranged according to the scheduled field in first call request
In corresponding scheduled field;And
Sending module, for sending second call request.
25. a kind of test device characterized by comprising
Third call request creation module, for creating the third call request for being directed to database, wherein non-test corresponding to
Scheduled field is provided with first state in the third call request of flow, and in the third call request for corresponding to test flow
In with the second state be provided with the scheduled field, second state be different from the first state;And
Routing module, for being routed the third call request according to the state of the scheduled field in the third call request
To corresponding tables of data in the database.
26. test device according to claim 25, further includes:
Receiving module, for receiving the first call request, wherein with the in the first call request for corresponding to non-test flow
One state is provided with scheduled field, and with the second state provided with described pre- in the first call request for corresponding to test flow
Determine field, second state is different from the first state;And
Second field setup module is called for the third to be arranged according to the scheduled field in first call request
Corresponding scheduled field in request.
27. device according to claim 25, further includes:
Tables of data creation module, for creating the first tables of data and the second tables of data, wherein second tables of data is described the
The mapping table of one tables of data.
28. device according to claim 27, the routing module include:
The first via is by submodule, will in the case where being in first state for the scheduled field in the third call request
The third call request routes to the first tables of data;
Secondary route submodule will in the case where being in the second state for the scheduled field in the third call request
The third call request routes to the second tables of data.
29. a kind of full link test method is applied to production environment, the production environment includes at least one application, feature
It is, comprising:
At least one described application receives HTTP call request, and the HTTP call request includes that the HTTP calling of user's transmission is asked
The HTTP call request that the tester that sums initiates, wherein HTTP call request and the tester that the user sends are sent out
The HTTP call request risen has different states in identical scheduled field;
The HTTP call request that at least one described application is sent by user described in the thread process in first thread pond;
The HTTP call request that at least one described application is initiated by tester described in the thread process in the second thread.
30. full link test method according to claim 29, further includes:
Creation is for the next call request for calling next application in link;
It is arranged in next call request according to the scheduled field in the call request for current application in calling link
Corresponding scheduled field;And
Next call request is sent to next application.
31. full link test method according to claim 30, wherein
Next call request includes HSF call request.
32. full link test method according to claim 30, further includes:
Next application is called in respective thread pond according to the state of the corresponding scheduled field in next call request
Thread.
33. full link test method according to claim 30, further includes:
The current application creation of link end is called to be directed to wide area information server call request;
It is corresponding predetermined in the data base call request according to being arranged for the scheduled field in the call request of current application
Field;And
Data base call request is routed into the number according to the state of the scheduled field in data base call request
According to tables of data corresponding in library.
34. full link test method according to claim 33, wherein
The data base call request includes that JDBC is requested.
35. full link test method according to claim 33, further includes:
Data base call request is routed into the number according to the state of the scheduled field in data base call request
According to tables of data corresponding in library.
36. a kind of computer readable storage medium, is stored thereon with executable code, when the executable code is by electronic equipment
Processor when executing, execute the processor as described in any one of claim 1 to 15 and claim 29-34
Method.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910199403.6A CN110262933B (en) | 2015-09-10 | 2015-09-10 | Test method, test device, and storage medium |
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910199403.6A CN110262933B (en) | 2015-09-10 | 2015-09-10 | Test method, test device, and storage medium |
CN201510574104.8A CN106528362B (en) | 2015-09-10 | 2015-09-10 | A kind of flow partition method and device |
Related Parent Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201510574104.8A Division CN106528362B (en) | 2015-09-10 | 2015-09-10 | A kind of flow partition method and device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN110262933A true CN110262933A (en) | 2019-09-20 |
CN110262933B CN110262933B (en) | 2023-05-02 |
Family
ID=58346071
Family Applications (2)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201510574104.8A Active CN106528362B (en) | 2015-09-10 | 2015-09-10 | A kind of flow partition method and device |
CN201910199403.6A Active CN110262933B (en) | 2015-09-10 | 2015-09-10 | Test method, test device, and storage medium |
Family Applications Before (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201510574104.8A Active CN106528362B (en) | 2015-09-10 | 2015-09-10 | A kind of flow partition method and device |
Country Status (1)
Country | Link |
---|---|
CN (2) | CN106528362B (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113157548A (en) * | 2020-01-07 | 2021-07-23 | 阿里巴巴集团控股有限公司 | Test method, test device and application tester |
CN115695241A (en) * | 2022-10-21 | 2023-02-03 | 深圳市正浩创新科技股份有限公司 | Communication pressure testing method and electronic equipment |
Families Citing this family (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108628636A (en) * | 2017-03-24 | 2018-10-09 | 北京京东尚科信息技术有限公司 | Method, apparatus, electronic equipment and the readable storage medium storing program for executing of system business isolation |
CN107341056A (en) * | 2017-07-05 | 2017-11-10 | 郑州云海信息技术有限公司 | A kind of method and device of the thread distribution based on NFS |
CN110019339B (en) * | 2017-11-20 | 2021-11-30 | 北京京东尚科信息技术有限公司 | Data query method and system |
CN108933713B (en) * | 2018-07-20 | 2022-08-26 | 创新先进技术有限公司 | Method and device for realizing sandbox debugging based on shadow link and business server |
CN109614314B (en) * | 2018-11-01 | 2024-03-01 | 北京奇虎科技有限公司 | Performance test method, device, server and readable storage medium |
CN115225666A (en) * | 2022-07-07 | 2022-10-21 | 支付宝(杭州)信息技术有限公司 | Production drilling method, device and system, emergency rule platform and injection platform |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101777008A (en) * | 2009-12-31 | 2010-07-14 | 中兴通讯股份有限公司 | Method and device for realizing mobile terminal system thread pool |
CN102143523A (en) * | 2010-11-18 | 2011-08-03 | 华为技术有限公司 | Service delivery platform and application testing method based on service delivery platform |
CN102868628A (en) * | 2011-07-06 | 2013-01-09 | 阿里巴巴集团控股有限公司 | Flow segmentation method, device and system |
CN103064780A (en) * | 2011-10-18 | 2013-04-24 | 阿里巴巴集团控股有限公司 | Software testing method and device thereof |
US8977607B1 (en) * | 2014-02-28 | 2015-03-10 | Linkedin Corporation | System and method for threading electronic messages |
Family Cites Families (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6418544B1 (en) * | 1999-06-22 | 2002-07-09 | International Business Machines Corporation | Use of a client meta-cache for realistic high-level web server stress testing with minimal client footprint |
US8254409B2 (en) * | 2009-12-01 | 2012-08-28 | Cisco Technology, Inc. | User isolation between network devices |
JP5869099B2 (en) * | 2011-03-30 | 2016-02-24 | アマゾン・テクノロジーズ、インコーポレイテッド | Framework and interface for offload device-based packet processing |
WO2013081962A1 (en) * | 2011-11-29 | 2013-06-06 | Amazon Technologies, Inc. | Interfaces to manage direct network peerings |
CN103139039B (en) * | 2013-02-25 | 2016-07-13 | 汉柏科技有限公司 | A kind of virtual network realizing flow isolation control and construction method |
CN104219316B (en) * | 2014-09-12 | 2018-03-23 | 微梦创科网络科技(中国)有限公司 | A kind of call request processing method and processing device in distributed system |
-
2015
- 2015-09-10 CN CN201510574104.8A patent/CN106528362B/en active Active
- 2015-09-10 CN CN201910199403.6A patent/CN110262933B/en active Active
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101777008A (en) * | 2009-12-31 | 2010-07-14 | 中兴通讯股份有限公司 | Method and device for realizing mobile terminal system thread pool |
CN102143523A (en) * | 2010-11-18 | 2011-08-03 | 华为技术有限公司 | Service delivery platform and application testing method based on service delivery platform |
CN102868628A (en) * | 2011-07-06 | 2013-01-09 | 阿里巴巴集团控股有限公司 | Flow segmentation method, device and system |
CN103064780A (en) * | 2011-10-18 | 2013-04-24 | 阿里巴巴集团控股有限公司 | Software testing method and device thereof |
US8977607B1 (en) * | 2014-02-28 | 2015-03-10 | Linkedin Corporation | System and method for threading electronic messages |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113157548A (en) * | 2020-01-07 | 2021-07-23 | 阿里巴巴集团控股有限公司 | Test method, test device and application tester |
CN115695241A (en) * | 2022-10-21 | 2023-02-03 | 深圳市正浩创新科技股份有限公司 | Communication pressure testing method and electronic equipment |
Also Published As
Publication number | Publication date |
---|---|
CN106528362A (en) | 2017-03-22 |
CN106528362B (en) | 2019-03-19 |
CN110262933B (en) | 2023-05-02 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110262933A (en) | Test method, test device and storage medium | |
RU2648966C2 (en) | Apparatus and method for processing multiple open api | |
CN105302710B (en) | The method and apparatus that a kind of determination needs the test case of regression test | |
CN110310034A (en) | A kind of service orchestration applied to SaaS, business flow processing method and apparatus | |
CN108683562A (en) | Abnormality detection localization method, device, computer equipment and storage medium | |
CN107391142A (en) | The method and device that a kind of application is split | |
CN108647141A (en) | Automatic test approach, device, computer-readable medium and electronic equipment | |
CN102236549A (en) | Visualization of runtime analysis across dynamic boundaries | |
JP2017514218A (en) | Running third-party applications | |
KR102180267B1 (en) | System for providing online to offline based fashion production matching service connecting client to contractor in clothing industry | |
CN106126540A (en) | Data base access system and access method thereof | |
CN109783388A (en) | UI automated testing method, device and electronic equipment | |
CN109460841A (en) | User's account-opening method, system and storage medium | |
CN106648556A (en) | Front end and back end integrated development testing method and device | |
JP2018067302A (en) | Software service execution device, system, and method | |
CN109960639A (en) | A kind of method and apparatus generating test case | |
CN109194714A (en) | A kind of official documents and correspondence method for pushing, device, terminal device and storage medium | |
CN107341235A (en) | Report form inquiring method, device, medium and electronic equipment | |
CN109242288A (en) | Performance data matching process and system | |
CN109976999A (en) | The measure and measurement apparatus of test case coverage rate | |
CN108694120A (en) | The method and apparatus of testing service component | |
CN111008008A (en) | Micro-service architecture-based application development method and system | |
CN106294037A (en) | Strike-machine method of testing and device | |
CN109471791A (en) | A kind of demand response communication consistency testing system and method | |
CN109753424A (en) | The method and apparatus of AB test |
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 |