+

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
injector
request message
manager
injector manager
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)
  • Computer And Data Communications (AREA)
  • Retry When Errors Occur (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

Block chain link point detection method, device, equipment and medium
Technical Field
The present invention relates to the field of electronic technologies, and in particular, to a block link point detection method, apparatus, device, and medium.
Background
The user can initiate a transaction through the client, and all transaction information recorded in the transaction can be packaged into a block for storage. As the ongoing transaction expands, the individual tiles are linked to one another, forming a chain of tiles, also known as ledgers. The Block chain is an open network account book, and a plurality of blocks (blocks) may be included in the Block chain. Blockchains come in many forms and may include, for example, public, private, and federated chains, among others.
The block chain is composed of interconnected blocks, one block is composed of a plurality of nodes with computing power, and a distributed algorithm is adopted among the nodes, so that a set of consensus algorithm is needed to ensure that the nodes achieve consensus, such as a Practical Byzantine Fault Tolerance (PBFT) algorithm, and the PBFT consensus algorithm is a state machine copy replication algorithm and is used for achieving final consensus consistency by ensuring copy replication consistency.
In the PBFT consensus algorithm, the states of nodes can be divided into a Leader node (Leader or Primary) and a Follower node (Follower or Backup), and different states lead to different service responsibilities of the nodes, where the Follower node is responsible for forwarding data and the Leader node is responsible for packing and uploading data, and in the actual working process, due to the influence of external factors, the states of the nodes can be switched between the Leader node and the Follower node, and the block chain itself needs to maintain a service state synchronized with the PBFT state according to service characteristics, and at this time, when the states of the nodes are switched, the block chain performs a specific processing operation according to the service state of the synchronous switching, so that the block chain can still work normally when the states of the nodes change.
In order to verify the availability of the blockchain after the state switching, the blockchain needs to be detected to ensure that the blockchain can work normally according to the switching of the service state no matter how the service state is switched. In the prior art, the switching of the node states is mainly triggered by controlling external resource abnormality to realize the simulation detection of the block chain, for example, the simulation detection is realized by means of simulating network abnormality, CPU abnormality or memory abnormality, however, the switching of the node states is triggered only by the external resource abnormality, and it is difficult to accurately and definitely detect which scene the node is switched under, for example, the result caused by the external resource abnormality cannot be detected, and the node is switched from a leader node to a follower node or from the follower node to the leader node.
Therefore, the above problems have yet to be solved.
Disclosure of Invention
In view of the above, in order to solve the above problems, the present invention provides the following technical solutions:
a block link point detection method, comprising:
an injector manager intercepts a first request message, wherein the first request message is a request message which is initiated by a first node and is used for acquiring the current service state, and the first node is a node in a block chain;
the injector manager determines a first scenario operation according to the first request message, wherein the first scenario operation is used for simulating an abnormal working state of the first node;
the injector manager injects the first scenario operation into the first node to enable the first node to detect whether the first node can operate normally when the first scenario operation is performed.
A block link point detection device comprising:
an intercepting unit, configured to intercept a first request message, where the first request message is a request message initiated by a first node and used to acquire a current service state, and the first node is a node in a block chain;
the determining unit is used for determining first scene operation according to the first request message intercepted by the intercepting unit, and the first scene operation is used for simulating the abnormal working state of the first node;
a first injection unit, configured to inject the first scenario operation determined by the determination unit into the first node, so that the first node detects whether the first node can normally operate when the first scenario operation is performed.
Optionally, the apparatus further comprises:
a second injection unit, configured to inject a first recovery operation to the first node, so that the first node stops executing the first scenario operation injected by the first injection unit.
Optionally, the intercepting unit is configured to: intercepting the first request message through an access point, wherein the access point is an anchor code enhanced access point;
the first injection unit is configured to: injecting the first scenario operation into the first node through the entry point.
Optionally, the determining unit is configured to:
acquiring preset registration information according to the first request message intercepted by the interception unit;
and acquiring a first injection rule and a first injection parameter corresponding to the registration information according to the registration information, wherein the first injection rule and the first injection parameter are rules and parameters written in advance by an injector agent, and the first injection rule and the first injection parameter are used for executing the first scene operation.
Optionally, the first injection unit is configured to:
and sending a first notification message to the first node, where the first notification message is used to guide the first node to read a preset execution memory, and the execution memory has the first injection rule and the first injection parameter stored in advance, so that the first node executes the first scene operation.
Optionally, the first injection unit is configured to:
sending a second notification message to the first node, where the second notification message is used to guide the first node to execute a first code segment preset in a block chain, and the first code segment records the first injection rule and the first injection parameter, so that the first node executes the first scene operation.
Optionally, the first injection unit is further configured to:
sending a command for switching the service state to the first node so that the first node switches the service state;
or,
after the interception unit intercepts the first request message, a command for switching the service state is sent to the first node after a first preset time period, so that the first node delays the service state switching;
or,
sending an exception code to the first node to enable the first node to output an erroneous working result;
or,
and sending a recovery code to the first node, wherein the recovery code is used for deleting the abnormal code so that the first node outputs a correct working result.
A computer device, the computer device comprising: an interaction device, an input/output (I/O) interface, a processor, and a memory having program instructions stored therein;
the interaction device is used for acquiring an operation instruction input by a user;
the processor is configured to execute program instructions stored in the memory to perform the above-described method.
A computer-readable storage medium comprising instructions which, when executed on a computer device, cause the computer device to perform the above-described method.
The application provides a block chain link point detection method, which comprises the following steps: an injector manager intercepts a first request message, wherein the first request message is a request message which is initiated by a first node and is used for acquiring the current service state, and the first node is a node in a block chain; the injector manager determines a first scene operation according to the first request message, wherein the first scene operation is used for simulating the abnormal working state of the first node; the injector manager injects the first scenario operation to the first node such that the first node detects whether the first node can function properly when the first scenario operation is performed. In this embodiment, the injector manager intercepts a request message for acquiring the current service state from the first node, and injects a first scenario operation to the first node, so that the first node executes the first scenario operation in order to acquire the current service state, and thus, the injector manager can accurately regulate and control the service state of the first node, so as to perform detection on a node in a block chain.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the provided drawings without creative efforts.
FIG. 1 is an architecture diagram of a blockchain system node;
fig. 2 is an architecture diagram of a blockchain system node for the blockchain link point detection method according to the embodiment of the present disclosure;
fig. 3 is a flowchart of an embodiment of a block link point detection method provided in an embodiment of the present application;
fig. 4A is a flowchart of an embodiment of a block link point detection method according to an embodiment of the present disclosure;
fig. 4B is a schematic diagram of another embodiment of a block link point detection method according to an embodiment of the present disclosure;
fig. 4C is a schematic diagram of another embodiment of a block link point detection method according to an embodiment of the present disclosure;
FIG. 5 is a schematic structural diagram of a computer device provided in an embodiment of the present application;
fig. 6 is a schematic structural diagram of a block link point detection device according to an embodiment of the present disclosure.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The terms "first," "second," "third," "fourth," and the like in the description and in the claims of the present application and in the above-described drawings (if any) are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It will be appreciated that the data so used may be interchanged under appropriate circumstances such that the embodiments described herein may be practiced otherwise than as specifically illustrated or described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
The user can initiate a transaction through the client, and all transaction information recorded in the transaction can be packaged into a block for storage. As the ongoing transaction expands, the individual tiles are linked to one another, forming a chain of tiles, also known as ledgers. The Block chain is an open network account book, and a plurality of blocks (blocks) may be included in the Block chain. Blockchains come in many forms and may include, for example, public, private, and federated chains, among others.
The block chain is composed of interconnected blocks, one block is composed of a plurality of nodes with computing power, and a distributed algorithm is adopted among the nodes, so that a set of consensus algorithm is needed to ensure that the nodes achieve consensus, such as a Practical Byzantine Fault Tolerance (PBFT) algorithm, and the PBFT consensus algorithm is a state machine copy replication algorithm and is used for achieving final consensus consistency by ensuring copy replication consistency.
In the PBFT consensus algorithm, the states of nodes can be divided into a Leader node (Leader or Primary) and a Follower node (Follower or Backup), and different states lead to different service responsibilities of the nodes, where the Follower node is responsible for forwarding data and the Leader node is responsible for packing and uploading data, and in the actual working process, due to the influence of external factors, the states of the nodes can be switched between the Leader node and the Follower node, and the block chain itself needs to maintain a service state synchronized with the PBFT state according to service characteristics, and at this time, when the states of the nodes are switched, the block chain performs a specific processing operation according to the service state of the synchronous switching, so that the block chain can still work normally when the states of the nodes change.
In order to verify the availability of the blockchain after the state switching, the blockchain needs to be detected to ensure that the blockchain can work normally according to the switching of the service state no matter how the service state is switched. In the prior art, the switching of the node states is mainly triggered by controlling external resource abnormality to realize the simulation detection of the block chain, for example, the simulation detection is realized by means of simulating network abnormality, CPU abnormality or memory abnormality, however, the switching of the node states is triggered only by the external resource abnormality, and it is difficult to accurately and definitely detect which scene the node is switched under, for example, the result caused by the external resource abnormality cannot be detected, and the node is switched from a leader node to a follower node or from the follower node to the leader node.
Therefore, in view of the above problems, the embodiments of the present application provide a block link point detection method, and for easy understanding, the method provided by the embodiments of the present application will be described in detail below with reference to the accompanying drawings.
Referring to fig. 1, as shown in fig. 1, a block chain node detection method provided in this embodiment of the present invention is used for detecting a block chain system shown in fig. 1, and a node of a block chain performs specific processing operations in a working process, such as a receive transaction 101, a forward transaction 102, a build block 103, a broadcast block 104, and the like, so as to complete a calculation process of a block chain node, where the four processing operations are performed, before starting, the node needs to acquire a current service state, and taking the receive transaction 101 as an example, a specific implementation manner is that, before starting to receive a transaction, a first node responsible for processing a receive transaction sends a request message to a state management module 105, a state of the state management module 105 is synchronized with a PBFT module, so that the state management module 105 feeds back a current service state to the first node according to the request message, thereby, the first node processing the received transaction knows the self service state, and the first node executes subsequent operation according to the self service state.
In order to ensure the normal operation of the blockchain system, the nodes of the blockchain need to be debugged, and the specific method is as follows: creating an abnormal working condition, and then detecting whether the block chain node can normally work under the current abnormal working condition, wherein the method for creating the abnormal working condition comprises the following steps: the implementation is realized by means of simulating network exception, CPU exception or memory exception, however, the exception working state is realized only by external resource exception, and it is difficult to determine the change of the external resource exception to the internal condition of the blockchain system, for this reason, referring to fig. 2, the present application adds an injector manager on the basis of the blockchain system provided in fig. 1, to solve the above problem, as shown in fig. 2, the injector manager 201 sets an entry point 202 on a path where a node (a node responsible for any one of the calculations of receiving the transaction 101, forwarding the transaction 102, constructing the block 103, or broadcasting the block 104) sends a request message to the state management module 105, the injector manager 201 injects a scene operation to the node sending the request message through the entry point 202, therefore, the change of the service state of the block chain node is accurately controlled, and the smooth proceeding of the subsequent detection steps is ensured.
Based on the system architecture shown in fig. 2, the following describes in detail specific working steps of the block link point detection method according to the embodiment of the present application with reference to the accompanying drawings. Referring to fig. 3, as shown in fig. 3, a block link point detection method according to an embodiment of the present application includes:
301. the injector manager intercepts a first request message.
In this embodiment, the first request message is a request message initiated by a first node and used for acquiring a current service state, where the first node is a node in a block chain, where the first node may be a node used for performing a transaction, a forwarding transaction, a building block, or a broadcasting block, and before starting working, the first node needs to send a request message to a state management module to acquire the current service state.
302. The injector manager determines a first scenario operation from the first request message.
In this embodiment, the first scenario operation is used to simulate an abnormal operating state of the first node, for example, the first scenario operation may be at least one of a state switching falsification, a falsification result, a time delay, or code injection such as exception and recovery.
303. The injector manager injects a first scenario operation into the first node.
In this embodiment, the injector manager injects a first scenario operation into a first node, so that the first node detects whether the first node can normally operate when the first scenario operation is executed.
Therefore, in this embodiment, the request message sent by the first node to the state management module is intercepted by the injector manager, and then the injector manager injects the first scene operation, and for the first node, the feedback message is received after the first request message is sent, so that the first node can execute the first scene operation, and thus, the working state of the current blockchain node is the working state formed when the first node executes the first scene operation, and thus, the working condition of the first node can be accurately detected.
Optionally, after the steps 301 to 303 are performed, the following steps may be further included:
the injector manager injects a first recovery operation into the first node.
In this embodiment, when the first node executes the first scenario operation and completes the detection, the injector manager injects the first recovery operation into the first node, so that the first node stops executing the first scenario operation, optionally, the execution of the first recovery operation may be divided into two cases, namely, manual execution and automatic execution, specifically, the manual execution may be that the user manually clicks an instruction that triggers the injector manager to inject the first recovery operation into the first node after confirming that the detection operation is completed, and the automatic execution may be that the injector manager is automatically triggered to inject the first recovery operation into the first node when a preset condition is met, for example, after the injector manager injects the first scenario operation into the first node and meets a target time, the injector manager is automatically executed to inject the first recovery operation into the first node.
Further, the steps in steps 301 to 303 may be implemented by the following specific embodiments, referring to fig. 4A, and as shown in fig. 4A, the specific embodiment of the block link point detection method provided in the embodiment of the present application includes:
401. the injector manager intercepts a first request message through the access point.
In this embodiment, the entry point is an anchor code enhanced entry point, and the injector manager realizes interception of the first request message by setting the entry point on a link for information transceiving between the first node and the state manager.
402. The injector manager obtains preset registration information according to the first request message.
In this embodiment, the injector manager triggers the operation of acquiring the registration information after intercepting the first request message.
403. The injector manager obtains a first injection rule and a parameter corresponding to the registration information according to the registration information.
In this embodiment, please refer to fig. 4B, since each service operation is operated independently, only a single access point cannot achieve a complete state switching scenario, and therefore, a cooperative injection operation of multiple access points is further provided. In order to simplify the implementation of the entry point and the injection scenario of each critical path, the injector manager hosting the injection operation can be abstracted, and only registration is needed to complete the functional injection of the corresponding entry point. As shown in fig. 4B, the injector manager 4031 is further connected to an injector agent 4032, and the injector agent 4032 writes injection rules and parameters, such as first injection rules and parameters, for example, after a user registers on the injector manager 4031, the injector manager 4031 may read the first injection rules and parameters corresponding to the registration information according to the registration information, so as to obtain a first scene injection operation, and then, the first scene operation may be injected through the entry point 4034 anchored on the blockchain system source code 4033.
404. An injector manager sends a notification message to the first node.
In this embodiment, the notification message is used to guide the first node to execute the scenario operation, and it should be noted that, as shown in fig. 4C, implementation manners of the scenario operation injection block chain system may be divided into two types, specifically: firstly, dynamic injection in a running period, namely storing an injection code 4041 for running scene operation in an execution memory through a compiler 4043, and executing a dynamic injection block chain system source code 4044 in a block chain running process; secondly, static injection is carried out in a compiling period, namely, in the compiling period of the block chain code, a compiler 4043 is used for writing a source code 4042 for executing scene operation into a block chain system source code 4044 to realize the static injection; for ease of understanding, the two cases will be described separately below.
Firstly, dynamic injection in the operation period.
The specific implementation mode of the dynamic injection in the operation period is as follows: the injector manager sends a first notification message to the first node.
In this embodiment, the injector agent writes the injection rule and the parameter into an execution memory in advance, where the execution memory may be a shared memory or a KV database (e.g., Redis), and since the injection rule and the parameter for executing the scene operation are stored in the execution memory and the blockchain source code is not written, the code of the blockchain system itself is not polluted, thereby ensuring that the service is not affected without changing the blockchain source code and ensuring that the affected performance is within an acceptable range.
In a specific working process, the first notification message is used for guiding the first node to read the execution memory, and the first notification message may be implemented in a notification function manner, because the execution memory pre-stores a first injection rule and a first injection parameter, when the injector manager injects the first scene operation into the first node, the injector manager guides the first node to read the preset execution memory through the notification message, so that the first node executes the first scene operation, as shown in fig. 4B, the injector manager is connected with the block chain system through an access point, and the injector manager sends the first notification message to the first node through the access point, thereby implementing injection of the first scene operation. Optionally, one blockchain system includes a plurality of nodes, and an access point may be set between each node and a link of the state manager, so that a plurality of access points are provided, and the plurality of access points may be managed by one injector manager.
Optionally, the runtime dynamic injection may be implemented by using Instrumentation + ASM or Hooking technologies.
And secondly, static injection in the compiling period.
The specific implementation manner of the compile-time static injection is as follows: the injector manager sends a second notification message to the first node.
In this embodiment, during the compilation period of the source code of the blockchain system, the first injection rule and parameter for executing the first scenario operation are written into the source code, but are isolated from the blockchain source code so as not to pollute the blockchain source code, the second notification message may be implemented in the form of a notification function, and the injector manager sends the second notification message to the first node through the access point, so that the first node executes the source code specified by the second notification message, i.e., the first injection rule and parameter, according to the second notification message, so as to execute the scenario operation.
Alternatively, the compile-time static injection may be implemented by using code enhancement techniques such as AspectJ, ASM, or AspectC + +.
It should be noted that, the first scenario operation that the first node is guided by the first notification message or the second notification message to perform is used to simulate an abnormal operating state of the first node, so as to detect whether the first node can keep working normally when the abnormal operating state occurs, specifically, the sending of the first scenario operation to the first node by the injector manager may include any one of the following operation manners.
Firstly, status switching forgery is performed.
The specific implementation manner of the state switching falsification is as follows: the injector manager sends a command to the first node to switch traffic states to cause the first node to switch traffic states.
In this embodiment, after receiving the command for switching the service state, the first node performs switching of the service state, for example, switching from the follower node to the leader node, or switching from the leader node to the follower node, where a specific switching manner is determined by the command for switching the service state, so that the service state switching manner of the first node can be accurately controlled, and further, the working condition of the first node when the service state is switched can be tested.
And II, time delay.
The specific implementation manner of the time delay is as follows: the injector manager sends a command for switching the traffic state to the first node after a first preset time period after intercepting the first request message, so that the first node delays switching the traffic state.
In this embodiment, the time delay belongs to an abnormal operation state, and therefore, in order to test the operation condition of the first node under the time delay, after intercepting the first request message, the injector manager intentionally delays the time for replying the command for switching the service state, where the time length of the delay is: the specific duration of the first preset time period can be adjusted by a tester according to actual use requirements, so that whether the working condition of the first node is normal or not in different time delay states can be accurately detected.
And thirdly, sending an exception code.
The specific implementation mode for sending the exception code is as follows: the injector manager sends an exception code to the first node to cause the first node to output an erroneous work result.
In this embodiment, after receiving the request message sent by the first node, the injector manager sends an abnormal code to the first node, so that the first node becomes an error node (or a byzantine node), and further tests whether the entire blockchain system is fault-tolerant to the error node when the first node is the error node, so as to ensure that the operation of the entire blockchain system is not affected by the error node.
And fourthly, sending a recovery code.
The step of sending the recovery code may be performed after the step of sending the exception code, and the specific implementation manner is as follows: the injector manager sends a recovery code to the first node, the recovery code for deleting the exception code to cause the first node to output a correct work result.
In this embodiment, in actual work, after the state manager sends the abnormal code to the first node, the state manager may detect the abnormality and reissue the recovery code to the first node, so that the first node resumes operation, therefore, in the process of testing the blockchain node, it is necessary to detect whether the mechanism can operate normally, and after sending the abnormal code, the injector manager sends the recovery code to the first node, and further tests whether the first node can recover to a normal working state from the abnormal working state after receiving the recovery code, and inputs a correct working result.
It should be noted that the above first scenario operation is only an example, in an actual working process, a tester may edit any abnormal working state according to a test requirement, and then inject the abnormal working state into the first node through the injector manager to implement detection of the first node, and further, the method may also be used for detecting multiple nodes at the same time, which is not limited in this application.
The above description is directed to the solutions provided in the embodiments of the present application. It will be appreciated that the computer device, in order to implement the above-described functions, comprises corresponding hardware structures and/or software modules for performing the respective functions. Those of skill in the art will readily appreciate that the various illustrative modules and algorithm steps described in connection with the embodiments disclosed herein may be implemented as hardware or combinations of hardware and computer software. Whether a function is performed as hardware or computer software drives hardware depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
Described in terms of hardware structures, the method may be implemented by one entity device, may also be implemented by multiple entity devices together, and may also be a logic function module in one entity device, which is not specifically limited in this embodiment of the present application.
For example, the above methods may each be implemented by the computer device of fig. 5. Fig. 5 is a schematic hardware structure diagram of a computer device according to an embodiment of the present application. The computer device comprises at least one processor 501, a communication line 502, a memory 503 and at least one communication interface 504.
The processor 501 may be a general processing unit (CPU), a microprocessor, an application-specific integrated circuit (server IC), or one or more ICs for controlling the execution of programs in accordance with the present disclosure.
The communication link 502 may include a path for transmitting information between the aforementioned components.
The communication interface 504 may be any device, such as a transceiver, for communicating with other devices or communication networks, such as an ethernet, a Radio Access Network (RAN), a Wireless Local Area Network (WLAN), etc.
The memory 503 may be, but is not limited to, a read-only memory (ROM) or other type of static storage device that can store static information and instructions, a Random Access Memory (RAM) or other type of dynamic storage device that can store information and instructions, an electrically erasable programmable read-only memory (EEPROM), a compact-disc-only memory (CD-ROM) or other optical disk storage, optical disk storage (including compact disk, laser disk, optical disk, digital versatile disk, blu-ray disk, etc.), magnetic disk storage media or other magnetic storage devices, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a computer. The memory may be separate and coupled to the processor via a communication line 502. The memory may also be integral to the processor.
The memory 503 is used for storing computer-executable instructions for executing the present application, and is controlled by the processor 501 to execute. The processor 501 is configured to execute computer-executable instructions stored in the memory 503 to implement the methods provided by the above-described embodiments of the present application.
Optionally, the computer-executable instructions in the embodiments of the present application may also be referred to as application program codes, which are not specifically limited in the embodiments of the present application.
In particular implementations, processor 501 may include one or more CPUs such as CPU0 and CPU1 in fig. 5 as an example.
In particular implementations, a computer device may include multiple processors, such as processor 501 and processor 507 in FIG. 5, as an example. Each of these processors may be a single-core (single-CPU) processor or a multi-core (multi-CPU) processor. A processor herein may refer to one or more devices, circuits, and/or processing cores for processing data (e.g., computer program instructions).
In particular implementations, a computer device may also include an output device 505 and an input device 506, as one embodiment. An output device 505, which is in communication with the processor 501, may display information in a variety of ways. For example, the output device 505 may be a Liquid Crystal Display (LCD), a Light Emitting Diode (LED) display device, a Cathode Ray Tube (CRT) display device, a projector (projector), or the like. The input device 506 is in communication with the processor 501 and may receive user input in a variety of ways. For example, the input device 506 may be a mouse, a keyboard, a touch screen device, or a sensing device, among others.
The computer device may be a general purpose device or a special purpose device. In a specific implementation, the computer device may be a desktop computer, a laptop computer, a web server, a Personal Digital Assistant (PDA), a mobile phone, a tablet computer, a wireless terminal device, an embedded device, or a device with a similar structure as in fig. 5. The embodiment of the application does not limit the type of the computer equipment.
In the embodiment of the present application, the storage device may be divided into the functional units according to the above method example, for example, each functional unit may be divided corresponding to each function, or two or more functions may be integrated into one processing unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit. It should be noted that the division of the unit in the embodiment of the present application is schematic, and is only a logic function division, and there may be another division manner in actual implementation.
For example, in the case where the respective functional units are divided in an integrated manner, fig. 6 shows a schematic diagram of a software detection apparatus.
As shown in fig. 6, the block link point detection device provided in the embodiment of the present application includes:
a block link point detection device comprising:
an intercepting unit 601, where the intercepting unit 601 is configured to intercept a first request message, where the first request message is a request message initiated by a first node and used for acquiring a current service state, and the first node is a node in a block chain;
a determining unit 602, where the determining unit 602 is configured to determine a first scene operation according to the first request message intercepted by the intercepting unit 601, where the first scene operation is used to simulate an abnormal working state of the first node;
a first injecting unit 603, where the first injecting unit 603 is configured to inject the first scenario operation determined by the determining unit 602 into the first node, so that the first node detects whether the first node can normally operate when the first scenario operation is performed.
Optionally, the apparatus further comprises:
a second injecting unit 604, wherein the first injecting unit 603 is configured to inject a first recovery operation to the first node, so that the first node stops executing the first scenario operation injected by the first injecting unit 603.
Optionally, the intercepting unit 601 is configured to: intercepting the first request message through an access point, wherein the access point is an anchor code enhanced access point;
the first injection unit 603 is configured to: injecting the first scenario operation into the first node through the entry point.
Optionally, the determining unit 602 is configured to:
acquiring preset registration information according to the first request message intercepted by the interception unit 601;
and acquiring a first injection rule and a first injection parameter corresponding to the registration information according to the registration information, wherein the first injection rule and the first injection parameter are rules and parameters written in advance by an injector agent, and the first injection rule and the first injection parameter are used for executing the first scene operation.
Optionally, the first injection unit 603 is configured to:
and sending a first notification message to the first node, where the first notification message is used to guide the first node to read a preset execution memory, and the execution memory has the first injection rule and the first injection parameter stored in advance, so that the first node executes the first scene operation.
Optionally, the first injection unit 603 is configured to:
sending a second notification message to the first node, where the second notification message is used to guide the first node to execute a first code segment preset in a block chain, and the first code segment records the first injection rule and the first injection parameter, so that the first node executes the first scene operation.
Optionally, the first injection unit 603 is further configured to:
sending a command for switching the service state to the first node so that the first node switches the service state;
or,
after the intercepting unit 601 intercepts the first request message, a command for switching the service state is sent to the first node after a first preset time period, so that the first node delays to switch the service state;
or,
sending an exception code to the first node to enable the first node to output an erroneous working result;
or,
and sending a recovery code to the first node, wherein the recovery code is used for deleting the abnormal code so that the first node outputs a correct working result.
Further, an embodiment of the present invention also provides a computer storage medium, which includes instructions that, when executed on a computer device, cause the computer device to execute the above method.
For a detailed description of the program stored in the computer storage medium provided in the embodiments of the present application, reference may be made to the above embodiments, which are not described herein again.
The embodiments in the present description are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other. The device disclosed by the embodiment corresponds to the method disclosed by the embodiment, so that the description is simple, and the relevant points can be referred to the method part for description.
Those of skill would further appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, computer software, or combinations of both, and that the various illustrative components and steps have been described above generally in terms of their functionality in order to clearly illustrate this interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
The steps of a method or algorithm described in connection with the embodiments disclosed herein may be embodied directly in hardware, in a software module executed by a processor, or in a combination of the two. A software module may reside in Random Access Memory (RAM), memory, Read Only Memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the invention. Thus, the present invention is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (10)

1. A block link point detection method, comprising:
an injector manager intercepts a first request message, wherein the first request message is a request message which is initiated by a first node and is used for acquiring the current service state, and the first node is a node in a block chain;
the injector manager determines a first scenario operation according to the first request message, wherein the first scenario operation is used for simulating an abnormal working state of the first node;
the injector manager injects the first scenario operation into the first node to enable the first node to detect whether the first node can operate normally when the first scenario operation is performed.
2. The method of claim 1, further comprising:
the injector manager injects a first recovery operation to the first node to cause the first node to stop performing the first scenario operation.
3. The method of claim 1, wherein intercepting a first request message by the injector manager comprises:
the injector manager intercepts the first request message through an entry point, wherein the entry point is an anchor code enhanced entry point;
the injector manager injects the first scenario operation to the first node, including:
the injector manager injects the first scenario operation to the first node through the entry point.
4. The method of claim 1, wherein the injector manager determines a first scenario operation from the first request message, comprising:
the injector manager acquires preset registration information according to the first request message;
and the injector manager acquires a first injection rule and a first injection parameter corresponding to the registration information according to the registration information, wherein the first injection rule and the first injection parameter are rules and parameters written in advance by an injector agent, and the first injection rule and the first injection parameter are used for executing the first scene operation.
5. The method of claim 4, wherein the injector manager injects the first scenario operation into the first node, comprising:
the injector manager sends a first notification message to the first node, where the first notification message is used to guide the first node to read a preset execution memory, and the execution memory has the first injection rule and the first injection parameter stored in advance, so that the first node executes the first scenario operation.
6. The method of claim 4, wherein the injector manager injects the first scenario operation into the first node, comprising:
the injector manager sends a second notification message to the first node, where the second notification message is used to guide the first node to execute a first code segment preset in a block chain, and the first code segment records the first injection rule and the first injection parameter, so that the first node executes the first scenario operation.
7. The method of any of claims 1 to 6, wherein the injector manager sends the first scenario operation to the first node to cause the first node to perform the first scenario operation, comprising:
the injector manager sending a command to the first node to switch traffic state to cause the first node to switch traffic state;
or,
after intercepting the first request message, the injector manager sends a command for switching the service state to the first node after a first preset time period, so that the first node delays switching the service state;
or,
the injector manager sending exception code to the first node to cause the first node to output a false work result;
or,
the injector manager sends a recovery code to the first node, the recovery code to delete the exception code to cause the first node to output a correct work result.
8. A block link point detection device, comprising:
an intercepting unit, configured to intercept a first request message, where the first request message is a request message initiated by a first node and used to acquire a current service state, and the first node is a node in a block chain;
the determining unit is used for determining first scene operation according to the first request message intercepted by the intercepting unit, and the first scene operation is used for simulating the abnormal working state of the first node;
a first injection unit, configured to inject the first scenario operation determined by the determination unit into the first node, so that the first node detects whether the first node can normally operate when the first scenario operation is performed.
9. A computer device, characterized in that the computer device comprises: an interaction device, an input/output (I/O) interface, a processor, and a memory having program instructions stored therein;
the interaction device is used for acquiring an operation instruction input by a user;
the processor is configured to execute program instructions stored in the memory to perform the method of any of claims 1-7.
10. A computer-readable storage medium comprising instructions that, when executed on a computer device, cause the computer device to perform the 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 (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111277645A (en) * 2020-01-16 2020-06-12 深圳市网心科技有限公司 Active and standby node hot switching method, blockchain system, blockchain 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
CN115174129A (en) * 2022-02-22 2022-10-11 中国工商银行股份有限公司 Abnormal node detection method and device, computer equipment and storage medium
CN115567401A (en) * 2022-08-22 2023-01-03 哈尔滨工业大学(深圳) Ethernet bay network topology simulation method, device, medium and terminal based on pipeline technology
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 (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111277645A (en) * 2020-01-16 2020-06-12 深圳市网心科技有限公司 Active and standby node hot switching method, blockchain system, blockchain 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
CN111327490B (en) * 2020-01-20 2021-01-29 腾讯科技(深圳)有限公司 Byzantine fault-tolerant detection method of block chain and related device
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
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
CN115174129A (en) * 2022-02-22 2022-10-11 中国工商银行股份有限公司 Abnormal node detection method and device, computer equipment and storage medium
CN115567401A (en) * 2022-08-22 2023-01-03 哈尔滨工业大学(深圳) Ethernet bay network topology simulation method, device, medium and terminal based on pipeline technology

Also Published As

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

Similar Documents

Publication Publication Date Title
CN110474822B (en) Block chain link point detection method, device, equipment and medium
Gordon et al. Accelerating mobile applications through flip-flop replication
Xu et al. POD-Diagnosis: Error diagnosis of sporadic operations on cloud applications
US7984332B2 (en) Distributed system checker
US9910766B2 (en) Whitebox network fuzzing
US10169203B2 (en) Test simulation for software defined networking environments
Leungwattanakit et al. Modular software model checking for distributed systems
CN112698974A (en) Fault injection test method, device and storage medium
CN103761184B (en) Code segment method of testing, device and the system of program
Shetty et al. Building ai agents for autonomous clouds: Challenges and design principles
CN102855184A (en) Android automatic test cross application device and method
CN108664385A (en) A kind of test method and device of application programming interface
CN110335041A (en) Consistency detection method, device, equipment and storage medium for intelligent contract calling
US11138091B2 (en) Regression analysis platform
US20230140552A1 (en) Development environment setup for commonly used components across teams
US7730452B1 (en) Testing a component of a distributed system
Mascheroni et al. Identifying key success factors in stopping flaky tests in automated REST service testing
Voas et al. Tolerant software interfaces: can COTS-based systems be trusted without them?
Alnawasreh et al. Online robustness testing of distributed embedded systems: An industrial approach
Herscheid et al. Experimental assessment of cloud software dependability using fault injection
Mazuera-Rozo et al. Detecting connectivity issues in android apps
Tiwari et al. Automatic performance verification of industrial gateway using python framework
Svensson et al. A new leader election implementation
Peng et al. Automated Server Testing: an Industrial Experience Report
CN110704218A (en) Data processing method, apparatus, computer equipment and storage medium

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
点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载