Blockchain-based microservice authentication method, device, equipment and storage medium

By combining blockchain technology with microservice clusters, secure storage and access management of business data among multiple enterprises are achieved, solving the problems of data leakage and permission modification, and improving the security and efficiency of data sharing.

CN115865404BActive Publication Date: 2025-11-11JIANGSU JINGXING WUYUAN TECH CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202211296947.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-10-21
Publication Date
2025-11-11
Estimated Expiration
2042-10-21

AI Technical Summary

Technical Problem

The existing system poses a risk of sensitive data leakage during the sharing of business data among multiple enterprises, and the permission level can be easily modified, resulting in insufficient security.

Method used

A distributed storage architecture is built using blockchain technology, combined with a microservice cluster. Hash encryption and authentication modules are used to authenticate and manage the permissions of third-party enterprises, ensuring data security and consistency.

Benefits of technology

It effectively improves the security and reliability of business data, reduces the data verification and synchronization process, and enhances the efficiency of data sharing and information security between enterprises.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115865404B_ABST
    Figure CN115865404B_ABST
Patent Text Reader

Abstract

This invention relates to the field of security protection technology, and in particular to a blockchain-based microservice authentication method, apparatus, device, and storage medium. The method includes: building a blockchain architecture: multiple blockchain nodes are combined into a blockchain architecture; the blockchain architecture also includes an authentication module; building a microservice cluster: the microservice cluster includes a registration center, a configuration center, a basic database, a communication gateway, and service monitoring components; third-party enterprise registration: the blockchain architecture is used to authenticate the identity information and permission level of third-party enterprises and store it in business data; third-party enterprise access authentication: the third-party enterprise sends an access application to the communication gateway, which then forwards it to the authentication module of the blockchain architecture for authentication, and then feeds back the authentication result to the communication gateway. The communication gateway determines whether to allow the third-party enterprise's access based on the feedback result from the blockchain architecture. This invention can effectively ensure the security of business data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of security protection technology, and in particular to a blockchain-based microservice authentication method, apparatus, device, and storage medium. Background Technology

[0002] In the internet industry, when multiple companies collaborate on related businesses, they often use a common system to record and store business data in order to facilitate information exchange between them.

[0003] In actual business operations, third-party companies, often separate from the main enterprise, are frequently needed to participate in and assist with the development of certain business processes. These third-party companies require access to some business data, necessitating the protection of confidential data while ensuring the sharing of commonly used business data. Therefore, it is necessary to establish different permission levels for different third-party companies, with the amount of business data they can access depending on their permission level. The existing system requires a series of processes for each new third-party company, including application, approval, registration, review, and filing, while maintaining information synchronization across multiple companies. This process is prone to sensitive data leakage, potentially leading to immeasurable consequences. Furthermore, the existing system stores third-party company permission levels in a separate storage module, making it vulnerable to external attacks that could modify the permission levels within this module. Therefore, the system's security capabilities for business data are relatively weak. Summary of the Invention

[0004] This invention provides a blockchain-based microservice authentication method that effectively solves the problems in the background technology and effectively ensures the security of business data when third-party enterprises use it. This invention also provides a blockchain-based microservice authentication device, a blockchain-based microservice authentication equipment, and a computer-readable storage medium, which can achieve the same technical effects.

[0005] This invention provides a blockchain-based microservice authentication method, comprising:

[0006] Building a blockchain architecture: Multiple blockchain nodes are set up on multiple main enterprises, and all blockchain nodes are combined into a blockchain architecture. The blockchain architecture stores business data in a distributed manner, and the business data includes at least the identity information of each main enterprise; the blockchain architecture also includes an authentication module.

[0007] Building a microservice cluster: A microservice cluster is built on a cloud server. The microservice cluster includes: a registry center, a configuration center, a basic database, a communication gateway, and service monitoring components; the blockchain architecture is registered to the registry center; the communication gateway is used for data interaction with the blockchain architecture and third-party enterprises.

[0008] Third-party enterprise registration: The blockchain architecture is used to authenticate the identity information and permission level of third-party enterprises. After the authentication is successful, the blockchain architecture hashes and encrypts the identity information of third-party enterprises to generate a hash value. Then, the hash value and the corresponding permission level are stored in the business data.

[0009] Third-party enterprise access authentication: The third-party enterprise sends an access application containing its identity information to the communication gateway, which then sends the third-party enterprise identity information to the blockchain architecture. The authentication module of the blockchain architecture performs authentication, comparing whether the hash value of the received third-party enterprise identity information is within the business data, and then sends the authentication result back to the communication gateway. The communication gateway determines whether to allow the third-party enterprise's access based on the feedback result from the blockchain architecture.

[0010] Furthermore, in building the blockchain architecture, the services provided by the blockchain architecture are made idempotent.

[0011] Furthermore, in building a microservice cluster, the business processing mode of the microservice cluster is set to asynchronous processing mode.

[0012] Furthermore, when building a microservice cluster, the communication gateway enables a timed polling function when it times out or encounters an error while receiving feedback information from the blockchain architecture.

[0013] Furthermore, the specific methods for identity verification and access level authentication of third-party companies during registration are as follows:

[0014] A third-party enterprise sends a registration application containing the identity information of a main enterprise to a communication gateway. The communication gateway forwards the registration application to the blockchain architecture. After receiving the registration application, the blockchain architecture sends multiple dynamic tokens to the main enterprise, each dynamic token corresponding to a different permission level. Then, it sends registration information containing a dynamic token and the third-party enterprise's identity information to the communication gateway. The communication gateway forwards the registration information to the blockchain architecture. The blockchain architecture verifies the received dynamic token. If the verification is successful, the third-party enterprise's identity information is confirmed, and the permission level of the third-party enterprise is determined.

[0015] Furthermore, an event listening service is set up in the communication gateway of the microservice cluster to detect changes in business data in each blockchain node. If a change occurs, the microservice cluster is notified, and the microservice cluster stores the change record in the basic database after receiving the notification.

[0016] Furthermore, a verification module is included in the microservice cluster setup to verify the corresponding data in the underlying database and blockchain architecture; the specific verification is as follows:

[0017] First, obtain the hash value of the data to be verified in the blockchain architecture, then obtain the hash value of the data to be verified in the basic database, and compare whether the two hash values ​​are consistent. If they are inconsistent, replace the data to be verified in the basic database with the data to be verified in the blockchain architecture.

[0018] This invention provides a blockchain-based microservice authentication device, applicable to the aforementioned blockchain-based microservice authentication method, comprising:

[0019] The blockchain architecture includes multiple blockchain nodes, which are respectively built on multiple main enterprises;

[0020] The microservice cluster includes a registry center, configuration center, basic database, communication gateway, and service monitoring components; the communication gateway interacts with the blockchain architecture for data exchange.

[0021] A third-party client is used for data interaction between third-party enterprises and communication gateways.

[0022] The present invention provides a blockchain-based microservice authentication device, including a processor, a memory, and an authentication program stored in the memory and executable by the processor, wherein when the authentication program is executed by the processor, it implements the steps of the aforementioned blockchain-based microservice authentication method.

[0023] The present invention provides a computer-readable storage medium storing an authentication program, wherein when the authentication program is executed by a processor, it implements the steps of the aforementioned blockchain-based microservice authentication method.

[0024] The technical solution of this invention can achieve the following technical effects:

[0025] 1. By storing business data among multiple main enterprises using blockchain technology and combining blockchain technology with microservice clusters, the security of business data interaction can be effectively enhanced. At the same time, it avoids too many complicated data verification and synchronization processes, making data sharing and business cooperation among multiple enterprises more convenient and faster, and ensuring the credibility of business data.

[0026] 2. By using a blockchain architecture to record the identity information and corresponding permission levels of third-party enterprises, the security and accuracy of the recorded third-party enterprise information, especially the permission level data, can be guaranteed by preventing external attacks from altering the information.

[0027] 3. The identity information of third-party companies recorded within the blockchain architecture is processed through hash encryption. This ensures that the recorded information of third-party companies can be identified by the main company, but cannot be deciphered by others who obtain the information, thereby improving the security of the data recorded within the blockchain architecture. Attached Figure Description

[0028] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0029] Figure 1 This is a design architecture diagram of a blockchain-based microservice authentication device in an embodiment of the present invention;

[0030] Figure 2 This is a design architecture diagram of the authentication module in an embodiment of the present invention. Detailed Implementation

[0031] The technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments.

[0032] In the description of this invention, it should be noted that the orientations or positional relationships indicated by terms such as "center", "up", "down", "left", "right", "vertical", "horizontal", "inner", and "outer" are based on the orientations or positional relationships shown in the accompanying drawings. They are only for the convenience of describing this invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limitations on this invention.

[0033] In the description of this invention, it should be noted that, unless otherwise explicitly specified and limited, the terms "connected" and "linked" should be interpreted broadly, referring to direct connection, indirect connection through an intermediate medium, or internal communication between two elements. Those skilled in the art can understand the specific meaning of these terms in this invention based on the specific circumstances.

[0034] This invention relates to a blockchain-based microservice authentication method, comprising:

[0035] Building a blockchain architecture: Multiple blockchain nodes are set up on multiple main enterprises. Each main enterprise has a client that can write data to the blockchain nodes set up within its own enterprise. All blockchain nodes are combined into a blockchain architecture. The blockchain architecture distributes business data such as transaction records and permission records. The business data includes at least the identity information of each main enterprise. If necessary, the identity information of each main enterprise can be hashed and encrypted to ensure that even if the business data is stolen, it cannot be read by the thief. An authentication module is also set up in the blockchain architecture to authenticate third-party enterprises.

[0036] Building a microservice cluster: A microservice cluster is built on a cloud server. The microservice cluster includes: a registry center, a configuration center, a basic database, a communication gateway, and service monitoring components. The registry center, configuration center, and basic database are all essential basic services in the existing microservice cluster and will not be elaborated here. The blockchain architecture is registered with the registry center, so that other components in the microservice cluster can call the blockchain architecture. The communication gateway is used for data interaction with the blockchain architecture and third-party enterprises.

[0037] Third-party enterprise registration: The blockchain architecture is used to authenticate the identity information and permission level of third-party enterprises. After the authentication is successful, the blockchain architecture hashes and encrypts the identity information of third-party enterprises to generate a hash value. Then, the hash value and the corresponding permission level are stored in the business data.

[0038] Third-party enterprise access authentication: When a third-party enterprise's client wants to access and use data within the microservice cluster, the third-party enterprise first needs to send an access application containing its identity information to the communication gateway. The communication gateway then sends the third-party enterprise's identity information to the blockchain architecture. The blockchain architecture's authentication module performs authentication, comparing the hash value of the received third-party enterprise's identity information with the business data, and then sends the authentication result back to the communication gateway. The communication gateway determines whether to allow the third-party enterprise's access based on the feedback result from the blockchain architecture. After the blockchain architecture completes its determination and sends back the result, it replies to the third-party enterprise with an Accept or Reject field to notify the third-party enterprise that access is allowed or denied. The third-party enterprise then performs business operations based on the feedback result.

[0039] Specifically, this authentication method uses blockchain technology to store business data between multiple master enterprises. Due to the decentralized nature of blockchain, business data recorded in the blockchain architecture can usually only be written, and modification is extremely difficult. Therefore, the credibility of business data can be guaranteed, reducing the trust cost between multiple enterprises. There is no need to repeatedly confirm business data, avoiding excessive and complicated data verification and synchronization processes, making data sharing and business cooperation between multiple enterprises more convenient and faster. The distributed architecture of microservice clusters can effectively decompose applications, enabling agile development, rapid evolution, convenient fault tolerance, and elastic scaling. The powerful combination of blockchain architecture and microservice clusters can better solve complex business problems between enterprises. For third-party enterprises, this authentication method records their identity information and corresponding permission levels through a blockchain architecture. This prevents external attacks from altering the information, especially the permission level data, of third-party enterprises, thus ensuring the security and accuracy of the recorded information. Simultaneously, the identity information of third-party enterprises recorded within the blockchain architecture is processed using hash encryption. This ensures that the recorded information is identifiable by the main enterprise, but cannot be deciphered by those who steal business data, thereby enhancing the security of the data recorded within the blockchain. The specific architecture of the authentication module is as follows... Figure 2 As shown.

[0040] In building a blockchain architecture, the services provided by the blockchain architecture are made idempotent. The core idea is to handle multiple repeated requests within a certain period of time, that is, when a client calls the blockchain architecture's services multiple times through a communication gateway, the blockchain architecture only returns a result once, thus preventing data distortion caused by multiple repeated calls.

[0041] To prevent the blockchain architecture from being stuck in a waiting state after requesting authentication, recording, and other processing, it is preferable to set the business processing mode of the microservice cluster to asynchronous processing mode when building a microservice cluster, so as not to affect the operation of other business operations in the microservice cluster.

[0042] Preferably, in building a microservice cluster, when the communication gateway times out or encounters an error while receiving feedback information from the blockchain architecture, the communication gateway enables a timed polling function and sends a notification only after receiving the result.

[0043] The specific methods for identity verification and access level authentication of third-party companies during registration are as follows:

[0044] A third-party enterprise sends a registration application containing the identity information of a main enterprise to a communication gateway. The communication gateway forwards the registration application to the blockchain architecture. Upon receiving the registration application, the blockchain architecture sends multiple dynamic tokens (also known as one-time passwords) to the main enterprise, each dynamic token corresponding to a different permission level. The main enterprise then selects the permission level to grant to the third-party enterprise and informs the third-party enterprise of the corresponding dynamic token. The third-party enterprise then sends registration information containing the dynamic token and its own identity information to the communication gateway. The communication gateway forwards the registration information to the blockchain architecture. The blockchain architecture verifies the received dynamic token. If the received dynamic token matches one of the multiple dynamic tokens previously sent to the main enterprise, the third-party enterprise's identity information is verified. The blockchain architecture then records the third-party enterprise's identity information in its business data and uses the received dynamic token to compare with the corresponding permission level to determine the third-party enterprise's permission level.

[0045] An event listening service is also set up in the communication gateway of the microservice cluster to detect changes in business data in each blockchain node. If a change occurs, the microservice cluster is notified. After receiving the notification, the microservice cluster stores the change record in the basic database. In this way, each enterprise can be notified in a timely manner, and each enterprise can understand the change information by viewing the stored change record.

[0046] The base database records certain business data to facilitate the operation of the microservice cluster. To ensure consistency between the business data in the base database and the blockchain architecture, it is preferable to include a verification module in the microservice cluster setup to verify the corresponding data in the base database and the blockchain architecture. The specific verification is as follows:

[0047] First, the hash value of the data to be verified in the blockchain architecture is obtained, and then the hash value of the data to be verified in the basic database is obtained. The two hash values ​​are compared to see if they match. If they do not match, the data to be verified in the basic database is replaced with the data to be verified in the blockchain architecture. This is commonly known as the reconciliation function, which ensures data consistency. Furthermore, comparing hash values ​​can significantly improve the speed and efficiency of reconciliation. The record mode of the basic database is set to transaction compensation mode. If authentication or transaction data storage fails, reverse transaction processing will be performed to ensure data consistency between the microservice's local business database and the blockchain storage.

[0048] This invention also relates to a blockchain-based microservice authentication device, applicable to the aforementioned blockchain-based microservice authentication method, comprising:

[0049] The blockchain architecture includes multiple blockchain nodes, which are respectively built on multiple main enterprises;

[0050] The microservice cluster includes a registry center, configuration center, basic database, communication gateway, and service monitoring components; the communication gateway interacts with the blockchain architecture for data exchange.

[0051] A third-party client is used for data interaction between third-party enterprises and communication gateways.

[0052] The present invention also relates to a blockchain-based microservice authentication device, including a processor, a memory, and an authentication program stored in the memory and executable by the processor, wherein when the authentication program is executed by the processor, it implements the steps of the blockchain-based microservice authentication method described above.

[0053] The present invention also relates to a computer-readable storage medium storing an authentication program, wherein when the authentication program is executed by a processor, it implements the steps of the aforementioned blockchain-based microservice authentication method.

[0054] The foregoing has shown and described 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 embodiments and descriptions in the specification are merely illustrative of the principles of the invention. Various changes and modifications can be made to the invention without departing from its spirit and scope, and all such changes and modifications fall within the scope of the present invention as claimed. The scope of protection of the present invention is defined by the appended claims and their equivalents.

Claims

1. A blockchain-based microservice authentication method, characterized in that, include: Building a blockchain architecture: Multiple blockchain nodes are set up on multiple main enterprises. All blockchain nodes are combined into a blockchain architecture. The blockchain architecture stores business data in a distributed manner. The business data includes at least the identity information of each main enterprise. The blockchain architecture also includes an authentication module; Building a microservice cluster: A microservice cluster is built on a cloud server. The microservice cluster includes: a registry center, a configuration center, a basic database, a communication gateway, and service monitoring components; the blockchain architecture is registered to the registry center; the communication gateway is used for data interaction with the blockchain architecture and third-party enterprises. The microservice cluster also includes a verification module to verify the corresponding data in the underlying database and blockchain architecture; the specific verification is as follows: First, obtain the hash value of the data to be verified in the blockchain architecture, then obtain the hash value of the data to be verified in the basic database, and compare whether the two hash values ​​are consistent. If they are inconsistent, replace the data to be verified in the basic database with the data to be verified in the blockchain architecture. Third-party enterprise registration: The blockchain architecture is used to authenticate the identity information and permission level of third-party enterprises. After the authentication is successful, the blockchain architecture hashes and encrypts the identity information of third-party enterprises to generate a hash value. Then, the hash value and the corresponding permission level are stored in the business data. The specific methods for verifying the identity and access levels of third-party enterprises are as follows: A third-party enterprise sends a registration application containing the identity information of a main enterprise to a communication gateway. The communication gateway forwards the registration application to the blockchain architecture. After receiving the registration application, the blockchain architecture sends multiple dynamic tokens to the main enterprise, each dynamic token corresponding to a different permission level. Then, it sends registration information containing a dynamic token and the third-party enterprise's identity information to the communication gateway. The communication gateway forwards the registration information to the blockchain architecture. The blockchain architecture verifies the received dynamic token. If the verification is successful, it confirms that the third-party enterprise's identity information has been authenticated and determines the third-party enterprise's permission level. Third-party enterprise access authentication: The third-party enterprise sends an access application containing its identity information to the communication gateway, which then sends the third-party enterprise identity information to the blockchain architecture. The authentication module of the blockchain architecture performs authentication, comparing whether the hash value of the received third-party enterprise identity information is within the business data, and then sends the authentication result back to the communication gateway. The communication gateway determines whether to allow the third-party enterprise's access based on the feedback result from the blockchain architecture.

2. The blockchain-based microservice authentication method according to claim 1, characterized in that, In building a blockchain architecture, the services provided by the blockchain architecture are made idempotent.

3. The blockchain-based microservice authentication method according to claim 1, characterized in that, When building a microservice cluster, the business processing mode of the microservice cluster is set to asynchronous processing mode.

4. The blockchain-based microservice authentication method according to claim 3, characterized in that, In building a microservice cluster, when the communication gateway times out or encounters an error while receiving feedback information from the blockchain architecture, the communication gateway enables a periodic polling function.

5. The blockchain-based microservice authentication method according to claim 1, characterized in that, An event listening service is also set up in the communication gateway of the microservice cluster to detect changes in business data in each blockchain node. If a change occurs, the microservice cluster is notified, and the microservice cluster stores the change record in the basic database after receiving the notification.

6. A blockchain-based microservice authentication device, characterized in that, The blockchain-based microservice authentication method applicable to any one of claims 1-5 includes: The blockchain architecture includes multiple blockchain nodes, which are respectively built on multiple main enterprises; The microservice cluster includes a registry center, configuration center, basic database, communication gateway, and service monitoring components; the communication gateway interacts with the blockchain architecture for data exchange. A third-party client is used for data interaction between third-party enterprises and communication gateways.

7. A blockchain-based microservice authentication device, characterized in that, The system includes a processor, a memory, and an authentication program stored in the memory and executable by the processor, wherein when the authentication program is executed by the processor, it implements the steps of the blockchain-based microservice authentication method as described in any one of claims 1-5.

8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores an authentication program, wherein when the authentication program is executed by a processor, it implements the steps of the blockchain-based microservice authentication method as described in any one of claims 1-5.

Citation Information

Patent Citations

  • A method for implementing simple authentication authorization using an API gateway

    CN109039880A

  • Power mobile terminal identity authentication mechanism based on block chain

    CN110958111A

  • Micro-service method and device based on block chain, and medium

    CN113127499A

  • High-concurrency trusted block chain system and method supporting micro-service

    CN113726828A