Intelligent access control method, device and equipment based on P2P (Peer-to-Peer) communication and medium
By adopting blockchain intelligent contracts and deep enhanced learning models in the smart access control system, the problems such as NAT penetration, network environment adaptability and equipment compatibility in traditional P2P communication are solved, and more efficient, reliable and secure intelligence have been realized Cardiac control.
Patent Information
- Application Number
- CN202411543304.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-31
- Publication Date
- 2025-01-24
- Estimated Expiration
- 2044-10-31
AI Technical Summary
Traditional P2P communications face challenges such as NAT penetration, network environment adaptability and device compatibility in intelligent access control, resulting in inefficient communication reliability and efficiency.
Using blockchain-based smart contracts and deep reinforcement learning models, safe, reliable and efficient connections between devices are achieved through the decentralized management of the blockchain and the automated process of smart contracts. At the same time, deep reinforcement learning models are used to analyze the network environment and data flow in real time, and dynamically adjust communication paths to improve communication efficiency.
Improving the security, reliability and user experience of the smart access control system, reducing the dependence on the central server, enhancing the scalability and fault tolerance of the system, and achieving a faster and more stable NAT penetration.
Smart Images

Figure CN119360492A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of access control intelligent control, and in particular to an intelligent access control method, device, equipment and medium based on P2P communication. Background Art
[0002] P2P communication is a network architecture in which each participant (node) can communicate directly with other nodes without relying on an intermediate server or centralized control point. The application of this method in intelligent access control can bring higher flexibility, reliability and security.
[0003] Communications have significant advantages in smart access control, but also face some challenges: NAT penetration: One of the main problems faced by P2P communication in actual deployment is NAT penetration, that is, how to enable devices in different private networks to communicate directly. Traditional P2P networks need to use technologies such as STUN, TURN or UPNP to solve this problem.
[0004] Network environment adaptability: Since P2P communication depends on the network environment of each node, the reliability and efficiency of communication may be affected when the network is unstable or the bandwidth is limited.
[0005] Device compatibility: In actual deployment, the compatibility and interoperability between different access control devices is an issue that needs to be addressed. Since P2P communication protocols and implementation methods may differ, the interconnection between different devices may require additional protocol adaptation and standardization work; Traditional access control systems usually rely on centralized servers for data processing, which may cause network delays and slow response speeds; Existing access control systems often rely on traditional databases for data storage and authentication, which are vulnerable to data tampering and centralization risks; In traditional P2P communication, NAT penetration is a complex and unstable process that usually relies on a fixed path selection strategy. Summary of the invention
[0006] In order to solve one of the above technical problems, a method, device, equipment and medium for intelligent access control based on P2P communication are provided. By optimizing P2P communication technology, a more secure, reliable and efficient intelligent access control method is designed. This solution solves the challenges of NAT penetration, network environment adaptability and device compatibility of traditional P2P access control systems, while improving the overall performance of the access control system and the accuracy of user experience.
[0007] In order to achieve the above purpose, the technical solution adopted by the present invention is: Part 1: An intelligent access control method based on P2P communication, including: Obtain user authentication data, register the access control device according to the user authentication data, generate a unique node for each access control device, perform node discovery of the access control device based on the smart contract node discovery of the blockchain, and when a new access control device sends a connection request, the access control device compares its own hash value with the hash value of the existing node in the network; Based on a deep reinforcement learning model, the network environment and data flow are analyzed in real time to determine the path with the best communication quality. The deep reinforcement learning model analyzes the TTL (time to live) information and delay information of the data packet and determines the shortest network connection path according to the current network environment and data flow; A traffic prediction model is constructed based on a long short-term memory network. The traffic prediction model predicts future traffic based on the historical traffic data in the access control device system and sets a threshold. When the system detects a difference between the current data traffic value and the predicted data traffic value When the set threshold is exceeded, an abnormal alarm is triggered; According to the abnormal alarm, the user authentication data is analyzed based on the random forest algorithm to output the access permission level, and the edge computing node of the system runs a deep learning model to process the business data flow between the access control devices; According to the edge computing node, the hardware and communication link status of the access control device are monitored in real time, and several edge computing nodes all run the K-means clustering algorithm. The K-means clustering algorithm divides the real-time monitored data into normal and abnormal categories. When an abnormal situation is detected, the edge computing node will generate an event report; based on the clustering results of the K-means clustering algorithm, the system locates the source of the fault and starts the self-healing mechanism.
[0008] When the system detects a failure in which an event report is generated by an edge computing node, the blockchain's smart contract initiates a self-healing mechanism and records the status and log data of each node in real time in the blockchain.
[0009] Preferably, the acquisition of user identity authentication data includes facial recognition and user behavior, specifically including: Collecting facial images through a camera, processing the facial images based on a convolutional neural network model, converting the facial images into facial feature vectors, analyzing user behaviors based on a support vector machine model, and extracting behavioral feature vectors to generate behavioral classification results; Based on the facial feature vector, at each access request by the user, the system of the access control device runs the convolutional neural network model again through the image captured by the real-time camera to match the captured image with the stored facial feature vector; Calculate the similarity score using the Euclidean distance according to the matching algorithm, and allow access when the score is below a predetermined threshold, and restrict access when the score is above the predetermined threshold; Identity authentication is strengthened based on the behavior classification results. If the user's gait or habitual movements are obviously different from the user's daily behavior habits, access will be retried after a random delay.
[0010] Preferably, the registration information of the access control device registered according to the user identity authentication data specifically includes: device ID, registration time, owner information, and the generated registration information is encrypted and stored on the blockchain; Each access control device generates a unique node, which is generated based on the hardware information and timestamp of the device according to the SHA-256 hash algorithm; When a new access control device sends a connection request, the access control device compares its own hash value with the hash value of the existing node in the network. The smart contract is responsible for verifying the hash value. By comparing the hash value generated by the new access control device with the hash value stored in the blockchain, the new device is allowed to join the network after confirming the consistency.
[0011] Preferably, the determining of the path with the best communication quality specifically includes: the deep reinforcement learning model selects the communication path through a Markov decision model, and determines the path with the best communication quality according to a state transition probability matrix and an instant reward matrix, wherein the Markov decision model includes a state space action space reward function; The determining of the shortest network connection path specifically includes: the deep reinforcement learning model determines the shortest network connection path according to the current network environment and data flow in combination with NAT penetration technology, and the NAT penetration technology includes any one of STUN, TURN or ICE.
[0012] Preferably, the flow prediction model is constructed based on the long short-term memory network, and the flow prediction model predicts the future flow based on the historical flow data in the system of the access control device, and sets a threshold. When the system detects the difference between the current data flow value and the predicted data flow value When the set threshold is exceeded, an abnormal alarm is triggered, including: Build a traffic prediction model based on LSTM network and use historical traffic data values Forecast data traffic value , the formula is: ; in, is the time step, For the past Historical traffic data of the steps; Traffic anomaly detection based on predicted data traffic values and current data traffic value The difference between , the formula is: ; when When the set threshold is exceeded, an abnormal alarm is triggered.
[0013] Preferably, an edge computing model is constructed based on the edge computing node, and the edge computing model includes edge node processing and edge intelligent optimization.
[0014] Preferably, the edge computing node monitors the hardware and communication link status of the access control device in real time, and several edge computing nodes all run a K-means clustering algorithm, which divides the real-time monitored data into normal and abnormal categories. When an abnormal situation is detected, the edge computing node generates an event report, which specifically includes: The K-means clustering algorithm clusters the real-time monitoring data into normal and abnormal classes to identify potential faults; When new data does not conform to the existing clustering, it is considered a fault; The edge computing node determines whether the new data belongs to a normal cluster or an abnormal cluster by calculating the distance from each data point to the cluster center; When an abnormal cluster situation is detected, the edge computing node generates an event report.
[0015] Part II: An intelligent access control device based on P2P communication, comprising: An acquisition module is used to register the access control device according to the user identity authentication data, each of the access control devices generates a unique node, and the node discovery of the access control device is performed based on the smart contract node discovery of the blockchain. When a new access control device sends a connection request, the access control device compares its own hash value with the hash value of the existing node in the network; A path selection module is used to analyze the network environment and data flow in real time and determine the path with the best communication quality. The deep reinforcement learning model analyzes the TTL (time to live) information and delay information of the data packet and determines the shortest network connection path according to the current network environment and data flow; The prediction module is used for the traffic prediction model to predict the future traffic based on the historical traffic data in the system of the access control device and set a threshold. When the system detects a difference between the current data traffic value and the predicted data traffic value When the set threshold is exceeded, an abnormal alarm is triggered; An exception handling module is used to analyze the user authentication data based on the random forest algorithm according to the exception alarm, output the access permission level, and the edge computing node of the system runs a deep learning model to process the business data flow between the access control devices; A fault detection module is used to monitor the hardware and communication link status of the access control device in real time according to the edge computing node, and several edge computing nodes all run the K-means clustering algorithm, which divides the real-time monitored data into normal and abnormal categories. When an abnormal situation is detected, the edge computing node will generate an event report; based on the clustering results of the K-means clustering algorithm, the system locates the source of the fault and starts the self-healing mechanism; The self-healing module is used to activate the self-healing mechanism of the smart contract of the blockchain when the system detects a fault in which an event report is generated by an edge computing node, and the status and log data of each node are recorded in real time in the blockchain.
[0016] Compared with the prior art, the present invention has the following beneficial effects: The present invention proposes an intelligent access control method based on P2P communication. 1. Edge computing nodes can quickly identify and respond to potential security threats, such as abnormal traffic or unauthorized access, by processing and analyzing data in real time. This approach not only reduces dependence on central servers, but also improves the scalability and fault tolerance of the system, allowing data processing to be performed in real time close to the data source, thereby greatly improving the system's response speed and reliability; Second, blockchain is also used for automatic fault detection and self-healing mechanisms between devices. It automatically triggers fault handling processes through smart contracts, significantly improving the reliability and automation level of the system. This decentralized management method reduces the risk of single point failures and improves the security of the overall system. It uses blockchain technology for decentralized data storage and identity authentication, ensuring the integrity and immutability of data. 3. The use of the DRL algorithm enables the system to dynamically adjust the communication path according to the real-time network status and historical data, thereby achieving faster and more stable NAT penetration. This intelligent path selection improves communication efficiency, especially in complex network environments. The deep reinforcement learning (DRL) algorithm dynamically selects the optimal path, solving the problem of fixed paths and slow responses in traditional methods. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] Figure 1 It is a flow chart of an intelligent access control method based on P2P communication; Figure 2It is a module diagram of an intelligent access control device based on P2P communication; Figure 3 It is a schematic diagram of the structure of the electronic device of the present invention; Figure 4 It is a schematic diagram of the computer-readable storage medium structure of the present invention. DETAILED DESCRIPTION
[0018] The following description is used to disclose the present invention so that those skilled in the art can implement the present invention. The preferred embodiments described below are only examples, and those skilled in the art may think of other obvious variations.
[0019] 1. STUN(Simple Traversal of UDP Through NATs) Introduction: STUN, the full name is Simple Traversal of UDP Through NATs, which means simply using UDP to penetrate NAT. It is a lightweight protocol mainly used for UDP to penetrate NAT. STUN allows applications to discover the NAT and firewalls between them and the public Internet, and determine the public IP addresses and port numbers assigned to them by NAT.
[0020] Working principle: The application (STUN CLIENT) sends a UDP request to the STUN SERVER outside the NAT to inquire about its own translated address.
[0021] After receiving the request, the STUN SERVER generates a response message, which carries the source port of the request message, that is, the external port corresponding to the STUN CLIENT on the NAT.
[0022] The response message is sent to the STUN CLIENT through NAT. The CLI learns its corresponding external address on NAT through the content in the response message body, and fills it into the UDP payload of the subsequent call protocol to inform the other end.
[0023] 2. TURN (Traversal Using Relays around NAT) Introduction: TURN, the full name of which is Traversal Using Relays around NAT, is an extension of STUN. It assigns the address and port of TURN Server as the external receiving address and port of the client, that is, all messages sent by private network users must be forwarded by TURN Server through Relay.
[0024] Working principle: Similar to STUN, but TURN achieves penetration through a "middleman" approach between two parties.
[0025] The message sent by the private network user is first sent to the TURN Server, and then forwarded by the TURN Server to the target user.
[0026] 3. ICE (Interactive Connectivity Establishment) Introduction: ICE, the full name of which is Interactive Connectivity Establishment, is not a protocol, but a framework that integrates multiple technologies such as STUN and TURN to achieve NAT penetration and P2P connection.
[0027] Working principle: ICE first tries to use the most direct communication method (such as a direct P2P connection), and if that fails, it tries to use STUN to discover the address and port behind the NAT.
[0028] If STUN also fails to establish a connection, TURN is used as a relay to achieve communication.
[0029] Embodiment 1: Reference Figure 1 As shown, an intelligent access control method based on P2P communication includes: Obtain user authentication data, register the access control device according to the user authentication data, generate a unique node for each access control device, perform node discovery of the access control device based on the smart contract node discovery of the blockchain, and when a new access control device sends a connection request, the access control device compares its own hash value with the hash value of the existing node in the network; Specifically include: Collecting facial images through a camera, processing the facial images based on a convolutional neural network model, converting the facial images into facial feature vectors, analyzing user behaviors based on a support vector machine model, and extracting behavioral feature vectors to generate behavioral classification results; Based on the facial feature vector, at each access request by the user, the system of the access control device runs the convolutional neural network model again through the image captured by the real-time camera to match the captured image with the stored facial feature vector; The similarity score is calculated using the Euclidean distance according to the matching algorithm. When the score is lower than a predetermined threshold, access is allowed, and when the score is higher than the predetermined threshold, access is restricted. The user behavior includes the user's gait and habitual movements.
[0030] Identity authentication is strengthened based on the behavior classification results. If the user's gait or habitual movements are obviously different from the user's daily behavior habits, access will be retried after a random delay.
[0031] The matching algorithm uses the Euclidean distance to calculate the similarity score, the formula is: ; Convolutional neural network is used to extract facial feature vectors , based on support vector machine for extracting behavioral feature vectors , certification score; The score calculation formula is: ; in, is the input user face image, It is the user behavior characteristic data. and is the weight coefficient.
[0032] Use the support vector machine model to analyze user behaviors (such as gait, habitual movements, etc.). These behavioral features are captured in real time by sensors of smart devices (such as accelerometers, gyroscopes, etc.) and transmitted to the support vector machine model; The model inputs these features to generate behavior classification results, which are used to further strengthen identity authentication. The decision boundary formula of SVM classifier is: ; in, is the weight vector, is the input vector, is the deviation term; Specifically, the registration information of the access control device registered according to the user identity authentication data includes: device ID, registration time, owner information, and the generated registration information is encrypted and stored on the blockchain to ensure the non-tamperability and decentralized management of the information; Each access control device generates a unique node, which is generated based on the hardware information and timestamp of the device according to the SHA-256 hash algorithm; Smart contracts automate the device’s node discovery process, ensuring new devices connect securely and seamlessly when joining the network; When a new access control device sends a connection request, the access control device compares its own hash value with the hash value of the existing node in the network. The smart contract is responsible for verifying the hash value to determine the legitimacy and security of the new node. By comparing the hash value generated by the new access control device with the hash value stored in the blockchain, the new device is allowed to join the network after confirming the consistency; Each device has a unique node ID, represented by and registration information through a hash function After encryption, it is recorded in the blockchain to ensure that the data cannot be tampered with; Generated by SHA-256 hash algorithm: Hash algorithm formula: ; Matching verification logic: The smart contract compares the hash value generated by the new device The hash value stored in the blockchain , only after ensuring consistency can new devices be allowed to join the network. Judgment condition formula: ; If the match is successful, the contract will issue a joining certificate for the new device, allowing it to register as a node in the P2P network.
[0033] Based on a deep reinforcement learning model, the network environment and data flow are analyzed in real time to determine the path with the best communication quality. The deep reinforcement learning model analyzes the TTL (time to live) information and delay information of the data packet and determines the shortest network connection path according to the current network environment and data flow; Specifically, the determining of the path with the best communication quality specifically includes: the deep reinforcement learning model selects the communication path through a Markov decision model, and determines the path with the best communication quality according to a state transition probability matrix and an immediate reward matrix, the Markov decision model including a state space action space reward function; Using the state transition probability matrix and the instant reward matrix R to determine the optimal strategy : ; in, is the current state, Choose for action, Status The value function of Other embodiments include but are not limited to: The Markov decision process (MDP) is used to model the communication channel selection problem, ensuring that the best communication path is selected under any given network state. The MDP model consists of the following elements: State Space : Current network environment information, such as delay, bandwidth, packet loss rate, etc.
[0034] Action Space A: Communication channels or technologies that can be selected, such as different NAT traversal methods.
[0035] Reward Matrix : In state The immediate reward obtained by choosing action a.
[0036] Transition probability matrix : The probability of transitioning from state s to state s' after taking action a.
[0037] Optimal strategy The calculation of is based on the following Bellman equation: ; Optimal strategy It is to choose the action that can maximize the long-term benefits under given conditions; The reinforcement learning model optimizes decisions by continuously trying different paths during training. The goal of the algorithm is to find the path that can provide the best communication quality within a given time. The loss function of the DRL model is defined as: ; in, is the discount factor used to measure the weight of future rewards, represents the immediate reward obtained at time t (such as data transmission rate, packet loss rate, delay, etc.); The determining of the shortest network connection path specifically includes: the deep reinforcement learning model determines the shortest network connection path according to the current network environment and data flow in combination with NAT penetration technology, and the NAT penetration technology includes any one of STUN, TURN or ICE.
[0038] A traffic prediction model is constructed based on a long short-term memory network. The traffic prediction model predicts future traffic based on the historical traffic data in the access control device system and sets a threshold. When the system detects a difference between the current data traffic value and the predicted data traffic value When the set threshold is exceeded, an abnormal alarm is triggered; Specifically include: A traffic prediction model is built based on the LSTM network. The data traffic in the access control system is predicted through the LSTM (Long Short-Term Memory Network Model), so as to dynamically adjust resource allocation. LSTM can capture long-term dependencies in time series, so as to accurately predict future traffic.
[0039] The output formula of LSTM is: ; in, is the weight matrix, is the bias term, is the activation function.
[0040] When the system detects that the difference between the current flow and the predicted flow exceeds the set threshold, an abnormal alarm will be triggered; Specific: Using historical traffic data values Forecast data traffic value , the formula is: ; in, is the time step, For the past Historical traffic data of the steps; Traffic anomaly detection based on predicted data traffic values and current data traffic value The difference between , the formula is: ; when When the set threshold is exceeded, an abnormal alarm is triggered.
[0041] According to the abnormal alarm, the user authentication data is analyzed based on the random forest algorithm to output the access permission level, and the edge computing node of the system runs a deep learning model to process the business data flow between the access control devices; According to the abnormal alarm, the user identity information data is analyzed based on the random forest algorithm. Analyze and output the access permission level Access Level, and the edge computing node of the system runs a deep learning model to process the business data flow between the access control devices; The user's behavioral characteristics are analyzed through the random forest algorithm to determine their access rights. Random forest is an integrated model built based on multiple decision trees, which can efficiently process large-scale data and provide high prediction accuracy.
[0042] The authority level is determined based on the following formula: Access Level ; in, It includes the user's behavioral characteristics (such as facial recognition results, behavior patterns, etc.), and each tree makes decisions independently, and finally the optimal permission level is determined by voting; The edge computing nodes in the system can independently run deep learning models (such as CNN) to process business data flows between devices. When abnormal traffic patterns or potential security threats are detected, the edge nodes will immediately start the linkage mechanism to notify other related nodes to take corresponding protection measures.
[0043] ; in, is the input business flow data, Feature data extracted by CNN for subsequent anomaly detection and decision making; Specifically, an edge computing model is constructed based on the edge computing node, and the edge computing model includes edge node processing and edge intelligent optimization; Edge computing model: The edge computing model uses the computing power of access points to process data at the edge of the network, thereby reducing transmission delays and improving response speed.
[0044] Edge node processing: At the edge nodes, high-precision positioning is performed using the signal arrival time difference; Edge intelligence optimization: To further improve positioning accuracy, edge nodes can use machine learning algorithms, such as gradient boosted decision trees (GBDT) or convolutional neural networks (CNN), to analyze historical and real-time data to predict and optimize the user's location.
[0045] According to the edge computing node, the hardware and communication link status of the access control device are monitored in real time, and several edge computing nodes all run the K-means clustering algorithm. The K-means clustering algorithm divides the real-time monitored data into normal and abnormal categories. When an abnormal situation is detected, the edge computing node will generate an event report; based on the clustering results of the K-means clustering algorithm, the system locates the source of the fault and starts the self-healing mechanism.
[0046] When the system detects a failure in which an event report is generated by an edge computing node, the blockchain's smart contract initiates a self-healing mechanism and records the status and log data of each node in real time in the blockchain.
[0047] Each edge computing node runs a -means clustering algorithm is used to detect abnormal situations. For example, it monitors changes in key parameters such as network latency, bandwidth usage, and packet loss rate.
[0048] The K-means clustering algorithm is used to classify real-time monitoring data into two categories: normal and abnormal: ; in, represents all data points, For a single data point, For clusters, is the center of the cluster.
[0049] Self-healing mechanism: When a fault is reported by an edge computing node, the blockchain smart contract will automatically start the self-healing mechanism. The status and log data of each node are recorded in real time in the blockchain to ensure that all fault information can be traced and verified.
[0050] The smart contract in the blockchain will select the appropriate repair strategy based on the type and scope of the fault, for example, reallocating communication paths, adjusting resource allocation, or triggering the startup of backup devices.
[0051] The selection of self-healing strategy is based on a multi-level decision tree model: The decision tree model makes decisions based on multiple dimensions, such as the impact scope of the fault (local fault, whole network fault), type (hardware fault, network fault), etc.
[0052] The decision tree formula is: ; in, is the input feature vector, is the leaf node of the decision tree, The node repair strategy.
[0053] Self-healing execution: When the decision tree determines the self-healing strategy, the system calls the relevant repair modules through the smart contract. These modules can include automatically restarting the device, switching to a backup communication link, or notifying the operation and maintenance personnel for manual intervention.
[0054] Adaptive learning and model updating: The system automatically adjusts and optimizes fault detection and self-healing strategies by regularly analyzing log data on the blockchain. Using reinforcement learning algorithms, the system can improve its decision-making model in continuous practice to adapt it to changing network environments and device performance.
[0055] The reward function for reinforcement learning is defined as: ; in, is the discount factor, For time The system optimizes its self-healing mechanism by maximizing long-term rewards.
[0056] Specifically, the edge computing node monitors the hardware and communication link status of the access control device in real time, and several edge computing nodes run the K-means clustering algorithm, which divides the real-time monitored data into normal and abnormal categories. When an abnormal situation is detected, the edge computing node generates an event report, which specifically includes: The K-means clustering algorithm clusters the real-time monitoring data into normal and abnormal classes to identify potential faults; When new data does not conform to the existing clustering, it is considered a fault; The edge computing node determines whether the new data belongs to a normal cluster or an abnormal cluster by calculating the distance from each data point to the cluster center; When an abnormal cluster situation is detected, the edge computing node generates an event report.
[0057] Embodiment 2: Based on the first embodiment, the present invention also includes an enhanced privacy and security protection mechanism to ensure the security of location information during transmission and storage, specifically including: Data protection based on homomorphic encryption: During P2P communication, all sensitive data is encrypted, transmitted and processed using homomorphic encryption. This encryption method allows calculations to be performed while the data remains encrypted, ensuring that data privacy is not leaked due to calculations.
[0058] The core formula of homomorphic encryption is: ; in, and The encrypted data can be directly multiplied, and the result is equivalent to multiplying the original data and then encrypting it.
[0059] The system uses blockchain technology to ensure that data cannot be tampered with and provides transparent auditing of data access. Each access and operation record is stored in an encrypted manner on the blockchain to ensure that only authorized users or devices can access specific data.
[0060] Role-Based Access Control (RBAC) Model: The system uses the RBAC model to manage and limit the access rights of different roles to data.
[0061] The decision function for access control is: ; in, Indicates the role of a user or device. Represents a set of access permissions for specific data.
[0062] The system detects potential cyber attacks or abnormal behaviors by training a deep neural network (DNN) model, which can identify possible threat signals by learning patterns in large-scale data sets.
[0063] The output formula of DNN is: ; in, is the weight matrix, is the input feature vector, is the bias vector, By monitoring abnormal traffic patterns, illegal access attempts, etc., the system can detect and respond to threats in a timely manner.
[0064] In P2P communications across different network domains, the system uses multi-factor authentication (MFA) to ensure the authenticity of user identities. This includes biometrics (such as fingerprints, facial recognition), passwords, and dynamic passwords.
[0065] The MFA authentication process is based on the following formula: ; in, It is a combination function that integrates different authentication factors to obtain the final authentication result.
[0066] To prevent data from being maliciously tampered with or damaged during transmission, the system hashes each data packet before transmission and appends the hash value to the packet.
[0067] At the receiving end, the system recalculates the hash value of the data and compares it with the attached hash value to ensure the integrity of the data.
[0068] The formula for data integrity verification is: ; If data inconsistency or integrity damage is detected, the system will automatically trigger a rollback mechanism to restore to the previous valid state, ensuring business continuity and reliability.
[0069] Embodiment three: Reference Figure 2 As shown, an intelligent access control device based on P2P communication includes: An acquisition module is used to register the access control device according to the user identity authentication data, each of the access control devices generates a unique node, and the node discovery of the access control device is performed based on the smart contract node discovery of the blockchain. When a new access control device sends a connection request, the access control device compares its own hash value with the hash value of the existing node in the network; A path selection module is used to analyze the network environment and data flow in real time and determine the path with the best communication quality. The deep reinforcement learning model analyzes the TTL (time to live) information and delay information of the data packet and determines the shortest network connection path according to the current network environment and data flow; The prediction module is used for the traffic prediction model to predict the future traffic based on the historical traffic data in the system of the access control device and set a threshold. When the system detects a difference between the current data traffic value and the predicted data traffic value When the set threshold is exceeded, an abnormal alarm is triggered; An exception handling module is used to analyze the user authentication data based on the random forest algorithm according to the exception alarm, output the access permission level, and the edge computing node of the system runs a deep learning model to process the business data flow between the access control devices; A fault detection module is used to monitor the hardware and communication link status of the access control device in real time according to the edge computing node, and several edge computing nodes all run the K-means clustering algorithm, which divides the real-time monitored data into normal and abnormal categories. When an abnormal situation is detected, the edge computing node will generate an event report; based on the clustering results of the K-means clustering algorithm, the system locates the source of the fault and starts the self-healing mechanism; The self-healing module is used to activate the self-healing mechanism of the smart contract of the blockchain when the system detects a fault in which an event report is generated by an edge computing node, and the status and log data of each node are recorded in real time in the blockchain.
[0070] The foregoing Figure 1 The various variations and specific examples of an intelligent access control method based on P2P communication in Example 1 are also applicable to an intelligent access control device based on P2P communication in this embodiment. Through the above detailed description of an intelligent access control method based on P2P communication, those skilled in the art can clearly know the implementation method of an intelligent access control device based on P2P communication in this embodiment, so for the sake of brevity of the specification, it will not be described in detail here.
[0071] Furthermore, the method or system according to the embodiment of the present application can also be Figure 3 The electronic device architecture shown in FIG. Figure 3As shown, the electronic device 500 may include a bus 501, one or more CPUs 502, a read-only memory (ROM) 503, a random access memory (RAM) 504, a communication port 505 connected to a network, an input / output component 506, a hard disk 507, etc. The storage device in the electronic device 500, such as the ROM 503 or the hard disk 507, may store a smart access control method based on P2P communication provided in the present application. The electronic device 500 may also include a user interface 508. Of course, Figure 3 The architecture shown is only exemplary and can be omitted according to actual needs when implementing different devices. Figure 3 One or more components of an electronic device are shown.
[0072] Figure 4 Schematic diagram of a computer-readable storage medium structure provided by an embodiment of the present application. Figure 4 As shown, a computer-readable storage medium 600 according to an embodiment of the present application is shown. Computer-readable instructions are stored on the computer-readable storage medium 600. When the computer-readable instructions are executed by the processor, the path planning method according to the embodiment of the present application described with reference to the above figures can be executed. The storage medium 600 includes, but is not limited to, for example, volatile memory and / or non-volatile memory. Volatile memory may include, for example, random access memory (RAM) and cache memory (cache), etc. Non-volatile memory may include, for example, read-only memory (ROM), hard disk, flash memory, etc.
[0073] The methods, apparatuses, and devices of the present application may be implemented in many ways. For example, the methods, apparatuses, and devices of the present application may be implemented by software, hardware, firmware, or any combination of software, hardware, and firmware. The above order of steps for the method is for illustration only, and the steps of the method of the present application are not limited to the order specifically described above unless otherwise specified. In addition, in some embodiments, the present application may also be implemented as programs recorded in a recording medium, which include machine-readable instructions for implementing the method according to the present application. Therefore, the present application also covers recording media storing programs for executing the method according to the present application.
[0074] The above shows and describes the basic principles, main features and advantages of the present invention. Those skilled in the art should understand that the present invention is not limited to the above embodiments. The above embodiments and descriptions only describe the principles of the present invention. The present invention may be subject to various changes and improvements without departing from the spirit and scope of the present invention. These changes and improvements fall within the scope of the present invention. The scope of protection claimed by the present invention is defined by the attached claims and their equivalents.
Claims
1. An intelligent access control method based on P2P communication, characterized in that: include: Obtain user authentication data, register access control devices based on the user authentication data, generate a unique node for each access control device, and perform node discovery for the access control device based on the blockchain smart contract node discovery. When a new access control device sends a connection request, the access control device compares its own hash value with the hash values of existing nodes in the network; Based on a deep reinforcement learning model, the network environment and data flow are analyzed in real time to determine the path with the best communication quality. The deep reinforcement learning model analyzes the TTL (time to live) information and latency information of the data packet and determines the shortest network connection path based on the current network environment and data flow; A traffic prediction model is constructed based on a long short-term memory network. The traffic prediction model predicts future traffic based on the historical traffic data in the access control system and sets a threshold. When the system detects a difference between the current data traffic value and the predicted data traffic value, When the set threshold is exceeded, an abnormal alarm is triggered; According to the abnormal alarm, the user authentication data is analyzed based on the random forest algorithm to output the access permission level, and the edge computing node of the system runs a deep learning model to process the business data flow between the access control devices; According to the edge computing node, the hardware and communication link status of the access control device are monitored in real time, and several edge computing nodes all run the K-means clustering algorithm. The K-means clustering algorithm divides the real-time monitored data into normal and abnormal categories. When an abnormal situation is detected, the edge computing node will generate an event report; based on the clustering results of the K-means clustering algorithm, the system locates the source of the fault and starts the self-healing mechanism. When the system detects a failure resulting from an event report generated by an edge computing node, the blockchain’s smart contract activates a self-healing mechanism and records the status and log data of each node in real time in the blockchain.
2. The intelligent access control method based on P2P communication according to claim 1, characterized in that: The acquisition of user identity authentication data includes facial recognition and user behavior, specifically including: Facial images are captured through a camera, processed based on a convolutional neural network model, converted into facial feature vectors, and user behavior is analyzed based on a support vector machine model. The support vector machine model extracts the behavior feature vectors and generates a behavior classification result; Based on the facial feature vector, each time a user requests access, the access control device system runs the convolutional neural network model again through the image captured by the real-time camera to match the captured image with the stored facial feature vector; Calculate a similarity score using Euclidean distance according to a matching algorithm, and allow access when the score is below a predetermined threshold, and restrict access when the score is above the predetermined threshold; Identity authentication is strengthened based on the behavior classification results.
3. The intelligent access control method based on P2P communication according to claim 2, characterized in that: The registration information of the access control device registered according to the user identity authentication data; specifically including: device ID, registration time, owner information, and the generated registration information is encrypted and stored on the blockchain; Each access control device generates a unique node, which is generated based on the device's hardware information and timestamp using the SHA-256 hash algorithm; When a new access control device sends a connection request, the access control device compares its own hash value with the hash values of existing nodes in the network. The smart contract is responsible for verifying the hash value. By comparing the hash value generated by the new access control device with the hash value stored in the blockchain, the new device is allowed to join the network after confirming the consistency.
4. The intelligent access control method based on P2P communication according to claim 1, characterized in that: Determining the path of optimal communication quality specifically includes: the deep reinforcement learning model selects the communication path through a Markov decision model, and determines the path of optimal communication quality based on a state transition probability matrix and an immediate reward matrix, wherein the Markov decision model includes a state-space action-space reward function; The determining of the shortest network connection path specifically includes: the deep reinforcement learning model determines the shortest network connection path based on the current network environment and data flow in combination with NAT penetration technology, and the NAT penetration technology includes any one of STUN, TURN or ICE.
5. The intelligent access control method based on P2P communication according to claim 1, characterized in that: The traffic prediction model is constructed based on the long short-term memory network. The traffic prediction model predicts the future traffic based on the historical traffic data in the access control device system and sets a threshold. When the system detects the difference between the current data traffic value and the predicted data traffic value When the set threshold is exceeded, an abnormal alarm is triggered, including: Build a traffic prediction model based on LSTM network and use historical traffic data values Predicted data traffic value , the formula is: ; in, is the time step, For the past Historical traffic data of the steps; Traffic anomaly detection based on predicted data traffic values and current data traffic value The difference between , the formula is: ; when When the set threshold is exceeded, an abnormal alarm is triggered.
6. The intelligent access control method based on P2P communication according to claim 1, characterized in that: An edge computing model is constructed based on the edge computing node, and the edge computing model includes edge node processing and edge intelligent optimization.
7. The intelligent access control method based on P2P communication according to claim 1, characterized in that: The edge computing nodes monitor the hardware and communication link status of the access control device in real time, and several edge computing nodes run the K-means clustering algorithm. The K-means clustering algorithm divides the real-time monitored data into normal and abnormal categories. When an abnormal situation is detected, the edge computing node generates an event report, which specifically includes: The K-means clustering algorithm clusters the real-time monitoring data into normal and abnormal classes to identify potential faults; When new data does not conform to the existing clustering, it is considered a fault; The edge computing node determines whether the new data belongs to a normal cluster or an abnormal cluster by calculating the distance between each data point and the cluster center; When an abnormal cluster situation is detected, the edge computing node generates an event report.
8. The intelligent access control device based on P2P communication according to claim 1, applied to the intelligent access control method based on P2P communication according to any one of 1 to 7, characterized in that: include: An acquisition module is used to register access control devices based on the user identity authentication data, generate a unique node for each access control device, and perform node discovery of the access control device based on the smart contract node discovery of the blockchain. When a new access control device sends a connection request, the access control device compares its own hash value with the hash values of existing nodes in the network; A path selection module is used to analyze the network environment and data flow in real time to determine the path with the best communication quality. The deep reinforcement learning model analyzes the TTL (time to live) information and delay information of the data packet to determine the shortest network connection path based on the current network environment and data flow; The prediction module is used for the traffic prediction model to predict the future traffic based on the historical traffic data in the system of the access control device and set a threshold. When the system detects a difference between the current data traffic value and the predicted data traffic value When the set threshold is exceeded, an abnormal alarm is triggered; An exception handling module is used to analyze user authentication data based on the abnormal alarm and the random forest algorithm to output the access permission level. The edge computing node of the system runs a deep learning model to process the business data flow between the access control devices; A fault detection module is used to monitor the hardware and communication link status of the access control device in real time based on the edge computing nodes. Several edge computing nodes run a K-means clustering algorithm, which divides the real-time monitored data into normal and abnormal categories. When an abnormal situation is detected, the edge computing node generates an event report. Based on the clustering results of the K-means clustering algorithm, the system locates the source of the fault and initiates a self-healing mechanism. The self-healing module is used to activate the self-healing mechanism of the blockchain smart contract when the system detects a fault generated by an event report generated by an edge computing node, and record the status and log data of each node in real time in the blockchain.
9. An electronic device, characterized in that: include: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the intelligent access control method based on P2P communication as described in any one of claims 1-7.
10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the intelligent access control method based on P2P communication according to any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Data collaboration method and electronic device
CN109495592A
Intelligent management and control method for power distribution station building
CN111654103A
Block chain fault processing method, device and equipment
CN114327973A
Decentralized fine-grained privacy protection crowdsourcing task matching method and matching system
CN116662827A
Network communication path optimal planning method based on improved ant colony algorithm
CN116846810A