CN109787863A - Bifurcated analogy method, bifurcated test method, equipment and storage medium - Google Patents

Bifurcated analogy method, bifurcated test method, equipment and storage medium Download PDF

Info

Publication number
CN109787863A
CN109787863A CN201910049107.8A CN201910049107A CN109787863A CN 109787863 A CN109787863 A CN 109787863A CN 201910049107 A CN201910049107 A CN 201910049107A CN 109787863 A CN109787863 A CN 109787863A
Authority
CN
China
Prior art keywords
test
container
group
bifurcated
node
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201910049107.8A
Other languages
Chinese (zh)
Inventor
柳宇航
何正军
王志文
吴思进
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hangzhou Fuzamei Technology Co Ltd
Original Assignee
Hangzhou Fuzamei 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 Hangzhou Fuzamei Technology Co Ltd filed Critical Hangzhou Fuzamei Technology Co Ltd
Priority to CN201910049107.8A priority Critical patent/CN109787863A/en
Publication of CN109787863A publication Critical patent/CN109787863A/en
Pending legal-status Critical Current

Links

Abstract

The present invention provides a kind of bifurcated analogy method, bifurcated test method, equipment and storage medium, which is suitable for test machine, comprising: configuration at least two groups test container group;Wherein, test container group includes at least two test node containers, can carry out p2p communication between each test node container of each test container group;Each group test container group is run simultaneously until the main chain block of each test node container is synchronous;Several test container groups out of service make the first test container group run scheduled first duration;First test container group out of service makes the second test container group run scheduled second duration;Each group test container group is run simultaneously again until the bifurcated of each test node container has been eliminated.The present invention realize by a test machine can automatic imitation bifurcated environment to be tested automatically, to save manpower and a large amount of material resources.

Description

Bifurcated analogy method, bifurcated test method, equipment and storage medium
Technical field
This application involves block chain technical fields, and in particular to a kind of bifurcated analogy method, bifurcated test method, equipment and Storage medium.
Background technique
For common block catenary system, need primarily to guarantee is exactly the consistency of block in whole network, in going The block catenary system of the heart has that each meshed network performance is inconsistent, each node has the feelings such as uncertainty in the actual environment Condition, the maximization that each node in system needs to keep synchronous regime that can guarantee number one, while guaranteeing block chain The safety of system entirety.
In order to guarantee that node work in main chain, is required to quickly return in the case of discovery node is in the bifurcated of non-main chain It moves back and is switched to main chain, to avoid unnecessary loss.Therefore it needs in many of development of block chain in bifurcated scene The work tested.
In existing block chain testing scheme, be usually all using the multiple computers composition test chain in same local area network into Row test needs when simulate bifurcated environment to realize by making part computer disconnect network manually, needs labor intensive and greatly The material resources of amount.
Summary of the invention
In view of drawbacks described above in the prior art or deficiency, being intended to provide one kind can automatic imitation by a test machine Bifurcated analogy method, bifurcated test method, equipment and storage medium of the bifurcated environment to be tested automatically.
In a first aspect, the present invention provides a kind of bifurcated analogy method, this method is suitable for test machine, this method comprises:
Configure at least two groups test container group;Wherein, test container group includes at least two test node containers, each to test P2p communication can be carried out between each test node container of container group;
Each group test container group is run simultaneously until the main chain block of each test node container is synchronous;
Several test container groups out of service make the first test container group run scheduled first duration;
First test container group out of service makes the second test container group run scheduled second duration;
Each group test container group is run simultaneously again until the bifurcated of each test node container has been eliminated.
Second aspect, the present invention provide a kind of bifurcated test method, including executing the survey such as above-mentioned bifurcated analogy method Implementation of test cases is in test-run a machine to generate test result.
The third aspect, the present invention provides another bifurcated test method, including what is configured in above-mentioned bifurcated analogy method Implementation of test cases is in test node container to generate test result.
Fourth aspect, the present invention also provides a kind of equipment, including one or more processors and memory, wherein memory Comprising can by instruction that the one or more processors execute so that the one or more processors execute it is each according to the present invention The method that embodiment provides.
5th aspect, the present invention also provides a kind of storage medium for being stored with computer program, which makes to count Calculation machine executes the method that each embodiment provides according to the present invention.
Bifurcated analogy method, bifurcated test method, equipment and the storage medium that many embodiments of the present invention provide by Configured in test machine it is several can mutual p2p communication test node container with analog block chain network, and each test node is held Device is divided at least two groups, runs two groups of test container groups individually after the main chain block of each test node container synchronizes with mould Quasi- bifurcated, then run each group test container group returns to main chain to simulate from bifurcated simultaneously, realizes through a test machine i.e. Can automatic imitation bifurcated environment to be tested automatically, to save manpower and a large amount of material resources;
Bifurcated analogy method, bifurcated test method, equipment and the storage medium that some embodiments of the invention provide are further By using docker engine dispensing containers, so that the test node container of substantial amounts can be configured on a test machine, into One step meets the test scene demand of block chain.
Detailed description of the invention
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 test scene schematic diagram in one embodiment of the invention.
Fig. 2 is a kind of flow chart for bifurcated analogy method that one embodiment of the invention provides.
Fig. 3 is the flow chart of step S103 in a kind of embodiment of method shown in Fig. 2.
Fig. 4 is the flow chart of step S109 in a kind of embodiment of method shown in Fig. 2.
Fig. 5 is a kind of flow chart for bifurcated test method that one embodiment of the invention provides.
Fig. 6 is the flow chart for another bifurcated test method that one embodiment of the invention provides.
Fig. 7 is a kind of structural schematic diagram for equipment that one embodiment of the invention provides.
Specific embodiment
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, part relevant to invention is illustrated only in attached drawing.
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 is the test scene schematic diagram in one embodiment of the invention.Below by taking scene shown in FIG. 1 as an example, to this hair Every solution of bright offer is described in detail.
Fig. 2 is a kind of flow chart for bifurcated analogy method that one embodiment of the invention provides.
As shown in Fig. 2, in the present embodiment, the present invention provides a kind of bifurcated analogy method, comprising:
S101: configuration at least two groups test container group;Wherein, test container group includes at least two test node containers, P2p communication can be carried out between each test node container of each test container group;
S103: while each group test container group is run until the main chain block of each test node container is synchronous;
S105: several test container groups out of service make the first test container group run scheduled first duration;
S107: the first test container group out of service makes the second test container group run scheduled second duration;
S109: each group test container group is run simultaneously again until the bifurcated of each test node container has been eliminated.
For the scene shown in Fig. 1, in step s101, test machine 400 generates two groups of test container groups 300, and each group Test container group 300 includes 3 test node containers, specifically includes 1 digging mine node container 100 and 2 ordinary node containers P2p communication can be mutually carried out between 200,6 test node containers.
Specifically, in the present embodiment, test machine 400 configures test node container using docker engine and test is held Device group, above-mentioned test node container are docker container.Docker engine has lightweight, takes up less resources, starts the spies such as fast Point may be implemented to dispose a large amount of test node container in a test machine, and realize quick and convenient using These characteristics Start and stop test;In more embodiments, can also be configured according to actual needs by technologies such as RunC test node container and Test container group;
It in the present embodiment, include 1 digging mine node to configure two groups of test container groups, 300, one groups of test container groups 300 Exemplary elaboration is carried out for container 100 and 2 ordinary node container 200;It, can also be according to actual in more embodiments Testing requirement configures multiple groups test container group 300, and the test node appearance of different number is configured in one group of test container group 300 Device (e.g., including 5 digging mine node containers 100, or, including 3 digging mine node containers 100 and 10 ordinary node containers 200, etc.), as long as one group of test container group includes at least two test node containers, mine node is dug including at least one Identical technical effect can be realized in container 100.
Fig. 3 is the flow chart of step S103 in a kind of embodiment of method shown in Fig. 2.As shown in figure 3, in the present embodiment In, step S103 includes:
S1031: make each group test container group while running scheduled third duration;
S1033: each digging mine node container 100 is made to stop digging mine;
S1035: whether the main chain block height for monitoring each test node container is identical: being then to confirm that each test node holds The main chain block of device has synchronized, and executes step S105;It is no, then it recycles current procedures and continues to monitor.
In another embodiment, when test container group 300 only includes multiple digging mine node containers 100, without including common When node container 200, step S103 only needs to run a period of time and confirms that each block height for digging mine node container 100 is identical I.e. executable step S105.
When confirming that the main chain block of each test node container has synchronized in step S103, the block of each test node container For height is 50:
In step s105, stop the second test container group, the first test container group is made to run scheduled first duration, this When the first test container group each test node container block height be 83-85 differ, increased newly more than 30 in the first duration A block, and the block height of each test node container of the second test container group is still 50;
In step s 107, stop the first test container group, the second test container group is made to run scheduled second duration, this When the second test container group each test node container block height be 72-74 differ, increased newly more than 20 in the second duration A block forms bifurcated with each test node container of the first test container group;
In step S109, while two groups of test container groups are run, is returned according to the bifurcated being pre-configured in test node container Annealing method, several test node containers will do it bifurcated rollback, and realizes and synchronize after eliminating bifurcated.
Fig. 4 is the flow chart of step S109 in a kind of embodiment of method shown in Fig. 2.As shown in figure 4, in the present embodiment In, step S109 includes:
S1091: while running each group test container group;
S1093: newest block and other each tests of the block height of the first test node container of monitoring for the first height The block height of node container is whether the block Hash of each block of the first height is identical:
Then to confirm that the bifurcated of each test node container has been eliminated, at this time can with all test node containers out of service, It can continue to run all test node containers, can be recycled with return step S105.
In the embodiment shown in fig. 4, step S109 randomly selects the newest block of a test node container in monitoring, And judged in the block height of the block;In further embodiments, step S109 can also choose not in monitoring Same block is judged, for example, the block height of current each test node container is that 93-98 is differed, then can wait simultaneously root Judged according to the block that block height is 99, it can be achieved that identical technical effect.
Fig. 5 is a kind of flow chart for bifurcated test method that one embodiment of the invention provides.
As shown in figure 5, in the present embodiment, the present invention also provides a kind of bifurcated test methods, comprising:
S201: the implementation of test cases in the test machine for executing the bifurcated analogy method that any of the above-described embodiment provides;
S203: test result is generated according to the implementing result of test case.
For example, whether bifurcated can be eliminated in time with test block catenary system: monitoring again while being run from step S109 Whether the main chain block of each test node container synchronizes in the 4th duration from when each group test container group, and according to monitoring result Generate test result.
In another example eliminating the speed of bifurcated, application when can also test bifurcated backing method for different bifurcated situations Performance, etc. when the block catenary system of different scales.
Fig. 6 is the flow chart for another bifurcated test method that one embodiment of the invention provides.
As shown in fig. 6, in the present embodiment, the present invention also provides another bifurcated test methods, comprising:
S301: test is executed in the test node container that the bifurcated analogy method that any of the above-described embodiment provides is configured Use-case;
S303: test result is generated according to the implementing result of test case.
The difference of method shown in Fig. 6 and method shown in Fig. 5 is that method testing script shown in Fig. 5 is configured in test machine Middle execution, and the configuration of method testing script shown in Fig. 6 executes in test node container, those skilled in the art can basis Actual testing requirement selects test method.
Fig. 7 is a kind of structural schematic diagram for equipment that one embodiment of the invention provides.
As shown in fig. 7, present invention also provides a kind of equipment 700, including one or more centres as on the other hand Unit (CPU) 701 is managed, can be added according to the program being stored in read-only memory (ROM) 702 or from storage section 708 The program that is downloaded in random access storage device (RAM) 703 and execute various movements appropriate and processing.In RAM703, also deposit It contains equipment 700 and operates required various programs and data.CPU701, ROM702 and RAM703 pass through the phase each other of bus 704 Even.Input/output (I/O) interface 705 is also connected to bus 704.
I/O interface 705 is connected to lower component: the importation 706 including keyboard, mouse etc.;It is penetrated including such as cathode The output par, c 707 of spool (CRT), liquid crystal display (LCD) etc. and loudspeaker etc.;Storage section 708 including hard disk etc.; And the communications portion 709 of the network interface card including LAN card, modem etc..Communications portion 709 via such as because The network of spy's net executes communication process.Driver 710 is also connected to I/O interface 705 as needed.Detachable media 711, such as Disk, CD, magneto-optic disk, semiconductor memory etc. are mounted on as needed on driver 710, in order to read from thereon Computer program be mounted into storage section 708 as needed.
Particularly, in accordance with an embodiment of the present disclosure, the method for any of the above-described embodiment description may be implemented as computer Software program.For example, embodiment of the disclosure includes a kind of computer program product comprising be tangibly embodied in machine readable Computer program on medium, the computer program include the program code for executing method.In such embodiments, The computer program can be downloaded and installed from network by communications portion 709, and/or be pacified from detachable media 711 Dress.
As another aspect, present invention also provides a kind of computer readable storage medium, the computer-readable storage mediums Matter can be computer readable storage medium included in the device of above-described embodiment;It is also possible to individualism, it is unassembled Enter the computer readable storage medium in equipment.Computer-readable recording medium storage has one or more than one program, should Program is used to execute by one or more than one processor is described in the present processes.
Flow chart and block diagram in attached drawing are illustrated according to the system of various embodiments of the invention, 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 of one module, program segment or code of table, a part of the module, program segment or code include one or more use The executable instruction of the logic function as defined in realizing.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 depending on related function.Also it wants It is noted that the combination of each box in block diagram and or flow chart and the box in block diagram and or flow chart, Ke Yitong The dedicated hardware based system of functions or operations as defined in executing is crossed to realize, or by specialized hardware and can be calculated The combination of machine instruction is realized.
Being described in the embodiment of the present application involved unit or module can be realized by way of software, can also be with It is realized by way of hardware.Described unit or module also can be set in the processor, for example, each unit can To be the software program being arranged in computer or intelligent movable equipment, it is also possible to the hardware device being separately configured.Wherein, this The title of a little units or module does not constitute the restriction to the unit or module itself under certain conditions.
Above description is only the preferred embodiment of the application and the explanation to institute's application technology principle.Those skilled in the art Member is it 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 the application design, appointed by above-mentioned technical characteristic or its equivalent feature Other technical solutions of meaning combination and formation.Such as features described above and (but being not limited to) disclosed herein have similar functions Technical characteristic replaced mutually and the technical solution that is formed.

Claims (10)

1. a kind of bifurcated analogy method, which is characterized in that the method is suitable for test machine, which comprises
Configure at least two groups test container group;Wherein, the test container group include at least two test node containers, it is described extremely It include that at least one digs mine node container, each test node of each test container group in few two test node containers P2p communication can be carried out between container;
Test container group described in each group is run simultaneously until the main chain block of each test node container is synchronous;
Several test container groups out of service make the first test container group run scheduled first duration;
The first test container group out of service makes the second test container group run scheduled second duration;
Test container group described in each group is run simultaneously again until the bifurcated of each test node container has been eliminated.
2. the method according to claim 1, wherein described while running test container group described in each group until each The main chain block of the test node container, which synchronizes, includes:
Make test container group described in each group while running scheduled third duration;
Each digging mine node container is set to stop digging mine;
Whether the main chain block height for monitoring each test node container is identical: being then to confirm each test node container Main chain block synchronized.
3. the method according to claim 1, wherein described, to run test container group described in each group straight simultaneously again Bifurcated to each test node container has been eliminated and includes:
Test container group described in each group is run simultaneously;
The block height for monitoring the first test node container is that the newest block of the first height and other each test nodes hold The block height of device is whether the block Hash of each block of the first height is identical:
It is then to confirm that the bifurcated of each test node container has been eliminated.
4. method according to claim 1-3, which is characterized in that the test node container is docker appearance Device.
5. method according to claim 1-3, which is characterized in that described to run test described in each group simultaneously again Container group returns to several test container groups out of service, makes after the bifurcated of each test node container has been eliminated First test container group runs scheduled first duration.
6. a kind of bifurcated test method, which is characterized in that executing bifurcated analogy method as described in any one in claim 1-5 Test machine in implementation of test cases to generate test result.
7. according to the method described in claim 6, it is characterized in that, the implementation of test cases includes: to generate test result
Monitor each test node container in the 4th duration from running test container group described in each group simultaneously again Whether main chain block synchronizes;
Test result is generated according to monitoring result.
8. a kind of bifurcated test method, which is characterized in that matched in bifurcated analogy method as described in any one in claim 1-5 Implementation of test cases is in the test node container set to generate test result.
9. a kind of equipment, which is characterized in that the equipment includes:
One or more processors;
Memory, 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 Execute such as method of any of claims 1-8.
10. a kind of storage medium for being stored with computer program, which is characterized in that realize when the program is executed by processor as weighed Benefit requires method described in any one of 1-8.
CN201910049107.8A 2019-01-18 2019-01-18 Bifurcated analogy method, bifurcated test method, equipment and storage medium Pending CN109787863A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910049107.8A CN109787863A (en) 2019-01-18 2019-01-18 Bifurcated analogy method, bifurcated test method, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910049107.8A CN109787863A (en) 2019-01-18 2019-01-18 Bifurcated analogy method, bifurcated test method, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN109787863A true CN109787863A (en) 2019-05-21

Family

ID=66501014

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910049107.8A Pending CN109787863A (en) 2019-01-18 2019-01-18 Bifurcated analogy method, bifurcated test method, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN109787863A (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20180248880A1 (en) * 2017-02-24 2018-08-30 Verizon Patent And Licensing Inc. Permissions using blockchain
CN108763058A (en) * 2018-04-24 2018-11-06 苏州同济区块链研究院有限公司 A kind of block chain evaluation system
CN109039648A (en) * 2018-08-03 2018-12-18 克洛斯比尔有限公司 A kind of creation method, equipment and the readable storage medium storing program for executing of block chain

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20180248880A1 (en) * 2017-02-24 2018-08-30 Verizon Patent And Licensing Inc. Permissions using blockchain
CN108763058A (en) * 2018-04-24 2018-11-06 苏州同济区块链研究院有限公司 A kind of block chain evaluation system
CN109039648A (en) * 2018-08-03 2018-12-18 克洛斯比尔有限公司 A kind of creation method, equipment and the readable storage medium storing program for executing of block chain

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
33复杂美区块链: "技术分享:构造区块链分叉的测试方法", 《HTTPS://NEWS.HUOXING24.COM/20181221212950097981.HTML》 *

Similar Documents

Publication Publication Date Title
CN106528262B (en) Mirror image dispositions method, device
Schaller Minimizing total tardiness for scheduling identical parallel machines with family setups
CN110113408A (en) A kind of block synchronous method, equipment and storage medium
CN109656599A (en) The method and system updated for client release
CN111459763A (en) Cross-kubernets cluster monitoring system and method
CN110392121A (en) Parallel chain block generation method, equipment and storage medium
CN109388677A (en) Method of data synchronization, device, equipment and its storage medium between cluster
CN110290166A (en) Across company-data exchange method, system, device and readable storage medium storing program for executing
JP6500896B2 (en) Attribute enumeration system, attribute enumeration method and attribute enumeration program
US9244652B1 (en) State management for task queues
CN109960639A (en) A kind of method and apparatus generating test case
CN109787863A (en) Bifurcated analogy method, bifurcated test method, equipment and storage medium
CN111435329A (en) Automatic testing method and device
Cole et al. Model-based systems engineering: application and lessons from a technology maturation project
CN110413287A (en) The dispositions method and device of software
US20200380437A1 (en) Business process design support method and business process design support apparatus
CN110362297A (en) A kind of element sort method and device
CN110752964A (en) Network equipment testing method and device
CN109656267B (en) Parallel cooperative test method for flight control system
CN112130962B (en) Continuous delivery platform and method for deploying application system by using same
US8739114B2 (en) Using infeasible nodes to select branching variables
CN113608754A (en) Service instantiation method and device and electronic equipment
CN109656709A (en) A kind of method and apparatus of Codis cluster dilatation
CN107656865A (en) Testing requirement determines method and device
Chazapis et al. EVOLVE: HPC and cloud enhanced testbed for extracting value from large-scale diverse data

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
WD01 Invention patent application deemed withdrawn after publication
WD01 Invention patent application deemed withdrawn after publication

Application publication date: 20190521