A smart community system based on blockchain

By using blockchain technology and deep learning optimization algorithms in the smart community system, the problem of insufficient data sharing and security is solved, the reliable sharing and integration of data is achieved, the convenience and security of community services are improved, and the Popular construction of smart communities.

CN113052744BActive Publication Date: 2024-10-29ZHEJIANG UNIV OF TECH
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202110338379.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-03-30
Publication Date
2024-10-29
Estimated Expiration
2041-03-30

AI Technical Summary

Technical Problem

Existing smart community systems have deficiencies in data sharing and security, lack of a unified smart home system, unsatisfactory community services, imperfect medical and health care, trust issues in smart devices and doubts about information security, resulting in inconvenient community management and services .

Method used

Adopt a smart community system based on blockchain, form a blockchain network through sensor nodes, realize data encryption signature and consensus operation, design a highly robust consensus mechanism and deep learning optimization algorithm, combine the DAG structure and CA mechanism, realize data Share and integrate, and ensure system security through malicious node attack protection strategies and semantic-aware neural autoencoders.

Benefits of technology

Ensure the reliability and authenticity of data, improve the security and trustworthiness of smart community systems, achieve effective sharing and integration of community smart node data, provide residents with convenient management and services, and promote the popularization of smart communities.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113052744B_ABST
    Figure CN113052744B_ABST
Patent Text Reader

Abstract

A blockchain-based smart community system, the smart community system includes a basic unit and a sensor node data acquisition device, the basic unit includes a security system, property, smart home and community hospital, wherein the sensor nodes constitute a blockchain network, each node will collect transaction information of each user or community, and encrypt and sign each transaction information, and perform data sharing, verification and consensus operations in the blockchain network until the transaction is finally processed and verified and synchronously written into the blockchain system. Security strategies include malicious node attack protection, community master node device key distribution and external attack identification. The present invention can realize the sharing and integration of community node data under the premise of ensuring data reliability, authenticity and the security and trustworthiness of the smart community system, and provide comprehensive and convenient management and services for community residents.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention discloses a design and implementation scheme for a smart community system, and in particular relates to a smart community system based on blockchain. Background Art

[0002] As the country continues to deepen its efforts in smart city construction and the arrival of an aging population, people increasingly hope to have a more livable, convenient, safe and healthy living environment. The construction of smart communities is an effective means to improve the quality of life. At the same time, it is also an important part of the current smart city construction and has broad development prospects.

[0003] At present, the construction of smart communities in residential areas has not been fully popularized. Even in some high-end communities, community smart construction is only limited to the partial realization of the public living areas of the owners, such as security, residential access control, smart parking lots, etc., such as Chinese patent application No. 201310401444.1, etc. However, the core of the community is the residents, and the lack of people-oriented smart construction will obviously lead to many problems. There is a lack of a unified smart home system within the family; dissatisfaction with the services of community property personnel has led to the passive collection of community service fees, property fees, fresh air systems and constant temperature and oxygen fees; the community's smart medical health care and emergency systems are imperfect; the qualifications and service levels of community service personnel are uneven; residents do not trust the smart devices in the community and worry about the security of personal information; there are doubts about the reliability and authenticity of community information, etc.

[0004] Therefore, how to achieve the sharing and integration of community smart node data while ensuring the reliability and authenticity of the data and the security and trustworthiness of the smart community system, and provide friendly, comprehensive and convenient management and services for community residents, is an important direction that urgently needs to be studied in this field. Summary of the invention

[0005] In order to overcome the shortcomings of the prior art, the present invention provides a smart community system based on blockchain, which realizes the sharing and integration of community smart node data while ensuring the reliability and authenticity of the data and the security and trustworthiness of the smart community system, and provides friendly, comprehensive and convenient management and services for community residents.

[0006] In order to achieve the above purpose, the technical solution of this application is as follows:

[0007] A blockchain-based smart community system, the smart community system includes a basic unit and sensor node data acquisition equipment, the basic unit includes a security system, property, smart home and community hospital, the sensor nodes therein constitute a blockchain network, each node will collect transaction information of each user or community, and encrypt and sign each transaction information, and perform data sharing, verification and consensus operations in the blockchain network until the transaction is finally processed and verified and synchronously written into the blockchain system.

[0008] Furthermore, the blockchain network composed of the sensor nodes is divided into two categories: ordinary community nodes and block generation nodes. The block generation nodes are responsible for generating new blocks and adding them to the local blockchain network after consensus is reached on the new blocks. A consensus mechanism model with strong robustness, less time consumption and computing resources, and a community blockchain network performance optimization algorithm based on deep reinforcement learning are designed for dynamic selection of block generation nodes.

[0009] Furthermore, the smart home, as an important part of the smart community, is composed of the owners' houses in each community. Various types of smart sensor nodes are deployed inside the house, including security monitoring, smart set-top boxes, home appliances, home medical and environmental monitoring equipment, which can send and receive transaction information. In addition, it also includes a transaction chain based on the DAG structure and local CA institutions collaborate with each other, and finally connect to the community blockchain main network.

[0010] Furthermore, the smart community system also includes:

[0011] Malicious node attack protection strategy module, internal communication nodes of smart community, including wireless community nodes and gateways, ordinary community nodes are divided into two categories according to the nature of the nodes, namely master nodes and lightweight nodes, and configured with keys corresponding to the generated manager nodes to manage legitimate sensor nodes. For the evaluation of node behavior in the smart community system, a node behavior confidence evaluation mechanism is designed to ensure system security and reduce resource consumption.

[0012] The malicious node attack protection strategy module includes an attack protection unit, which can effectively ensure the confidentiality of data in a transparent system without the need for any central verification or authorization server, and is a smart community master node device key issuance and message encryption and decryption implementation method.

[0013] In the malicious node attack protection strategy module, the key issuance of the smart community master node device includes the following steps:

[0014] Step 1). The smart community backbone node device searches for the RPC port of the nearest available gateway for communication;

[0015] Step 2). Gateway device registration manager public key;

[0016] Step 3). Instantiate the gateway and set the manager, register the node devices and record their respective public key information;

[0017] Step 4). Distribute the administrator's symmetric key to each smart community node device;

[0018] Step 5). Verify and bind the transaction data using proof of work (POW);

[0019] Step 6). Submit community node device data to the blockchain.

[0020] In the attack protection unit, external attack identification is performed before node behavior confidence evaluation. A semantic-aware neural autoencoder is designed, including the following components:

[0021] Feature embedding representation;

[0022] A bidirectional LSTM network for a single feature representation in the input feature vector;

[0023] Improved semantic and edge-gated GCN network to enhance automatic prediction accuracy;

[0024] The attack type classifier takes the GCN candidate parameter representation and type label as input to predict the corresponding attack method.

[0025] The beneficial effects of the present invention are as follows: by integrating the blockchain network into the smart community system, the immutability of transaction information submitted by the blockchain can be utilized, and at the same time a security protection strategy adapted to the system can be constructed to ensure the reliability and authenticity of the data and the trustworthiness of the smart community system security, making it possible to implement a variety of application scenarios in the community, truly realizing the sharing and integration of community smart node data, promoting the popularization of smart community construction, and providing comprehensive and convenient management and services for community residents. BRIEF DESCRIPTION OF THE DRAWINGS

[0026] Figure 1 This is a schematic diagram of the overall architecture of the smart community system based on blockchain;

[0027] Figure 2 This is a schematic diagram of the Byzantine Fault Tolerant protocol communication method;

[0028] Figure 3 This is a schematic diagram of the community smart home architecture;

[0029] Figure 4 This is a schematic diagram of the secure communication process of the smart community master node;

[0030] Figure 5 Schematic diagram of the key issuance and encryption and decryption process of the master node device;

[0031] Figure 6 It is a flow chart of key distribution for master node devices;

[0032] Figure 7 This is a schematic diagram of the interaction between manager nodes, master nodes and lightweight nodes;

[0033] Figure 8 Schematic diagram of a semantic-aware neural autoencoder for attack recognition;

[0034] Fig. 9 Schematic diagram of the internal structure of semantic GCN. DETAILED DESCRIPTION

[0035] The present invention will be further described in detail below in conjunction with the accompanying drawings and specific implementation methods and cases, which are included to provide a further understanding of the present invention and are incorporated into and constitute an integral part of this specification. The accompanying drawings illustrate embodiments of the present invention and together with the specification are used to explain the design method and principle of the present invention.

[0036] like Figure 1 As shown in the figure, it is a schematic diagram of the overall architecture and overall network of the smart community system based on blockchain of the present invention. The system implementation method of this embodiment includes:

[0037] Smart communities include basic community units such as community services, smart grids, security systems, properties, smart homes and community hospitals. This application does not list all the basic community units. Various smart devices and sensors are distributed in each community unit, such as security monitoring, smart set-top boxes, home appliances, home medical and environmental monitoring equipment, etc. These smart devices and sensors in the community units constitute sensor nodes distributed in the community units. The sensor nodes constitute a blockchain network. Each sensor node will collect transaction information within each community unit, encrypt and sign each transaction information, and perform data sharing, verification and consensus operations in the blockchain network until the transaction is finally processed and verified and synchronously written into the blockchain system.

[0038] Among them, it is necessary to explain the verification and consensus operations, which currently include PBFT (Byzantine Fault Tolerance), POW (Proof Of Work), etc. In addition, the blockchain structure designed in the system will be based on the DAG (directed acyclic graph) structure. The advantage of this structure is that, compared with the traditional chain structure, the community transaction information generated by its sensor nodes can be directly added to the chain without waiting for the previously submitted blocks to be verified. The traditional structure needs to wait for the previous one or two blocks to be verified before it can be submitted, that is, the new block is related to the previous two, which can be expressed as block = hash {hash (TS1) || hash (TS2)}, where TS is the transaction information. At the same time, the added transaction information can be run synchronously on different branch chains, which improves the system operation efficiency. The blocks on the chain are connected before and after, and the data cannot be changed once it is stored in the blockchain system, forming a fair and trustworthy environment. In addition, the community also includes an environmental and underground pipe water monitoring system. Urban construction needs to refer to the environmental and groundwater conditions of each community, but some of this information (such as the distribution of urban underground pipes) has sharing and ownership issues. At this time, the zero-knowledge proof feature of the blockchain can be used to ensure the privacy of core data while disclosing the required data.

[0039] The blockchain-based smart community system of the present invention also includes:

[0040] The blockchain network composed of the sensor nodes is divided into two categories: ordinary community nodes and block generation nodes. The block generation nodes are responsible for generating new blocks and adding them to the local blockchain network after reaching a consensus on the new blocks.

[0041] In this embodiment, the tasks of the block generation node are first explained. The block generation node generally has the characteristics of large power consumption and high performance. It is responsible for generating blocks, collecting, verifying and packaging blocks into the blockchain, broadcasting the generated new blocks to other generation nodes, and adding the new blocks to the local blockchain after completing the consensus operation on the new blocks; secondly, the mathematical model of the node is described as follows: Assuming there are n nodes and a block generation nodes, the node set can be expressed as δ S ={S1, S2, ... S n}, node S n The equity and computing resources consumed are represented as Y n (unit: token) and c n (unit: GHz), the set is denoted by Y n ={Y1, Y2, ... Y n} and c n ={c1, c2, ... c n}. The block generation node can be expressed as δP ={S p1 , S p2 ,…S pa}, The block generation node set δ P According to the rules proposed in the next section, S It is assumed that the block generation nodes follow a non-uniform Poisson point process with density λ(x) and are clustered in space R 2 In the independent random positions, where the node S n The position is represented by the two-dimensional coordinate x n ∈R 2 If x={x n} represents the location set, and the density function is defined as ∫∫ A λ(x)dx=E{Num(A)}, Where Num(A) is the number of nodes in region A, and the block size and block interval time generated by the block generation nodes in turn are represented as S B With T I .

[0042] Furthermore, a consensus mechanism model with strong robustness and less time and computing resources is designed. The consensus model is based on the Byzantine fault-tolerant protocol, such as Figure 2 As shown in the figure, it is a schematic diagram of the communication mode of the Byzantine fault-tolerant protocol. The consensus process of the protocol includes five stages: request, pre-preparation, preparation, submission and reply. As long as a small part of the replica nodes reach a consensus, the transaction can be considered honest. However, the message exchange between replica nodes is very time-consuming and each replica node must verify the messages from the majority of other replica nodes, which takes up a lot of computing resources and time. Therefore, in this system, the block generation node that generates a new block is regarded as the client, which is represented as c=1,2,…,K,other block generation nodes serve as replica nodes i=1,2,…,K,i≠c,In other words, the client publishes a series of transactions to the block and broadcasts them to other validators to reach a consensus. During the consensus process, a replica node will be designated as the primary replica node. During the consensus process, the main operations involved are message exchange and verification. For message exchange, this system models the time-varying transmission link as a finite state Markov channel, let express and The link data transmission rate is divided and quantized into L levels, namely r = {r1, r2, ..., r L}, forming a probability transfer matrix w·r·t of size L*L, Defined as p(t)=[p m (t)] L×L ,in y1,y2∈r.

[0043] The above models are integrated into a community blockchain network performance optimization method based on deep reinforcement learning, which can dynamically select suitable block generation nodes from all sensor nodes. The method includes an offline deep neural network construction stage, which can use the corresponding state and action to approximate the node action value function, and an online dynamic reinforcement deep Q-learning stage for system control, action selection and dynamic network update. The main process includes: first, setting the threshold of the number of block generation nodes in the entire network to PK, then the number of nodes generated in the network will not be greater than PK; in the definition B action space in the algorithm, the action space representation A related to the block generation node indicator is specified. (t) =[a, η, S B , T I ] (t) , then run the method. In step 8 of the method, the qualified block generation nodes will be preliminarily selected according to the block size and block interval strategy, and then input into step 9 to solve the action value function Q, find a set of solutions for the block generation nodes when the network transaction processing throughput is maximized, update and determine the final set of qualified block generation nodes A, and then select the block generation nodes. The block generation nodes first obtain the transaction information of the neighboring sensor nodes, and then create the basic data structure of the block in the system, including the block header and the block body. The block header stores the hash value of the previous block, the timestamp and the root hash value of the Merkle tree, where the Merkle tree is a tree data structure used to store the hash value of each transaction information; the block body stores the acquired sensor node transaction information. After the block data is encapsulated, the block generation node will broadcast to the entire system network, requiring other block generation nodes to run the consensus method to perform consensus operations on the block. When the consensus is completed and passed, the block will be added to the blockchain network.

[0044] The method for optimizing the performance of a community blockchain network based on deep reinforcement learning includes the following three definitions:

[0045] A. State space: The transaction processing scale of the node at decision time t (t = 1, 2, ...) is x, the equity distribution is Y, the position of the node is x, and the computing power of the node is c = {c k}, the data transmission rate between connected nodes is R = {R i,j}, then the state space is defined as:

[0046] S (t) =[χ,Y,x,c,R] (t)

[0047] B. Action Space: In order to maximize throughput, several parts of the blockchain system should be adjusted to adapt to the dynamic environment, including block generation node a, consensus algorithm η, block size S B The time interval between blocks is T I , formally the action space of decision period t is expressed as:

[0048] A (t) =[a, η, S B , T I ] (t)

[0049] The block generation node index when a n =1, indicating that node S n is selected as the block generation node, otherwise it is 0. In addition, the parameter η is used to control the consensus algorithm protocol and predefine a limited block method. The block size and block interval are

[0050] C. Incentive function: To ensure the decentralization, immutability and security of the blockchain system while maximizing transaction processing throughput, the following problems should be solved in each decision period.

[0051] P1: max Q(S, A)

[0052] C1: G(Y)≤η s ,G(λ)≤η l

[0053] C2:T F,δ ≤w×T I ,δ=0,1,2

[0054] C3: f≤F δ ,δ=0,1,2.

[0055] Among them, Q(S, A) is the action value function to be solved in the process, and the calculation method is expressed as:

[0056]

[0057] The discount factor μ∈(0, 1] reflects the trade-off between current and future incentives, and the current incentive is defined as:

[0058]

[0059] In this stage, if the constraints C1-C3 cannot be met, the optimized community blockchain network will perform poorly in terms of distribution, latency and security. Therefore, in this case, the incentive value is set to 0 to avoid this invalid situation. The entire community blockchain network performance optimization algorithm based on deep reinforcement learning is expressed as Algorithm 1.

[0060] Algorithm 1: Community blockchain network performance optimization algorithm based on deep reinforcement learning. The process is as follows:

[0061] 1. Offline deep neural network construction phase:

[0062] 2. Load the historical state transition configuration file and Q(S, A) value into memory D;

[0063] 3. Pre-train the deep neural network (Q) using the input pairs (S, A) and the corresponding estimates Q(S, A);

[0064] 4. Online dynamic reinforcement learning stage:

[0065] 5. For each decision period t, execute:

[0066] 6. / **Optimize and adjust the community blockchain system** /

[0067] 7. Choose a random action with probability ε, otherwise A (t) = argmax A Q(S (t) , A ( t ) ), where Q(S (t) , A( t) ) The main network Q performs prediction and estimation;

[0068] 8. Execute A (t) , select the block generation node and consensus algorithm, and adjust the generated block size and block interval;

[0069] 9. / **Update** /

[0070] 10. Monitor the incentive value R (t) With the next state S (t+1) ;

[0071] 11. Storage (t) , A (t) , R (t) , S (t+1) ) to D;

[0072] 12. Randomly sample a batch of state transitions (S (i) , A (i) , R (i) , S(i+1) );

[0073] 13. According to the calculation formula y (i) =R (i) +λmax A′ Q(S (i+1) , A′) calculate the target Q value from the network Q;

[0074] 14. Every N times, the loss function L(θ)=[y (i) -Q(S (i) ;θ)] 2 Update the target network Q.

[0075] The above algorithm is used to dynamically change the settings of the generated nodes according to the computing efficiency of the nodes, so as to achieve the purpose of improving system performance and reducing energy consumption.

[0076] like Figure 3 FIG. 1 is a schematic diagram of a community smart home architecture of the present invention. The system implementation method of this embodiment includes:

[0077] As an important part of the smart community, smart home is composed of the houses of owners in each community. Various sensor nodes are deployed inside the house, including security monitoring, smart set-top boxes, home appliances, home medical and environmental monitoring equipment, which can send and receive transaction information. In addition, it also includes a transaction chain based on the DAG structure and local CA institutions to collaborate with each other, and finally connect to the community blockchain main network.

[0078] Taking smart home as an example, the block generating node in the smart home will regularly collect and batch process the transaction information of nearby sensor nodes, package them into blocks and perform consensus operations. If successful, it will be sent to the blockchain network to complete data storage.

[0079] Among them, it should be noted that based on the DAG (directed acyclic graph) structure, there are three types of nodes, including brand new, partially confirmed and fully confirmed, which represent three different states respectively. The newly submitted block will be in a partially confirmed state before the consensus verification is met, and will be in a fully confirmed state after the conditions are met. Under this structure, blockchain forks are allowed, and the weight of each block is determined by the number of block verification transactions. Since the number of transaction submissions in the community is very frequent, the blockchain system using this structure can save more energy and improve operating efficiency.

[0080] Furthermore, the blockchain-based smart community system design method of the present invention also includes:

[0081] Smart home consists of three parts: smart home, DAG transaction chain and smart monitoring devices in the home. Each family has a home master node, which is an online computing device with pre-installed firmware and corresponding DAG transaction chain implementation. Each home node is connected to its neighbor node through TCP / UDP protocol for communication or synchronization; the home master node can be any type of IoT device or customized chip, and has a certain computing power, such as servers, PCs, embedded boards and other microcomputers. All home master nodes in the community provide maintenance and share the computing power of the distributed network; in addition, it also includes a local certificate authority (CA), which serves as a permission management system. In the local community, each home master node needs to obtain a certification CA issued before joining the blockchain network.

[0082] The present invention also proposes a security strategy, which also includes:

[0083] like Figure 4 FIG. 1 is a schematic diagram of the secure communication process of the master node of the smart community of the present invention. The system implementation method of this embodiment includes:

[0084] Malicious node attack protection strategy module, the internal communication nodes of the smart community, including wireless community nodes, gateways, etc., are divided into two categories according to the nature of the nodes: backbone nodes and lightweight nodes, and the manager nodes and corresponding keys are configured and generated to manage the list of legal devices. For the evaluation of the node behavior in the smart community system, a node behavior confidence evaluation mechanism is designed to ensure system security and reduce resource consumption.

[0085] Secondly, it should be noted that a node confidence calculation method is used. The present invention assigns a confidence value attribute Tr to the node device running on the blockchain-based smart community system. K . Based on the behavior of the node, this value will change dynamically according to the behavior of the node, including normal behavior and abnormal behavior. The node with normal behavior will continuously improve the confidence value, and the abnormal behavior of the attacked node will be the opposite. At the same time, the difficulty of proof of work will be linked to the confidence value, and the proof of work mechanism (POW) needs to be used for consensus verification after the transaction information block is submitted. This means that normal behavior nodes will consume less computing resources, and abnormal nodes will increase the attack computing overhead, which will prevent illegal intrusion.

[0086] Furthermore, there are two abnormal behaviors that may exist in the nodes: the first is lazy nodes, that is, such nodes only verify a fixed set of earlier transaction blocks each time, and do not verify newly submitted transaction blocks; the other is double-spending nodes, that is, before the previous block has completed consensus verification, the same identifier is used multiple times to perform transaction submission operations. Both of these will affect the security, stability and performance of the system. In addition, there are also external attacks. Protection against external attacks will be described in the following. Figure 8 The external attack identification part shown is introduced again.

[0087] The confidence value can be described as Tr K =η(δ1Tr K P +δ2Tr K N ), where δ1 and δ2 are penalty coefficient weights, which can adjust the normal part and the abnormal part (for example, if the positive part needs to have a greater impact, the value of δ1 can be appropriately increased). The normal and abnormal parts are Tr K P With Tr K N , η is the external attack identifier, which has only two possible values, 1 and -∞, that is, when an external attack occurs, the node will be directly isolated and will not participate in the consensus; the quantitative expression of the normal part is n K Indicates the number of times a node submits legal transaction information within the most recent unit time T, w a Represents the weight of the ath transaction. In order to ensure that the community active communication nodes in the system achieve the best performance optimization effect, that is, to ensure the speed of transaction submission while consuming the minimum computing energy, some inactive nodes need to be excluded. If a node a does not submit any community transaction information within a period of time T, it is considered that the node is inactive and may even be an untrustworthy node. Such nodes should be excluded to avoid computing resource consumption. Furthermore, the quantitative representation of the abnormal part is D K represents the number of abnormal behaviors of node K, t represents the current time, and t m It indicates the time when the mth abnormal behavior occurs, ε is the abnormal behavior penalty weight, which can be adjusted dynamically. By using the technical solution of the present invention, node behavior evaluation can be effectively performed to ensure system security and reduce resource consumption.

[0088] The security strategy of the present invention also includes:

[0089] A smart community master node device key issuance and message encryption and decryption implementation method that can effectively ensure data confidentiality in a transparent system without the need for any central verification or authorization server.

[0090] In this embodiment, it is necessary to explain the process of issuing and encrypting and decrypting the master node device key. Figure 5 As shown in the figure, it is the key issuance and encryption and decryption process. The following will use mathematical description to assist in explaining the security strategy: the manager and the community node device each hold a pair of public and private keys, represented as (PK A , S.K. A ) and (PK N , S.K. N ), the manager also holds a symmetric key SK O The symmetric key is generated only once. During the issuance and encryption and decryption process, a random value nonce is first appended to the sent data packet. a , which is used to control the computational complexity. The message first sent to the community node device can be expressed as Message1 = Encrypt PKN [sign SKO (TS1, nonce a )], where Encrypt means encryption, TS means timestamp, and Message means message. The public key of the destination device is used to encrypt the message, and then the community node device uses its own private key to decrypt it, obtains the administrator's symmetric key and random value, and returns the random value to the administrator. If the community node device returns the correct random value, it is considered that the device has correctly decrypted Message1; then, the community node device uses the symmetric key to send an encrypted message Message2 to the administrator, which is expressed as Message2=Encrypt SKO [sign SKN (nonce a ,TS2,nonce b )], finally, the manager sends Message3 to the community node device, which is represented by Message3=Encrypt SKO [sign SKA (nonce b , TS3)], decryption returns the random value nonce of the previous step b , that is, nonce b =Decrypt SKO (Message3), Decrypt is the decryption operation, thereby completing the final key distribution. Each time a node communicates, it will use the sender's key to sign (i.e., sign operation) to ensure that the received message will not be tampered with or damaged. The role of adding a timestamp (TS) is to ensure the immediacy of the message and to resist double-spending attacks. The technical solution proposed in the present invention can achieve the key distribution operation without any central trusted server, effectively ensuring the confidentiality of data in a transparent system.

[0091] like Figure 6 and Figure 7 As shown, the flowchart of the backbone node device key distribution of the present invention and the schematic diagram of the interaction between the manager node, the backbone node and the lightweight node are shown, and the specific steps include:

[0092] Step 1). The smart community backbone node device searches for the RPC port of the nearest available gateway for communication;

[0093] Step 2). Gateway device registration manager public key;

[0094] Step 3). Instantiate the gateway and set the manager, register the node devices and record their respective public key information;

[0095] Step 4). Distribute the administrator's symmetric key to each smart community node device;

[0096] Step 5). Verify and bind the transaction data using proof of work (POW);

[0097] Step 6). Submit community node device data to the blockchain.

[0098] Furthermore, in the attack protection described in the security strategy of the present invention, external attack identification is performed before the node behavior confidence is calculated, and a semantic-aware neural autoencoder is designed. In this step, Figure 8 As shown in FIG. 1 , a schematic diagram of the attack recognition semantic perception neural autoencoder of the present invention is shown. The bidirectional LSTM (Long Short-Term Memory Neural Network) and GCN (Graph Neural Network) are used to train the recognition network model. By recording the traffic information in the community system within a certain period of time, which must include legitimate network traffic and malicious attack traffic, TCP / UDP / HTTP, ports, frame formats, etc. are extracted from this information. The encoder includes the following components:

[0099] Component 1). Feature Embedding Representation:

[0100] This component extracts the data packets sent by the node network, parses and extracts the features related to attack identification, and labels them, such as TCP, frame, UDP, and port, etc., and encapsulates the information in a single data packet into a feature vector w i , a single feature is represented in a vector as x i , randomly initialize the feature embedding x re ∈R dw , the pre-trained feature embedding is denoted as x pe ∈R dw , the test set is x pos ∈R dp , randomly initialize the feature embedding to x le ∈R dl, during the training process, x pos With x le will be fine-tuned, while the pre-trained embedding remains unchanged, and the final feature representation is:

[0101] Where ° is the connection operation.

[0102] Component 2). Bidirectional LSTM network for a single feature representation in the input feature vector:

[0103] In this component, the input feature vector is first standardized using the formula: z represents the standardized scoring result, x represents the specific eigenvalue, μ represents the eigenvalue expectation, δ represents the eigenvalue standard deviation, and then the field is converted into a vector model as a feature input into the network. Formally, LSTM can be defined as the function LSTM θ (x 1:i ), which takes the sequence x 1:i Takes as input and returns the hidden layer state This state can be regarded as the representation of the feature from the beginning to position i, that is, the feature at position i and its left context are encoded. However, for attack identification, the left and right features have a certain temporal correlation, so a bidirectional LSTM is used, expressed as BiLSTM, one for forward transmission and the other for backward transmission, respectively defined as LSTM A With LSTM B , by merging the states of the two LSTMs, a complete context-aware representation of the features is created:

[0104]

[0105] Component 3). Improved semantic and edge-gated GCN network to enhance automatic prediction accuracy:

[0106] In this component, the output result of component 3 is used as the input of this component. The core of this component is a graph convolutional neural network. The network takes an undirected graph as the basic model. Considering the undirected graph G = (V, E), V and E represent the vertex edge set respectively. The node set representation and encoding information of the direct adjacent nodes of a node are as follows:

[0107]

[0108] Where ReLU is a rectified linear unit activation function, x represents the feature vector matrix, each column of which represents the encoding node feature, x μ is the one-hot encoding of the corresponding node, and N(v) represents the adjacent nodes of point v.

[0109] Then stack the k-layer GCN network, which is defined as follows:

[0110] When k = 0, That is, it represents the feature input.

[0111] This component improves the existing GCN network semantic representation, such as Fig. 9 As shown in Figure 1, it is a schematic diagram of the internal structure of semantic GCN. This component allows for reverse representation of features and the addition of semantic functions. Considering the graph G = (V, ξ), the semantic function L = (u, v) is defined. The semantic function is obtained based on the result of semantic dependency calculation in the attack identification corpus, where (u, v)∈ξ. Feature reversal is allowed. For example, if there are features (port: 8080, frame: content) and (frame: content, port: 80), the reverse feature is marked as (frame: content, port: 80)->subj′. If there is a self-loop, it is recorded as self. The semantic function and direction parameter are integrated into GCN, which is expressed as:

[0112]

[0113] However, this formalization represents a transition parameterization, and the influence of the semantic function on the weight is not very large, so let The semantic components of the bias term are retained, where dir(u, v) represents three states: direct pointing, reverse direction, and self-loop.

[0114] This component also adds an edge gating mechanism. Since not all adjacent nodes in the current GCN network are correct and semantic analysis is not completely reliable, there may be incorrect semantic edge representations within the network, so the weight needs to be increased or decreased. The directly pointing feature type should be given a higher weight, so the gate scalar of each edge needs to be calculated. The calculation method is as follows:

[0115]

[0116] Where σ is the logistic sigmoid function, Represent gate weights and bias terms respectively. The bidirectional LSTM network complements the improved GCN network, which can effectively process time series feature data, and at the same time enhance the correlation between some data with long time intervals, thus improving the accuracy of prediction.

[0117] Component 4). Attack type classifier, which takes GCN candidate parameter representation and type label as input to predict the corresponding attack method:

[0118] This component uses the softmax regression function to classify attack behaviors:

[0119] Probability calculation: t i , t p Generated by GCN, where W l,r is the weight matrix output by GCN.

[0120] After the automatic encoder model is generated, the traffic communication data of the smart community node devices is recorded in real time, and the features are extracted and input into the model to make accurate attack behavior judgments.

[0121] Although the above content describes the specific implementation method of the present invention in conjunction with the accompanying drawings, it is only a preferred embodiment of the present invention. Technical personnel in the relevant field should understand that any tampering, equivalence and deformation or modification made on the basis of the technical solution of the present invention without creative labor should be included in the scope of protection of the claims of the present invention.

Claims

1. A smart community system based on blockchain, characterized in that: The smart community system includes a basic unit and sensor node data acquisition equipment. The basic unit includes a security system, property, smart home and community hospital. The sensor nodes constitute a blockchain network. Each node collects transaction information of each user or community, encrypts and signs each transaction information, and performs data sharing, verification and consensus operations in the blockchain network until the transaction is finally processed and verified and synchronously written into the blockchain system. The smart community system also includes: Malicious node attack protection strategy module, internal communication nodes of smart community, including wireless community nodes and gateways, ordinary community nodes are divided into two categories according to the nature of the nodes: main nodes and lightweight nodes, and configured with keys corresponding to the generated manager nodes to manage legitimate sensor nodes; evaluate the node behavior in the smart community system, and design a node behavior confidence evaluation mechanism to ensure system security and reduce resource consumption; The malicious node attack protection strategy module includes an attack protection unit, which can effectively ensure the confidentiality of data in a transparent system without the need for any central verification or authorization server, and is a smart community master node device key issuance and message encryption and decryption implementation method; In the malicious node attack protection strategy module, the key issuance of the smart community master node device includes the following steps: Step 1). The smart community backbone node device searches for the nearest available gateway's RPC port for communication; Step 2). Gateway device registration manager public key; Step 3). Instantiate the gateway and set the manager, register the node devices and record their respective public key information; Step 4). Distribute the administrator's symmetric key to each smart community node device; Step 5). Verify and bind the transaction data using proof of work (POW). Step 6). Submit community node device data to the blockchain; In the attack protection unit, external attack identification is performed before node behavior confidence evaluation. A semantic-aware neural autoencoder is designed, including the following components: Feature embedding representation; A bidirectional LSTM network for a single feature representation in the input feature vector; Improved semantic and edge-gated GCN network to enhance automatic prediction accuracy; The attack type classifier takes the GCN candidate parameter representation and type label as input to predict the corresponding attack method.

2. The blockchain-based smart community system according to claim 1 is characterized in that: The blockchain network composed of the sensor nodes is divided into two categories: ordinary community nodes and block generation nodes. The block generation nodes are responsible for generating new blocks and adding them to the local blockchain network after consensus is reached on the new blocks. A consensus mechanism model with strong robustness, less time consumption and computing resources, and a community blockchain network performance optimization algorithm based on deep reinforcement learning are designed for dynamic selection of block generation nodes.

3. The blockchain-based smart community system according to claim 1 or 2, characterized in that: The smart home, as an important part of the smart community, is composed of the owners' houses in each community. Various types of smart sensor nodes are deployed inside the house, including security monitoring, smart set-top boxes, home appliances, home medical and environmental monitoring equipment, which can send and receive transaction information. In addition, it also includes a transaction chain based on the DAG structure and local CA institutions to collaborate with each other, and finally connect to the community blockchain main network.

Citation Information

Patent Citations

  • Smart community three-dimensional monitoring platform and method

    CN104281991A

  • An implementation method of a smart community and a node device

    CN109086622A

  • Distributed network attack detection and security measurement system and method based on block chain

    CN110120936A