CN110474822A - A kind of block chain link point detecting method, device, equipment and medium - Google Patents

A kind of block chain link point detecting method, device, equipment and medium Download PDF

Info

Publication number
CN110474822A
CN110474822A CN201910731255.8A CN201910731255A CN110474822A CN 110474822 A CN110474822 A CN 110474822A CN 201910731255 A CN201910731255 A CN 201910731255A CN 110474822 A CN110474822 A CN 110474822A
Authority
CN
China
Prior art keywords
node
scene operation
injector
request message
block chain
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
CN201910731255.8A
Other languages
Chinese (zh)
Other versions
CN110474822B (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.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent 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 Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN201910731255.8A priority Critical patent/CN110474822B/en
Publication of CN110474822A publication Critical patent/CN110474822A/en
Application granted granted Critical
Publication of CN110474822B publication Critical patent/CN110474822B/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
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/06Management of faults, events, alarms or notifications
    • H04L41/0654Management of faults, events, alarms or notifications using network fault recovery
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/08Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
    • H04L43/0805Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters by checking availability
    • H04L43/0817Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters by checking availability by checking functioning

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Environmental & Geological Engineering (AREA)
  • Retry When Errors Occur (AREA)
  • Computer And Data Communications (AREA)

Abstract

The application provides a kind of block chain link point detecting method, comprising: injector manager intercepts and captures the first request message for being used to obtain current traffic state that block chain first node is sent;Injector manager determines the first scene operation for simulating abnormal operation according to the first request message;Injector manager injects the first scene operation to first node, so that can first node detection first node when executing the first scene operation work normally.The application also provides a kind of block chain link point detection device, computer equipment and medium, the request message that first node obtains current traffic state is intercepted and captured by injector manager, and the first scene operation is injected to first node, so that first node is to execute the first scene operation to have got current traffic state, so as to pass through the service condition of injector manager accuracy controlling first node, in order to execute the detection to block chain interior joint.

Description

A kind of block chain link point detecting method, device, equipment and medium
Technical field
The present invention relates to electronic technology fields, more specifically to a kind of block chain link point detecting method, device, set Standby and medium.
Background technique
User can initiate to trade by client, and the whole Transaction Informations recorded in transaction can be packaged into an area It is stored in block.As lasting transaction expands, block interlinks one by one, forms block chain, and block chain is also referred to as Account book.Block chain is an open network account book, may include having multiple blocks (Block) in block chain.Block chain tool There are many forms, such as may include public chain, private chain and alliance's chain etc..
Block chain is made of block interconnected, and a block is made of multiple nodes for having computing capability, by Distributed algorithm is used between each node, it is therefore desirable to ensure to reach common understanding between each node by a set of common recognition algorithm, example Such as practical Byzantine failure tolerance algorithm (practical byzantine fault tolerance, PBFT), PBFT common recognition algorithm is A kind of state machine copy replication algorithm accomplishes final consistency of knowing together and ensuring copy replication consistency.
In PBFT common recognition algorithm, the state of node can be divided into leader node (Leader or Primary) and follower Node (Follower or Backup), different states cause the business responsibility of node different, wherein follower's node is responsible for number According to forwarding, and leader node is responsible for the packing and upload of data, during real work, due to the shadow of external factor It rings, the state of node can switch between leader node and follower's node, and block chain itself can be according to business feature The service condition of one with PBFT state synchronized need to be safeguarded, at this point, block chain can be according to same when the state of node switches The service condition of step switching carries out particular procedure operation, so that block chain can still work normally when node state changes.
In order to proofing state switching after block chain availability, need to detect block chain, with ensure no matter business shape How state switches, and block chain can be worked normally according to the switching of service condition.It is main external by control in the prior art Resource exception triggers the switching of node state, to realize the analog detection to block chain, such as abnormal by analog network, The means such as CPU exception or memory abnormal are realized, however, only by external resource extremely come the switching for triggering node state, very Difficulty accomplishes that precisely and clearly detection egress is switched under any scene, for example, external resource exception can not be detected It is caused as a result, being node is switched to follower's node from leader node, or be switched to leader's section from follower's node Point.
Therefore, the above problem needs to solve.
Summary of the invention
In view of this, to solve the above problems, technical solution provided by the invention is as follows:
A kind of block chain link point detecting method, comprising:
Injector manager intercepts and captures the first request message, and first request message is first node initiation for obtaining The request message of current traffic state, the first node are a node in block chain;
The injector manager determines the first scene operation, first scene operation according to first request message For simulating the abnormal operation of the first node;
The injector manager injects first scene operation to the first node, so that the first node Can detection first node when executing first scene operation work normally.
A kind of block chain link point detection device, comprising:
Unit is intercepted and captured, the intercepting and capturing unit is first node for intercepting and capturing the first request message, first request message That initiates is used to obtain the request message of current traffic state, and the first node is a node in block chain;
Determination unit, the determination unit are used for, and are determined according to first request message that the intercepting and capturing unit is intercepted and captured First scene operation, first scene operation are used to simulate the abnormal operation of the first node;
First injection unit, first injection unit are used for, and Xiang Suoshu first node injects the determination unit and determines First scene operation so that the first node detection when executing first scene operation first node It can work normally.
Optionally, described device further include:
Second injection unit, first injection unit are used for, and Xiang Suoshu first node injects the first recovery operation, so that Obtain first scene operation that the first node stops executing the first injection unit injection.
Optionally, the intercepting and capturing unit, is used for: intercepting and capturing first request message by point of penetration, the point of penetration is The point of penetration of anchor code enhancing;
First injection unit, is used for: injecting first scene to the first node by the point of penetration and grasps Make.
Optionally, the determination unit, is used for:
Preset registration information is obtained according to first request message that the intercepting and capturing unit is intercepted and captured;
The first injection rule corresponding with the registration information and parameter are obtained according to the registration information, wherein described First injection rule is that injector acts on behalf of the rule and parameter being previously written with parameter, and the first injection rule is used for parameter Execute first scene operation.
Optionally, first injection unit, is used for:
The first notification message is sent to the first node, first notification message is for guiding the first node to read Preset execution memory is taken, the first injection rule and parameter are prestored in the execution memory, so that the first segment Point executes first scene operation.
Optionally, first injection unit, is used for:
Second notification message is sent to the first node, the second notification message is for guiding the first node to hold Preset first code section in row block chain, record has the first injection rule and parameter in the first code section, so that It obtains the first node and executes first scene operation.
Optionally, first injection unit is also used to:
The order that service switchover state is sent to the first node, so that the first node service switchover state;
Alternatively,
After the intercepting and capturing unit intercepts and captures first request message, in the rear to the first segment of the first preset time period Point sends the order of service switchover state, so that the first node delayed switching service condition;
Alternatively,
Abnormality code is sent to the first node, so that the working result of the first node output error;
Alternatively,
It is sent to the first node and restores code, the recovery code is for deleting the abnormality code, so that institute It states first node and exports correct working result.
A kind of computer equipment, the computer equipment include: interactive device, input/output (I/O) interface, processor And memory, program instruction is stored in the memory;
The interactive device is used to obtain the operational order of user's input;
The processor executes the above method for executing the program instruction stored in memory.
A kind of computer readable storage medium, including instruction, when described instruction is run on a computing device, so that institute It states computer equipment and executes the above method.
A kind of block chain link point detecting method provided herein, comprising: injector manager intercepts and captures the first request and disappears Breath, the first request message are the request message for being used to obtain current traffic state that first node is initiated, and first node is block A node in chain;Injector manager determines that the first scene operation, the first scene operation are used for according to the first request message Simulate the abnormal operation of first node;Injector manager injects the first scene operation to first node, so that first Can nodal test first node when executing the first scene operation work normally.In the present embodiment, pass through injector manager The request message that first node obtains current traffic state is intercepted and captured, and injects the first scene operation to first node, so that first Node is to execute the first scene operation to have got current traffic state, so as to accurately be adjusted by injector manager The service condition of first node is controlled, in order to execute the detection to block chain interior joint.
Detailed description of the invention
In order to more clearly explain the embodiment of the invention or the technical proposal in the existing technology, to embodiment or will show below There is attached drawing needed in technical description to be briefly described, it should be apparent that, the accompanying drawings in the following description is only this The embodiment of invention for those of ordinary skill in the art without creative efforts, can also basis The attached drawing of offer obtains other attached drawings.
Fig. 1 is the architecture diagram of block catenary system node;
Fig. 2 is the architecture diagram that block chain link point detecting method provided by the embodiments of the present application is used for block catenary system node;
Fig. 3 is the flow chart of one embodiment of block chain link point detecting method provided by the embodiments of the present application;
Fig. 4 A is the flow chart of the specific embodiment of block chain link point detecting method provided by the embodiments of the present application;
Fig. 4 B is the signal of another specific embodiment of block chain link point detecting method provided by the embodiments of the present application Figure;
Fig. 4 C is the signal of another specific embodiment of block chain link point detecting method provided by the embodiments of the present application Figure;
Fig. 5 is the structural schematic diagram of computer equipment provided by the embodiments of the present application;
Fig. 6 is a kind of structural schematic diagram of block chain link point detection device provided by the embodiments of the present application.
Specific embodiment
Following will be combined with the drawings in the embodiments of the present invention, and technical solution in the embodiment of the present invention carries out clear, complete Site preparation description, it is clear that described embodiments are only a part of the embodiments of the present invention, instead of all the embodiments.It is based on Embodiment in the present invention, it is obtained by those of ordinary skill in the art without making creative efforts every other Embodiment shall fall within the protection scope of the present invention.
The description and claims of this application and term " first ", " second ", " third " " in above-mentioned attached drawing The (if present)s such as four " are to be used to distinguish similar objects, without being used to describe a particular order or precedence order.It should manage The data that solution uses in this way are interchangeable under appropriate circumstances, so that the embodiments described herein can be in addition to illustrating herein Or the sequence other than the content of description is implemented.In addition, term " includes " and " having " and their any deformation, it is intended that Cover it is non-exclusive include, for example, containing the process, method, system, product or equipment of a series of steps or units need not limit In step or unit those of is clearly listed, but may include be not clearly listed or for these process, methods, produce The other step or units of product or equipment inherently.
User can initiate to trade by client, and the whole Transaction Informations recorded in transaction can be packaged into an area It is stored in block.As lasting transaction expands, block interlinks one by one, forms block chain, and block chain is also referred to as Account book.Block chain is an open network account book, may include having multiple blocks (Block) in block chain.Block chain tool There are many forms, such as may include public chain, private chain and alliance's chain etc..
Block chain is made of block interconnected, and a block is made of multiple nodes for having computing capability, by Distributed algorithm is used between each node, it is therefore desirable to ensure to reach common understanding between each node by a set of common recognition algorithm, example Such as practical Byzantine failure tolerance algorithm (practical byzantine fault tolerance, PBFT), PBFT common recognition algorithm is A kind of state machine copy replication algorithm accomplishes final consistency of knowing together and ensuring copy replication consistency.
In PBFT common recognition algorithm, the state of node can be divided into leader node (Leader or Primary) and follower Node (Follower or Backup), different states cause the business responsibility of node different, wherein follower's node is responsible for number According to forwarding, and leader node is responsible for the packing and upload of data, during real work, due to the shadow of external factor It rings, the state of node can switch between leader node and follower's node, and block chain itself can be according to business feature The service condition of one with PBFT state synchronized need to be safeguarded, at this point, block chain can be according to same when the state of node switches The service condition of step switching carries out particular procedure operation, so that block chain can still work normally when node state changes.
In order to proofing state switching after block chain availability, need to detect block chain, with ensure no matter business shape How state switches, and block chain can be worked normally according to the switching of service condition.It is main external by control in the prior art Resource exception triggers the switching of node state, to realize the analog detection to block chain, such as abnormal by analog network, The means such as CPU exception or memory abnormal are realized, however, only by external resource extremely come the switching for triggering node state, very Difficulty accomplishes that precisely and clearly detection egress is switched under any scene, for example, external resource exception can not be detected It is caused as a result, being node is switched to follower's node from leader node, or be switched to leader's section from follower's node Point.
Therefore, in view of the above-mentioned problems, the embodiment of the present application provides a kind of block chain link point detecting method, for convenient for reason Solution, below in conjunction with attached drawing, is described in detail method provided by the embodiment of the present application.
The applicable working environment of this method is introduced first, referring to Fig. 1, as shown in Figure 1, provided by the embodiment of the present application For detecting block catenary system shown in FIG. 1, the node of block chain can execute block chain link point detecting method during the work time Particular procedure operation, such as receive transaction 101, transmitted transaction 102, building block 103 and broadcast block 104 etc., to complete The calculating process of one block chain node, above-mentioned four kinds of processing operations, before proceeding, node requires to obtain current business State, for receiving transaction 101, specific implementation is, before starting to receive transaction, is responsible for processing receives transaction the One node sends request message, the state and PBFT module hold mode of the state management module 105 to state management module 105 It is synchronous, so that the state management module 105 feeds back current traffic state according to the request message, to first node, so that The first node that processing receives transaction knows own service state, so that first node is subsequent according to the execution of own service state Operation.
In order to ensure the normal work of block catenary system, the node to block chain is needed to debug, concrete mode are as follows: wound Abnormal work situation is made, can detect block chain link point later work normally in current abnormal work, currently, create different The method of normal working condition are as follows: by analog network, the means such as abnormal, CPU exception or memory abnormal are realized, however, only by External resource realizes abnormal operation extremely, is difficult to determine that external resource extremely changes block catenary system inner case Become, for this purpose, referring to Fig. 2, the application joined a kind of injector management provided by Fig. 1 on the basis of block catenary system Device, to solve the above problems, as shown in Fig. 2, injector manager 201 is in node (for being responsible for receiving transaction 101, forwarding and hand over Easy 102, construct block 103 or broadcast the node that any one in block 104 calculates) it sends and requests to state management module 105 On the path of message, point of penetration 202 is set, injector manager 201 passes through the point of penetration 202 to the node for sending request message Scene operation is injected, to accurately control the change of block chain link point service condition, it is ensured that following detection step is gone on smoothly.
Block provided by the embodiments of the present application is discussed in detail below in conjunction with attached drawing based on above-mentioned system architecture shown in Fig. 2 The specific work steps of chain link point detecting method.Referring to Fig. 3, as shown in figure 3, block chain link provided by the embodiment of the present application Point detecting method includes:
301, injector manager intercepts and captures the first request message.
In the present embodiment, which is that the request for obtaining current traffic state that first node is initiated disappears Breath, the first node are a node in block chain, wherein the first node can be for executing receipts transaction, forwarding is handed over Easily, it constructs block or broadcasts the node of block, before start-up operation, need to send request message to state management module to obtain Obtain current traffic state.
302, injector manager determines the first scene operation according to the first request message.
In the present embodiment, the first scene operation is used to simulate the abnormal operation of the first node, for example, this first Scene operation can be state switching and forge, distort in the code injections such as result, time delay or throw exception and recovery extremely Few one kind.
303, injector manager injects the first scene operation to first node.
In the present embodiment, injector manager injects the first scene operation to first node, so that the first node is examined Can the first node when executing first scene operation be surveyed work normally.
It can be seen that intercepting and capturing first node in the present embodiment by injector manager and being sent to state management module Request message, injector manager injects the first scene operation and exactly sends the first request for first node and disappear later Feedback message is had received after breath, so that first node can execute the first scene operation, so as to accurately know, current block The working condition of chain node is to be formed by working condition when first node executes the first scene operation, so as to the The working condition of one node is accurately detected.
Optionally, after having executed above-mentioned steps 301 to 303, can with the following steps are included:
Injector manager injects the first recovery operation to first node.
In the present embodiment, when first node executes the first scene operation, after completing detection, injector manager is to first segment Point the first recovery operation of injection, so that the first node stops executing first scene operation, optionally, this is first extensive The execution operated again, which can be divided into, to be manually performed and executes two kinds of situations automatically, and specifically, manually performing can be user true To recognize after the completion of detection operation, manual clicking trigger injector manager injects the instruction of the first recovery operation to first node, from Dynamic execution can be when meeting preset condition, and automatic trigger injector manager injects the first recovery operation to first node Instruction, for example, executing injection automatically after injector manager meets the object time to the first scene operation of first node injection Device manager injects the first recovery operation to first node.
Further, step described in above-mentioned steps 301 to 303 can specifically be realized by following specific embodiments, Fig. 4 A is please referred to, as shown in Figure 4 A, the specific embodiment packet of block chain link point detecting method provided by the embodiment of the present application It includes:
401, injector manager intercepts and captures the first request message by point of penetration.
In the present embodiment, which is the point of penetration of anchor code enhancing, and injector manager passes through in first node The chain road setting point of penetration of information transmit-receive, realizes the interception to the first request message between state supervisor.
402, injector manager obtains preset registration information according to the first request message.
In the present embodiment, injector manager triggers the behaviour for obtaining registration information after intercepting and capturing the first request message Make.
403, injector manager obtains the first injection rule corresponding with registration information and parameter according to registration information.
In the present embodiment, please refer to Fig. 4 B, due to every kind of business operation be all it is independently operated, only by single point of penetration without Method accomplishes comprehensive state handoff scenario, also needs the collaboration implant operation for providing multiple points of penetration thus.And it is each in order to simplify The realization of the point of penetration and injection scene of critical path, can take out injector manager trustship implant operation, it is only necessary to infuse thus Volume can both complete the function injection of corresponding point of penetration.As shown in Figure 4 B, injector manager 4031 is also connected with injector generation Reason 4032, by 4032 write-in injection rule of injector agency and parameter, such as the first injection rule and parameter, when user is infusing Enter after being registered on device manager 4031, injector manager 4031 can read corresponding with registration information according to registration information First injection rule and parameter, so that the first scene implant operation is obtained, later by being anchored on block catenary system source code Point of penetration 4034 on 4033, can inject the first scene operation.
404, injector manager sends a notification message to the first node.
In the present embodiment, notification message is for guiding first node to execute scene operation, it should be noted that such as Fig. 4 C institute Showing, the implementation of scene operation injection block catenary system can be divided into two kinds, specifically: one, runtime Dynamic injection are led to It crosses compiler 4043 injecting codes 4041 for being used for Run-time scenario operation are stored in execution memory, in block chain operational process Middle execution Dynamic injection block catenary system source code 4044;Two, compiling duration static injection is i.e. logical in the compiling duration of block chain code It crosses compiler 4043 source code 4042 for being used to execute scene operation is written in block catenary system source code 4044, realize static Injection;For ease of understanding, this two kinds of situations are illustrated individually below.
One, runtime Dynamic injection.
The specific implementation of runtime Dynamic injection are as follows: injector manager sends the first notice to first node and disappears Breath.
In the present embodiment, injection rule is written in an execution memory with parameter in advance by injector agency, in the execution It deposits and can be shared drive or KV database (such as Redis), since the injection rule for executing scene operation is deposited with parameter In executing memory, the code for being not written into block chain source code, therefore will not polluting block catenary system itself exists to realize for storage Ensure that business is not affected in the case where without changing block chain source code, also guarantees that influenced performance is acceptable at one In range.
In specific work process, for the first notification message for guiding first node to read above-mentioned execution memory, this is first logical Know that message can be to realize by way of notification function, prestores the first injection rule and parameter, note in memory due to executing Enter device manager when injecting the first scene operation to first node, guides first node to read preset hold by notification message Row memory so that first node executes the first scene operation, as shown in Figure 4 B, injector manager and block catenary system it Between by point of penetration connect, injector manager by the point of penetration to first node send the first notification message, to realize The injection of first scene operation.It optionally, include multiple nodes in a block catenary system, each node and state supervisor Point of penetration can be set between link, to have multiple points of penetration, multiple points of penetration can pass through an injector manager Realize unified management.
Optionally, above-mentioned runtime Dynamic injection can be realized using technologies such as Instrumentation+ASM or Hooking Runtime injection.
Two, compiling duration static injection.
The specific implementation of compiling duration static injection are as follows: injector manager sends the second notice to first node and disappears Breath.
In the present embodiment, in the compiling duration of block catenary system source code, for executing the first injection of the first scene operation Rule is written in source code with parameter, but is isolated with block chain source code, thus not contaminated area block chain source code, this second Notification message can realize that injector manager sends second to first node by point of penetration and leads to by way of notification function Message is known, so that first node executes source code, i.e. the first note specified by second notification message according to the second notification message Enter rule and parameter, thereby executing scene operation.
Optionally, above-mentioned compiling duration static injection can use AspectJ, ASM or AspectC++ etc. for code enhancement technology Realize compiling injection.
It should be noted that first that above-mentioned first notification message or the guided first node of second notification message execute Scape is operated for simulating the abnormal operation of first node, so that can detect first node when abnormal operation occur It keeps working normally, specifically, it may include following operation side that injector manager, which sends the first scene operation to first node, Any one in formula.
One, state switching is forged.
The specific implementation that state switching is forged are as follows: injector manager sends service switchover state to first node Order, so that first node service switchover state.
In the present embodiment, first node executes the switching of service condition, example after the order for receiving service switchover state It such as is switched to leader node from follower's node, or is switched to follower's node from leader node, specific switching side Formula is determined by the order of service switchover state, switches form so as to be accurately controlled the service condition of first node, into And working condition of the first node when service condition switches can be tested.
Two, time delay.
The specific implementation of time delay are as follows: injector manager is default first after intercepting and capturing the first request message The rear order that service switchover state is sent to first node of period, so that first node delayed switching service condition.
In the present embodiment, time delay belongs to a kind of operation irregularity state, therefore, prolongs to test first node in the time Working condition under late, through injector manager after intercepting and capturing the first request message, deliberately service switchover state is replied in delay Order time, the time span of delay: the specific duration of the first preset time period can be by tester according to actually making It is adjusted with demand, so as to accurately detect under different delay state, whether the working condition of first node is normal.
Three, abnormality code is sent.
Sending the specific implementation of abnormality code are as follows: injector manager sends abnormality code to first node, so that Obtain the working result of the first node output error.
In the present embodiment, injector manager is sent out after the request message for receiving first node transmission to first node Abnormal code is sent, so that the first node becomes an error node (or Byzantium's node), and then is tested, when first When node is error node, can entire block catenary system fault-tolerant to the error node, to ensure the work of entire block catenary system Work is not influenced by the error node.
Four, it sends and restores code.
Sending the step of restoring code can carry out after above-mentioned transmission abnormality code step, specific implementation are as follows: Injector manager is sent to first node restores code, restores code and is used for suppressing exception code, so that first node is defeated Correct working result out.
In the present embodiment, in real work, after state supervisor has sent abnormality code to first node, condition managing Device itself may perceive this exception, and reissue recovery code to first node, so that first node restores to transport again Make, therefore, during test block chain node, need to detect this mechanism whether can normal operation therefore sending After complete abnormality code, injector manager is sent to first node restores code, and then tests after receiving recovery code, the Can one node be restored to normal working condition in abnormal operation, input correct working result.
It should be noted that above-mentioned first scene operation is a kind of citing, in practical work process, tester can be with According to test needs, any abnormal operation is edited, later by injector manager by abnormal operation injection the In one node, to realize the detection to first node, further, this method can also be used to detect simultaneously multiple nodes, right This embodiment of the present application is not defined.
It is above-mentioned that scheme provided by the embodiments of the present application is described.It is understood that computer equipment is for reality Existing above-mentioned function, it comprises execute the corresponding hardware configuration of each function and/or software module.Those skilled in the art should It is readily appreciated that, module described in conjunction with the examples disclosed in the embodiments of the present disclosure and algorithm steps, the application can It is realized with the combining form of hardware or hardware and computer software.Some function is driven actually with hardware or computer software The mode of hardware executes, specific application and design constraint depending on technical solution.Professional technician can be to every A specific application uses different methods to achieve the described function, but this realizes it is not considered that beyond the application Range.
It is described from hardware configuration, the above method can be realized by an entity device, can also be set by multiple entities Standby common realization, can also be a logic functional block in an entity device, the embodiment of the present application is not made this specifically It limits.
For example, the above method can be realized by the computer equipment in Fig. 5.Fig. 5 provides for the embodiment of the present application Computer equipment hardware structural diagram.The computer equipment includes at least one processor 501, and communication line 502 is deposited Reservoir 503 and at least one communication interface 504.
Processor 501 can be a general central processor (central processing unit, CPU), micro process Device, application-specific integrated circuit (application-specific integrated circuit, server I C) or one Or it is multiple for controlling the integrated circuit of application scheme program execution.
Communication line 502 may include an access, and information is transmitted between said modules.
Communication interface 504, using the device of any transceiver one kind, for other equipment or communication, such as Ethernet, wireless access network (radio access network, RAN), WLAN (wireless local area Networks, WLAN) etc..
Memory 503 can be read-only memory (read-only memory, ROM) or can store static information and instruction Other kinds of static storage device, random access memory (random access memory, RAM) or letter can be stored The other kinds of dynamic memory of breath and instruction, is also possible to Electrically Erasable Programmable Read-Only Memory (electrically Er server able programmable read-only memory, EEPROM), CD-ROM (compact disc Read-only memory, CD-ROM) or other optical disc storages, optical disc storage (including compression optical disc, laser disc, optical disc, number General optical disc, Blu-ray Disc etc.), magnetic disk storage medium or other magnetic storage apparatus or can be used in carrying or storing tool There is the desired program code of instruction or data structure form and can be by any other medium of computer access, but is not limited to This.Memory, which can be, to be individually present, and is connected by communication line 502 with processor.Memory can also be with processor collection At together.
Wherein, memory 503 be used for store execution application scheme computer executed instructions, and by processor 501 Control executes.Processor 501 is for executing the computer executed instructions stored in memory 503, to realize that the application is above-mentioned The method that embodiment provides.
Optionally, the computer executed instructions in the embodiment of the present application can also be referred to as application code, the application Embodiment is not especially limited this.
In the concrete realization, as one embodiment, processor 501 may include one or more CPU, such as in Fig. 5 CPU0 and CPU1.
In the concrete realization, as one embodiment, computer equipment may include multiple processors, such as in Fig. 5 Processor 501 and processor 507.Each of these processors can be monokaryon (single-CPU) processor, It can be multicore (multi-CPU) processor.Here processor can refer to one or more equipment, circuit, and/or use In the processing core of processing data (such as computer program instructions).
In the concrete realization, as one embodiment, computer equipment can also include output equipment 505 and input equipment 506.Output equipment 505 and processor 501 communicate, and can show information in many ways.For example, output equipment 505 can be with It is liquid crystal display (liquid crystal display, LCD), Light-Emitting Diode (light emitting diode, LED) Show equipment, cathode-ray tube (cathode ray tube, CRT) shows equipment or projector (projector) etc..Input Equipment 506 and processor 501 communicate, and can receive the input of user in many ways.For example, input equipment 506 can be mouse Mark, keyboard, touch panel device or sensing equipment etc..
Above-mentioned computer equipment can be a common apparatus either special equipment.In the concrete realization, it counts Calculating machine equipment can be desktop computer, portable computer, network server, palm PC (personal digital Assistant, PDA), cell phone, tablet computer, wireless terminal device, embedded device or have setting for similar structures in Fig. 5 It is standby.The unlimited type for determining computer equipment of the embodiment of the present application.
The embodiment of the present application can carry out the division of functional unit according to above method example to storage equipment, for example, can With each functional unit of each function division of correspondence, two or more functions can also be integrated in a processing unit In.Above-mentioned integrated unit both can take the form of hardware realization, can also realize in the form of software functional units.It needs It is noted that be schematical, only a kind of logical function partition to the division of unit in the embodiment of the present application, it is practical real It is current that there may be another division manner.
For example, Fig. 6 shows a kind of software detection dress in the case where to use the integrated each functional unit of model split The schematic diagram set.
As shown in fig. 6, block chain link point detection device provided by the embodiments of the present application, comprising:
A kind of block chain link point detection device, comprising:
Unit 601 is intercepted and captured, the intercepting and capturing unit 601 is for intercepting and capturing the first request message, first request message The request message for being used to obtain current traffic state that one node is initiated, the first node are a node in block chain;
Determination unit 602, the determination unit 602 are used for, first request intercepted and captured according to the intercepting and capturing unit 601 Message determines that the first scene operation, first scene operation are used to simulate the abnormal operation of the first node;
First injection unit 603, first injection unit 603 are used for, and the injection of Xiang Suoshu first node is described determining single First scene operation that member 602 determines, so that first node detection is executing first scene operation when institute Can first node be stated work normally.
Optionally, described device further include:
Second injection unit 604, first injection unit 603 are used for, and Xiang Suoshu first node injection first restores behaviour Make, so that the first node stops executing first scene operation that first injection unit 603 injects.
Optionally, the intercepting and capturing unit 601, is used for: intercepting and capturing first request message, the point of penetration by point of penetration For the point of penetration of anchor code enhancing;
First injection unit 603, is used for: injecting first scene to the first node by the point of penetration Operation.
Optionally, the determination unit 602, is used for:
Preset registration information is obtained according to first request message that the intercepting and capturing unit 601 is intercepted and captured;
The first injection rule corresponding with the registration information and parameter are obtained according to the registration information, wherein described First injection rule is that injector acts on behalf of the rule and parameter being previously written with parameter, and the first injection rule is used for parameter Execute first scene operation.
Optionally, first injection unit 603, is used for:
The first notification message is sent to the first node, first notification message is for guiding the first node to read Preset execution memory is taken, the first injection rule and parameter are prestored in the execution memory, so that the first segment Point executes first scene operation.
Optionally, first injection unit 603, is used for:
Second notification message is sent to the first node, the second notification message is for guiding the first node to hold Preset first code section in row block chain, record has the first injection rule and parameter in the first code section, so that It obtains the first node and executes first scene operation.
Optionally, first injection unit 603 is also used to:
The order that service switchover state is sent to the first node, so that the first node service switchover state;
Alternatively,
After the intercepting and capturing unit 601 intercepts and captures first request message, in the rear to described of the first preset time period One node sends the order of service switchover state, so that the first node delayed switching service condition;
Alternatively,
Abnormality code is sent to the first node, so that the working result of the first node output error;
Alternatively,
It is sent to the first node and restores code, the recovery code is for deleting the abnormality code, so that institute It states first node and exports correct working result.
Further, the embodiment of the present invention also provides a kind of computer storage medium, including instruction, when the instruction is calculating When being run on machine equipment, so that the computer equipment executes the above method.
The detailed description of program in relation to storing in computer storage medium provided by the embodiments of the present application can refer to above-mentioned Embodiment, this will not be repeated here.
Each embodiment in this specification is described in a progressive manner, the highlights of each of the examples are with other The difference of embodiment, the same or similar parts in each embodiment may refer to each other.For device disclosed in embodiment For, since it is corresponded to the methods disclosed in the examples, so being described relatively simple, related place is said referring to method part It is bright.
Professional further appreciates that, unit described in conjunction with the examples disclosed in the embodiments of the present disclosure And algorithm steps, can be realized with electronic hardware, computer software, or a combination of the two, in order to clearly demonstrate hardware and The interchangeability of software generally describes each exemplary composition and step according to function in the above description.These Function is implemented in hardware or software actually, the specific application and design constraint depending on technical solution.Profession Technical staff can use different methods to achieve the described function each specific application, but this realization is not answered Think beyond the scope of this invention.
The step of method described in conjunction with the examples disclosed in this document or algorithm, can directly be held with hardware, processor The combination of capable software module or the two is implemented.Software module can be placed in random access memory (RAM), memory, read-only deposit Reservoir (ROM), electrically programmable ROM, electrically erasable ROM, register, hard disk, moveable magnetic disc, CD-ROM or technology In any other form of storage medium well known in field.
The foregoing description of the disclosed embodiments enables those skilled in the art to implement or use the present invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, as defined herein General Principle can be realized in other embodiments in the case where not departing from core of the invention thought or scope.Therefore, originally Invention is not intended to be limited to the embodiments shown herein, and is to fit to and the principles and novel features disclosed herein Consistent widest scope.

Claims (10)

1. a kind of block chain link point detecting method characterized by comprising
Injector manager intercepts and captures the first request message, and first request message is the current for obtaining of first node initiation The request message of service condition, the first node are a node in block chain;
The injector manager determines that the first scene operation, first scene operation are used for according to first request message Simulate the abnormal operation of the first node;
The injector manager injects first scene operation to the first node, so that the first node detects When executing first scene operation, can the first node be worked normally.
2. the method according to claim 1, wherein the method also includes:
The injector manager injects the first recovery operation to the first node, so that the first node stops executing First scene operation.
3. the method according to claim 1, wherein the injector manager intercepts and captures the first request message, packet It includes:
The injector manager intercepts and captures first request message by point of penetration, and the point of penetration is anchor code enhancing Point of penetration;
The injector manager injects first scene operation to the first node, comprising:
The injector manager injects first scene operation to the first node by the point of penetration.
4. the method according to claim 1, wherein the injector manager is according to first request message Determine the first scene operation, comprising:
The injector manager obtains preset registration information according to first request message;
The injector manager obtains the first injection rule corresponding with the registration information and ginseng according to the registration information Number, wherein the first injection rule is that injector acts on behalf of the rule and parameter being previously written, the first injection rule with parameter Then with parameter for executing first scene operation.
5. according to the method described in claim 4, it is characterized in that, the injector manager injects institute to the first node State the first scene operation, comprising:
The injector manager sends the first notification message to the first node, and first notification message is for guiding institute It states first node and reads preset execution memory, the first injection rule and parameter are prestored in the execution memory, so that It obtains the first node and executes first scene operation.
6. according to the method described in claim 4, it is characterized in that, the injector manager injects institute to the first node State the first scene operation, comprising:
The injector manager sends second notification message to the first node, and the second notification message is for guiding institute It states first node and executes preset first code section in block chain, record has the first injection rule in the first code section With parameter so that the first node executes first scene operation.
7. method according to any one of claims 1 to 6, which is characterized in that the injector manager is to the first segment Point sends first scene operation, so that the first node executes first scene operation, comprising:
The injector manager sends the order of service switchover state to the first node, so that the first node is cut Change service condition;
Alternatively,
The injector manager is after intercepting and capturing first request message, in the rear to the first segment of the first preset time period Point sends the order of service switchover state, so that the first node delayed switching service condition;
Alternatively,
The injector manager sends abnormality code to the first node, so that the work of the first node output error Make result;
Alternatively,
The injector manager is sent to the first node restores code, and the recovery code is for deleting the abnormal generation Code, so that the first node exports correct working result.
8. a kind of block chain link point detection device characterized by comprising
Unit is intercepted and captured, the intercepting and capturing unit is first node initiation for intercepting and capturing the first request message, first request message For obtaining the request message of current traffic state, the first node is a node in block chain;
Determination unit, the determination unit are used for, and determine first according to first request message that the intercepting and capturing unit is intercepted and captured Scene operation, first scene operation are used to simulate the abnormal operation of the first node;
First injection unit, first injection unit are used for, and Xiang Suoshu first node injects the institute that the determination unit determines The first scene operation is stated, so that can the first node when executing first scene operation for first node detection It works normally.
9. a kind of computer equipment, which is characterized in that the computer equipment includes: that interactive device, input/output (I/O) connect Mouthful, processor and memory, be stored with program instruction in the memory;
The interactive device is used to obtain the operational order of user's input;
The processor is executed as described in claim 1-7 any one for executing the program instruction stored in memory Method.
10. a kind of computer readable storage medium, including instruction, which is characterized in that when described instruction is transported on a computing device When row, so that the computer equipment executes such as method of any of claims 1-7.
CN201910731255.8A 2019-08-08 2019-08-08 Block chain link point detection method, device, equipment and medium Active CN110474822B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910731255.8A CN110474822B (en) 2019-08-08 2019-08-08 Block chain link point detection method, device, equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910731255.8A CN110474822B (en) 2019-08-08 2019-08-08 Block chain link point detection method, device, equipment and medium

Publications (2)

Publication Number Publication Date
CN110474822A true CN110474822A (en) 2019-11-19
CN110474822B CN110474822B (en) 2022-07-08

Family

ID=68511608

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910731255.8A Active CN110474822B (en) 2019-08-08 2019-08-08 Block chain link point detection method, device, equipment and medium

Country Status (1)

Country Link
CN (1) CN110474822B (en)

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111277645A (en) * 2020-01-16 2020-06-12 深圳市网心科技有限公司 Hot switching method for main and standby nodes, block chain system, block chain node and medium
CN111324591A (en) * 2020-01-20 2020-06-23 腾讯科技(深圳)有限公司 Block chain bifurcation detection method and related device
CN111327490A (en) * 2020-01-20 2020-06-23 腾讯科技(深圳)有限公司 Byzantine fault-tolerant detection method of block chain and related device
CN111949531A (en) * 2020-08-10 2020-11-17 腾讯科技(深圳)有限公司 Block chain network testing method, device, medium and electronic equipment
CN111988321A (en) * 2020-08-24 2020-11-24 桂林电子科技大学 Alliance chain abnormity detection system based on machine learning and detection method thereof
CN112073269A (en) * 2020-09-14 2020-12-11 腾讯科技(深圳)有限公司 Block chain network testing method, device, server and storage medium
US11738225B2 (en) 2021-11-23 2023-08-29 Civil Aviation University Of China Preparation method for composite fire extinguishing agent with cooling function

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104462225A (en) * 2014-11-12 2015-03-25 华为技术有限公司 Data reading method, device and system
CN105718369A (en) * 2016-01-19 2016-06-29 国家电网公司 Computer software test abnormity processing system and test method
CN107368408A (en) * 2017-05-31 2017-11-21 中国船舶工业综合技术经济研究院 A kind of software fault towards interface injects automated testing method
CN108647361A (en) * 2018-05-21 2018-10-12 中国工商银行股份有限公司 A kind of date storage method, apparatus and system based on block chain
CN109559583A (en) * 2017-09-27 2019-04-02 华为技术有限公司 Failure simulation method and its device
CN109617759A (en) * 2018-12-04 2019-04-12 中钞信用卡产业发展有限公司杭州区块链技术研究院 Block catenary system stability test method, apparatus, equipment and storage medium

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104462225A (en) * 2014-11-12 2015-03-25 华为技术有限公司 Data reading method, device and system
CN105718369A (en) * 2016-01-19 2016-06-29 国家电网公司 Computer software test abnormity processing system and test method
CN107368408A (en) * 2017-05-31 2017-11-21 中国船舶工业综合技术经济研究院 A kind of software fault towards interface injects automated testing method
CN109559583A (en) * 2017-09-27 2019-04-02 华为技术有限公司 Failure simulation method and its device
CN108647361A (en) * 2018-05-21 2018-10-12 中国工商银行股份有限公司 A kind of date storage method, apparatus and system based on block chain
CN109617759A (en) * 2018-12-04 2019-04-12 中钞信用卡产业发展有限公司杭州区块链技术研究院 Block catenary system stability test method, apparatus, equipment and storage medium

Cited By (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111277645A (en) * 2020-01-16 2020-06-12 深圳市网心科技有限公司 Hot switching method for main and standby nodes, block chain system, block chain node and medium
CN111277645B (en) * 2020-01-16 2023-02-10 深圳市迅雷网络技术有限公司 Hot switching method for main and standby nodes, block chain system, block chain node and medium
CN111324591A (en) * 2020-01-20 2020-06-23 腾讯科技(深圳)有限公司 Block chain bifurcation detection method and related device
CN111327490A (en) * 2020-01-20 2020-06-23 腾讯科技(深圳)有限公司 Byzantine fault-tolerant detection method of block chain and related device
CN111327490B (en) * 2020-01-20 2021-01-29 腾讯科技(深圳)有限公司 Byzantine fault-tolerant detection method of block chain and related device
CN111324591B (en) * 2020-01-20 2021-02-12 腾讯科技(深圳)有限公司 Block chain bifurcation detection method and related device
CN111949531A (en) * 2020-08-10 2020-11-17 腾讯科技(深圳)有限公司 Block chain network testing method, device, medium and electronic equipment
CN111949531B (en) * 2020-08-10 2022-02-25 腾讯科技(深圳)有限公司 Block chain network testing method, device, medium and electronic equipment
CN111988321A (en) * 2020-08-24 2020-11-24 桂林电子科技大学 Alliance chain abnormity detection system based on machine learning and detection method thereof
CN112073269A (en) * 2020-09-14 2020-12-11 腾讯科技(深圳)有限公司 Block chain network testing method, device, server and storage medium
US11738225B2 (en) 2021-11-23 2023-08-29 Civil Aviation University Of China Preparation method for composite fire extinguishing agent with cooling function

Also Published As

Publication number Publication date
CN110474822B (en) 2022-07-08

Similar Documents

Publication Publication Date Title
CN110474822A (en) A kind of block chain link point detecting method, device, equipment and medium
US11620277B2 (en) Transaction processing at non-relational databases
KR100575497B1 (en) Fault tolerant computer system
US8265980B2 (en) Workflow model for coordinating the recovery of IT outages based on integrated recovery plans
US8584079B2 (en) Quality on submit process
US7702667B2 (en) Methods and systems for validating accessibility and currency of replicated data
US20200319982A1 (en) Notification mechanism for disaster recovery events
CN109582731A (en) A kind of real time data synchronization method and system
CN106030456A (en) Automatic asynchronous handoff identification
US11151025B1 (en) Generating software test plans based at least in part on monitored traffic of a production application
CN109933520A (en) Software development test method, device, computer installation and storage medium
CN110309051A (en) Method, system, equipment and the storage medium of management of test cases
US9823999B2 (en) Program lifecycle testing
CN103778026A (en) Object calling method and device
CN112130889A (en) Resource management method and device, storage medium and electronic device
JP6577901B2 (en) Computer system and system state reproduction method
US11637789B2 (en) Orchestrating apparatus, VNFM apparatus, managing method and program
JP2012089049A (en) Computer system and server
US20090240987A1 (en) Test amplification for datacenter applications via model checking
US11650892B1 (en) Resilient coordination, command, and control of widely distributed test agents
CN112650815B (en) Method and device for synchronizing environment data, storage medium and electronic device
Lovrek et al. Improving software maintenance by using agent-based remote maintenance shell
KR101528071B1 (en) Method for gathering error context information of application software and middleware
Ciarfella et al. The Totem protocol development environment
CN105260193A (en) Self healing frame and healing method of large software

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