CN108733527A - System, method and apparatus for test server function - Google Patents

System, method and apparatus for test server function Download PDF

Info

Publication number
CN108733527A
CN108733527A CN201710269981.3A CN201710269981A CN108733527A CN 108733527 A CN108733527 A CN 108733527A CN 201710269981 A CN201710269981 A CN 201710269981A CN 108733527 A CN108733527 A CN 108733527A
Authority
CN
China
Prior art keywords
server
virtual objects
target
establishment data
tested
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201710269981.3A
Other languages
Chinese (zh)
Other versions
CN108733527B (en
Inventor
孔祥云
王少华
胡文萍
张琪
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Jingdong Century Trading Co Ltd
Beijing Jingdong Shangke Information Technology Co Ltd
Original Assignee
Beijing Jingdong Century Trading Co Ltd
Beijing Jingdong Shangke Information Technology 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 Beijing Jingdong Century Trading Co Ltd, Beijing Jingdong Shangke Information Technology Co Ltd filed Critical Beijing Jingdong Century Trading Co Ltd
Priority to CN201710269981.3A priority Critical patent/CN108733527B/en
Publication of CN108733527A publication Critical patent/CN108733527A/en
Application granted granted Critical
Publication of CN108733527B publication Critical patent/CN108733527B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/22Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing
    • G06F11/26Functional testing
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network

Landscapes

  • Engineering & Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer And Data Communications (AREA)
  • Debugging And Monitoring (AREA)

Abstract

This application discloses system, the method and apparatus for test server function.One specific implementation mode of the system includes:Server to be tested, master server and from server cluster;Master server, the establishment data of at least one virtual objects for receiving client transmission, selects from server as target from from server cluster from server, and the establishment data of at least one virtual objects are sent to target from server;Target is used for the establishment data based at least one virtual objects, creates at least one virtual objects from server;Server to be tested carries out functional test for calling at least one virtual objects.This embodiment improves the successfully tested rates of server capability to be tested.

Description

System, method and apparatus for test server function
Technical field
This application involves field of computer technology, and in particular to technical field of measurement and test, more particularly, to test server System, the method and apparatus of function.
Background technology
With the development of business event, the system for supporting business event operation also becomes increasingly complex.Under normal conditions, The system will include multiple servers, interdepend between these servers, to realize the function of each server.
When needing to test the function of some server, need in the system with the server there are dependence other The cooperation of server.Therefore, when with server to be tested there are when other server normal operations of dependence, clothes to be tested The functional test success of business device;When being not normally functioning there are other servers of dependence with server to be tested, wait for The functional test of test server fails.
However, when testing the function of some server, there are other servers of dependence are usual with the server It is not normally functioning, results in the successfully tested rate of server capability relatively low in this way.
Invention content
The purpose of the application is to propose a kind of improved system, method and apparatus for test server function, come Solve the technical issues of background section above is mentioned.
In a first aspect, the embodiment of the present application provides a kind of system for test server function, which includes:It waits for Test server, master server and from server cluster;Master server, for receiving at least one virtual right of client transmission The establishment data of elephant, select from server as target from from server cluster from server, and will be at least one virtual The establishment data of object are sent to target from server;Target is used for the establishment based at least one virtual objects from server Data create at least one virtual objects;Server to be tested carries out functional test for calling at least one virtual objects.
In some embodiments, master server is additionally operable to:Receive the establishment at least one virtual objects that client is sent Request, wherein request to create includes agreement used in each virtual objects at least one virtual objects;For at least one Each virtual objects in a virtual objects select and the virtual objects institute from pre-stored establishment data template set The corresponding establishment data template of agreement used, wherein create each establishment data template difference in data template set Corresponding different agreement;The establishment data template of selected taking-up is sent to client, so that wound of the client to selected taking-up It builds data template to modify, generates the establishment data of the virtual objects.
In some embodiments, master server is specifically used for:Poll is from the idle end of the slave server in server cluster Mouth quantity, until determine the slave server of at least one virtual objects of idle port quantity satisfaction establishment, stopping poll, and by The slave server determined is as target from server.
In some embodiments, master server is specifically used for:It obtains from each sky from server in server cluster Not busy port number;Meet to select in the slave server for creating at least one virtual objects from idle port quantity and make from server It is target from server.
In some embodiments, master server is specifically used for:It randomly selects out from from server cluster and makees from server It is target from server.
In some embodiments, target is specifically used for from server:It is virtual right for each of at least one virtual objects As assignment of port numbers;The establishment data of port numbers and at least one virtual objects based at least one virtual objects create extremely Few virtual objects.
In some embodiments, target is additionally operable to from server:The port numbers of at least one virtual objects are sent to master Server.
In some embodiments, server to be tested, is specifically used for:At least one virtual objects are obtained from master server Port numbers;The port indicated by port numbers by least one virtual objects, at least one virtual objects of far call carry out Functional test.
Second aspect, the embodiment of the present application provide a kind of method of the test server function for master server, main Server is connect with client, server to be tested and from each in server cluster from server communication respectively, to be tested Server is connect with from each in server cluster from server communication;This method includes:Client is received to send at least The establishment data of one virtual objects;It is selected from from server cluster from server as target from server;It will at least The establishment data of one virtual objects are sent to target from server, so that target is based at least one virtual objects from server Establishment data, create at least one virtual objects, at least one virtual objects of server calls to be tested carry out function survey Examination.
In some embodiments, before the establishment data for receiving at least one virtual objects that client is sent, further include: Receive the request to create at least one virtual objects that client is sent, wherein request to create includes at least one virtual objects In each virtual objects used in agreement;For each virtual objects at least one virtual objects, from prestoring Establishment data template set in select establishment data template corresponding with agreement used in the virtual objects, wherein The each establishment data template created in data template set corresponds to different agreements respectively;By the establishment data mould of selected taking-up Plate is sent to client, so that client modifies to the establishment data template of selected taking-up, generates the wound of the virtual objects Build data.
In some embodiments, it is selected from server as target from server from from server cluster, including:Wheel The idle port quantity from the slave server in server cluster is ask, until determining that idle port quantity meets creates at least one The slave server of a virtual objects stops poll, and using the slave server determined as target from server.
In some embodiments, it is selected from server as target from server from from server cluster, including:It obtains It takes from each idle port quantity from server in server cluster;Meet from idle port quantity and creates at least one void It is selected in the slave server of quasi- object from server as target from server.
In some embodiments, it is selected from server as target from server from from server cluster, including:From It is randomly selected out from server cluster from server as target from server.
The third aspect, the embodiment of the present application provide a kind of device of the test server function for master server, main Server is connect with client, server to be tested and from each in server cluster from server communication respectively, to be tested Server is connect with from each in server cluster from server communication;The device includes:Create data receipt unit, configuration Establishment data at least one virtual objects for receiving client transmission;Target is configured to from server selection unit It is selected from from server cluster from server as target from server;Data transmission unit is created, is configured near The establishment data of few virtual objects are sent to target from server so that target be based on from server it is at least one virtual right The establishment data of elephant, create at least one virtual objects, and at least one virtual objects of server calls to be tested carry out function survey Examination.
In some embodiments, which further includes:Request to create receiving unit is configured to receive what client was sent The request to create of at least one virtual objects, wherein request to create includes each virtual objects at least one virtual objects Used agreement;Data template selection unit is created, it is virtual right for each of at least one virtual objects to be configured to As selecting establishment number corresponding with agreement used in the virtual objects from pre-stored establishment data template set According to template, wherein each establishment data template created in data template set corresponds to different agreements respectively;Create data mould Plate transmission unit is configured to the establishment data template of selected taking-up being sent to client, so that client is to selected taking-up Establishment data template modify, generate the establishment data of the virtual objects.
In some embodiments, target is further configured to from server selection unit:Poll is from server cluster Slave server idle port quantity, until determining that idle port quantity meets the slave clothes for creating at least one virtual objects It is engaged in device, stops poll, and using the slave server determined as target from server.
In some embodiments, target is further configured to from server selection unit:It obtains from server cluster Each idle port quantity from server;Meet the slave server for creating at least one virtual objects from idle port quantity In select from server as target from server.
In some embodiments, target is further configured to from server selection unit:From from server cluster with Machine is selected from server as target from server.
Fourth aspect, the embodiment of the present application provide a kind of electronic equipment, which includes:One or more processing Device;Storage device, for storing one or more programs;When one or more programs are executed by one or more processors, make Obtain method of the one or more processors realization as described in any realization method in second aspect.
5th aspect, the embodiment of the present application provide a kind of computer readable storage medium, are stored thereon with computer journey Sequence realizes the method as described in any realization method in second aspect when the computer program is executed by processor.
System, method and apparatus provided by the embodiments of the present application for test server function, first, master server connects Receive the establishment data at least one virtual objects that client is sent;Later, master server is selected from from server cluster Target is sent to target from server from server, and by the establishment data of at least one virtual objects;Then, target is from service Device goes out at least one virtual objects using the establishment data creation of at least one virtual objects;Finally, server calls to be tested Target is from least one of server virtual objects, to realize the test for treating test server function.By with virtual right As instead of there are other servers of dependence with server to be tested, carrying out the test of server capability to be tested, improve The successfully tested rate of server capability to be tested.
Description of the drawings
By reading a detailed description of non-restrictive embodiments in the light of the attached drawings below, the application's is other Feature, objects and advantages will become more apparent upon:
Fig. 1 is the exemplary system architecture figure according to the system for test server function of the embodiment of the present application;
Fig. 2 is the sequence diagram according to one embodiment of the system for test server function of the application;
Fig. 3 is the signal according to an application scenarios of the system for test server function of the embodiment of the present application Figure;
Fig. 4 is the sequence diagram according to another embodiment of the system for test server function of the application;
Fig. 5 is the flow according to one embodiment of the method for the test server function for master server of the application Figure;
Fig. 6 is the structure according to one embodiment of the device of the test server function for master server of the application Schematic diagram;
Fig. 7 is adapted for the structural schematic diagram of the computer system of the electronic equipment for realizing the embodiment of the present application.
Specific implementation mode
The application is described in further detail with reference to the accompanying drawings and examples.It is understood that this place is retouched The specific embodiment stated is used only for explaining related invention, rather than the restriction to the invention.It also should be noted that in order to Convenient for description, is illustrated only in attached drawing and invent relevant part with related.
It should be noted that in the absence of conflict, the features in the embodiments and the embodiments of the present application can phase Mutually combination.The application is described in detail below with reference to the accompanying drawings and in conjunction with the embodiments.
Fig. 1 shows the exemplary system architecture of the system for test server function according to the embodiment of the present application 100。
As shown in Figure 1, system architecture 100 may include terminal device 101, master server 102, from server cluster 103, Server 104 and network 105,106 to be tested.Wherein, from server cluster 103 may include from server 1031,1032, 1033,1034.Medium of the network 105 for providing communication link between terminal device 101 and master server 102.Network 106 To master server 102, between server cluster 103 and server to be tested 104 provide communication link medium.Network 105,106 may include various connection types, such as wired, wireless communication link or fiber optic cables etc..
User can be interacted by network 105 with master server 102 with using terminal equipment 101, to receive or send message Deng.Terminal device 101 can be various electronic equipments, including but not limited to smart mobile phone, tablet computer, E-book reader, Pocket computer on knee and desktop computer etc..
Master server 102 can provide various services, such as main clothes from server cluster 103 and server to be tested 104 Be engaged in device 102 can first receiving terminal apparatus 101 send at least one virtual objects establishment data;Then, from from service Target is selected in device cluster 103 from server (such as from server 1031);Finally by the establishment of at least one virtual objects Data are sent to target from server.From the target in server cluster 103 from server can utilize it is received at least The establishment data creation of one virtual objects goes out at least one virtual objects.Server 104 to be tested can be with invocation target from clothes At least one of business device virtual objects, to realize that the function for the treatment of test server 104 is tested.
It should be noted that the method one for the test server function for master server that the embodiment of the present application is provided As executed by master server 102.Correspondingly, the device for the test server function of master server is generally positioned at main service In device 102.
It should be understood that terminal device, master server, server to be tested, network in Fig. 1 and from server cluster and It is only schematical from the number of the slave server in server cluster.According to needs are realized, can have any number of Terminal device, master server, server to be tested, network and from server cluster and from server cluster from service Device.
With continued reference to Fig. 2, it illustrates one embodiment according to the system for test server function of the application Sequential 200.
As described above, the system for test server function in the present embodiment may include:It is to be tested Server (such as server 104 to be tested shown in FIG. 1), master server (such as master server 102 shown in FIG. 1) and from clothes Business device cluster (such as shown in FIG. 1 from server cluster 103).Wherein, master server, for receiving client (such as Fig. 1 institutes The terminal device 101 shown) send at least one virtual objects establishment data, selected from from server cluster from service Device is sent to target from server as target from server, and by the establishment data of at least one virtual objects;Target is from clothes Business device, is used for the establishment data based at least one virtual objects, creates at least one virtual objects;Server to be tested is used In calling at least one virtual objects, functional test is carried out.
As shown in Fig. 2, in step 201, master server receives the establishment at least one virtual objects that client is sent Data.
In the present embodiment, master server (such as master server 102 shown in FIG. 1) can by wired connection mode or Person's radio connection receives the establishment number of at least one virtual objects from client (such as terminal device 101 shown in FIG. 1) According to.
Herein, virtual objects can be mock objects, and mock objects can exist to rely on server to be tested to close The substitute of other servers of system.It can receive the calling of server to be tested, and be returned the result to server to be tested. For server to be tested, call after mock objects returning the result of receiving of server to be tested and calling with it is to be tested Server is identical there are returning the result of receiving of server to be tested after other servers of dependence.
Herein, the establishment data of virtual objects can be used for create virtual objects, usually may include request data and Response data.Wherein, request data can be during the function for the treatment of test server is tested, by clothes to be tested Business device is sent to that there are the request datas of other servers of dependence with server to be tested.Response data can be right During the function of server to be tested is tested, by there are other server roots of dependence with server to be tested The response data returned according to the request data received from server to be tested.
In step 202, master server is selected from server as target from from server cluster from server.
In the present embodiment, master server can be from from server cluster (such as server cluster 103 shown in FIG. 1) Target is selected from server (such as shown in FIG. 1 from server 1031).
In some optional realization methods of the present embodiment, master server can be with poll from the slave clothes in server cluster The idle port quantity of business device, until determine that idle port quantity meets the slave server for creating at least one virtual objects, Stop poll, and using the slave server determined as target from server.Wherein, the English of port is port, can be recognized For the outlet for being equipment with extraneous Communication.Port can be divided into virtual port and physical port, herein, what port was often referred to Virtual port, i.e. TCP/IP (Transmission Control Protocol/Internet Protocol, transmission control Agreement/Internet Protocol) in port.Port can be divided into again according to its state occupies port and idle port.As Example, master server can inquire the idle port quantity from the slave server in server cluster successively, until sky is arrived in inquiry Not busy port number is not less than the slave server of mock number of objects, stops inquiry, and should from server as target from service Device.Wherein, a port need to be occupied by creating a mock object.
In some optional realization methods of the present embodiment, master server can be obtained from server cluster first Each idle port quantity from server;Then, the slave clothes for creating at least one virtual objects are met from idle port quantity It is selected from server as target from server in business device.As an example, master server can meet from idle port quantity It creates and selects the most slave server of idle port quantity in the slave server of at least one virtual objects as target from clothes Business device.
In some optional realization methods of the present embodiment, master server can be randomly selected from from server cluster Go out from server as target from server.
In step 203, the establishment data of at least one virtual objects are sent to target from server by master server.
In the present embodiment, from server, master server can will at least one for target based on selected taking-up in step 202 The establishment data of a virtual objects are sent to target from server.
In step 204, target creates at least one void from establishment data of the server based at least one virtual objects Quasi- object.
In the present embodiment, the establishment data based at least one virtual objects received from master server, target from Server can be created that at least one virtual objects.
In some optional realization methods of the present embodiment, target can be at least one virtual right first from server Each virtual objects assignment of port numbers as in;Then, port numbers based at least one virtual objects and at least one virtual The establishment data of object, create at least one virtual objects.As an example, target can create HTTP from server Mock objects under (HyperText Transfer Protocol, hypertext transfer protocol).For at least one mock objects In each mock objects, target can select HTTP first from server;Then the establishment data of the mock objects are utilized to match Set out request data and response data;It is the mock object designated ports finally to utilize the port numbers of the mock objects, that is, is created Go out the mock objects.
In some optional realization methods of the present embodiment, target can be by least one virtual objects from server Port numbers are sent to master server.After the port numbers that master server receives at least one virtual objects, master server is also The port numbers of at least one virtual objects can be sent to client or server to be tested.
In step 205, at least one virtual objects of server calls to be tested carry out functional test.
In the present embodiment, based at least one virtual objects being created that in step 204, server (example to be tested Server 104 to be tested as shown in Figure 1) at least one virtual objects can be called, carry out functional test.
In some optional realization methods of the present embodiment, first, target can will be at least one virtual from server The port numbers of object are sent to master server;Then, server to be tested can obtain at least one virtual right from master server The port numbers of elephant;Finally, the port that server to be tested can be indicated by the port numbers by least one virtual objects, remotely At least one virtual objects are called, functional test is carried out.Here, at least one virtual objects are received in server to be tested After port numbers, it can generate and treat the test code that the function of test server is tested.Wherein, testing can be in code Include the port numbers of at least one virtual objects.It, will be according to test code when server to be tested runs the test code At least one of the port numbers of virtual objects find corresponding port of the target from server, and pass through the port far call At least one virtual objects, to realize that the function for the treatment of test server under the cooperation of at least one virtual objects is surveyed Examination.
It should be noted that the present embodiment to the quantity from the slave server in server cluster without limit.Therefore, If the system for test server function needs simultaneously to test the function of multiple servers to be tested, that is, need a large amount of Port create virtual objects, it is only necessary to correspondingly increase and can be realized pair from the quantity of the slave server in server cluster The extension of port number.
It is an application according to the system for test server function of the embodiment of the present application with continued reference to Fig. 3, Fig. 3 The schematic diagram of scene.In the application scenarios of Fig. 3, first, master server 303 receives at least one void that client 301 is sent The establishment data 302 of quasi- object;Later, master server 303 selects target from server 304 from from server cluster, and The establishment data 302 of at least one virtual objects are sent to target from server 304;Then, target is based on from server 304 The establishment data 302 of at least one virtual objects, are created that at least one virtual objects 305;Last server 306 to be tested is adjusted With target from least one of server 304 virtual objects 305, functional test is carried out.
System provided by the embodiments of the present application for test server function, first, master server receive client hair The establishment data of at least one virtual objects sent;Later, master server selects target from service from from server cluster Device, and the establishment data of at least one virtual objects are sent to target from server;Then, target from server by utilizing at least The establishment data creation of one virtual objects goes out at least one virtual objects;Finally, server calls target to be tested is from service At least one of device virtual objects, to realize the test for treating test server function.By being replaced and being waited for virtual objects Test server carries out the test of server capability to be tested there are other servers of dependence, improves clothes to be tested The successfully tested rate for device function of being engaged in.
With further reference to Fig. 4, it illustrates another realities according to the system for test server function of the application Apply the sequential 400 of example.
As described above, the system for test server function in the present embodiment may include:It is to be tested Server (such as server 104 to be tested shown in FIG. 1), master server (such as master server 102 shown in FIG. 1) and from clothes Business device cluster (such as shown in FIG. 1 from server cluster 103).Wherein, master server, for receiving client (such as Fig. 1 institutes The terminal device 101 shown) send at least one virtual objects request to create, wherein request to create includes at least one void Agreement used in each virtual objects in quasi- object;For each virtual objects at least one virtual objects, from pre- Establishment data template corresponding with agreement used in the virtual objects is selected in the establishment data template set first stored, Wherein, each establishment data template created in data template set corresponds to different agreements respectively;By the establishment of selected taking-up Data template is sent to client, so that client modifies to the establishment data template of selected taking-up, it is virtual right to generate this The establishment data of elephant;Receive the establishment data at least one virtual objects that client is sent;It is chosen from from server cluster Go out from server as target from server, and the establishment data of at least one virtual objects are sent to target from server; Target is used for the establishment data based at least one virtual objects, creates at least one virtual objects from server;Clothes to be tested Business device carries out functional test for calling at least one virtual objects.
As shown in figure 4, in step 401, master server receives the establishment at least one virtual objects that client is sent Request.
In the present embodiment, master server (such as master server 102 shown in FIG. 1) can by wired connection mode or The establishment that person's radio connection receives at least one virtual objects from client (such as terminal device 101 shown in FIG. 1) is asked It asks.Wherein, request to create may include agreement used in each virtual objects at least one virtual objects.
Herein, different virtual objects can use different agreements.For example, agreement used in virtual objects can be with It is HTTP, SOAP (Simple Object Access Protocol, Simple Object Access Protocol) or FTP (File Transfer Protocol, File Transfer Protocol) etc..
In step 402, for each virtual objects at least one virtual objects, master server is from pre-stored It creates in data template set and selects establishment data template corresponding with agreement used in the virtual objects.
In the present embodiment, for each virtual objects at least one virtual objects, master server can be according to this Agreement used in virtual objects, selected from pre-stored establishment data template set with used in the virtual objects The corresponding establishment data template of agreement.
In the present embodiment, master server, which can prestore, creates data template set.Wherein, data template collection is created Each establishment data template in conjunction can correspond to different agreements respectively.Specifically, for using each void of same agreement For quasi- object, in title of the establishment data except virtual objects, port numbers, request data for creating each virtual objects Except return value etc. in parameter value and response data differs, remainder data is identical.Therefore, it is created to reduce to generate The workload of data, master server can prestore the corresponding establishment data template of different agreement.
In step 403, the establishment data template of selected taking-up is sent to client by master server.
In the present embodiment, the establishment data template of selected taking-up in step 402 can be sent to client by master server End.
In step 404, client modifies to the establishment data template of selected taking-up, generates the wound of the virtual objects Build data.
In the present embodiment, client can modify to received establishment data template, and it is virtual right to generate this The establishment data of elephant.Specifically, client can be according to testing requirement to virtual right in received establishment data template The return value etc. in parameter value and response data in the title of elephant, port numbers, request data is modified, and it is virtual right to generate this The establishment data of elephant.
In step 405, master server receives the establishment data at least one virtual objects that client is sent.
In the present embodiment, master server can receive the establishment data of at least one virtual objects from client.
In a step 406, master server is selected from server as target from from server cluster from server.
In the present embodiment, master server can be from from server cluster (such as server cluster 103 shown in FIG. 1) Target is selected from server (such as shown in FIG. 1 from server 1031).
In step 407, the establishment data of at least one virtual objects are sent to target from server by master server.
In the present embodiment, from server, master server can will at least one for target based on selected taking-up in step 406 The establishment data of a virtual objects are sent to target from server.
In a step 408, target creates at least one void from establishment data of the server based at least one virtual objects Quasi- object.
In the present embodiment, the establishment data based at least one virtual objects received from master server, target from Server can be created that at least one virtual objects.
In step 409, at least one virtual objects of server calls to be tested carry out functional test.
In the present embodiment, based at least one virtual objects being created that in step 408, server (example to be tested Server 104 to be tested as shown in Figure 1) at least one virtual objects can be called, carry out functional test.
Figure 4, it is seen that compared with the corresponding embodiments of Fig. 2, the present embodiment for test server function The sequential 400 of system increases step 401-404.As a result, in the scheme of the present embodiment description, client passes through to from main service Establishment data template received by device, which is modified, can be obtained the establishment data of virtual objects, be generated virtually to reduce The workload of the establishment data of object.
With further reference to Fig. 5, it illustrates the methods according to the test server function for master server of the application One embodiment flow 500.This is used for the flow 500 of the method for the test server function of master server, including following Step:
Step 501, the establishment data at least one virtual objects that client is sent are received.
In the present embodiment, master server (such as master server 102 shown in FIG. 1) can by wired connection mode or Person's radio connection receives the establishment number of at least one virtual objects from client (such as terminal device 101 shown in FIG. 1) According to.
Step 502, it is selected from from server cluster from server as target from server.
In the present embodiment, master server can be from from server cluster (such as server cluster 103 shown in FIG. 1) Target is selected from server (such as shown in FIG. 1 from server 1031).
In some optional realization methods of the present embodiment, master server can be with poll from the slave clothes in server cluster The idle port quantity of business device, until determine that idle port quantity meets the slave server for creating at least one virtual objects, Stop poll, and using the slave server determined as target from server.
In some optional realization methods of the present embodiment, master server can be obtained from server cluster first Each idle port quantity from server;Then, the slave clothes for creating at least one virtual objects are met from idle port quantity It is selected from server as target from server in business device.
In some optional realization methods of the present embodiment, master server can be randomly selected from from server cluster Go out from server as target from server.
Step 503, the establishment data of at least one virtual objects are sent to target from server.
In the present embodiment, from server, master server can will at least one for target based on selected taking-up in step 502 The establishment data of a virtual objects are sent to target from server so that target from server based at least one virtual objects Data are created, at least one virtual objects are created, at least one virtual objects of server calls to be tested carry out functional test.
In some optional realization methods of the present embodiment, at least one virtual objects of client transmission are being received Before creating data, master server can receive the request to create of at least one virtual objects of client transmission first, wherein Request to create includes agreement used in each virtual objects at least one virtual objects;Then, at least one void Each virtual objects in quasi- object, select from pre-stored establishment data template set and are used with the virtual objects The corresponding establishment data template of agreement, wherein create data template set in each establishment data template correspond to respectively Different agreements;Finally, the establishment data template of selected taking-up is sent to client, so that wound of the client to selected taking-up It builds data template to modify, generates the establishment data of the virtual objects.
The method for the test server function for master server that embodiments herein provides, first, master server Receive the establishment data at least one virtual objects that client is sent;Then, master server is chosen from from server cluster Go out target from server;Finally, the establishment data of at least one virtual objects are sent to target from server by master server, with Target is set to go out at least one virtual objects, service to be tested from the establishment data creation of at least one virtual objects of server by utilizing Device invocation target is from least one of server virtual objects, to realize the test for treating test server function.Pass through Other servers with server to be tested there are dependence are replaced with virtual objects, carry out the survey of server capability to be tested Examination, improves the successfully tested rate of server capability to be tested.
With further reference to Fig. 6, as the realization to method shown in above-mentioned Fig. 5, this application provides one kind being used for main service One embodiment of the device of the test server function of device, the device embodiment is corresponding with embodiment of the method shown in fig. 5, The device specifically can be applied in various electronic equipments.
As shown in fig. 6, the device 600 of the test server function for master server of the present embodiment includes:Create number From server selection unit 602 and data transmission unit 603 is created according to receiving unit 601, target.Wherein, data receiver is created Unit 601 is configured to receive the establishment data at least one virtual objects that client is sent;Target is chosen single from server Member 602 is configured to select from from server cluster from server as target from server;Create data transmission unit 603, it is configured to the establishment data of at least one virtual objects being sent to target from server, so that target is from server base In the establishment data of at least one virtual objects, virtual objects are created, at least one virtual objects of server calls to be tested, into Row functional test.
In the present embodiment, it is used in the device 600 of test server function of master server:Create data receipt unit 601, the specific advantageous effect that handles and its bring of the target from server selection unit 602 and establishment data transmission unit 603 It can be referring to the associated description of the realization method of step 501, step 502 and step 503 in Fig. 5 corresponding embodiments, herein no longer It repeats.
In some optional realization methods of the present embodiment, the device of the test server function for master server 600 can also include:Request to create receiving unit (not shown) is configured to receive at least one void that client is sent The request to create of quasi- object, wherein request to create includes the used association of each virtual objects at least one virtual objects View;Data template selection unit (not shown) is created, is configured to virtual for each of at least one virtual objects Object selects establishment corresponding with agreement used in the virtual objects from pre-stored establishment data template set Data template, wherein each establishment data template created in data template set corresponds to different agreements respectively;Create data Template transmission unit (not shown) is configured to the establishment data template of selected taking-up being sent to client, so that objective Family end modifies to the establishment data template of selected taking-up, generates the establishment data of the virtual objects.
In some optional realization methods of the present embodiment, target from server selection unit 602, further use by configuration In:Poll is created from the idle port quantity of the slave server in server cluster until determining that idle port quantity meets The slave server of at least one virtual objects stops poll, and using the slave server determined as target from server.
In some optional realization methods of the present embodiment, target from server selection unit 602, further use by configuration In:It obtains from each idle port quantity from server in server cluster;Meet from idle port quantity and creates at least It is selected in the slave server of one virtual objects from server as target from server.
In some optional realization methods of the present embodiment, target from server selection unit 602, further use by configuration In:It is randomly selected out from from server cluster from server as target from server.
Below with reference to Fig. 7, it illustrates the computer systems 700 suitable for the electronic equipment for realizing the embodiment of the present application Structural schematic diagram.Electronic equipment shown in Fig. 7 is only an example, to the function of the embodiment of the present application and should not use model Shroud carrys out any restrictions.
As shown in fig. 7, computer system 700 includes central processing unit (CPU) 701, it can be read-only according to being stored in Program in memory (ROM) 702 or be loaded into the program in random access storage device (RAM) 703 from storage section 708 and Execute various actions appropriate and processing.In RAM 703, also it is stored with system 700 and operates required various programs and data. CPU 701, ROM 702 and RAM 703 are connected with each other by bus 704.Input/output (I/O) interface 705 is also connected to always Line 704.
It is connected to I/O interfaces 705 with lower component:Importation 706 including button, touch screen etc.;Including such as liquid crystal The output par, c 707 of display (LCD) etc. and loud speaker etc.;Storage section 708 including hard disk etc.;And including such as The communications portion 709 of the network interface card of LAN card, modem etc..Communications portion 709 is held via the network of such as internet Row communication process.Driver 710 is also according to needing to be connected to I/O interfaces 705.Detachable media 711, such as disk, CD, magnetic CD, semiconductor memory etc. are mounted on driver 710 as needed, in order to from the computer program read thereon It is mounted into storage section 708 as needed.
Particularly, in accordance with an embodiment of the present disclosure, it may be implemented as computer above with reference to the process of flow chart description Software program.For example, embodiment of the disclosure includes a kind of computer program product comprising be carried on computer-readable medium On computer program, which includes the program code for method shown in execution flow chart.In such reality It applies in example, which can be downloaded and installed by communications portion 709 from network, and/or from detachable media 711 are mounted.When the computer program is executed by central processing unit (CPU) 701, limited in execution the present processes Above-mentioned function.It should be noted that computer-readable medium described herein can be computer-readable signal media or Computer readable storage medium either the two arbitrarily combines.Computer readable storage medium for example can be --- but Be not limited to --- electricity, magnetic, optical, electromagnetic, infrared ray or semiconductor system, device or device, or arbitrary above combination. The more specific example of computer readable storage medium can include but is not limited to:Electrical connection with one or more conducting wires, Portable computer diskette, hard disk, random access storage device (RAM), read-only memory (ROM), erasable type may be programmed read-only deposit Reservoir (EPROM or flash memory), optical fiber, portable compact disc read-only memory (CD-ROM), light storage device, magnetic memory Part or above-mentioned any appropriate combination.In this application, computer readable storage medium can any be included or store The tangible medium of program, the program can be commanded the either device use or in connection of execution system, device.And In the application, computer-readable signal media may include the data letter propagated in a base band or as a carrier wave part Number, wherein carrying computer-readable program code.Diversified forms may be used in the data-signal of this propagation, including but not It is limited to electromagnetic signal, optical signal or above-mentioned any appropriate combination.Computer-readable signal media can also be computer Any computer-readable medium other than readable storage medium storing program for executing, the computer-readable medium can send, propagate or transmit use In by instruction execution system, device either device use or program in connection.Include on computer-readable medium Program code can transmit with any suitable medium, including but not limited to:Wirelessly, electric wire, optical cable, RF etc., Huo Zheshang Any appropriate combination stated.
Flow chart in attached drawing and block diagram, it is illustrated that according to the system of the various embodiments of the application, method and computer journey The architecture, function and operation in the cards of sequence product.In this regard, each box in flowchart or block diagram can generation A part for a part for one module, program segment, or code of table, the module, program segment, or code includes one or more uses The executable instruction of the logic function as defined in realization.It should also be noted that in some implementations as replacements, being marked in box The function of note can also occur in a different order than that indicated in the drawings.For example, two boxes succeedingly indicated are actually It can be basically executed in parallel, they can also be executed in the opposite order sometimes, this is depended on the functions involved.Also it to note Meaning, the combination of each box in block diagram and or flow chart and the box in block diagram and or flow chart can be with holding The dedicated hardware based system of functions or operations as defined in row is realized, or can use specialized hardware and computer instruction Combination realize.
Being described in unit involved in the embodiment of the present application can be realized by way of software, can also be by hard The mode of part is realized.Described unit can also be arranged in the processor, for example, can be described as:A kind of processor packet It includes and creates data receipt unit, target from server selection unit and create data transmission unit.Wherein, the title of these units The restriction to the unit itself is not constituted under certain conditions, is also described as " connecing for example, creating data receipt unit Receive the unit of the establishment data at least one virtual objects that client is sent ".
As on the other hand, present invention also provides a kind of computer-readable medium, which can be Included in electronic equipment described in above-described embodiment;Can also be individualism, and without be incorporated the electronic equipment in. Above computer readable medium carries one or more program, when said one or multiple programs are held by the electronic equipment When row so that the electronic equipment:Receive the establishment data at least one virtual objects that client is sent;From from server cluster In select from server as target from server;The establishment data of at least one virtual objects are sent to target from service Device, so that target creates at least one virtual objects from establishment data of the server based at least one virtual objects, it is to be tested At least one virtual objects of server calls carry out functional test.
Above description is only the preferred embodiment of the application and the explanation to institute's application technology principle.People in the art Member should be appreciated that invention scope involved in the application, however it is not limited to technology made of the specific combination of above-mentioned technical characteristic Scheme, while should also cover in the case where not departing from foregoing invention design, it is carried out by above-mentioned technical characteristic or its equivalent feature Other technical solutions of arbitrary combination and formation.Such as features described above has similar work(with (but not limited to) disclosed herein Can technical characteristic replaced mutually and the technical solution that is formed.

Claims (12)

1. a kind of system for test server function, which is characterized in that the system comprises:Server to be tested, main clothes It is engaged in device and from server cluster;
The master server, the establishment data of at least one virtual objects for receiving client transmission, from described from service It is selected from server as target from server in device cluster, and the establishment data of at least one virtual objects is sent To the target from server;
The target is used for the establishment data based at least one virtual objects from server, creates described at least one Virtual objects;
The server to be tested carries out functional test for calling at least one virtual objects.
2. system according to claim 1, which is characterized in that the master server is additionally operable to:
Receive the request to create at least one virtual objects that client is sent, wherein the request to create include it is described at least Agreement used in each virtual objects in one virtual objects;
For each virtual objects at least one virtual objects, selected from pre-stored establishment data template set Take out establishment data template corresponding with agreement used in the virtual objects, wherein in the establishment data template set Each establishment data template correspond to different agreements respectively;
The establishment data template of selected taking-up is sent to the client, so that establishment number of the client to selected taking-up It modifies according to template, generates the establishment data of the virtual objects.
3. system according to claim 1, which is characterized in that the master server is specifically used for:
From the idle port quantity of the slave server in server cluster described in poll, until determining that idle port quantity meets Create the slave server of at least one virtual objects, stop poll, and using the slave server determined as target from Server.
4. system according to claim 1, which is characterized in that the master server is specifically used for:
It obtains described from each idle port quantity from server in server cluster;
Meet from idle port quantity in the slave server for creating at least one virtual objects and selects from server conduct Target is from server.
5. system according to claim 1, which is characterized in that the master server is specifically used for:
It is randomly selected out from server cluster from server as target from server from described.
6. system according to claim 1, which is characterized in that the target is specifically used for from server:
For each virtual objects assignment of port numbers at least one virtual objects;
The establishment data of port numbers and at least one virtual objects based at least one virtual objects, described in establishment At least one virtual objects.
7. system according to claim 6, which is characterized in that the target is additionally operable to from server:
The port numbers of at least one virtual objects are sent to the master server.
8. system according to claim 7, which is characterized in that the server to be tested is specifically used for:
The port numbers of at least one virtual objects are obtained from the master server;
The port indicated by port numbers by least one virtual objects, it is at least one virtual right described in far call As carrying out functional test.
9. a kind of method of test server function for master server, which is characterized in that the master server respectively with visitor Family end, server to be tested are connected with from each in server cluster from server communication, the server to be tested and institute It states from each from server communication connection in server cluster;The method includes:
Receive the establishment data at least one virtual objects that the client is sent;
It is selected from server cluster from server as target from server from described;
The establishment data of at least one virtual objects are sent to the target from server, so that the target is from service Establishment data of the device based at least one virtual objects create at least one virtual objects, server tune to be tested With at least one virtual objects, functional test is carried out.
10. a kind of device of test server function for master server, which is characterized in that the master server respectively with visitor Family end, server to be tested are connected with from each in server cluster from server communication, the server to be tested and institute It states from each from server communication connection in server cluster;Described device includes:
Data receipt unit is created, is configured to receive the establishment data at least one virtual objects that the client is sent;
Target from server selection unit, be configured to select from server cluster from described from server as target from Server;
Create data transmission unit, be configured to by the establishment data of at least one virtual objects be sent to the target from Server so that the target from establishment data of the server based at least one virtual objects, create described at least one A virtual objects, at least one virtual objects described in server calls to be tested carry out functional test.
11. a kind of electronic equipment, which is characterized in that the electronic equipment includes:
One or more processors;
Storage device, for storing one or more programs;
When one or more of programs are executed by one or more of processors so that one or more of processors are real Now method as claimed in claim 9.
12. a kind of computer readable storage medium, is stored thereon with computer program, which is characterized in that the computer program Method as claimed in claim 9 is realized when being executed by processor.
CN201710269981.3A 2017-04-24 2017-04-24 System, method and apparatus for testing server functionality Active CN108733527B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710269981.3A CN108733527B (en) 2017-04-24 2017-04-24 System, method and apparatus for testing server functionality

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710269981.3A CN108733527B (en) 2017-04-24 2017-04-24 System, method and apparatus for testing server functionality

Publications (2)

Publication Number Publication Date
CN108733527A true CN108733527A (en) 2018-11-02
CN108733527B CN108733527B (en) 2021-10-01

Family

ID=63934283

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710269981.3A Active CN108733527B (en) 2017-04-24 2017-04-24 System, method and apparatus for testing server functionality

Country Status (1)

Country Link
CN (1) CN108733527B (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109769100A (en) * 2019-01-17 2019-05-17 苏州科达科技股份有限公司 Video conference test method, device and storage medium
CN109857656A (en) * 2019-01-18 2019-06-07 深圳壹账通智能科技有限公司 Adaptation method, device, computer equipment and storage medium based on test
CN112087474A (en) * 2019-06-13 2020-12-15 北京东土科技股份有限公司 Cluster-based port information acquisition method and device
CN112131095A (en) * 2019-06-25 2020-12-25 北京京东振世信息技术有限公司 Pressure testing method and device

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104899142A (en) * 2015-06-10 2015-09-09 北京嘀嘀无限科技发展有限公司 Remote mock testing method and device
US20160070640A1 (en) * 2014-09-04 2016-03-10 Home Box Office, Inc. Mock object generation
CN105487965A (en) * 2015-12-28 2016-04-13 北京畅游天下网络技术有限公司 Universal server pressure testing method and device
CN106528400A (en) * 2016-09-22 2017-03-22 深圳峰创智诚科技有限公司 MOCK testing method and device

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20160070640A1 (en) * 2014-09-04 2016-03-10 Home Box Office, Inc. Mock object generation
CN104899142A (en) * 2015-06-10 2015-09-09 北京嘀嘀无限科技发展有限公司 Remote mock testing method and device
CN105487965A (en) * 2015-12-28 2016-04-13 北京畅游天下网络技术有限公司 Universal server pressure testing method and device
CN106528400A (en) * 2016-09-22 2017-03-22 深圳峰创智诚科技有限公司 MOCK testing method and device

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109769100A (en) * 2019-01-17 2019-05-17 苏州科达科技股份有限公司 Video conference test method, device and storage medium
CN109857656A (en) * 2019-01-18 2019-06-07 深圳壹账通智能科技有限公司 Adaptation method, device, computer equipment and storage medium based on test
CN112087474A (en) * 2019-06-13 2020-12-15 北京东土科技股份有限公司 Cluster-based port information acquisition method and device
CN112087474B (en) * 2019-06-13 2022-09-20 北京东土科技股份有限公司 Cluster-based port information acquisition method and device
CN112131095A (en) * 2019-06-25 2020-12-25 北京京东振世信息技术有限公司 Pressure testing method and device
CN112131095B (en) * 2019-06-25 2023-09-01 北京京东振世信息技术有限公司 Pressure testing method and device

Also Published As

Publication number Publication date
CN108733527B (en) 2021-10-01

Similar Documents

Publication Publication Date Title
CN108182111A (en) Task scheduling system, method and apparatus
CN108632101A (en) Method and apparatus for updating configuration object
CN109981619A (en) Data capture method, device, medium and electronic equipment
CN109995877A (en) Information-pushing method and device
CN109697075A (en) File updating method, system and device
CN108733527A (en) System, method and apparatus for test server function
CN108804402A (en) Report generating system based on big data platform and method
CN109408205A (en) Method for scheduling task and device based on hadoop cluster
CN108846753A (en) Method and apparatus for handling data
CN109992732A (en) Information sharing method, device, electronic equipment and storage medium
CN108540831A (en) Method and apparatus for pushed information
CN107247629A (en) Cloud computing system and cloud computing method and device for controlling server
CN109255337A (en) Face critical point detection method and apparatus
CN109766148A (en) Method and apparatus for Processing Interface method call
CN110324185A (en) Hyper parameter tuning method, apparatus, server, client and medium
CN107329834A (en) Method and apparatus for performing calculating task
CN110209315A (en) The display methods of character, device, electronic equipment and storage medium in user interface
CN109684059A (en) Method and device for monitoring data
CN115484158A (en) Communication configuration method and device of vehicle-mounted equipment based on eSIM card
CN109840109A (en) Method and apparatus for generating Software Development Kit
CN109240802A (en) request processing method and device
CN109828830A (en) Method and apparatus for managing container
CN110113176A (en) Information synchronization method and device for configuration server
CN108052377A (en) Input processing method based on cloud, device, server and storage medium
CN108696554A (en) Load-balancing method and device

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