CN109194538A - Test method, device, server and storage medium based on distributed coordination - Google Patents

Test method, device, server and storage medium based on distributed coordination Download PDF

Info

Publication number
CN109194538A
CN109194538A CN201810876289.1A CN201810876289A CN109194538A CN 109194538 A CN109194538 A CN 109194538A CN 201810876289 A CN201810876289 A CN 201810876289A CN 109194538 A CN109194538 A CN 109194538A
Authority
CN
China
Prior art keywords
node
server
execution machine
test
test assignment
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
CN201810876289.1A
Other languages
Chinese (zh)
Other versions
CN109194538B (en
Inventor
林铭森
毛皓
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ping An Technology Shenzhen Co Ltd
Original Assignee
Ping An Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Ping An Technology Shenzhen Co Ltd filed Critical Ping An Technology Shenzhen Co Ltd
Priority to CN201810876289.1A priority Critical patent/CN109194538B/en
Priority to PCT/CN2018/107675 priority patent/WO2020024405A1/en
Publication of CN109194538A publication Critical patent/CN109194538A/en
Application granted granted Critical
Publication of CN109194538B publication Critical patent/CN109194538B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/12Network monitoring probes
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/0803Configuration setting

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The present invention relates to a kind of test method based on distributed coordination, device, server and storage mediums to carry out enqueue operations for test assignment this method comprises: server locks node by control service module zk-server registered task node and task;Execution machine monitors server by control client zk-client, after having test assignment, proxy module on the execution machine is notified by client zk-client, the proxy module is controlled and creates execution machine node in the case where the task of server registration locks node, to obtain test assignment;Server notifies the corresponding script of execution machine deployment test assignment;Execution machine Download Script from script bank, and deployable state information is sent to server;Server sends the message for executing test assignment to the machine of execution;Execution machine carries out test building and perform script, to test test assignment.The present invention does not need the state of monitoring execution machine, and test assignment allocation flow is simple, improves the execution efficiency of test assignment.

Description

Test method, device, server and storage medium based on distributed coordination
Technical field
The present invention relates to field of communication technology more particularly to a kind of test methods based on distributed coordination, device, service Device and storage medium.
Background technique
Currently, host master needs to judge to hold in master and servant's mode m aster-slave mode of Jenkins dispatching platform Whether row machine slave is in idle condition, and real-time monitoring executes the heartbeat of machine slave, to monitor the shape of execution machine slave State.There are certain delay (5-10 seconds) during the heartbeat of monitoring execution machine slave, if the time in heartbeat delay is empty In gap, there is execution machine slave delay machine, but it is still available mode that machine slave is executed on host master, at this moment executes machine Slave is still assigned, then will lead to node building failure, test assignment can not be executed by executing machine slave, at this moment needs weight New allocation for test task, the state that machine slave is executed in the building process once tested are difficult to monitor, test assignment allocation flow Complexity causes the execution efficiency of test assignment low.
Summary of the invention
The purpose of the present invention is to provide a kind of test method based on distributed coordination, device, server and storages to be situated between Matter, it is intended to simplify test assignment allocation flow, improve the execution efficiency of test assignment.
To achieve the above object, the present invention provides a kind of test method based on distributed coordination, described based on distribution The test method of coordination includes:
S1, server by control service module zk-server registered task node and are appointed when receiving test assignment Business lock node, carries out enqueue operations for test assignment, and save the corresponding attribute information of the task node, the attribute information Including script bank systematic name;
S2 executes machine by control client zk-client and monitors server, has test on listening to the server After task, the proxy module on the execution machine is notified by client zk-client, the proxy module is controlled and utilizes scheduled lock machine It makes and creates execution machine node in the case where the task of the server registration locks node, to obtain test assignment;
S3, the server record corresponding node name under the execution machine node after the machine of execution obtains test assignment Title and status information notify the execution machine deployment test assignment corresponding if the status information is newly-built success status Script;
S4, the execution machine obtain the server registration after receiving the notice of deployment script of the server The corresponding attribute information of task node in script bank systematic name, in the corresponding script bank of the script bank systematic name Download Script, and after completing script deployment, the deployable state information of itself is updated, corresponding deployable state information is sent to The server;
S5, after the server receives the deployable state information of the execution machine, if all deployable state information is Completion status is disposed, then sends the message for executing test assignment to the execution machine;
S6, the execution machine carry out test building simultaneously after receiving the message of execution test assignment of the server Perform script, to test the test assignment.
Preferably, the scheduled lock machine is made as optimistic locking mechanism, and described control proxy module locks node in the task The step of creating execution machine node down, specifically includes:
It controls the proxy module and attempts newly-built execution machine node in the case where the task locks node;
If newly-built execution machine node success, distributes the success of execution machine, which obtains test assignment;
If newly-built execution machine node failure distributes the failure of execution machine, returns to the step for executing and attempting newly-built execution machine node Suddenly.
Preferably, the scheduled lock machine is made as concurrent lock mechanism, and described control proxy module locks node in the task The step of creating execution machine node down, specifically includes:
It controls the proxy module and creates temporal order's node in the case where the task locks node;
If the digital number of temporal order's node is the smallest digital number, which gets lock, the generation It manages module and obtains test assignment;
If the digital number of temporal order's node is not that the smallest digital number is returned after listening to lock and being released The step of receipt row creates temporal order's node in the case where the task locks node.
Preferably, the attribute information further includes the quantity of execution machine, the step for carrying out test building and perform script Suddenly, it specifically includes: if the quantity for the execution machine that the building of this test assignment needs is Liang Tai and two or more, Liang Tai and Liang Tai Above execution machine is performed simultaneously same script, to carry out concurrent scheduling.
To achieve the above object, the present invention also provides a kind of test device, the test device is execution machine, the test Device includes memory and the processor that connect with the memory, is stored with and can transport on the processor in the memory Capable processing system, the processing system realize following steps when being executed by the processor:
Execution machine monitors server by control client zk-client, has test to appoint on listening to the server After business, the proxy module on the execution machine is notified by client zk-client, the proxy module is controlled and utilizes scheduled lock mechanism Execution machine node is created in the case where the task of the server registration locks node, to obtain test assignment;
After receiving the notice of deployment script of the server, the task node for obtaining the server registration is corresponding Attribute information in script bank systematic name, the Download Script in the corresponding script bank of the script bank systematic name, and After completing script deployment, the deployable state information of itself is updated, corresponding deployable state information is sent to the server;
After receiving the message of execution test assignment of the server, test building and perform script are carried out, with right The test assignment is tested.
Preferably, the scheduled lock machine is made as optimistic locking mechanism, and described control proxy module locks node in the task The step of creating execution machine node down, specifically includes:
It controls the proxy module and attempts newly-built execution machine node in the case where the task locks node;
If newly-built execution machine node success, distributes the success of execution machine, which obtains test assignment;
If newly-built execution machine node failure distributes the failure of execution machine, returns to the step for executing and attempting newly-built execution machine node Suddenly.
Preferably, the scheduled lock machine is made as concurrent lock mechanism, and described control proxy module locks node in the task The step of creating execution machine node down, specifically includes:
It controls the proxy module and creates temporal order's node in the case where the task locks node;
If the digital number of temporal order's node is the smallest digital number, which gets lock, the generation It manages module and obtains test assignment;
If the digital number of temporal order's node is not that the smallest digital number is returned after listening to lock and being released The step of receipt row creates temporal order's node in the case where the task locks node.
Preferably, the attribute information further includes the quantity of execution machine, the step for carrying out test building and perform script Suddenly, it specifically includes: if the quantity for the execution machine that the building of this test assignment needs is Liang Tai and two or more, Liang Tai and Liang Tai Above execution machine is performed simultaneously same script, to carry out concurrent scheduling.
To achieve the above object, the present invention also provides a kind of server, the server includes memory and deposits with described The processor of reservoir connection, is stored with the processing system that can be run on the processor, the processing system in the memory System realizes following steps when being executed by the processor:
When receiving test assignment, node is locked by control service module zk-server registered task node and task, Test assignment is subjected to enqueue operations, and saves the corresponding attribute information of the task node, the attribute information includes script Library systematic name;
After the machine of execution obtains test assignment, corresponding nodename and status information are recorded under the execution machine node, If the status information is newly-built success status, the corresponding script of the execution machine deployment test assignment is notified;
After the deployable state information for receiving the execution machine, if all deployable state information is deployment completion status, The message for executing test assignment is then sent to the execution machine, to test test assignment.
The present invention also provides a kind of computer readable storage medium, processing is stored on the computer readable storage medium System, the processing system realize the test method based on distributed coordination that above-mentioned server executes when being executed by processor The step of or processing system the test side based on distributed coordination that above-mentioned execution machine executes is realized when being executed by processor The step of method.
The beneficial effects of the present invention are: the present invention architecturally introduces zookeeper, the client on each execution machine Zk-client monitors the test assignment on service module zk-server, has test assignment then institute on service module zk-server There is client zk-client to will receive notice, client zk-client notifies the proxy module slave-agent of itself to go to obtain Test assignment is taken, the execution machine of delay machine cannot go to obtain test assignment, realize that execution owner is dynamic and take test assignment, the present invention is by taking Business module zk-server manages stateful and operation data, is fed back to the information in execution machine by client zk-client In service module zk-server, master and servant's mode m aster-slave mode compared with the prior art does not need monitoring execution machine State, test assignment allocation flow is simple, improves the execution efficiency of test assignment.
Detailed description of the invention
Fig. 1 is the optional application environment schematic diagram of each embodiment one of the invention;
Fig. 2 is the schematic diagram of the hardware structure of one embodiment of server in Fig. 1
Fig. 3 is the schematic diagram of the hardware structure of one embodiment of test device in Fig. 1;
Fig. 4 is that the present invention is based on the flow diagrams of one embodiment of test method of distributed coordination.
Specific embodiment
In order to make the objectives, technical solutions, and advantages of the present invention clearer, with reference to the accompanying drawings and embodiments, right The present invention is further elaborated.It should be appreciated that described herein, specific examples are only used to explain the present invention, not For limiting the present invention.Based on the embodiments of the present invention, those of ordinary skill in the art are not before making creative work Every other embodiment obtained is put, shall fall within the protection scope of the present invention.
It should be noted that the description for being related to " first ", " second " etc. in the present invention is used for description purposes only, and cannot It is interpreted as its relative importance of indication or suggestion or implicitly indicates the quantity of indicated technical characteristic.Define as a result, " the One ", the feature of " second " can explicitly or implicitly include at least one of the features.In addition, the skill between each embodiment Art scheme can be combined with each other, but must be based on can be realized by those of ordinary skill in the art, when technical solution Will be understood that the combination of this technical solution is not present in conjunction with there is conflicting or cannot achieve when, also not the present invention claims Protection scope within.
As shown in fig.1, being that the application environment of the preferred embodiment of the test method the present invention is based on distributed coordination is shown It is intended to.The application environment schematic diagram includes server 1 and multiple test devices 2 (i.e. execution machine).Server 1 can pass through net The suitable technology such as network, near-field communication technology and test device 2 carry out data interaction.In the present embodiment, it introduces and divides in framework Cloth application program coordination service zookeeper, wherein in 1 deployment services module zk-server of server, in each test Deploying client zk-client in device 2, in addition, proxy module slave-agent is deployed in each test device 2, and it is objective Family end zk-client can be packaged into proxy module slave-agent, can also be individually present.By service module zk- Server manages stateful and operation data, and the information in execution machine is fed back to service module zk- by client zk-client In server.
Wherein, the server 1 or test device 2 are that one kind can be according to the instruction for being previously set or storing, automatically The equipment for carrying out numerical value calculating and/or information processing.The server 1 or test device 2 can be computer, be also possible to list A network server, the server group of multiple network servers composition or being taken by a large amount of hosts or network based on cloud computing The cloud for device composition of being engaged in, wherein cloud computing is one kind of distributed computing, one consisting of a loosely coupled set of computers Super virtual computer.
In the present embodiment, it as shown in Fig. 2, server 1 may include, but is not limited only to, system bus phase intercommunication can be passed through Believe that memory 11, the processor 12, network interface 13 of connection, memory 11 are stored with the processing system that can be run on the processor 12 System and service module zk-server.It should be pointed out that Fig. 1 illustrates only the server 1 with component 11-13, but should manage Solution is, it is not required that implements all components shown, the implementation that can be substituted is more or less component.
Wherein, memory 11 includes the readable storage medium storing program for executing of memory and at least one type.Inside save as the operation of server 1 Caching is provided;Readable storage medium storing program for executing can be for if flash memory, hard disk, multimedia card, card-type memory are (for example, SD or DX memory Deng), random access storage device (RAM), static random-access memory (SRAM), read-only memory (ROM), electric erasable can compile Journey read-only memory (EEPROM), programmable read only memory (PROM), magnetic storage, disk, CD etc. it is non-volatile Storage medium.In some embodiments, readable storage medium storing program for executing can be the internal storage unit of server 1, such as the server 1 Hard disk;In further embodiments, which is also possible to the External memory equipment of server 1, such as The plug-in type hard disk being equipped on server 1, intelligent memory card (Smart Media Card, SMC), secure digital (Secure Digital, SD) card, flash card (Flash Card) etc..In the present embodiment, the readable storage medium storing program for executing of memory 11 is commonly used in Storage is installed on the processing system in the operating system and types of applications software of test device 1, such as storage one embodiment of the invention The program code etc. of system.In addition, memory 11 can be also used for temporarily storing all kinds of numbers that has exported or will export According to.
The processor 12 can be in some embodiments central processing unit (Central Processing Unit, CPU), controller, microcontroller, microprocessor or other data processing chips.The processor 12 is commonly used in the control clothes The overall operation of business device 1, such as execute control relevant to the test device 2 progress data interaction or communication and processing Deng.In the present embodiment, the processor 12 is for running the program code stored in the memory 11 or processing data, example Such as run processing system.
The network interface 13 may include radio network interface or wired network interface, which is commonly used in Communication connection is established between the server 1 and test device 2.In the present embodiment, network interface 13 is mainly used for server 1 It is connected with one or more test devices 2, establishes data transmission channel between server 1 and one or more test devices 2 And communication connection.
The processing system and service module zk-server are stored in memory 11, including at least one is stored in Computer-readable instruction in reservoir 11, at least one computer-readable instruction can be executed by processor device 12, to realize this Apply for the method for each embodiment;And the function that at least one computer-readable instruction is realized according to its each section is different, It can be divided into different logic modules.
In the present embodiment, it as shown in figure 3, test device 2 may include, but is not limited only to, it can be mutual by system bus Memory 21, processor 22, the network interface 23 of communication connection, memory 21 are stored with the processing that can be run on processor 22 System, client zk-client and proxy module agent.It should be pointed out that Fig. 3 illustrates only the survey with component 21-23 Trial assembly sets 2, it should be understood that being not required for implementing all components shown, the implementation that can be substituted is more or less Component.
Wherein, memory 21 is similar with above-mentioned memory 11, processor 22 is similar with above-mentioned processor 12, and network connects Mouth 23 is similar with above-mentioned network interface 13, and details are not described herein again.The processing system, client zk-client and act on behalf of mould Block agent is stored in memory 21, is stored in the computer-readable instruction in memory 21 including at least one, this at least one A computer-readable instruction can be executed by processor device 22, the method to realize each embodiment of the application;And this at least one Computer-readable instruction is different according to the function that its each section is realized, can be divided into different logic modules.
In one embodiment, following steps are realized when above-mentioned processing system is executed by the processor 12:
When receiving test assignment, node is locked by control service module zk-server registered task node and task, Test assignment is subjected to enqueue operations, and saves the corresponding attribute information of the task node, the attribute information includes script Library systematic name;
After the machine of execution obtains test assignment, corresponding nodename and status information are recorded under the execution machine node, If the status information is newly-built success status, the corresponding script of the execution machine deployment test assignment is notified;
After the deployable state information for receiving the execution machine, if all deployable state information is deployment completion status, The message for executing test assignment is then sent to the execution machine, to test test assignment.
In another embodiment, following steps are realized when above-mentioned processing system is executed by the processor 22:
Execution machine monitors server by control client zk-client, has test to appoint on listening to the server After business, the proxy module on the execution machine is notified by client zk-client, the proxy module is controlled and utilizes scheduled lock mechanism Execution machine node is created in the case where the task of the server registration locks node, to obtain test assignment;
After receiving the notice of deployment script of the server, the task node for obtaining the server registration is corresponding Attribute information in script bank systematic name, the Download Script in the corresponding script bank of the script bank systematic name, and After completing script deployment, the deployable state information of itself is updated, corresponding deployable state information is sent to the server;
After receiving the message of execution test assignment of the server, test building and perform script are carried out, with right The test assignment is tested.
Further, the scheduled lock machine is made as optimistic locking mechanism, and described control proxy module is locked in the task to be saved Under point the step of newly-built execution machine node, specifically include:
It controls the proxy module and attempts newly-built execution machine node in the case where the task locks node;
If newly-built execution machine node success, distributes the success of execution machine, which obtains test assignment;
If newly-built execution machine node failure distributes the failure of execution machine, returns to the step for executing and attempting newly-built execution machine node Suddenly.
Further, the scheduled lock machine is made as concurrent lock mechanism, and described control proxy module is locked in the task to be saved Under point the step of newly-built execution machine node, specifically include:
It controls the proxy module and creates temporal order's node in the case where the task locks node;
If the digital number of temporal order's node is the smallest digital number, which gets lock, the generation It manages module and obtains test assignment;
If the digital number of temporal order's node is not that the smallest digital number is returned after listening to lock and being released The step of receipt row creates temporal order's node in the case where the task locks node.
Further, the attribute information further includes the quantity of execution machine, described to carry out test building and perform script Step specifically includes: if the quantity for the execution machine that the building of this test assignment needs is two and two or more, two and two A above execution machine is performed simultaneously same script, to carry out concurrent scheduling.
The present invention architecturally introduces zookeeper, and the client zk-client on each execution machine monitors service module Test assignment on zk-server, having test assignment on service module zk-server, then all clients zk-client can be received To notice, client zk-client notifies the proxy module slave-agent of itself to go to obtain test assignment, the execution of delay machine Machine cannot go to obtain test assignment, realize that execution owner is dynamic and take test assignment, the present invention manages institute by service module zk-server Stateful and operation data is fed back to the information in execution machine in service module zk-server by client zk-client, Master and servant's mode m aster-slave mode compared with the prior art does not need the state of monitoring execution machine, test assignment distribution Process is simple, improves the execution efficiency of test assignment.
As shown in figure 4, Fig. 4 is to be somebody's turn to do the present invention is based on the flow diagram of one embodiment of test method of distributed coordination Test method based on distributed coordination the following steps are included:
Step S1, server is when receiving test assignment, by controlling service module zk-server registered task node And task locks node, test assignment is carried out enqueue operations, and save the corresponding attribute information of the task node, the attribute Information includes script bank systematic name;
Wherein, for server when receiving test assignment, service module zk-server creates a root first, does For task node, enqueue operations are exactly that child node is created under this root, then calculate the sum of child node, analyze son section Whether the sum of point is identical with the destination number of task queue.If it is identical, then root start node is created, due to root mesh Record this node of start has state change, and service module zk-server is informed about the client zk-client of execution machine: Task queue is here.Meanwhile the also newly-built task of service module zk-server locks node, creates node for executing machine To take task.
In addition, the attribute information of registered task node includes the ID code of task node, executes machine quantity, script bank system name Claim, script bank systematic name is used for the Download Script from corresponding script bank.
Step S2 executes machine by control client zk-client and monitors server, has on listening to the server After test assignment, the proxy module on the execution machine is notified by client zk-client, controls the proxy module using scheduled Lock mechanism creates execution machine node in the case where the task of the server registration locks node, to obtain test assignment;
Wherein, each proxy module can go task to lock under node and attempt newly after the notice for being connected to client zk-client Build execution machine node, wherein create execution machine node using scheduled lock mechanism, create the successful functionating of execution machine node Enough get test assignment.In this process, the execution machine of delay machine will not go newly-built execution machine node to take task, so Without being concerned about whether execution machine state is in idle available mode, without monitoring the state of execution machine, simple flow.
In one embodiment, optimistic lock mechanism can be used and take test assignment, it is assumed that the quantity for executing machine is 2:
Firstly, the proxy module that First executes machine attempts newly-built execution machine node slave1 in the case where task locks node, newly Function is built up, then distributes the success of execution machine;
The proxy module of second execution machine attempts newly-built execution machine node slave1 in the case where task locks node, can not create Function then distributes the failure of execution machine;
Then, the proxy module of second execution machine attempts newly-built execution machine node slave2 in the case where task locks node, newly Function is built up, then distributes the success of execution machine.
In another embodiment, concurrent lock machine can be used and produce test assignment:
It controls the proxy module and creates temporal order's node in the case where the task locks node, synchronization only has an execution Machine gets the concurrently lock of task;
If the digital number of temporal order's node is the smallest digital number, that is, what is made number one creates at first Temporal order's node, then the proxy module, which is got, concurrently locks, which obtains test assignment;
If the digital number of temporal order's node is not the smallest digital number, then it represents that concurrently lock other Execution machine is got, and just by monitoring temporal order's node of the smallest digital number, whether deletion event is known whether at this time Released and concurrently locked, listen to concurrently lock be released after, return execute the task lock node under creates temporal order The step of node, indicates to have got at this time concurrent until the digital number of temporal order's node is the smallest digital number Lock can get test assignment after getting concurrently lock.
Scheduled lock mechanism can be optimistic locking mechanism or concurrent lock mechanism in above-described embodiment, so that the present embodiment branch The execution for holding high concurrent and superelevation concurrent test task is conducive to improve testing efficiency.
Step S3, the server record corresponding section after the machine of execution obtains test assignment under the execution machine node Point title and status information notify the execution machine deployment test assignment pair if the status information is newly-built success status The script answered;
Wherein, nodename be execution machine host ip, status information include create successfully, create fail.Server prison The status information for surveying under execution machine node the machine that executes notifies execution machine to dispose the survey if status information is to create successfully The corresponding script of trial business.
It saves in addition, needing to execute status information and data of machine etc. in the prior art into database, and this implementation Example service module zk-server saves the status information and data of all execution machines, without interacting with database, more It is convenient.
Step S4, the execution machine obtain the server after receiving the notice of deployment script of the server Script bank systematic name in the corresponding attribute information of the task node of registration, in the corresponding script of the script bank systematic name Download Script in library, and after completing script deployment, the deployable state information of itself is updated, corresponding deployable state information is sent out Give the server;
Wherein, machine Download Script from script bank is executed, script deployment is completed, updates the deployable state information of itself, it should Deployable state information is " deployment is completed ", and deployable state information is sent to server.
Step S5, after the server receives the deployable state information of the execution machine, if all deployable states are believed Breath is deployment completion status, then sends the message for executing test assignment to the execution machine;
Step S6, the execution machine carry out test structure after receiving the message of execution test assignment of the server Simultaneously perform script is built, to test the test assignment.
Wherein, if the quantity for the execution machine that the building of this test assignment needs is one, which is being received After the message of the execution test assignment of server, test building and perform script are carried out;
If if the quantity for the execution machine that the building of this test assignment needs were Liang Tai and two or more, every execution machine The message for receiving the execution test assignment of server can be neglected since the time difference that every execution machine receives message is smaller, It can be considered that being to trigger building simultaneously, N number of identical queue task can be sequentially submitted when constructing test assignment, robs and takes office The execution machine of business belongs to be constructed with primary, and the same test script is run on more execution machines, concurrent scheduling is realized, further mentions High testing efficiency.
The present invention architecturally introduces zookeeper, and the client zk-client on each execution machine monitors service module Test assignment on zk-server, having test assignment on service module zk-server, then all clients zk-client can be received To notice, client zk-client notifies the proxy module slave-agent of itself to go to obtain test assignment, the execution of delay machine Machine cannot go to obtain test assignment, realize that execution owner is dynamic and take test assignment, the present invention manages institute by service module zk-server Stateful and operation data is fed back to the information in execution machine in service module zk-server by client zk-client, Master and servant's mode m aster-slave mode compared with the prior art does not need the state of monitoring execution machine, test assignment distribution Process is simple, improves the execution efficiency of test assignment.
The present invention also provides a kind of computer readable storage medium, processing is stored on the computer readable storage medium System, the processing system realize the test method based on distributed coordination that above-mentioned server executes when being executed by processor The step of or processing system the test side based on distributed coordination that above-mentioned execution machine executes is realized when being executed by processor The step of method.
The serial number of the above embodiments of the invention is only for description, does not represent the advantages or disadvantages of the embodiments.
Through the above description of the embodiments, those skilled in the art can be understood that above-described embodiment side Method can be realized by means of software and necessary general hardware platform, naturally it is also possible to by hardware, but in many cases The former is more preferably embodiment.Based on this understanding, technical solution of the present invention substantially in other words does the prior art The part contributed out can be embodied in the form of software products, which is stored in a storage medium In (such as ROM/RAM, magnetic disk, CD), including some instructions are used so that a terminal device (can be mobile phone, computer, clothes Business device, air conditioner or the network equipment etc.) execute method described in each embodiment of the present invention.
The above is only a preferred embodiment of the present invention, is not intended to limit the scope of the invention, all to utilize this hair Equivalent structure or equivalent flow shift made by bright specification and accompanying drawing content is applied directly or indirectly in other relevant skills Art field, is included within the scope of the present invention.

Claims (10)

1. a kind of test method based on distributed coordination, which is characterized in that the test method packet based on distributed coordination It includes:
S1, server are locked when receiving test assignment by control service module zk-server registered task node and task Test assignment is carried out enqueue operations by node, and saves the corresponding attribute information of the task node, and the attribute information includes Script bank systematic name;
S2 executes machine by control client zk-client and monitors server, has test assignment on listening to the server Afterwards, the proxy module on the execution machine is notified by client zk-client, controls the proxy module and is existed using scheduled lock mechanism Execution machine node is created under the task lock node of the server registration, to obtain test assignment;
S3, the server execute machine obtain test assignment after, recorded under the execution machine node corresponding nodename and Status information notifies the corresponding script of the execution machine deployment test assignment if the status information is newly-built success status;
S4, the execution machine obtain appointing for the server registration after receiving the notice of deployment script of the server The script bank systematic name being engaged in the corresponding attribute information of node, is downloaded in the corresponding script bank of the script bank systematic name Script, and after completing script deployment, the deployable state information of itself is updated, corresponding deployable state information is sent to described Server;
S5, after the server receives the deployable state information of the execution machine, if all deployable state information is deployment Completion status then sends the message for executing test assignment to the execution machine;
S6, the execution machine carry out test building and execute after receiving the message of execution test assignment of the server Script, to test the test assignment.
2. the test method according to claim 1 based on distributed coordination, which is characterized in that the scheduled lock mechanism For optimistic lock mechanism, described control proxy module the step of newly-built execution machine node, is specifically included in the case where the task locks node:
It controls the proxy module and attempts newly-built execution machine node in the case where the task locks node;
If newly-built execution machine node success, distributes the success of execution machine, which obtains test assignment;
If newly-built execution machine node failure distributes the failure of execution machine, returns and execute the step of attempting newly-built execution machine node.
3. the test method according to claim 1 based on distributed coordination, which is characterized in that the scheduled lock mechanism For concurrent lock mechanism, described control proxy module the step of newly-built execution machine node, is specifically included in the case where the task locks node:
It controls the proxy module and creates temporal order's node in the case where the task locks node;
If the digital number of temporal order's node is the smallest digital number, which gets lock, this acts on behalf of mould Block obtains test assignment;
If the digital number of temporal order's node is not the smallest digital number, after listening to lock and being released, return is held The step of row creates temporal order's node in the case where the task locks node.
4. the test method according to any one of claims 1 to 3 based on distributed coordination, which is characterized in that the category Property information further include execution machine quantity, it is described to carry out test building and the step of perform script, specifically include: if this is tested The quantity for the execution machine that task building needs is Liang Tai and two or more, then Liang Tai and two or more execution machine is performed simultaneously together One script, to carry out concurrent scheduling.
5. a kind of test device, which is characterized in that the test device be execution machine, the test device include memory and with The processor of memory connection is stored with the processing system that can be run on the processor in the memory, described Processing system realizes following steps when being executed by the processor:
Execution machine monitors server by control client zk-client, after having test assignment on listening to the server, Proxy module on the execution machine is notified by client zk-client, controls the proxy module using scheduled lock mechanism in institute It states and creates execution machine node under the task lock node of server registration, to obtain test assignment;
After receiving the notice of deployment script of the server, the corresponding category of task node of the server registration is obtained Script bank systematic name in property information, the Download Script in the corresponding script bank of the script bank systematic name, and complete After script deployment, the deployable state information of itself is updated, corresponding deployable state information is sent to the server;
After receiving the message of execution test assignment of the server, test building and perform script are carried out, to described Test assignment is tested.
6. test device according to claim 5, which is characterized in that the scheduled lock machine is made as optimistic locking mechanism, institute It states and controls the step of proxy module creates execution machine node in the case where the task locks node, specifically include:
It controls the proxy module and attempts newly-built execution machine node in the case where the task locks node;
If newly-built execution machine node success, distributes the success of execution machine, which obtains test assignment;
If newly-built execution machine node failure distributes the failure of execution machine, returns and execute the step of attempting newly-built execution machine node.
7. test device according to claim 5, which is characterized in that the scheduled lock machine is made as concurrent lock mechanism, institute It states and controls the step of proxy module creates execution machine node in the case where the task locks node, specifically include:
It controls the proxy module and creates temporal order's node in the case where the task locks node;
If the digital number of temporal order's node is the smallest digital number, which gets lock, this acts on behalf of mould Block obtains test assignment;
If the digital number of temporal order's node is not the smallest digital number, after listening to lock and being released, return is held The step of row creates temporal order's node in the case where the task locks node.
8. according to the described in any item test devices of claim 5 to 7, which is characterized in that the attribute information further includes executing The quantity of machine described the step of carrying out test building and perform script, specifically includes: if this test assignment building needs are held The quantity of row machine is Liang Tai and two or more, then Liang Tai and two or more execution machine is performed simultaneously same script, to carry out simultaneously Hair scheduling.
9. a kind of server, which is characterized in that the server includes memory and the processor that connect with the memory, institute The processing system for being stored with and being run in memory on the processor is stated, when the processing system is executed by the processor Realize following steps:
When receiving test assignment, node is locked by control service module zk-server registered task node and task, will be surveyed Trial business carries out enqueue operations, and saves the corresponding attribute information of the task node, and the attribute information includes script bank system System title;
After the machine of execution obtains test assignment, corresponding nodename and status information are recorded under the execution machine node, if should Status information is newly-built success status, then notifies the corresponding script of the execution machine deployment test assignment;
After the deployable state information for receiving the execution machine, if all deployable state information is deployment completion status, send out Send the message for executing test assignment to the execution machine, to test test assignment.
10. a kind of computer readable storage medium, which is characterized in that be stored with processing system on the computer readable storage medium System, the processing system realize that server according to any one of claims 1 to 4 executes when being executed by processor based on It is realized when the step of test method of distributed coordination or the processing system are executed by processor as in Claims 1-4 The step of test method based on distributed coordination that described in any item execution machines execute.
CN201810876289.1A 2018-08-03 2018-08-03 Testing method, device, server and storage medium based on distributed coordination Active CN109194538B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201810876289.1A CN109194538B (en) 2018-08-03 2018-08-03 Testing method, device, server and storage medium based on distributed coordination
PCT/CN2018/107675 WO2020024405A1 (en) 2018-08-03 2018-09-26 Test method, device, server and storage medium based on distributed coordination

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810876289.1A CN109194538B (en) 2018-08-03 2018-08-03 Testing method, device, server and storage medium based on distributed coordination

Publications (2)

Publication Number Publication Date
CN109194538A true CN109194538A (en) 2019-01-11
CN109194538B CN109194538B (en) 2022-03-25

Family

ID=64920023

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810876289.1A Active CN109194538B (en) 2018-08-03 2018-08-03 Testing method, device, server and storage medium based on distributed coordination

Country Status (2)

Country Link
CN (1) CN109194538B (en)
WO (1) WO2020024405A1 (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110109742A (en) * 2019-05-09 2019-08-09 重庆八戒电子商务有限公司 A kind of method and device that the distributed task scheduling based on zookeeper is coordinated
CN110456777A (en) * 2019-08-20 2019-11-15 广州小鹏汽车科技有限公司 The test method and system of vehicle control device
CN110768866A (en) * 2019-10-23 2020-02-07 通号城市轨道交通技术有限公司 Method and device for building distributed bottom layer framework
CN111045807A (en) * 2019-12-17 2020-04-21 深圳前海环融联易信息科技服务有限公司 Zookeeper task processing method and device, computer equipment and storage medium
CN112015632A (en) * 2019-05-29 2020-12-01 深圳兆日科技股份有限公司 Test method, device and system based on distributed architecture and storage medium

Families Citing this family (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111400192A (en) * 2020-04-02 2020-07-10 北京达佳互联信息技术有限公司 Service program performance testing method and device, electronic equipment and storage medium
CN111858047B (en) * 2020-07-14 2024-03-22 中国工商银行股份有限公司 File interaction method, device and system
CN112671531B (en) * 2020-09-24 2023-03-07 紫光云技术有限公司 Cross-cloud persistence construction method based on Jenkins
CN112527489A (en) * 2020-12-22 2021-03-19 税友软件集团股份有限公司 Task scheduling method, device and equipment and computer readable storage medium
CN112527686A (en) * 2020-12-29 2021-03-19 平安普惠企业管理有限公司 Interface performance test method, device, equipment and storage medium
CN112988343A (en) * 2021-02-05 2021-06-18 开店宝科技集团有限公司 Batch data fragmentation method, system, computer equipment and storage medium
CN113190425B (en) * 2021-04-28 2023-09-22 北京京东振世信息技术有限公司 Resource switching method and device
CN113485908B (en) * 2021-05-25 2024-06-18 中国人民财产保险股份有限公司 Coverage rate obtaining method and device and electronic equipment
CN113220592B (en) * 2021-06-04 2024-04-30 中国农业银行股份有限公司 Processing method and device for automatic test resources, server and storage medium
CN114780217B (en) * 2022-04-19 2023-05-23 湖南长银五八消费金融股份有限公司 Task scheduling method, device, computer equipment and medium
CN116380149B (en) * 2023-04-07 2024-02-02 深圳市兴源智能仪表股份有限公司 Method and system for testing rotation of instrument code wheel

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050022194A1 (en) * 2003-06-13 2005-01-27 Weir James G. Testing frame work in a distributed environment
CN102420727A (en) * 2012-01-05 2012-04-18 北京邮电大学 Distributed protocol test system and method
US20130007520A1 (en) * 2011-06-28 2013-01-03 Tom Giammarresi Apparatus and methods for automated device testing in content distribution network
CN104092591A (en) * 2014-08-04 2014-10-08 飞狐信息技术(天津)有限公司 Task monitoring method and system
CN104184823A (en) * 2014-09-05 2014-12-03 北京京东尚科信息技术有限公司 Automatic task scheduling method and system
CN105721582A (en) * 2016-02-22 2016-06-29 中国农业银行股份有限公司 Multi-node file backup system
CN106452830A (en) * 2016-08-22 2017-02-22 平安科技(深圳)有限公司 Test task execution machine distribution method and device
CN107766147A (en) * 2016-08-23 2018-03-06 上海宝信软件股份有限公司 Distributed data analysis task scheduling system

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103064742B (en) * 2012-12-25 2016-05-11 中国科学院深圳先进技术研究院 A kind of automatic deployment system and method for hadoop cluster
CN103744724A (en) * 2014-02-19 2014-04-23 互联网域名系统北京市工程研究中心有限公司 Timed task clustering method and device thereof
US10606651B2 (en) * 2015-04-17 2020-03-31 Microsoft Technology Licensing, Llc Free form expression accelerator with thread length-based thread assignment to clustered soft processor cores that share a functional circuit
CN106713458A (en) * 2016-12-23 2017-05-24 智者四海(北京)技术有限公司 Zookeeper cluster deployment method, Zookeeper cluster deployment device, Zookeeper instance deployment method, Zookeeper instance deployment device, and Zookeeper cluster management platform

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050022194A1 (en) * 2003-06-13 2005-01-27 Weir James G. Testing frame work in a distributed environment
US20130007520A1 (en) * 2011-06-28 2013-01-03 Tom Giammarresi Apparatus and methods for automated device testing in content distribution network
CN102420727A (en) * 2012-01-05 2012-04-18 北京邮电大学 Distributed protocol test system and method
CN104092591A (en) * 2014-08-04 2014-10-08 飞狐信息技术(天津)有限公司 Task monitoring method and system
CN104184823A (en) * 2014-09-05 2014-12-03 北京京东尚科信息技术有限公司 Automatic task scheduling method and system
CN105721582A (en) * 2016-02-22 2016-06-29 中国农业银行股份有限公司 Multi-node file backup system
CN106452830A (en) * 2016-08-22 2017-02-22 平安科技(深圳)有限公司 Test task execution machine distribution method and device
CN107766147A (en) * 2016-08-23 2018-03-06 上海宝信软件股份有限公司 Distributed data analysis task scheduling system

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110109742A (en) * 2019-05-09 2019-08-09 重庆八戒电子商务有限公司 A kind of method and device that the distributed task scheduling based on zookeeper is coordinated
CN112015632A (en) * 2019-05-29 2020-12-01 深圳兆日科技股份有限公司 Test method, device and system based on distributed architecture and storage medium
CN112015632B (en) * 2019-05-29 2024-02-09 深圳兆日科技股份有限公司 Test method, device and system based on distributed architecture and storage medium
CN110456777A (en) * 2019-08-20 2019-11-15 广州小鹏汽车科技有限公司 The test method and system of vehicle control device
CN110768866A (en) * 2019-10-23 2020-02-07 通号城市轨道交通技术有限公司 Method and device for building distributed bottom layer framework
CN111045807A (en) * 2019-12-17 2020-04-21 深圳前海环融联易信息科技服务有限公司 Zookeeper task processing method and device, computer equipment and storage medium
CN111045807B (en) * 2019-12-17 2024-05-14 深圳前海环融联易信息科技服务有限公司 Method, device, computer equipment and storage medium for processing task based on zookeeper

Also Published As

Publication number Publication date
CN109194538B (en) 2022-03-25
WO2020024405A1 (en) 2020-02-06

Similar Documents

Publication Publication Date Title
CN109194538A (en) Test method, device, server and storage medium based on distributed coordination
CN110752947B (en) K8s cluster deployment method and device, and deployment platform
CN109491776A (en) Task method of combination and system
CN110138876B (en) Task deployment method, device, equipment and platform
CN110245003A (en) A kind of machine learning uniprocessor algorithm arranging system and method
CN104468638B (en) A kind of distributed data processing method and system
CN107590072A (en) A kind of application and development and the method and apparatus of test
CN110611707B (en) Task scheduling method and device
CN113312165B (en) Task processing method and device
CN113067900B (en) Intelligent contract deployment method and device
CN112288423A (en) Aggregation payment method and system of distributed framework
CN112491980B (en) Cloud host service management method, system, terminal and storage medium
CN105591782B (en) The management method and device of test equipment
CN110120970A (en) Data processing method, device and gateway system based on car networking
CN109739640A (en) A kind of container resource management system based on Shen prestige framework
CN113064744A (en) Task processing method and device, computer readable medium and electronic equipment
CN104793981B (en) A kind of online snapshot management method and device of cluster virtual machine
CN113742033A (en) Kubernetes cluster federal system and implementation method thereof
CN114706690A (en) Method and system for sharing GPU (graphics processing Unit) by Kubernetes container
CN114006815B (en) Automatic deployment method and device for cloud platform nodes, nodes and storage medium
CN111522630B (en) Method and system for executing planned tasks based on batch dispatching center
CN112799970A (en) Test data processing method, device, electronic equipment and medium
CN114077756A (en) Method and system for processing informatization service based on block chain
CN109257256A (en) Apparatus monitoring method, device, computer equipment and storage medium
CN113220480B (en) Distributed data task cross-cloud scheduling system and method

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