Block chain node communication method and device
By using the mechanism of identity certificates and attribute certificates in blockchain node communication, flexible control of the permissions of the communication initiator is achieved, solving the flexibility problem of permission management in the blockchain network, and improving security and communication efficiency.
Patent Information
- Application Number
- CN202410719260.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-04
- Publication Date
- 2024-09-06
AI Technical Summary
In blockchain technology, how to flexibly control the authority of the communication initiator during the communication process is difficult to effectively solve with existing technology.
The communication initiator sends the identity certificate and requests the attribute certificate to the target node. The target node issues the corresponding attribute certificate based on the identity certificate. The communication initiator carries the attribute certificate to communicate with the target node, and performs encrypted transmission and validity time verification when necessary. The behavior model management module is used for rating and permission management.
It achieves precise control over the access rights of the communication initiator, enhances the security and integrity of the blockchain network, and prevents unauthorized operations and data access.
Smart Images

Figure CN118611929A
Abstract
Description
Technical Field
[0001] The present application belongs to the field of blockchain technology, and in particular, relates to a blockchain node communication method and device. Background Art
[0002] In blockchain technology, permission management is the key to ensure that only authorized users can perform specific operations. Blockchain is a decentralized distributed ledger where all participants can have a complete copy of the ledger, so any unauthorized user may cause damage to the system. The goal of permission management is to achieve access control over the blockchain network to protect the integrity and security of the data. However, how to achieve flexible control of the permissions of the communication initiator during the communication process is still a technical problem that needs to be solved urgently. Summary of the invention
[0003] The embodiments of the present application provide a blockchain node communication method and device, which can solve the problem that the authority of the communication initiator cannot be flexibly controlled.
[0004] In a first aspect, an embodiment of the present application provides a blockchain node communication method, including:
[0005] The communication initiator sends an identity certificate to the target node and requests an attribute certificate from the target node, wherein the attribute certificate is used to determine the access rights of the communication initiator;
[0006] Receiving a corresponding attribute certificate sent by the target node according to the identity certificate;
[0007] The communication initiator carries the attribute certificate to communicate with the target node.
[0008] In a possible implementation, before the target node sends the attribute certificate to the communication initiator, it also includes: encrypting the attribute certificate using the public key of the target node to obtain an encrypted attribute certificate.
[0009] In a possible implementation, the receiving the attribute certificate sent by the target node according to the identity certificate includes:
[0010] Receiving an encryption attribute certificate sent by the target node according to the identity certificate;
[0011] The communication initiator carries the attribute certificate to communicate with the target node, including:
[0012] The communication initiator sends an access request to the target node carrying the encryption attribute certificate;
[0013] After the target node uses its private key to decrypt the encrypted attribute certificate and determines the access rights of the communication initiator, the communication initiator communicates with the target node within the access rights.
[0014] In a possible implementation, the identity certificate includes identity identification information, and the attribute certificate includes: access permission information for the interface and / or module and the validity period of the attribute certificate. The target node sends the corresponding attribute certificate to the communication initiator according to the identity certificate, including:
[0015] Determine the corresponding access rights information and the validity period of the attribute certificate according to the identity information;
[0016] An attribute certificate is generated based on the access permission information and the validity period of the attribute certificate, and sent to the communication initiator.
[0017] In one possible implementation, the blockchain node communication method further includes:
[0018] The target node determines whether the current time is within the validity period of the attribute certificate;
[0019] If not, the communication initiator is notified to request the attribute certificate again;
[0020] Or the communication initiator determines whether the current time is within the validity period of the attribute certificate;
[0021] If not, request the attribute certificate from the target node again.
[0022] In one possible implementation, the blockchain node communication method further includes:
[0023] Accumulate scores according to the error requests sent by the communication initiator to obtain an error request score;
[0024] If the error request score is greater than a preset threshold, it is determined that the communication initiator has abnormal behavior;
[0025] Based on the abnormal behavior, the authority level of the attribute certificate is reduced.
[0026] In a second aspect, an embodiment of the present application provides a blockchain node communication device, including:
[0027] An attribute certificate request module, used for the communication initiator to send an identity certificate to the target node and request an attribute certificate from the target node;
[0028] An attribute certificate sending module, used for the target node to send the corresponding attribute certificate to the communication initiator according to the identity certificate;
[0029] The communication module is used for the communication initiator to communicate with the target node by carrying the attribute certificate after receiving the attribute certificate.
[0030] In a possible implementation, the blockchain node communication device further includes:
[0031] A behavior pattern management module, wherein the behavior pattern management module is used to accumulate scores based on the erroneous requests sent by the communication initiator to obtain an erroneous request score; if the erroneous request score is greater than a preset threshold, it is determined that the communication initiator has engaged in abnormal behavior and the attribute certificate of the communication initiator is revoked.
[0032] In a third aspect, an embodiment of the present application provides a terminal device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the method described above when executing the computer program.
[0033] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method as described above is implemented.
[0034] Beneficial effects of this application
[0035] The present application provides a blockchain node communication method, apparatus, terminal device and storage medium. Before the communication initiator attempts to communicate with the target node, it first sends an identity certificate to the target node and requests an attribute certificate. After verifying the identity certificate of the communication initiator, the target node will send an attribute certificate corresponding to the identity of the communication initiator. After receiving the attribute certificate, the communication initiator carries the attribute certificate for subsequent communication with the target node. The present application grants access rights to the communication initiator by issuing an attribute certificate to the communication initiator. In this way, the access rights of the communication initiator can be precisely controlled, making the control of the access rights of the communication initiator more flexible and intelligent, while helping to prevent unauthorized operations and data access, and protecting the security and integrity of the blockchain network. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0037] Figure 1 It is a flowchart of a blockchain node communication method provided by an embodiment of the present application;
[0038] Figure 2 It is a schematic diagram of a process in which a communication initiator carries an attribute certificate to communicate with a target node according to an embodiment of the present application;
[0039] Figure 3 is a schematic diagram of an interaction process provided by an embodiment of the present application;
[0040] Figure 4 It is a structural diagram of a blockchain node communication device provided in an embodiment of the present application;
[0041] Figure 5 It is a structural diagram of the terminal device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0042] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present application.
[0043] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of described features, wholes, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or combinations thereof.
[0044] It should also be understood that the term “and / or” used in the specification and appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.
[0045] As used in the specification and appended claims of this application, the term "if" can be interpreted as "when" or "uponce" or "in response to determining" or "in response to detecting", depending on the context. Similarly, the phrase "if it is determined" or "if [described condition or event] is detected" can be interpreted as meaning "uponce it is determined" or "in response to determining" or "uponce [described condition or event] is detected" or "in response to detecting [described condition or event]", depending on the context.
[0046] In addition, in the description of the present application specification and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish the descriptions and cannot be understood as indicating or implying relative importance.
[0047] References to "one embodiment" or "some embodiments" etc. described in the specification of this application mean that one or more embodiments of the present application include specific features, structures or characteristics described in conjunction with the embodiment. Therefore, the statements "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways.
[0048] In blockchain technology, permission management is the key to ensure that only authorized users can perform specific operations. Blockchain is a decentralized distributed ledger where all participants can have a complete copy of the ledger, so any unauthorized user may cause damage to the system. The goal of permission management is to achieve access control over the blockchain network to protect the integrity and security of the data. However, how to achieve flexible control of the permissions of the communication initiator during the communication process is still a technical problem that needs to be solved urgently.
[0049] The present application provides a blockchain node communication method, including: a communication initiator sends an identity certificate to a target node, and requests an attribute certificate from the target node, the attribute certificate being used to determine the access rights of the communication initiator; the target node sends a corresponding attribute certificate to the communication initiator according to the identity certificate; the communication initiator receives the attribute certificate, and communicates with the target node carrying the attribute certificate. The blockchain node communication method provided by the present application grants the communication initiator access rights by issuing an attribute certificate to the communication initiator, making the control of the communication initiator's access rights more flexible and intelligent.
[0050] In order to illustrate the technical solution of the present application, specific embodiments are provided below.
[0051] See also Figure 1 The process of an embodiment of the blockchain node communication method shown, as an example but not a limitation, includes the following steps:
[0052] Step S100: The communication initiator sends an identity certificate to the target node, and requests an attribute certificate from the target node, wherein the attribute certificate is used to determine the access rights of the communication initiator;
[0053] Step S200: receiving a corresponding attribute certificate sent by the target node according to the identity certificate;
[0054] Step S300: The communication initiator carries the attribute certificate to communicate with the target node.
[0055] The principle of this scheme is introduced below. Before the communication initiator attempts to communicate with the target node, it first sends an identity certificate to the target node to prove the authenticity of its identity and requests an attribute certificate from the target node. After receiving the identity certificate of the communication initiator, the target node will verify its authenticity. If the verification is successful, the target node will send an attribute certificate corresponding to the identity of the communication initiator. After receiving the attribute certificate, the communication initiator will carry the attribute certificate for subsequent communication with the target node.
[0056] It should be noted that the attribute certificate includes a series of information about the authority and role of the communication initiator, which is used to determine the access rights of the communication initiator in the blockchain network. In addition, the attribute certificate obtained by the communication initiator can be determined according to its identity, and different identities correspond to different attribute certificates. In addition, the generation of attribute certificates can be performed locally on the node or issued by a CA.
[0057] It should be noted that the identity certificate can be an X.509 certificate, which carries basic information such as the public key and node type. When verifying the identity certificate, in addition to verifying the validity of the certificate, it is generally necessary to verify whether the node type in the certificate meets expectations.
[0058] By using the blockchain node communication method provided by this application, the access rights of the communication initiator can be precisely controlled through attribute certificates. This helps prevent unauthorized operations and data access, and protects the security and integrity of the blockchain network. In addition, since attribute certificates can contain various permissions and role information, the communication method provided by this application can be made scalable by adding new permissions and roles. Moreover, by verifying identity and permissions before communication, unnecessary permission checks and data transmission can be avoided during the communication process, thereby improving communication efficiency.
[0059] In one possible implementation, the communication initiator includes: a blockchain node and a client.
[0060] It should be noted that the communication initiator of this application can be a blockchain node or a client. As a communication initiator, a blockchain node can directly interact with other nodes to ensure smooth and secure communication within the blockchain network. As a communication initiator, a client allows external users or systems to interact with the blockchain network through the client, thereby expanding the scope and scenarios of use of the blockchain system.
[0061] In some possible implementations, the blockchain node and the client are located on the same device. By using a software development kit (SDK), developers can implement the functions of the blockchain node and the client on the same device.
[0062] It should be noted that the blockchain node is an important part of the blockchain network. It is responsible for storing complete or partial data of the blockchain, verifying and broadcasting transactions, and participating in the consensus process. The client is the interface for users to interact with the blockchain network, allowing users to initiate transactions, query blockchain status, call smart contracts, etc. In some scenarios, in order to simplify deployment, reduce costs or improve performance, blockchain nodes and clients may be deployed on the same physical device or virtual machine, which can reduce network latency and communication overhead. In addition, it should be noted that the connection established between nodes can be bidirectional, that is, node A obtains the attribute certificate of node B, and node B also obtains the attribute certificate of node A. In this way, bidirectional access control between nodes AB can be achieved.
[0063] Whether it is a blockchain node or a client, as the communication initiator, it needs to perform identity authentication and carry the obtained attribute certificate to communicate, ensuring that only authenticated nodes and clients can participate in communication, and can only communicate within the scope of authority granted by the attribute certificate. In this way, flexible control of the authority of the communication initiator is achieved and the security of the system is improved.
[0064] In a possible implementation, before the target node sends the attribute certificate to the communication initiator, it also includes: encrypting the attribute certificate using the public key of the target node to obtain an encrypted attribute certificate.
[0065] It should be noted that in blockchain node communication, when the target node needs to send an attribute certificate to the communication initiator, in order to ensure the security and integrity of the certificate during transmission, an encryption algorithm can be used to encrypt the attribute certificate.
[0066] Generally speaking, the encryption process is that the target node uses the public key of the communication initiator to encrypt the attribute certificate to generate an encrypted attribute certificate. This step ensures that only the communication initiator (the node holding the corresponding private key) can decrypt and read the content of the attribute certificate. However, in this embodiment, the attribute certificate is encrypted using the public key of the target node. The reason is that the communication initiator does not need to obtain the specific permission content in the attribute certificate. It only needs to carry the attribute certificate to communicate with the target node and the target node decrypts the attribute certificate to obtain specific access permission information for the interface and / or module.
[0067] It should be noted that attribute certificates are used to determine the access rights of the communication initiator. Encrypted transmission can ensure that only legitimate nodes can obtain these rights, prevent the certificate from being intercepted and tampered with by a third party during transmission, ensure the authenticity and integrity of the certificate, and enhance the security of the system.
[0068] In one possible implementation, see Figure 2 , the receiving the attribute certificate sent by the target node according to the identity certificate includes:
[0069] Step D1: receiving the encryption attribute certificate sent by the target node according to the identity certificate;
[0070] The communication initiator carries the attribute certificate to communicate with the target node, including:
[0071] Step D2: The communication initiator sends an access request to the target node carrying the encryption attribute certificate;
[0072] Step D3: After the target node uses its private key to decrypt the encrypted attribute certificate and determines the access rights of the communication initiator, the communication initiator communicates with the target node within the access rights.
[0073] It should be noted that the special feature of this embodiment is that the public key of the target node itself is used to encrypt the attributes, and after receiving the encrypted attribute certificate, the private key of the target node is used to decrypt it, that is, a set of passwords is shared with the node, and there is no need to set up an additional cryptographic system.
[0074] In a possible implementation, the identity certificate includes identity identification information, and the attribute certificate includes: access permission information for the interface and / or module and the validity period of the attribute certificate. The target node sends the corresponding attribute certificate to the communication initiator according to the identity certificate, including:
[0075] Step A1: Determine the corresponding access permission information and the validity period of the attribute certificate according to the identity information;
[0076] Step A2: Generate an attribute certificate based on the access permission information and the validity period of the attribute certificate, and send it to the communication initiator.
[0077] It should be noted that this embodiment provides a method for generating an attribute certificate based on an identity certificate.
[0078] Specifically, first, when the target node receives the identity certificate of the communication initiator, it first parses the certificate to obtain the identity information of the communication initiator, wherein the identity information is used to identify different nodes or clients.
[0079] Next, the access rights and validity period of the attribute certificate are determined based on the identity information of the communication initiator. Exemplarily, the target node can determine the access rights of the communication initiator by querying a predefined permission mapping table or access control list (ACL). Among them, the access rights refer to the access rights for interfaces and / or modules, and such a setting can make the access rights more fine-grained.
[0080] In addition to access rights information, the attribute certificate also includes a validity period field, which is used to specify the validity period of the certificate. Exemplarily, the validity period can be fixed (for example, a fixed period of time from the time of issuance) or dynamic (for example, dynamically generated based on the activities or requests of the communication initiator). Setting the validity period helps ensure that the certificate will not expire or be abused.
[0081] Finally, after determining the access rights information and the validity period of the attribute certificate, the target node will generate an attribute certificate based on this information. The attribute certificate includes the identity of the communication initiator, the access rights list, the validity period, and other additional information that may be required (such as digital signatures, etc.). After the attribute certificate is generated, the target node will send the attribute certificate back to the communication initiator.
[0082] It should be noted that since the attribute certificate is determined based on the identity information of the communication initiator, fine-grained access control can be achieved. Different identities can correspond to different combinations of access rights, thus meeting complex and changing application scenarios and user needs.
[0083] Furthermore, attribute certificates include not only the access rights of the communication initiator, but also the validity period. The validity period can be flexibly set according to actual needs. In theory, a shorter validity period has higher security. The reason is that a shorter certificate validity period reduces the risk of long-term abuse or misuse of the certificate. If the certificate is stolen or improperly used during its validity period, a shorter validity period will limit the time window of potential damage. And over time, the system environment, user roles, and permissions may change. A shorter certificate validity period can ensure that these changes can be reflected in access control in a timely manner, thereby reducing the security risks caused by expired certificates.
[0084] In one possible implementation, the blockchain node communication method further includes:
[0085] The target node determines whether the current time is within the validity period of the attribute certificate;
[0086] If not, notify the communication initiator to re-request the attribute certificate.
[0087] It should be noted that during the communication process, the validity period of the attribute certificate needs to be verified. As the issuer and verifier of the attribute certificate, the target node has a higher responsibility for the security of the communication. By checking the validity period of the certificate, any attempt to use an expired or invalid certificate can be prevented, thereby enhancing the security of the system. The target node checks the validity period of the attribute certificate during each communication. If the target node finds that the attribute certificate carried by the communication initiator has expired, it will reject the current message of the communication initiator and notify the communication initiator to re-request the attribute certificate. In this way, the real-time nature of the attribute certificate is ensured and the risk of using expired certificates for communication is reduced.
[0088] In one possible implementation, the blockchain node communication method further includes:
[0089] The communication initiator determines whether the current time is within the validity period of the attribute certificate;
[0090] If not, request the attribute certificate from the target node again.
[0091] It should be noted that the difference between this embodiment and the previous embodiment is that the verification subject of the attribute certificate validity period is not the target node, but the communication initiator. That is, the communication initiator can also check whether the obtained attribute certificate is within the validity period before communication, that is, the communication initiator can independently control the certificate update process without waiting for feedback from the target node. If it is found that the current attribute certificate has expired, the communication initiator can also actively request a new attribute certificate.
[0092] In some possible cases, the communication initiator can apply for a new certificate in advance before the certificate expires, thereby reducing communication interruptions and delays caused by certificate expiration. For applications or users that need to communicate frequently, managing the validity period of the certificate by the communication initiator can provide a better user experience because the user or application can know in advance when the certificate needs to be updated.
[0093] Whether it is the target node or the communication initiator, judging the validity period of the attribute certificate has its unique advantages and applicable scenarios. In practical applications, the most appropriate solution can be selected according to specific business needs and security requirements.
[0094] In one possible implementation, the blockchain node communication method further includes:
[0095] Accumulate scores according to the error requests sent by the communication initiator to obtain an error request score;
[0096] If the error request score is greater than a preset threshold, it is determined that the communication initiator has abnormal behavior;
[0097] Based on the abnormal behavior, the authority level of the attribute certificate is reduced.
[0098] For example, for an important target node, if the communication initiator returns an undefined result status, the communication initiator's request can be directly judged as abnormal, that is, the error score corresponding to this situation is set to a preset threshold. For general request errors, a lower error score is set, and the error scores are accumulated to obtain an error request score. If the error request score reaches the preset threshold, the communication initiator's request is judged to be abnormal, and the authority level of the attribute certificate is reduced according to the abnormal behavior. For example, only abnormal interfaces and modules can be prohibited.
[0099] In some embodiments, after an attribute certificate is revoked, it can be reissued, but the authority of the reissued attribute certificate is lower than the original attribute certificate.
[0100] See also Figure 3 The schematic diagram of the interaction process shown illustrates the blockchain communication method proposed in this application.
[0101] The communication initiator (i.e., node A or client in the figure) sends an identity certificate to the target node (i.e., node B in the figure). The target node verifies the identity certificate. If the verification fails, no attribute certificate is returned. If the verification succeeds, an attribute certificate is returned to the communication initiator. After receiving the attribute certificate, the communication initiator sends an access request to the target node with the attribute certificate. The target node determines the scope of authority and validity period of the communication initiator based on the attribute certificate and responds to its request.
[0102] The present application embodiment provides a blockchain node communication device 400, see Figure 4 ,include:
[0103] The attribute certificate request module 401 is used for the communication initiator to send the identity certificate to the target node and request the attribute certificate from the target node;
[0104] The attribute certificate sending module 402 is used for the target node to send the corresponding attribute certificate to the communication initiator according to the identity certificate;
[0105] The communication module 403 is used for the communication initiator to communicate with the target node by carrying the attribute certificate after receiving the attribute certificate.
[0106] The current blockchain node certificate generally directly writes the role information into the identity authentication certificate. Before establishing a connection between a blockchain node and a client or other blockchain nodes, the certificates will be exchanged and verified first. The node reads the role information of the other party in the identity authentication certificate to control and access the connection. However, this method can only know which node or client the communication message comes from after the connection, and cannot perform more fine-grained authority control on the node, especially the client. The blockchain node communication device 400 proposed in this application can solve the above problems.
[0107] The blockchain node communication device 400 provided in the embodiment of the present application first uses the attribute certificate request module 401 to send an identity certificate to the target node to prove the authenticity of its identity, and requests an attribute certificate from the target node. The attribute certificate sending module 402 verifies the authenticity of the identity certificate, and if the verification is successful, sends the attribute certificate corresponding to the identity of the communication initiator. Finally, the communication module 403 carries the attribute certificate for subsequent communication with the target node.
[0108] By using the blockchain node communication device provided by the present application, the access rights of the communication initiator can be precisely controlled through the attribute certificate. This helps prevent unauthorized operations and data access, and protects the security and integrity of the blockchain network. In addition, since the attribute certificate can contain various permissions and role information, the communication method provided by the present application can be made scalable by adding new permissions and roles. Moreover, by verifying the identity and permissions before communication, unnecessary permission checks and data transmission can be avoided during the communication process, thereby improving communication efficiency.
[0109] In a possible implementation, the blockchain node communication device further includes:
[0110] Behavior pattern management module 404, the behavior pattern management module is used to accumulate scores based on the erroneous requests sent by the communication initiator to obtain an erroneous request score; if the erroneous request score is greater than a preset threshold, it is determined that the communication initiator has abnormal behavior, and based on the abnormal behavior, the authority level of the attribute certificate is reduced.
[0111] Exemplarily, the behavior pattern management module may include an analyzer and a controller. The analyzer accumulates scores based on the error requests sent by the communication initiator to obtain an error request score. If the error request score is greater than a preset threshold, it is determined that the communication initiator has abnormal behavior and handed it over to the controller for processing. The controller revokes the current attribute certificate of the communication initiator with abnormal behavior found by the analyzer and reissues an attribute certificate with lower authority.
[0112] Figure 5The terminal device 1000 is a schematic diagram of a terminal device provided in an embodiment of the present application. The terminal device 1000 includes: at least one processor 1001 ( Figure 5 Only one processor is shown in the figure), a memory 1002, and a computer program 1003 stored in the memory 1002 and executable on the at least one processor 1001, wherein the processor 1001 implements the steps in the above-mentioned 5 method embodiments when executing the computer program 1003.
[0113] The terminal device 1000 may be a computing device such as a desktop computer, a notebook, a PDA, or a cloud server. The terminal device may include, but is not limited to, a processor 1001 and a memory 1002. Those skilled in the art will appreciate that Figure 5 It is only an example of the terminal device 1000 and does not constitute a limitation on the terminal device 1000 , and may include more or fewer components than shown in the figure, or a combination of certain components, or different components, for example, it may also include input and output devices, network access devices, etc.
[0114] The processor 1001 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.
[0115] In some embodiments, the memory 1002 may be an internal storage unit of the terminal device 1000, such as a hard disk or memory of the terminal device 1000. In other embodiments, the memory 1002 may also be an external storage device of the terminal device 1000, such as a plug-in hard disk, a smart memory card (SmartMedia Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. equipped on the terminal device 1000. Further, the memory 1002 may also include both an internal storage unit of the terminal device 1000 and an external storage device. The memory 1002 is used to store an operating system, an application program, a boot loader (BootLoader), data and other programs, such as the program code of the computer program, etc. The memory 1002 may also be used to temporarily store data that has been output or is to be output.
[0116] The technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In practical applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.
[0117] An embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in the above-mentioned method embodiments can be implemented.
[0118] An embodiment of the present application provides a computer program product. When the computer program product runs on a mobile terminal, the mobile terminal can implement the steps in the above-mentioned method embodiments when executing the computer program product.
[0119] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present application implements all or part of the processes in the above-mentioned embodiment method, which can be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium can at least include: any entity or device that can carry the computer program code to the camera / terminal device, recording medium, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, RandomAccess Memory), electric carrier signal, telecommunication signal and software distribution medium. For example, a USB flash drive, a mobile hard disk, a magnetic disk or an optical disk. In some jurisdictions, according to legislation and patent practice, computer-readable media cannot be electric carrier signals and telecommunication signals.
[0120] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0121] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0122] In the embodiments provided in the present application, it should be understood that the disclosed devices / network equipment and methods can be implemented in other ways. For example, the device / network equipment embodiments described above are merely schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0123] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0124] The embodiments described above are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, a person skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.
Claims
1. A blockchain node communication method, characterized in that: include: The communication initiator sends an identity certificate to the target node and requests an attribute certificate from the target node, wherein the attribute certificate is used to determine the access rights of the communication initiator; Receiving an attribute certificate sent by the target node according to the identity certificate; The communication initiator carries the attribute certificate to communicate with the target node.
2. The blockchain node communication method according to claim 1, characterized in that: Before the target node sends the attribute certificate to the communication initiator, the method further includes: encrypting the attribute certificate using the public key of the target node to obtain an encrypted attribute certificate.
3. The blockchain node communication method according to claim 2, characterized in that: The receiving the attribute certificate sent by the target node according to the identity certificate includes: receiving the encryption attribute certificate sent by the target node according to the identity certificate; The communication initiator carries the attribute certificate to communicate with the target node, including: The communication initiator sends an access request to the target node carrying the encryption attribute certificate; After the target node decrypts the encrypted attribute certificate using its private key and determines the access rights of the communication initiator, the communication initiator communicates with the target node within the access rights.
4. The blockchain node communication method according to claim 1, characterized in that: The identity certificate includes identity identification information, and the attribute certificate includes: access permission information for the interface and / or module and the validity period of the attribute certificate. The target node sends the corresponding attribute certificate to the communication initiator according to the identity certificate, including: Determine the corresponding access rights information and the validity period of the attribute certificate according to the identity information; An attribute certificate is generated based on the access permission information and the validity period of the attribute certificate, and sent to the communication initiator.
5. The blockchain node communication method according to claim 4, characterized in that: Also includes: The target node determines whether the current time is within the validity period of the attribute certificate; If not, the communication initiator is notified to request the attribute certificate again; Or the communication initiator determines whether the current time is within the validity period of the attribute certificate; If not, request the attribute certificate from the target node again.
6. The blockchain node communication method according to claim 1, characterized in that: The blockchain node communication method further includes: Accumulate scores according to the error requests sent by the communication initiator to obtain an error request score; If the error request score is greater than a preset threshold, it is determined that the communication initiator has abnormal behavior; Based on the abnormal behavior, the authority level of the attribute certificate is reduced.
7. A blockchain node communication device, characterized in that: include: An attribute certificate request module, used for the communication initiator to send an identity certificate to the target node and request an attribute certificate from the target node; An attribute certificate sending module, used for the target node to send the corresponding attribute certificate to the communication initiator according to the identity certificate; The communication module is used for the communication initiator to communicate with the target node by carrying the attribute certificate after receiving the attribute certificate.
8. The blockchain node communication device according to claim 7, characterized in that: The blockchain node communication device also includes: A behavior pattern management module, wherein the behavior pattern management module is used to accumulate scores based on the erroneous requests sent by the communication initiator to obtain an erroneous request score; if the erroneous request score is greater than a preset threshold, it is determined that the communication initiator has engaged in abnormal behavior and the attribute certificate of the communication initiator is revoked.
9. A terminal device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the method according to any one of claims 1 to 6 is implemented.
10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
