A method and apparatus for restricting licenses in a distributed database

By using OpenSSL encryption and the Gossip mechanism to synchronize licenses in a distributed database, combined with SQL client and server checks, the shortcomings of existing license management technologies are addressed, enabling secure and stable management of the distributed database and ensuring the validity and access rights of the licenses.

CN119357921BActive Publication Date: 2025-10-31上海沄熹科技有限公司
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202411289523.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-09-14
Publication Date
2025-10-31
Estimated Expiration
2044-09-14

AI Technical Summary

Technical Problem

Existing technologies are insufficient for effectively managing distributed database licenses and cannot meet the security and management needs of enterprises.

Method used

The license content is encrypted using OpenSSL to generate public and private keys. The license activation code is synchronized in the database cluster through the Gossip mechanism, and timestamps and customer information are synchronized between nodes. Combined with the SQL client and server checking mechanisms, the validity of the license and usage rights are ensured.

Benefits of technology

It enables effective license management for distributed databases, preventing unauthorized and expired use, improving system security and stability, reducing management complexity, and ensuring normal use by ordinary users within the license validity period and restrictions after expiration.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119357921B_ABST
    Figure CN119357921B_ABST
Patent Text Reader

Abstract

This invention relates to the field of database technology, specifically providing a method and apparatus for restricting licenses in a distributed database, comprising the following steps: S1, license generation; S2, license usage; S3, the nodes of the database cluster synchronize the license activation code to other nodes via a Gossip mechanism; S4, when a regular user initiates a connection to the database server through the database's SQL client, the server checks whether the current time has exceeded the license's expiration time; S5, during SQL execution, a series of checks are performed to ensure the normal operation of the database's basic functions and the license's functionality; S6, each time the expiration time set in the license is checked to ensure it is greater than the current time. Compared with existing technologies, this invention can effectively prevent unauthorized and expired use of the database, ensuring the security and stability of the database system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of database technology, and specifically provides a method and apparatus for restricting licenses in distributed databases. Background Technology

[0002] With the development of information technology, databases are increasingly used in data storage and management. To regulate database use and prevent unauthorized or expired use, database license management is typically required.

[0003] However, most database license management solutions currently on the market are applicable to single-node databases, which makes it difficult to meet the actual needs of enterprises for distributed database management. Summary of the Invention

[0004] This invention addresses the shortcomings of the prior art by providing a practical method for restricting licenses in distributed databases.

[0005] A further technical objective of this invention is to provide a reasonably designed, secure, and applicable license restriction device for distributed databases.

[0006] The technical solution adopted by this invention to solve its technical problem is:

[0007] A method for restricting licenses in a distributed database, comprising the following steps:

[0008] S1, License generation;

[0009] The use of S2 and License;

[0010] S3, the nodes in the database cluster synchronize the license activation code to other nodes through the Gossip mechanism;

[0011] S4. When a regular user initiates a connection to the database server through the database's SQL client, the server will check whether the current time has exceeded the license's expiration time.

[0012] S5. During SQL execution, a series of checks will be performed to ensure that the basic functions of the database and the license function are used normally.

[0013] S6. Each time, check whether the expiration time set in the license is greater than the current time.

[0014] Furthermore, in step S1, a public key and a private key pair are generated using OpenSSL. The public key is used to encrypt the license content (expiration timestamp and customer information), and the private key is saved to the database for decrypting the license.

[0015] Furthermore, step S2 includes:

[0016] (1) After the database cluster starts, if the license is not set, ordinary users cannot log in to the database, and only security administrators are allowed to log in to execute commands to set the cluster settings;

[0017] (2) The security administrator adds the license to the started database cluster by configuring cluster.license in the cluster settings. The database uses its built-in private key to decrypt the license and verify its validity. If valid, the database cluster is activated successfully; otherwise, activation fails.

[0018] Furthermore, in step S3, each database node has an expiration timestamp and customer information, i.e., the function of license restriction.

[0019] Furthermore, in step S4, when a regular user initiates a connection to the database server through the database's SQL client, the server checks whether the current time has exceeded the license's expiration time. If it has, login is not allowed; otherwise, login is allowed normally.

[0020] When the database license is invalid, only security administrators are allowed to establish a connection with the database server through the database's SQL client, and only non-business operations are permitted.

[0021] If the usage period expires, regular users will no longer be able to connect to the database, and established connections will be automatically disconnected. At this time, only security administrators are allowed to log in and execute commands to update the license by setting cluster settings.

[0022] Furthermore, in step S5, firstly, check if the license is valid. If it is, execute normally; otherwise, proceed to the next step to check if it is an internal SQL execution within the database. If it is, execute normally; otherwise, proceed to the next step to check if the database being operated on is a system database. If it is, execute normally; otherwise, proceed to the next step.

[0023] Check if this is a cluster setting operation. If so, proceed normally; otherwise, report an error and prompt the user to enter a valid license activation code.

[0024] Furthermore, in step S6, the license expiration check frequency is once every 24 hours. Each time, it checks whether the expiration time set in the license is greater than the current time. If so, the license is valid.

[0025] Otherwise, the license will expire, and all connections initiated by SQL clients will be disconnected.

[0026] A license restriction device for a distributed database includes: at least one memory and at least one processor;

[0027] The at least one memory is used to store a machine-readable program;

[0028] The at least one processor is configured to invoke the machine-readable program to execute a license restriction method for a distributed database.

[0029] Compared with the prior art, the license restriction method and apparatus for distributed databases of the present invention have the following outstanding advantages:

[0030] This invention effectively prevents unauthorized and expired use of databases, ensuring the security and stability of the database system. By setting a cluster setting for one database node, it ensures that all database nodes can be subject to license restrictions.

[0031] This ensures that the database cluster can promptly update license information after license expiration, reducing system management complexity. It also implements access control for ordinary users, allowing normal database use within the license's validity period and automatically restricting access after expiration, thus improving system maintainability. Attached Figure Description

[0032] 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 some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0033] Appendix Figure 1 This is a schematic diagram illustrating the process of loading and parsing a license in a distributed database license restriction method.

[0034] Appendix Figure 2 This is a flowchart illustrating the license verification process for SQL client login in a license restriction method for a distributed database.

[0035] Appendix Figure 3 This is a flowchart illustrating the license verification process during SQL execution in a license restriction method for a distributed database.

[0036] Appendix Figure 4 This is a license restriction method for distributed databases that periodically checks whether the license is valid. Detailed Implementation

[0037] To enable those skilled in the art to better understand the present invention, the present invention will be further described in detail below with reference to specific embodiments. Obviously, the described embodiments are merely some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0038] The following is a preferred embodiment:

[0039] like Figure 1 As shown, a license restriction method for a distributed database in this embodiment includes the following steps:

[0040] S1, License generation;

[0041] Use OpenSSL to generate a public and private key pair. Use the public key to encrypt the license content (expiration timestamp and customer information), and save the private key to the database for decrypting the license.

[0042] The use of S2 and License;

[0043] (1) After the database cluster starts, if the license is not set, ordinary users cannot log in to the database, and only security administrators are allowed to log in to execute commands to set the cluster settings;

[0044] (2) The security administrator adds the license to the started database cluster by configuring cluster.license in the cluster settings. The database uses its built-in private key to decrypt the license and verify its validity. If valid, the database cluster is activated successfully; otherwise, activation fails.

[0045] set cluster setting cluster.license='zPEy3ZvpighzWl8sYzSFOXb+1JhKoWhfad9mS+N+fs+dcrnMSBrjScJEbX LvohWbxDcDBz1d+Wef1cSjStGj+4TZxDbLYG71M4CAsicm9yXIFLxhsOE+NhLHVqNvSL1eptR0+LbkY35qtjGYXTukXQLcqjL+zcvFbypscfrG6bE=';

[0046] S3: The nodes in the database cluster synchronize the license activation code to other nodes through the Gossip mechanism; therefore, each database node has the function of expiration timestamp and customer information, i.e., license restriction.

[0047] like Figure 2 As shown in S4, when a regular user initiates a connection to the database server through the database's SQL client, the server will check whether the current time has exceeded the license's expiration time.

[0048] If so, login is not allowed; otherwise, login is allowed normally.

[0049] When the database license is invalid (no license set or license expired), only security administrators are allowed to establish a connection with the database server through the database's SQL client, and only non-business operations (business operations include DDL and DML operations) are allowed.

[0050] If the usage period expires, regular users will no longer be able to connect to the database, and any established connections will be automatically disconnected. At this point, only security administrators will be allowed to log in and execute commands to update the license by configuring cluster settings.

[0051] like Figure 3 As shown in Figure S5, during the SQL execution process, a series of checks will be performed to ensure that the basic functions of the database and the license function are used normally.

[0052] First, check if the license is valid. If it is, proceed normally; otherwise, proceed to the next step: check if the SQL is executed within the database. If it is, proceed normally; otherwise, proceed to the next step: check if the database being operated on is a system database. If it is, proceed normally; otherwise, proceed to the next step.

[0053] Check if this is a cluster setting operation. If so, proceed normally; otherwise, report an error and prompt the user to enter a valid license activation code.

[0054] like Figure 4 As shown, S6, each time check whether the expiration time set in the License is greater than the current time;

[0055] The license expiration check frequency is once every 24 hours. Each time, it checks whether the expiration time set in the license is greater than the current time. If it is, the license is valid; otherwise, the license is invalid and all connections initiated by SQL clients are disconnected.

[0056] Based on the above method, a license restriction device for a distributed database in this embodiment includes: at least one memory and at least one processor;

[0057] The at least one memory is used to store a machine-readable program;

[0058] The at least one processor is configured to invoke the machine-readable program to execute a license restriction method for a distributed database.

[0059] The specific embodiments described above are merely specific examples of the present invention. The patent protection scope of the present invention includes, but is not limited to, the specific embodiments described above. Any technical solution that conforms to the technical claims of the present invention and any appropriate changes or substitutions made by a person skilled in the art should fall within the patent protection scope of the present invention.

[0060] Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the appended claims and their equivalents.

Claims

1. A license restriction method for a distributed database, characterized in that, It has the following steps: S1, License generation; Use OpenSSL to generate a public and private key pair, use the public key to encrypt the license content, and save the private key to the database for decrypting the license. The use of S2 and License; include: (1) After the database cluster starts, if the license is not set, ordinary users cannot log in to the database, and only security administrators are allowed to log in to execute commands to set the cluster settings; (2) The security administrator adds the license to the started database cluster by setting cluster.license in cluster settings. The database uses the built-in private key to decrypt the license and verify whether the license is valid. If it is valid, the database cluster is activated successfully; otherwise, the activation fails. S3, the nodes in the database cluster synchronize the license activation code to other nodes through the Gossip mechanism; Each database node has an expiration timestamp and customer information, which is the function of license restriction; S4. When a regular user initiates a connection to the database server through the database's SQL client, the server will check whether the current time has exceeded the license's expiration time. If yes, login will not be allowed; otherwise, login will be allowed normally. When the database license is invalid, only security administrators are allowed to establish a connection with the database server through the database's SQL client, and only non-business operations are permitted. If the usage time expires, ordinary users will no longer be able to connect to the database, and established connections will be automatically disconnected. At this time, only security administrators are allowed to log in and execute commands to update the license by setting cluster settings. S5. During SQL execution, a series of checks will be performed to ensure that the basic functions of the database and the license function are used normally. S6. Each time, check whether the expiration time set in the license is greater than the current time.

2. The license restriction method for a distributed database according to claim 1, characterized in that, In step S5, first, check if the license is valid. If it is, proceed normally; otherwise, proceed to the next step to check if it is executing SQL within the database. If it is, proceed normally. Otherwise, proceed to the next step and check if the database being operated on is a system database. If it is, proceed normally; otherwise, proceed to the next step. Check if this is a cluster setting operation. If so, proceed normally; otherwise, report an error and prompt the user to enter a valid license activation code.

3. The license restriction method for a distributed database according to claim 2, characterized in that, In step S6, the license expiration check frequency is once every 24 hours. Each time, it checks whether the expiration time set in the license is greater than the current time. If so, the license is valid. Otherwise, the license will expire, and all connections initiated by SQL clients will be disconnected.

4. A license restriction device for a distributed database, characterized in that, include: At least one memory and at least one processor; The at least one memory is used to store a machine-readable program; The at least one processor is configured to invoke the machine-readable program to perform the method according to any one of claims 1 to 3.

Citation Information

Patent Citations

  • Distributed database network connection management method based on Gossip

    CN114363357A

  • Software authorization management method

    CN114745149A

  • License authorization and verification method for KaiWuDB database

    CN116579014A

  • Distributed database cluster permission method and system based on authentication center

    CN117648678A