CN117155594A - Block chain self-adaptive detection method, terminal and storage medium for Sybil attack - Google Patents

Block chain self-adaptive detection method, terminal and storage medium for Sybil attack Download PDF

Info

Publication number
CN117155594A
CN117155594A CN202211366833.0A CN202211366833A CN117155594A CN 117155594 A CN117155594 A CN 117155594A CN 202211366833 A CN202211366833 A CN 202211366833A CN 117155594 A CN117155594 A CN 117155594A
Authority
CN
China
Prior art keywords
detection
distribution scheme
force distribution
calculation force
scheme
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211366833.0A
Other languages
Chinese (zh)
Inventor
陈友荣
章阳
缪克雷
王章权
张旭东
吕晓雯
任条娟
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhejiang Shuren University
Original Assignee
Zhejiang Shuren University
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 Zhejiang Shuren University filed Critical Zhejiang Shuren University
Priority to CN202211366833.0A priority Critical patent/CN117155594A/en
Publication of CN117155594A publication Critical patent/CN117155594A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/14Network architectures or network communication protocols for network security for detecting or protecting against malicious traffic
    • H04L63/1441Countermeasures against malicious traffic
    • 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/14Network analysis or design
    • H04L41/145Network analysis or design involving simulating, designing, planning or modelling of a network

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Hardware Design (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The invention provides a block chain self-adaptive detection method facing Sybil attack, which comprises the following steps: initializing system parameters and detecting regional slicing; constructing a detection and calculation power distribution self-adaptive detection and optimization model for the witch attack; constructing a search space, randomly generating a plurality of detection calculation force distribution schemes of a detection target area in the search space to form a distribution scheme matrix, and recording the current iteration times and the similarity ratio of the detection calculation force distribution scheme in the current iteration process to the detection calculation force distribution scheme in the previous iteration process when the same iteration times are achieved; judging whether the model is in an AO hawk optimization algorithm or not according to the current iteration times and the similarity ratio; if the detection algorithm belongs to the detection algorithm, updating a detection algorithm distribution scheme, and calculating to obtain a detection algorithm optimal distribution scheme in the current iteration process; if not, obtaining a global optimal solution of the witch attack detection optimization model; and according to the optimal distribution scheme of the detection power, the detection power is distributed in a self-adaptive mode to different target areas, and the detection of the target area witches attack is carried out.

Description

Block chain self-adaptive detection method, terminal and storage medium for Sybil attack
Technical Field
The invention relates to the technical field of blockchains, in particular to a blockchain self-adaptive detection method, a terminal and a storage medium for Sybil attack.
Background
Blockchain is a brand-new decentralization infrastructure and distributed computing paradigm, has the characteristics of decentralization, time sequence data, collective maintenance, programmability, safety, credibility and the like, is widely applied to the fields of finance, energy, medical treatment and the like, and has attracted high importance and wide attention from government departments, financial institutions, scientific enterprises and capital markets.
In blockchains, consensus algorithms are critical in determining whether a blockchain can be effectively applied. Currently, the main consensus algorithms are mainly POS (Proof of Stake), DPOS (Delegated Proof of Stake), PBFT (Practical Byzantine Fault Tolerance), DAG (Directed Acyclic Graphs) consensus, etc., but these consensus algorithms are vulnerable to witch attacks.
The Sybil attack means that an attacker spoofs other nodes by disguising identities. The specific attack process is as follows: when nodes perform block consensus, an attacker continuously sends messages to other nodes by disguising the identities of a plurality of nodes, so that the connection condition of a block chain network is obtained, and the routing of the normal nodes is misled. And finally, when the number of the nodes disguised by the attacker reaches a certain degree, the block consensus result is possibly directly influenced.
In order to effectively cope with the Sybil attack and ensure the safety of information in the blockchain system, the system needs to detect the Sybil attack, and reduce the influence of Sybil attackers on the consensus algorithm, thereby reducing the influence of the Sybil attack as much as possible while ensuring the block consensus efficiency. In order to effectively suppress the witches attack of the blockchain, a detection method aiming at the witches attack of the blockchain needs to be researched, the influence of the witches attack is reduced, and the blockchain uploading efficiency of the blockchain is improved.
However, most of the current technologies focus on researching the situation of detecting the witches attack on one target, so that the detection efficiency is low, the witches attack is difficult to find in time, and the situation of simultaneously detecting the witches attack on other targets is not considered. Meanwhile, an effective calculation force distribution calculation model of the detection force is lacked, and research on optimal detection force distribution is performed.
Disclosure of Invention
(one) solving the technical problems
Aiming at the defects of the prior art, the invention provides a block chain self-adaptive detection method, a terminal and a storage medium for Sybil attacks, which solve the problems that detection efficiency is low, sybil attacks are difficult to discover in time and detection of Sybil attacks on other targets is not considered simultaneously in the background art. Meanwhile, the problem of lack of an effective calculation power distribution calculation model of the detection power and research on optimal detection power distribution is solved.
(II) technical scheme
In order to achieve the above purpose, the invention is realized by the following technical scheme: a block chain self-adaptive detection method facing Sybil attack comprises the following steps:
s1, initializing system parameters and detecting regional fragmentation;
s2, constructing a detection power distribution adaptive detection optimization model for the Sybil attack;
s3, constructing a search space, randomly generating a plurality of detection calculation force distribution schemes of a detection target area in the search space, forming a distribution scheme matrix, and recording the current iteration times and the similarity ratio of the detection calculation force distribution scheme of the current iteration process to the detection calculation force distribution scheme of the previous iteration process when the same iteration times are achieved;
s4, judging whether the algorithm is in four stages of an AO hawk optimization algorithm according to the current iteration times and the similarity ratio;
s5, if the detection algorithm belongs to the detection algorithm, updating a detection algorithm distribution scheme, and calculating to obtain a detection algorithm optimal distribution scheme in the current iteration process;
s6, if the detection algorithm does not belong to the detection algorithm, obtaining a global optimal solution of the detection optimization model of the witch attack, and obtaining a detection algorithm optimal distribution scheme;
s7, according to the optimal distribution scheme of the detection power, the detection power is distributed to different target areas in a self-adaptive mode, and detection of the witch attack in the target areas is carried out.
Preferably, the system parameters include: maximum iteration number M, current iteration number M and optimal allocation scheme x in current iteration process best Threshold kappa, iteration round threshold STh, reward ratio ρ, gain increment ratio ε i And omega i
Preferably, the constructing a detection algorithm distribution adaptive detection optimization model for the witch attack comprises: let τ i Representing the detection calculation force duty ratio allocated to the target region i, and alpha represents the detection total calculation force, then the detection calculation force tau i Alpha, collecting behavior information of all nodes in a target area i, and judging whether the nodes are Sybil attackers or not through a threshold method;
if the node is a witch attacker, limiting the consensus right of the node, restarting the consensus right of the node after 100 blocks of consensus, and calculating the consensus efficiency of the target area iAverage transaction delay->Average node communication overhead->Establishing an Sybil attack detection optimization model as follows:
wherein r is 1 Represents consensus efficiency factor, r 2 Represents an average transaction delay factor, r 3 Representing the average node communication overhead factor and N represents the number of target areas.
Preferably, the search space is constructed, a plurality of detection calculation force distribution schemes of the detection target area are randomly generated in the search space, an distribution scheme matrix is formed, and the current iteration times and the similarity ratio of the detection calculation force distribution scheme in the current iteration process to the detection calculation force distribution scheme in the previous iteration process with the same iteration times are recorded; comprising the following steps: constructing a search space by combining constraint conditions in the Sybil attack detection optimization model formula (1), randomly generating K detection calculation force distribution schemes of a detection pool in the search space, and forming a distribution scheme matrix X= { X 1 ,x 2 ,...,x k ,...,x K X, where x k Representing a kth detection algorithm assignment scheme;
if the current iteration number is 1, detecting the similarity ratio S of the computing force distribution scheme k UTh if not, calculating the similarity ratio S of each detection calculation force distribution scheme in the current iteration process to the corresponding detection calculation force distribution scheme in the previous iteration process k
Wherein S is k Representing the similarity ratio of the kth detection computing force distribution scheme in the current iteration process to the kth detection computing force distribution scheme in the last iteration process,representing the detection calculation force of the jth target area in the kth detection calculation force distribution scheme in the m rounds of iterative process,/>The detection calculation force of the jth target area in the kth detection calculation force distribution scheme in the m-1 round of iterative process is represented.
Preferably, the performing the update of the detection power allocation scheme includes:
when M is less than or equal to (2 xM)/3 and S k When the searching range of the optimal power distribution scheme is more than or equal to UTh, if the current distribution scheme is far away from the optimal distribution scheme, the searching range of the optimal power distribution scheme is rapidly determined by simulating the high-altitude soaring of hawk through a formula (3), and the detection power distribution scheme is updated;
wherein,representing the kth detection calculation force distribution scheme under the m+1 iteration, x c Representing a vector of size omega X1, X being composed of the mean value of the current detection power allocation scheme matrix X best Represents the optimal allocation scheme in the current iteration process, rand 1 Representing a random number in the range from 0 to 1;
when M is less than or equal to (2 xM)/3 and S k When the power distribution scheme is less than UTh, the searching range of the optimal distribution scheme is wider, so that eagle is simulated to spin on the prey through a formula (4), and the detection power distribution scheme is updated through short gliding equal-altitude flight action, so that the current searching range is further narrowed, and the rapid approach of the later optimal detection power distribution scheme is facilitated;
wherein R is L Representing a distribution function in the form of a Lewy flight, x d Representing randomly selected detection algorithm assignment scheme, mu, in the current assignment scheme matrix X 1 Sum mu 2 A random value vector representing a simulated eagle spiral search;
when M > (2 XM)/(N)3 and S k When the detection power distribution scheme is more than or equal to LTh, the transition from a large-range searching to a small-range optimizing is considered, so that when the accurate area of the hunting is determined by simulating hawk according to the formula (5), the detection power distribution scheme is updated by adopting low-altitude flight and quick attack, and the detection power distribution scheme is quickly close to the optimal detection power distribution scheme, so that the next link can accurately search the optimal detection power distribution scheme;
wherein x is mean Mean value vector omega representing current allocation scheme matrix X in different dimensions 1 And omega 2 Representing the allocation scheme search parameters in the range of 0 to 1, rand 2 Representing a vector of size n x 1 composed of random numbers in the range of 0 to 1, up representing a vector of size n x 1 composed of maxima of different dimensions, lp representing a vector of size n x 1 composed of minima of different dimensions;
when M > (2 XM)/3 and S k When the detection calculation force distribution scheme is less than LTh, the detection calculation force distribution scheme is considered to be close to an optimal solution, so that a quality function f which ensures accurate searching is calculated through a formula (6), hawk is simulated to accurately grasp and capture a prey by combining with a formula (7), the detection calculation force distribution scheme is updated, and the optimal detection calculation force distribution scheme is found;
wherein f represents the quality function of the exact search, g 1 Representing random values, g, during simulated eagle capture of prey 2 Representing the slope of the flight during simulated eagle capture of the prey.
Preferably, the calculating to obtain the optimal distribution scheme of the detection calculation force in the current iteration process includes: step 1: for each detection calculation force distribution scheme, calculating a similarity ratio difference value of the detection calculation force distribution scheme under adjacent iteration times according to a formula (8);
wherein,representing the similarity ratio difference of the kth detection algorithm at the mth iteration, +.>Representing the similarity ratio of the kth detection algorithm at the mth iteration;
judging whether the similarity ratio difference value of each detection calculation force distribution scheme is smaller than a threshold pi according to the similarity ratio difference value calculation result, and counting the detection calculation force distribution scheme times sum smaller than the threshold pi; when sum reaches iteration round threshold STh and optimal calculation force distribution scheme x under current iteration best If the current solution method is not changed, determining that the current solution method falls into a local optimal solution, jumping to the step 2, otherwise, directly jumping to the step 3;
step 2: generating a new detection calculation force distribution scheme according to the formula (9), replacing the detection calculation force distribution scheme with the similarity ratio difference value smaller than the threshold pi, and carrying out an artificial bee colony solution updating mechanism to ensure the difference of the newly generated detection calculation force distribution scheme in the search space;
wherein,representing the regenerated detection calculation force distribution scheme, x t Indicating the detection algorithm power distribution scheme which needs to be replaced in the distribution scheme matrix, x r1 And x r2 Representing a randomly selected detection algorithm distribution scheme;
step 3: judging whether each detection calculation force distribution scheme accords with the constraint condition of the model (1), if so, directly jumping to the step 4, otherwise, jumping to the step 5;
step 4: generating a new detection computing force distribution scheme according to the formula (9), and replacing the detection computing force distribution scheme which does not meet the constraint conditions in the model (1), so as to ensure the difference of the newly generated detection computing force distribution scheme in the search space;
step 5: calculating the fitness value of each detection calculation force distribution scheme according to a formula (10), calculating the similarity ratio of each detection calculation force distribution scheme according to a formula (2), selecting the detection calculation force distribution scheme with the largest fitness value, and updating the optimal distribution scheme x in the current iteration process best
Wherein F is k A fitness value representing a kth pool detection computing power allocation scheme;
step 6: judging whether the current iteration number M is larger than the maximum iteration number M, if not, continuing optimizing iteration, wherein the current iteration number m=m+1; otherwise, obtaining a global optimal solution of the detecting pool profit model, and obtaining a detecting capacity optimal allocation scheme.
The invention also provides a block chain self-adaptive detection system facing the witches attack, which comprises:
an initialization module: the method comprises the steps of initializing system parameters and detecting regional fragments;
the witch attack detection optimization model building module comprises a witch attack detection optimization model building module: the method is used for constructing a detection and calculation power distribution self-adaptive detection and optimization model for the witch attack;
the detection calculation module of the optimal distribution scheme of the power: the method comprises the steps of constructing a search space, randomly generating a plurality of detection calculation force distribution schemes of a detection target area in the search space, forming a distribution scheme matrix, and recording the current iteration times and the similarity ratio of the detection calculation force distribution scheme of the current iteration process to the detection calculation force distribution scheme of the previous iteration process when the same iteration times are achieved;
judging whether the model is in four stages of an AO hawk optimization algorithm according to the current iteration times and the similarity ratio;
if the detection algorithm belongs to the detection algorithm, updating a detection algorithm distribution scheme, and calculating to obtain a detection algorithm optimal distribution scheme in the current iteration process;
if the detection result does not belong to the detection result, obtaining a global optimal solution of the detection optimization model of the witch attack, and obtaining a detection calculation power optimal allocation scheme;
detection power self-adaptive distribution module: the method is used for adaptively distributing the detection power to different target areas according to the optimal distribution scheme of the detection power and detecting the witch attack of the target areas.
The invention also provides a block chain self-adaptive detection terminal facing the witches attack, which comprises a processor and a memory, wherein at least one instruction or at least one section of program is stored in the memory, and the at least one instruction or the at least one section of program is loaded and executed by the processor to realize the block chain self-adaptive detection method facing the witches attack.
The invention also provides a computer readable storage medium storing a computer program which when executed by one or more processors implements a blockchain adaptive detection method step for the witch attack as described in any of the preceding.
(III) beneficial effects
The invention provides a block chain self-adaptive detection method, a terminal and a storage medium for Sybil attack. The beneficial effects are as follows:
according to the technical scheme, the situation that the detection computing power carries out the detection of the Sybil attack on a plurality of target areas is considered, the mathematical formula is used for expressing the detection computing power, the hash value computing power is calculated, the network performance and other formulas of the detection computing power are distributed to the plurality of target areas for carrying out the Sybil attack detection computing power, a Sybil attack detection optimizing model with self-adaptive detection computing power distribution is established, the selection mechanism of different optimizing links is improved on the basis of the traditional hawk optimizing method, the convergence speed of the detection optimizing model is improved, solution replacement is carried out timely according to the similarity ratio of the solution in a plurality of iterative processes, the hawk optimizing method is effectively prevented from sinking into a local optimal solution.
Drawings
FIG. 1 is a flowchart of a block chain adaptive detection method for Sybil attack according to an embodiment of the present invention;
FIG. 2 is a block chain adaptive detection system architecture diagram for Sybil attack according to an embodiment of the present invention;
fig. 3 is a block chain adaptive detection terminal structure diagram for the witch attack according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention.
A block chain self-adaptive detection method facing Sybil attack comprises the following steps:
initializing system parameters and detecting regional slicing;
constructing a detection and calculation power distribution self-adaptive detection and optimization model for the witch attack;
constructing a search space, randomly generating a plurality of detection calculation force distribution schemes of a detection target area in the search space, forming a distribution scheme matrix, and recording the current iteration times and the similarity ratio of the detection calculation force distribution scheme in the current iteration process to the detection calculation force distribution scheme in the previous iteration process when the same iteration times are achieved;
judging whether the model is in four stages of an AO hawk optimization algorithm according to the current iteration times and the similarity ratio;
if the detection algorithm belongs to the detection algorithm, updating a detection algorithm distribution scheme, and calculating to obtain a detection algorithm optimal distribution scheme in the current iteration process;
if the detection result does not belong to the detection result, obtaining a global optimal solution of the detection optimization model of the witch attack, and obtaining a detection calculation power optimal allocation scheme;
according to the optimal distribution scheme of the detection power, the detection power is distributed to different target areas in a self-adaptive mode, and the detection of the witch attack in the target areas is carried out.
Preferably, the system parameters include: maximum iteration number M, current iteration number M and optimal allocation scheme x in current iteration process best Threshold kappa, iteration round threshold STh, reward ratio ρ, gain increment ratio ε i And omega i
Preferably, the constructing a detection algorithm distribution adaptive detection optimization model for the witch attack comprises: let τ i Representing the detection calculation force duty ratio allocated to the target region i, and alpha represents the detection total calculation force, then the detection calculation force tau i Alpha, collecting behavior information of all nodes in a target area i, and judging whether the nodes are Sybil attackers or not through a threshold method;
if the node is a witch attacker, limiting the consensus right of the node, restarting the consensus right of the node after 100 blocks of consensus, and calculating the consensus efficiency of the target area iAverage transaction delay->Average node communication overhead->Establishing an Sybil attack detection optimization model as follows:
wherein r is 1 Represents consensus efficiency factor, r 2 Represents an average transaction delay factor, r 3 Representing the average node communication overhead factor and N represents the number of target areas.
Preferably, the search space is constructed, a plurality of detection calculation force distribution schemes of the detection target area are randomly generated in the search space, an distribution scheme matrix is formed, and the current iteration times and the similarity ratio of the detection calculation force distribution scheme in the current iteration process to the detection calculation force distribution scheme in the previous iteration process with the same iteration times are recorded; comprising the following steps: constructing a search space by combining constraint conditions in the Sybil attack detection optimization model formula (1), randomly generating K detection calculation force distribution schemes of a detection pool in the search space, and forming a distribution scheme matrix X= { X 1 ,x 2 ,...,x k ,...,x K X, where x k Representing a kth detection algorithm assignment scheme;
if the current iteration number is 1, detecting the similarity ratio S of the computing force distribution scheme k UTh if not, calculating the similarity ratio S of each detection calculation force distribution scheme in the current iteration process to the corresponding detection calculation force distribution scheme in the previous iteration process k
Wherein S is k Representing the similarity ratio of the kth detection computing force distribution scheme in the current iteration process to the kth detection computing force distribution scheme in the last iteration process,representing the detection calculation force of the jth target area in the kth detection calculation force distribution scheme in the m rounds of iterative process,/>The detection calculation force of the jth target area in the kth detection calculation force distribution scheme in the m-1 round of iterative process is represented.
Preferably, the performing the update of the detection power allocation scheme includes:
when M is less than or equal to (2 xM)/3 and S k When the searching range of the optimal power distribution scheme is more than or equal to UTh, if the current distribution scheme is far away from the optimal distribution scheme, the searching range of the optimal power distribution scheme is rapidly determined by simulating the high-altitude soaring of hawk through a formula (3), and the detection power distribution scheme is updated;
wherein,representing the kth detection calculation force distribution scheme under the m+1 iteration, x c Representing a vector of size omega X1, X being composed of the mean value of the current detection power allocation scheme matrix X best Represents the optimal allocation scheme in the current iteration process, rand 1 Representing a random number in the range from 0 to 1;
when M is less than or equal to (2 xM)/3 and S k When the power distribution scheme is less than UTh, the searching range of the optimal distribution scheme is wider, so that eagle is simulated to spin on the prey through a formula (4), and the detection power distribution scheme is updated through short gliding equal-altitude flight action, so that the current searching range is further narrowed, and the rapid approach of the later optimal detection power distribution scheme is facilitated;
wherein R is L Representing a distribution function in the form of a Lewy flight, x d Representing randomly selected detection algorithm assignment scheme, mu, in the current assignment scheme matrix X 1 Sum mu 2 A random value vector representing a simulated eagle spiral search;
when M > (2 XM)/3 and S k Measuring and calculating power distribution party is considered when the measured power is more than or equal to LThThe scheme needs to search from a large range to a small range for optimizing, so when the accurate area of the hunting is determined by simulating hawk through a formula (5), a low-altitude flight and quick attack are adopted, a detection capacity distribution scheme is updated, the detection capacity distribution scheme is quickly closed to an optimal detection capacity distribution scheme, and the next link is facilitated to accurately search the optimal detection capacity distribution scheme;
wherein x is mean Mean value vector omega representing current allocation scheme matrix X in different dimensions 1 And omega 2 Representing the allocation scheme search parameters in the range of 0 to 1, rand 2 Representing a vector of size n x 1 composed of random numbers in the range of 0 to 1, up representing a vector of size n x 1 composed of maxima of different dimensions, lp representing a vector of size n x 1 composed of minima of different dimensions;
when M > (2 XM)/3 and S k When the detection calculation force distribution scheme is less than LTh, the detection calculation force distribution scheme is considered to be close to an optimal solution, so that a quality function f which ensures accurate searching is calculated through a formula (6), hawk is simulated to accurately grasp and capture a prey by combining with a formula (7), the detection calculation force distribution scheme is updated, and the optimal detection calculation force distribution scheme is found;
wherein f represents the quality function of the exact search, g 1 Representing random values, g, during simulated eagle capture of prey 2 Representing the slope of the flight during simulated eagle capture of the prey.
Preferably, the calculating to obtain the optimal distribution scheme of the detection calculation force in the current iteration process includes: step 1: for each detection calculation force distribution scheme, calculating a similarity ratio difference value of the detection calculation force distribution scheme under adjacent iteration times according to a formula (8);
wherein,representing the similarity ratio difference of the kth detection algorithm at the mth iteration, +.>Representing the similarity ratio of the kth detection algorithm at the mth iteration;
judging whether the similarity ratio difference value of each detection calculation force distribution scheme is smaller than a threshold pi according to the similarity ratio difference value calculation result, and counting the detection calculation force distribution scheme times sum smaller than the threshold pi; when sum reaches iteration round threshold STh and optimal calculation force distribution scheme x under current iteration best If the current solution method is not changed, determining that the current solution method falls into a local optimal solution, jumping to the step 2, otherwise, directly jumping to the step 3;
step 2: generating a new detection calculation force distribution scheme according to the formula (9), replacing the detection calculation force distribution scheme with the similarity ratio difference value smaller than the threshold pi, and carrying out an artificial bee colony solution updating mechanism to ensure the difference of the newly generated detection calculation force distribution scheme in the search space;
wherein,representing the regenerated detection calculation force distribution scheme, x t Indicating the detection algorithm power distribution scheme which needs to be replaced in the distribution scheme matrix, x r1 And x r2 Representing a randomly selected detection algorithm distribution scheme;
step 3: judging whether each detection calculation force distribution scheme accords with the constraint condition of the model (1), if so, directly jumping to the step 4, otherwise, jumping to the step 5;
step 4: generating a new detection computing force distribution scheme according to the formula (9), and replacing the detection computing force distribution scheme which does not meet the constraint conditions in the model (1), so as to ensure the difference of the newly generated detection computing force distribution scheme in the search space;
step 5: calculating the fitness value of each detection calculation force distribution scheme according to a formula (10), calculating the similarity ratio of each detection calculation force distribution scheme according to a formula (2), selecting the detection calculation force distribution scheme with the largest fitness value, and updating the optimal distribution scheme x in the current iteration process best
Wherein F is k A fitness value representing a kth pool detection computing power allocation scheme;
step 6: judging whether the current iteration number M is larger than the maximum iteration number M, if not, continuing optimizing iteration, wherein the current iteration number m=m+1; otherwise, obtaining a global optimal solution of the detecting pool profit model, and obtaining a detecting capacity optimal allocation scheme.
As shown in fig. 2, the present invention further provides a block chain adaptive detection system for sywitch attack, which includes:
an initialization module: the method comprises the steps of initializing system parameters and detecting regional fragments;
the witch attack detection optimization model building module comprises a witch attack detection optimization model building module: the method is used for constructing a detection and calculation power distribution self-adaptive detection and optimization model for the witch attack;
the detection calculation module of the optimal distribution scheme of the power: the method comprises the steps of constructing a search space, randomly generating a plurality of detection calculation force distribution schemes of a detection target area in the search space, forming a distribution scheme matrix, and recording the current iteration times and the similarity ratio of the detection calculation force distribution scheme of the current iteration process to the detection calculation force distribution scheme of the previous iteration process when the same iteration times are achieved;
judging whether the model is in four stages of an AO hawk optimization algorithm according to the current iteration times and the similarity ratio;
if the detection algorithm belongs to the detection algorithm, updating a detection algorithm distribution scheme, and calculating to obtain a detection algorithm optimal distribution scheme in the current iteration process;
if the detection result does not belong to the detection result, obtaining a global optimal solution of the detection optimization model of the witch attack, and obtaining a detection calculation power optimal allocation scheme;
detection power self-adaptive distribution module: the method is used for adaptively distributing the detection power to different target areas according to the optimal distribution scheme of the detection power and detecting the witch attack of the target areas.
The invention also provides a block chain self-adaptive detection terminal facing the witches attack, which comprises a processor 30 and a memory 31, wherein at least one instruction or at least one section of program is stored in the memory 31, and the at least one instruction or the at least one section of program is loaded and executed by the processor 30 to realize the block chain self-adaptive detection method facing the witches attack.
The invention also provides a computer readable storage medium storing a computer program which when executed by one or more processors implements a blockchain adaptive detection method step for the witch attack as described in any of the preceding.
In summary, in the embodiment of the invention, considering the situation that the detection power detects the witch attack on the plurality of target areas, the hash value calculation power is calculated by using a mathematical formula, and the network performance and other formulas of the detection power are distributed to the plurality of target areas to perform the witch attack detection power, so as to establish the witch attack detection optimization model with self-adaptive detection power distribution. The invention provides a detection optimization method for the witches attack based on hawk optimization, which improves selection mechanisms of different optimization links on the basis of a traditional hawk optimization method, improves convergence speed of a detection optimization model, timely replaces a solution according to a similarity ratio of the solution in a plurality of iterative processes, effectively avoids the hawk optimization method from sinking into a local optimal solution.
Although embodiments of the present invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made therein without departing from the principles and spirit of the invention, the scope of which is defined in the appended claims and their equivalents.

Claims (9)

1. A block chain self-adaptive detection method facing Sybil attack is characterized by comprising the following steps:
initializing system parameters and detecting regional slicing;
constructing a detection and calculation power distribution self-adaptive detection and optimization model for the witch attack;
constructing a search space, randomly generating a plurality of detection calculation force distribution schemes of a detection target area in the search space, forming a distribution scheme matrix, and recording the current iteration times and the similarity ratio of the detection calculation force distribution scheme in the current iteration process to the detection calculation force distribution scheme in the previous iteration process when the same iteration times are achieved;
judging whether the model is in four stages of an AO hawk optimization algorithm according to the current iteration times and the similarity ratio;
if the detection algorithm belongs to the detection algorithm, updating a detection algorithm distribution scheme, and calculating to obtain a detection algorithm optimal distribution scheme in the current iteration process;
if the detection result does not belong to the detection result, obtaining a global optimal solution of the detection optimization model of the witch attack, and obtaining a detection calculation power optimal allocation scheme;
according to the optimal distribution scheme of the detection power, the detection power is distributed to different target areas in a self-adaptive mode, and the detection of the witch attack in the target areas is carried out.
2. The adaptive detection method of block chains for witches attacks according to claim 1, wherein the system parameters comprise: most preferably, the first to fourthLarge iteration number M, current iteration number M, and optimal allocation scheme x in current iteration process best Threshold kappa, iteration round threshold STh, reward ratio ρ, gain increment ratio ε i And omega i
3. The adaptive detection method of the block chain for the witches attack according to claim 2, wherein the constructing the adaptive detection optimization model for the witches attack with detection capacity distribution comprises: let τ i Representing the detection calculation force duty ratio allocated to the target region i, and alpha represents the detection total calculation force, then the detection calculation force tau i Alpha, collecting behavior information of all nodes in a target area i, and judging whether the nodes are Sybil attackers or not through a threshold method;
if the node is a witch attacker, limiting the consensus right of the node, restarting the consensus right of the node after 100 blocks of consensus, and calculating the consensus efficiency of the target area iAverage transaction delay->Average node communication overhead->Establishing an Sybil attack detection optimization model as follows:
wherein r is 1 Represents consensus efficiency factor, r 2 Represents an average transaction delay factor, r 3 Representing the average node communication overhead factor and N represents the number of target areas.
4. The block chain self-adaptive detection method for the Sybil attack according to claim 3, wherein the search space is constructed, a plurality of detection calculation force distribution schemes of the detection target area are randomly generated in the search space, an distribution scheme matrix is formed, and the similarity ratio of the current iteration times and the detection calculation force distribution schemes of the current iteration process to the detection calculation force distribution schemes of the last iteration times is recorded; comprising the following steps: constructing a search space by combining constraint conditions in the Sybil attack detection optimization model formula (1), randomly generating K detection calculation force distribution schemes of a detection pool in the search space, and forming a distribution scheme matrix X= { X 1 ,x 2 ,...,x k ,...,x K X, where x k Representing a kth detection algorithm assignment scheme;
if the current iteration number is 1, detecting the similarity ratio S of the computing force distribution scheme k UTh if not, calculating the similarity ratio S of each detection calculation force distribution scheme in the current iteration process to the corresponding detection calculation force distribution scheme in the previous iteration process k
Wherein S is k Representing the similarity ratio of the kth detection computing force distribution scheme in the current iteration process to the kth detection computing force distribution scheme in the last iteration process,representing the detection calculation force of the jth target area in the kth detection calculation force distribution scheme in the m rounds of iterative process,/>The detection calculation force of the jth target area in the kth detection calculation force distribution scheme in the m-1 round of iterative process is represented.
5. The adaptive detection method for a block chain for an witch attack of claim 4, wherein said performing a detection algorithm update comprises:
when M is less than or equal to (2 xM)/3 and S k When the searching range of the optimal power distribution scheme is more than or equal to UTh, if the current distribution scheme is far away from the optimal distribution scheme, the searching range of the optimal power distribution scheme is rapidly determined by simulating the high-altitude soaring of hawk through a formula (3), and the detection power distribution scheme is updated;
wherein,representing the kth detection calculation force distribution scheme under the m+1 iteration, x c Representing a vector of size omega X1, X being composed of the mean value of the current detection power allocation scheme matrix X best Represents the optimal allocation scheme in the current iteration process, rand 1 Representing a random number in the range from 0 to 1;
when M is less than or equal to (2 xM)/3 and S k When the power distribution scheme is less than UTh, the searching range of the optimal distribution scheme is wider, so that eagle is simulated to spin on the prey through a formula (4), and the detection power distribution scheme is updated through short gliding equal-altitude flight action, so that the current searching range is further narrowed, and the rapid approach of the later optimal detection power distribution scheme is facilitated;
wherein R is L Representing a distribution function in the form of a Lewy flight, x d Representing randomly selected detection algorithm assignment scheme, mu, in the current assignment scheme matrix X 1 Sum mu 2 A random value vector representing a simulated eagle spiral search;
when M > (2 XM)/3 and S k When the detection power distribution scheme is more than or equal to LTh, the transition from a large-range searching to a small-range optimizing is considered, so that when the accurate area of the hunting is determined by simulating hawk according to the formula (5), the detection power distribution scheme is updated by adopting low-altitude flight and quick attack, and the detection power distribution scheme is quickly close to the optimal detection power distribution scheme, so that the next link can accurately search the optimal detection power distribution scheme;
wherein x is mean Mean value vector omega representing current allocation scheme matrix X in different dimensions 1 And omega 2 Representing the allocation scheme search parameters in the range of 0 to 1, rand 2 Representing a vector of size n x 1 composed of random numbers in the range of 0 to 1, up representing a vector of size n x 1 composed of maxima of different dimensions, lp representing a vector of size n x 1 composed of minima of different dimensions;
when M > (2 XM)/3 and S k When the detection calculation force distribution scheme is less than LTh, the detection calculation force distribution scheme is considered to be close to an optimal solution, so that a quality function f which ensures accurate searching is calculated through a formula (6), hawk is simulated to accurately grasp and capture a prey by combining with a formula (7), the detection calculation force distribution scheme is updated, and the optimal detection calculation force distribution scheme is found;
wherein f represents the quality function of the exact search, g 1 Representing a simulated hawkRandom value during capturing prey, g 2 Representing the slope of the flight during simulated eagle capture of the prey.
6. The adaptive detection method for the block chain oriented to the witch attack of claim 5, wherein the calculating obtains an optimal distribution scheme of detection calculation force in the current iteration process, and the method comprises the following steps:
step 1: for each detection calculation force distribution scheme, calculating a similarity ratio difference value of the detection calculation force distribution scheme under adjacent iteration times according to a formula (8);
wherein,representing the similarity ratio difference of the kth detection algorithm at the mth iteration, +.>Representing the similarity ratio of the kth detection algorithm at the mth iteration;
judging whether the similarity ratio difference value of each detection calculation force distribution scheme is smaller than a threshold pi according to the similarity ratio difference value calculation result, and counting the detection calculation force distribution scheme times sum smaller than the threshold pi; when sum reaches iteration round threshold STh and optimal calculation force distribution scheme x under current iteration best If the current solution method is not changed, determining that the current solution method falls into a local optimal solution, jumping to the step 2, otherwise, directly jumping to the step 3;
step 2: generating a new detection calculation force distribution scheme according to the formula (9), replacing the detection calculation force distribution scheme with the similarity ratio difference value smaller than the threshold pi, and carrying out an artificial bee colony solution updating mechanism to ensure the difference of the newly generated detection calculation force distribution scheme in the search space;
wherein,representing the regenerated detection calculation force distribution scheme, x t Indicating the detection algorithm power distribution scheme which needs to be replaced in the distribution scheme matrix, x r1 And x r2 Representing a randomly selected detection algorithm distribution scheme;
step 3: judging whether each detection calculation force distribution scheme accords with the constraint condition of the model (1), if so, directly jumping to the step 4, otherwise, jumping to the step 5;
step 4: generating a new detection computing force distribution scheme according to the formula (9), and replacing the detection computing force distribution scheme which does not meet the constraint conditions in the model (1), so as to ensure the difference of the newly generated detection computing force distribution scheme in the search space;
step 5: calculating the fitness value of each detection calculation force distribution scheme according to a formula (10), calculating the similarity ratio of each detection calculation force distribution scheme according to a formula (2), selecting the detection calculation force distribution scheme with the largest fitness value, and updating the optimal distribution scheme x in the current iteration process best
Wherein F is k A fitness value representing a kth pool detection computing power allocation scheme;
step 6: judging whether the current iteration number M is larger than the maximum iteration number M, if not, continuing optimizing iteration, wherein the current iteration number m=m+1; otherwise, obtaining a global optimal solution of the detecting pool profit model, and obtaining a detecting capacity optimal allocation scheme.
7. A block chain adaptive detection system for witches attacks, comprising:
an initialization module: the method comprises the steps of initializing system parameters and detecting regional fragments;
the witch attack detection optimization model building module comprises a witch attack detection optimization model building module: the method is used for constructing a detection and calculation power distribution self-adaptive detection and optimization model for the witch attack;
the detection calculation module of the optimal distribution scheme of the power: the method comprises the steps of constructing a search space, randomly generating a plurality of detection calculation force distribution schemes of a detection target area in the search space, forming a distribution scheme matrix, and recording the current iteration times and the similarity ratio of the detection calculation force distribution scheme of the current iteration process to the detection calculation force distribution scheme of the previous iteration process when the same iteration times are achieved;
judging whether the model is in four stages of an AO hawk optimization algorithm according to the current iteration times and the similarity ratio;
if the detection algorithm belongs to the detection algorithm, updating a detection algorithm distribution scheme, and calculating to obtain a detection algorithm optimal distribution scheme in the current iteration process;
if the detection result does not belong to the detection result, obtaining a global optimal solution of the detection optimization model of the witch attack, and obtaining a detection calculation power optimal allocation scheme;
detection power self-adaptive distribution module: the method is used for adaptively distributing the detection power to different target areas according to the optimal distribution scheme of the detection power and detecting the witch attack of the target areas.
8. A block chain adaptive detection terminal for a witch attack, wherein the terminal comprises a processor and a memory, at least one instruction or at least one program is stored in the memory, and the at least one instruction or the at least one program is loaded and executed by the processor to implement a block chain adaptive detection method for a witch attack according to any one of claims 1-6.
9. A computer readable storage medium, characterized in that it stores a computer program, which when executed by one or more processors implements the steps of a block chain adaptive detection method for a witch attack according to any of claims 1-6.
CN202211366833.0A 2022-11-01 2022-11-01 Block chain self-adaptive detection method, terminal and storage medium for Sybil attack Pending CN117155594A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211366833.0A CN117155594A (en) 2022-11-01 2022-11-01 Block chain self-adaptive detection method, terminal and storage medium for Sybil attack

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211366833.0A CN117155594A (en) 2022-11-01 2022-11-01 Block chain self-adaptive detection method, terminal and storage medium for Sybil attack

Publications (1)

Publication Number Publication Date
CN117155594A true CN117155594A (en) 2023-12-01

Family

ID=88899325

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211366833.0A Pending CN117155594A (en) 2022-11-01 2022-11-01 Block chain self-adaptive detection method, terminal and storage medium for Sybil attack

Country Status (1)

Country Link
CN (1) CN117155594A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117742976A (en) * 2024-02-20 2024-03-22 广东省科技基础条件平台中心 Common node selection method based on dung beetle optimization algorithm

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117742976A (en) * 2024-02-20 2024-03-22 广东省科技基础条件平台中心 Common node selection method based on dung beetle optimization algorithm
CN117742976B (en) * 2024-02-20 2024-05-24 广东省科技基础条件平台中心 Common node selection method based on dung beetle optimization algorithm

Similar Documents

Publication Publication Date Title
CN115328189B (en) Multi-unmanned plane cooperative game decision-making method and system
CN112070418B (en) Weapon target distribution method of multi-target whale optimization algorithm
CN117155594A (en) Block chain self-adaptive detection method, terminal and storage medium for Sybil attack
CN111641595A (en) Power network security risk assessment method and system
Xiao et al. Network security situation prediction method based on MEA-BP
CN113553591A (en) Multi-stage dynamic defense method based on evolutionary game theory
CN112333723A (en) Wireless sensor node deployment method, storage medium and computing device
Zhang et al. Prediction algorithm for network security situation based on bp neural network optimized by sa-soa
CN114048474A (en) Group intelligence-based image recognition backdoor defense method, device and medium
CN116522747A (en) Two-stage optimized extrusion casting process parameter optimization design method
CN112215300A (en) Network structure enhancement-based graph convolution model defense method, device and system
CN116684152A (en) Active defense method, device and system for multiple aggressors
US11095672B2 (en) Method for evaluating domain name and server using the same
Wang et al. Genetic Algorithm‐Based Variable Value Control Method for Solving the Ground Target Attacking Weapon‐Target Allocation Problem
CN114862152A (en) Target importance evaluation method based on complex network
Liu et al. A Time-Driven Dynamic Weapon Target Assignment Method
Zhu et al. Simple and Efficient Partial Graph Adversarial Attack: A New Perspective
Tunga et al. Efficacy analysis of NSGAII and multi-objective particle swarm optimization (MOPSO) in agent based weapon target assignment (WTA) model
CN117938473A (en) Spoofing defense method and device based on reinforcement learning high-attack and defense interaction in multi-honeypot scene
CN116452011B (en) Data processing method and device for agent decision
CN113194059A (en) Method for selecting defense strategy of moving target
CN116090356B (en) Heterogeneous warhead multi-objective task planning method based on task reliability constraint
CN115801549B (en) Self-adaptive network recovery method, device and equipment based on key node identification
Fu et al. Intelligent grouping algorithms for regular expressions in deep inspection
CN113033754B (en) Evaluation method for high-frequency ground wave radar target tracking algorithm based on collaborative scene evolution

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