Distributed Cluster Software Licensing Method, Device, System, Equipment and Medium

By setting up an authorization client on the management node of the distributed cluster, obtaining and parsing the authorization information in the authorization file, software authorization for the distributed cluster is realized, and the problem of inapplicability of traditional authorization methods is solved, ensuring the software authorization and use of all worker nodes in the cluster.

CN115589320BActive Publication Date: 2025-06-20SANGFOR TECH INC
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202211229318.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-10-08
Publication Date
2025-06-20
Estimated Expiration
2042-10-08

AI Technical Summary

Technical Problem

It is difficult for the prior art to effectively license software in distributed clusters, especially in clusters deployed on public clouds. Traditional hardware dog, online and offline authorization methods are not applicable.

Method used

By setting up an authorized client on the management node of the distributed cluster, establish a communication connection with the authorized server on the public cloud, obtain the authorization file and parse the authorization information, and use software authorization to the cluster based on this information, so that the worker nodes joining the cluster have the right to use the authorized software.

Benefits of technology

The software authorization of distributed clusters is realized, so that all work nodes in the cluster can effectively use the authorized software, solve the problem that traditional authorization methods are not suitable for distributed clusters, and promote the development of digital transformation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115589320B_ABST
    Figure CN115589320B_ABST
Patent Text Reader

Abstract

The present invention discloses a method, device, system, electronic device and computer-readable storage medium for software authorization of a distributed cluster, which is applied to the field of computer technology. The method is applied to an authorization client and includes: obtaining an authorization file sent by an authorization server; parsing the authorization file to obtain authorization information; performing software authorization on the cluster where the authorization client is located based on the authorization information, so that the working nodes joining the cluster are entitled to use the software; The present invention can realize software authorization for a distributed cluster, so that the working nodes joining the cluster are entitled to use the authorized software, which is beneficial to promoting the development of digital transformation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] Embodiments of the present invention relate to the field of computer technology, and in particular, to a distributed cluster software authorization method, device, system, electronic device, and computer-readable storage medium. Background Art

[0002] The application scope of distributed systems is becoming wider and wider, covering all edge scenarios, opening up the channel from edge computing to cloud computing, and finally converging to digital transformation. In the process of realizing digital transformation, some problems have also been found to be needed to be solved. For example, after the software platform is sold to customers in the form of cluster products, its authorization method is still blank.

[0003] At present, there are three common software authorization methods: 1. If the client has the conditions for networking, authorization is performed online; 2. If the client cannot be connected to the Internet, authorization is performed offline; 3. In special scenarios, authorization is performed through a hardware dog. For distributed clusters, none of the above three authorization methods are feasible. The specific reasons are as follows: Distributed clusters can be deployed on public clouds (such as Alibaba Cloud, Tencent Cloud, and Amazon Cloud). Since the hardware dog is essentially a hardware device and must be plugged into a specific server, and there is no place for users to plug in hardware devices on the servers on the public cloud, distributed clusters cannot perform software authorization through the hardware dog method. In addition, common online and offline authorizations are all for single-instance software running on a single physical machine, which limits the software to run only on that physical machine and not on other physical machines. However, distributed systems are generally deployed in clusters and run on multiple physical machines or virtual machines. If only a physical machine is authorized, the authorization will become invalid when the cluster is restarted or the node goes offline, and the cluster can be migrated to other physical machines at any time during operation. Therefore, the method of software authorization for a physical machine is not applicable to distributed clusters.

[0004] In view of this, how to implement software authorization of a distributed cluster becomes a problem that needs to be solved by those skilled in the art. Summary of the invention

[0005] The purpose of the embodiments of the present invention is to provide a distributed cluster software authorization method, device, system, electronic device and computer-readable storage medium, which can realize software authorization for a distributed cluster during use, so that the working nodes joining the cluster have the right to use the authorized software, which is conducive to promoting the development of digital transformation.

[0006] In order to solve the above technical problems, an embodiment of the present invention provides a distributed cluster software authorization method, which is applied to an authorization client and includes:

[0007] Obtain the authorization file sent by the authorization server;

[0008] Parse the authorization file to obtain authorization information;

[0009] Based on the authorization information, perform software authorization on the cluster where the authorization client is located, so that the working nodes joining the cluster are entitled to use the software.

[0010] Optionally, the performing software authorization on the cluster where the authorization client is located based on the authorization information includes:

[0011] Perform a legality verification on the cluster where the authorization client is located according to the authorization information, and perform software authorization on the cluster when the verification is legal.

[0012] Optionally, the authorization information includes:

[0013] Authorization start time, authorization end time, authorized resource quota, and authorized master node identifier.

[0014] Optionally, the performing a legality verification on the cluster where the authorization client is located according to the authorization information includes:

[0015] Judge whether the authorized master node identifier is consistent with the current master node identifier of the cluster. If they are consistent, then judge whether the target resources of the working nodes in the cluster exceed the authorized resource quota. If not, the cluster where the authorization client is located is legal.

[0016] Optionally, when the software authorization on the cluster where the authorization client is located based on the authorization information is completed, it further includes:

[0017] Start the logical clock, and delete the working nodes in the cluster when the timing value of the logical clock is greater than the authorization duration; the authorization duration is determined based on the authorization start time and the authorization end time.

[0018] Optionally, the authorization client is set on a management node of the cluster.

[0019] Optionally, it further includes:

[0020] When a node addition request is detected, determine the remaining resource quota based on the authorized resource quota and the current used resource quota of the cluster;

[0021] Judge whether the resources of the working node to be added exceed the remaining resource quota. If they exceed, reject the addition; if not, add the working node to be added to the cluster.

[0022] An embodiment of the present invention further provides a distributed software authorization device, which is applied to an authorization client and includes:

[0023] An acquisition module, configured to acquire an authorization file sent by an authorization server;

[0024] An analysis module, configured to analyze the authorization file to obtain authorization information;

[0025] An authorization module, configured to perform software authorization on the cluster where the authorization client is located based on the authorization information, so that nodes joining the cluster are entitled to use the software.

[0026] An embodiment of the present invention further provides a distributed cluster software authorization system, including:

[0027] An authorization client, configured to send an authorization request to an authorization server, where the authorization request includes a software authorization identifier and a master node identifier;

[0028] An authorization server, configured to establish a mapping relationship between the software authorization identifier and the master node identifier according to the authorization request, and generate an authorization file and return it to the authorization client;

[0029] The authorization client is configured to acquire the authorization file, analyze the authorization file to obtain the authorization information, and perform software authorization on the cluster where the authorization client is located based on the authorization information, so that working nodes joining the cluster are entitled to use the software.

[0030] Optionally,

[0031] The authorization client is further configured to, when the current master node of the cluster goes offline, select a new master node from other management nodes of the cluster; send a new authorization request to the authorization server, where the new authorization request includes the master node identifier, the new master node identifier, and the software authorization identifier;

[0032] The authorization server is further configured to modify the mapping relationship between the software authorization identifier and the master node identifier to a mapping relationship between the software authorization identifier and the new master node identifier according to the new authorization request, and generate a new authorization file and return it to the client.

[0033] An embodiment of the present invention further provides an electronic device applied to an authorization client, including:

[0034] A memory, configured to store a computer program;

[0035] A processor, configured to implement the steps of the distributed cluster software authorization method as described above when executing the computer program.

[0036] An embodiment of the present invention also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the distributed cluster software authorization method as described above are implemented.

[0037] The present invention provides a distributed cluster software authorization method, device, system, electronic device, and computer-readable storage medium, which are applied to an authorization client. The method includes: obtaining an authorization file sent by an authorization server; parsing the authorization file to obtain authorization information; and performing software authorization on the cluster where the authorization client is located based on the authorization information, so that the working nodes joining the cluster are entitled to use the software.

[0038] It can be seen that the authorization client in the embodiment of the present invention obtains the authorization file sent by the authorization server, parses the authorization file to obtain the authorization information, and then performs software authorization on the cluster where the authorization client is located based on the authorization information. For a distributed cluster, when the cluster is entitled to use the software, the working nodes joining the cluster are also entitled to use the software. That is, the present invention can implement software authorization for a distributed cluster, enabling the working nodes joining the cluster to be entitled to use the authorized software, which is beneficial to promoting the development of digital transformation. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required for use in the prior art and the embodiments will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.

[0040] Figure 1 It is a schematic diagram of a distributed cluster software authorization process provided by an embodiment of the present invention;

[0041] Figure 2 It is a schematic flowchart of a distributed cluster software authorization method provided by an embodiment of the present invention;

[0042] Figure 3 It is a schematic structural diagram of a distributed cluster software authorization device provided by an embodiment of the present invention;

[0043] Figure 4 It is a schematic structural diagram of a distributed cluster software authorization system provided by an embodiment of the present invention;

[0044] Figure 5 It is a schematic structural diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0045] The embodiments of the present invention provide a distributed cluster software authorization method, device, system, electronic device, and computer-readable storage medium, which can implement software authorization for a distributed cluster during use, enabling the working nodes joining the cluster to have the right to use the authorized software, and facilitating the development of digital transformation.

[0046] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Apparently, the described embodiments are some, but not all, of the embodiments of the present invention. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.

[0047] Based on the existing software authorization methods, the method of authorizing through a hardware dongle. Since the hardware dongle is essentially a hardware device and must be plugged into a specific server, while the distributed cluster is deployed on a public cloud and there is no place for users to insert the hardware device on the servers of the public cloud, this method is not applicable to the software authorization of the distributed cluster; the online and offline authorization methods are both for authorizing single-instance software running on a single physical machine, which limits that the software can only run on this physical machine and cannot run on other physical machines. However, the distributed cluster is deployed in a clustered manner and consists of multiple physical machines or virtual machines. If software authorization is only performed on a certain physical machine, when the cluster restarts or a node goes offline, the authorization will become invalid, and the cluster can be migrated to other physical machines at any time during operation. Therefore, the method of software authorization for a certain physical machine is also not applicable to the distributed cluster.

[0048] In view of this, the embodiments of the present invention provide a distributed cluster software authorization method, device, system, and computer-readable storage medium. By setting an authorization client on a certain management node of the distributed cluster, establishing a communication connection between the authorization client and the authorization server on the public cloud, the authorization client receives the authorization file sent by the authorization server, parses the authorization file to obtain authorization information, and then performs software authorization on the cluster to which the authorization client belongs based on the authorization information, thereby realizing software authorization for each working node joining the cluster, enabling each working node joining the cluster to have the right to use the corresponding software. As Figure 1The following is a schematic diagram of the software authorization process for a distributed cluster provided by an embodiment of the present invention. There is an authorization server on the public cloud. The distributed cluster is a cluster composed of multiple working nodes (working node 1, working node 2, working node 3... working node n), and provides services externally in the form of a cluster. Assume that there is an authorization client on the management node 0 in the distributed cluster. Specifically, when the distributed cluster needs to perform software authorization, the authorization client selects a master node from working node 1, working node 2, working node 3... working node n, and sends the software authorization identifier and the master node identifier of the master node as an authorization request to the authorization server. The authorization server generates an authorization file based on the received master node identifier and software authorization identifier, and returns the authorization file to the authorization client. The authorization client parses the authorization file to obtain authorization information, and then performs software authorization on the cluster according to the authorization information. In this way, multiple working nodes (working node 1, working node 2, working node 3... working node n) in the cluster are all authorized to use the software.

[0049] Next, a software authorization method for a distributed cluster provided by an embodiment of the present application will be introduced in detail. Please refer to Figure 2 , Figure 2 which is a schematic flowchart of a software authorization method for a distributed cluster provided by an embodiment of the present invention. This method is applied to the authorization client and may specifically include:

[0050] S210: Obtain an authorization file sent by the authorization server;

[0051] It should be noted that in practical applications, the authorization client can be set on a certain management node in the cluster. When the distributed cluster needs to perform software authorization on the working nodes, an authorization request can be sent to the authorization server through the authorization client first. The authorization server generates an authorization file based on the authorization request and sends the authorization file to the authorization client so that the authorization client can receive the authorization file.

[0052] Specifically, when the distributed cluster needs to perform software authorization on the working nodes, the authorization client can select a master node from each working node of the distributed cluster. Specifically, the node identifiers of each working node in the distributed cluster can be obtained, and then the master node can be selected according to each working node identifier. Among them, a node identifier can be randomly selected from each working node identifier, and the working node corresponding to the node identifier is used as the master node. It is also possible to sort each node identifier by size and select the working node corresponding to the largest or smallest node identifier as the master node. The specific method of selecting the master node will not be elaborated in detail in the present invention.

[0053] Specifically, after selecting the master node, the authorization client sends an authorization request to the authorization server. The authorization request may include a software authorization identifier and a master node identifier. The authorization server generates an authorization file based on the software authorization identifier and the master node identifier in the authorization request. Specifically, the authorization server establishes a mapping relationship between the software authorization identifier and the master node identifier and generates an authorization file.

[0054] In practical applications, after purchasing the software, the user will obtain a software authorization identifier (specifically, it can be a string composed of a series of numbers and letters). When initially obtaining software permissions, the user can input the software authorization identifier through the UI interface of the nodes in the distributed cluster. Among them, after receiving the software authorization identifier input by the user, the authorization client can select the master node from each working node of the cluster, or can select the master node when receiving the software authorization request, and generate an authorization request including the software authorization identifier and the master node identifier after receiving the software authorization identifier input by the user. Of course, the authorization request can also include the address information corresponding to the node where the authorization client is located, so that after the authorization server generates the authorization file, it can return the authorization file to the authorization client according to the corresponding address information.

[0055] S220: Parse the authorization file to obtain authorization information;

[0056] It can be understood that after receiving the authorization file sent by the authorization server, the authorization client parses the authorization file to obtain authorization information.

[0057] S230: Perform software authorization on the cluster where the authorization client is located based on the authorization information, so that the working nodes joining the cluster have the right to use the software.

[0058] Specifically, after obtaining the authorization information, the authorization client can perform software authorization on the cluster based on the authorization information, enabling the cluster to have the right to use the software. Therefore, each working node joining the cluster also has the right to use the software, that is, realizing software authorization for each working node in the cluster.

[0059] It can be seen from the above technical solutions that the authorization client obtains the authorization file sent by the authorization server, parses the authorization file to obtain authorization information, and then performs software authorization on the cluster where the authorization client is located based on the authorization information. For a distributed cluster, when the cluster has the right to use the software, the working nodes joining the cluster also have the right to use the software. That is, the present invention can realize software authorization for a distributed cluster, enabling the working nodes joining the cluster to have the right to use the authorized software, which is conducive to promoting the development of digital transformation. Further, the software authorization of the cluster where the authorization client is located based on the authorization information in the above S230 includes:

[0060] Perform a legality verification on the cluster where the authorized client is located based on the authorization information, and perform software authorization on the cluster when the verification is legal.

[0061] It should be noted that after the authorized client receives the authorization file sent by the authorization server and parses the authorization information, in order to prevent users from stealing the software and further improve the software security, it is possible to verify whether the current cluster is legal based on this authorization information, and only perform software authorization on the cluster when the cluster is verified to be legal.

[0062] Specifically, the authorization information in the embodiments of the present invention may include: authorization start time, authorization end time, authorized resource quota, and authorized master node identifier.

[0063] Among them, the authorized resource quota can be used to limit the total number of authorized nodes in the cluster. The authorized duration can be calculated through the authorization start time and the authorization end time. Of course, the authorized duration can also be directly included in the authorization information. For example, the authorization start time is 2021-11-10, the authorization end time is 2021-11-10, the authorized duration is 10 years, the authorized quota is 50 nodes, that is, 50 devices can be added to this distributed cluster, the maximum usage period is 10 years, and the master device identifier is: 326771BF6EE08E543362.

[0064] Furthermore, the process of performing a legality verification on the cluster where the authorized client is located according to the authorization information may specifically include:

[0065] Judge whether the authorized master node identifier is consistent with the current master node identifier of the cluster. If they are consistent, then judge whether the target resources of the working nodes in the cluster exceed the authorized resource quota. If not, the cluster where the authorized client is located is legal.

[0066] It can be understood that in order to prevent users from stealing the software and prevent the authorization file from being distributed or copied at will, in the embodiments of the present invention, after the authorized client parses the authorization information, it is further verified whether the authorized master node identifier in the authorization information is consistent with the current master node identifier of the cluster. When the two are consistent, it is further judged whether the target resources of the working nodes in the cluster exceed the authorized resource quota. When the target resources of the working nodes in the cluster do not exceed the authorized resource quota, it is determined that the cluster is legal, and software authorization can be performed on the cluster based on the authorization information.

[0067] It should also be noted that, in practical applications, in order to further prevent software piracy, the authorization server in the embodiments of the present invention can send the signed and protected authorization file to the authorization client. It can also encrypt the signed and protected authorization file with the public key in a set of key pairs (public key and private key), and then send the encrypted authorization file to the authorization client to prevent the information in the authorization file from being tampered with, etc., further improving the security of the authorization file. After receiving the authorization file, the authorization client can decrypt the authorization file with the private key of the key pair and parse the decrypted authorization file to obtain the authorization information.

[0068] In addition, in the embodiments of the present invention, in order to further prevent users from tampering with the content in the authorization information, such as modifying the authorization expiration time, increasing the quota of cluster authorization, etc., the parsed authorization information can be protected by signature and the signed and protected authorization information can be stored, so as to achieve the purpose of anti-piracy.

[0069] Further, when the software authorization for the cluster where the authorization client is located is completed based on the authorization information in S230 above, the method may further include:

[0070] Start a logical clock, and when the timing value of the logical clock is greater than the authorization duration, delete the working nodes in the cluster; the authorization duration is determined based on the authorization start time and the authorization expiration time.

[0071] It should be noted that, in order to prevent users from achieving the purpose of piracy by modifying the system time, a logical clock can also be built into the authorization client in the embodiments of the present invention. When the software authorization for the cluster is completed, start this logical clock, which accumulates by 1 every second. When the accumulated value is greater than the authorization duration, the software authorization for the cluster becomes invalid. At this time, delete the working nodes in the cluster, so as to achieve the purpose of preventing users from continuing to use the distributed cluster.

[0072] Further, the method may further include:

[0073] When a node addition request is detected, determine the remaining resource quota based on the authorized resource quota and the currently used resource quota of the cluster;

[0074] Judge whether the resources of the working node to be added exceed the remaining resource quota. If they exceed, reject the addition; if they do not exceed, add the working node to be added to the cluster.

[0075] Specifically, in practical applications, the number of worker nodes in the cluster can be dynamically adjusted according to actual needs. That is, when the worker nodes in the current cluster do not meet the actual needs, new worker nodes can be added to the cluster. When the authorized client in the cluster detects an addition request, it can determine the remaining resource quota based on the authorized resource quota in the authorization information and the currently used resource quota of the cluster. For example, if the authorized resource quota is 50 and the currently used resource quota is 50, then the remaining resource quota is 0. If the resource of the worker node to be added is 2 and the remaining resource quota is less than the resource of the worker node to be added, the addition of the new worker node will be rejected at this time. If the currently used resource quota is 45, then the remaining resource quota of 5 is greater than the resource of the worker node to be added, and the worker node to be added will be added to the cluster at this time, so that the newly added worker node has the right to use the corresponding software.

[0076] In addition, in the process of the authorized client sending an authorization request to the authorization server in practical applications, in the case where the authorized client and the authorization server cannot perform wireless communication (i.e., offline), after the master node is selected on the authorized client, the software authorization identifier and the master node identifier can be exported from the device through a transfer medium (such as a USB flash drive, etc.), and the software authorization identifier and the master node identifier can be uploaded to the authorization server through a device that can be wirelessly connected to the server. After the authorization server generates the authorization file, the authorization file can be sent to the user's email, etc., and then the authorization file is imported through the UI (User Interface) interface of the distributed cluster through the transfer medium. And during the process of importing the authorization file, it is verified whether the authorization file has been tampered with through numerical fingerprints. After the verification is successful, the authorized client further parses the authorization file to obtain the authorization information and stores the authorization information in the distributed configuration center for the nodes in the distributed cluster to complete software authorization according to the authorization information.

[0077] Based on the above embodiments, an embodiment of the present invention further provides a distributed cluster software authorization device, which is applied to an authorized client. Specifically, please refer to Figure 3 , and the device includes:

[0078] An obtaining module 31, configured to obtain an authorization file sent by an authorization server;

[0079] An analyzing module 32, configured to analyze the authorization file to obtain authorization information;

[0080] An authorizing module 33, configured to perform software authorization on the cluster where the authorized client is located based on the authorization information, so that the nodes joining the cluster have the right to use the software.

[0081] It should be noted that the distributed software authorization device provided in the embodiments of the present invention has the same beneficial effects as the distributed software authorization method provided in the above embodiments. For the specific introduction of the distributed software authorization method involved in the embodiments of the present invention, please refer to the above embodiments, and the present invention will not elaborate herein.

[0082] Based on the above embodiments, the embodiments of the present invention further provide a distributed cluster software authorization system. Specifically, please refer to Figure 4 , and the system includes:

[0083] An authorization client 41, configured to send an authorization request to an authorization server 42, where the authorization request includes a software authorization identifier and a master node identifier;

[0084] An authorization server 42, configured to establish a mapping relationship between the software authorization identifier and the master node identifier according to the authorization request, and generate an authorization file to return to the authorization client 41;

[0085] The authorization client 41 is configured to obtain the authorization file, parse the authorization file to obtain authorization information, and perform software authorization on the cluster where the authorization client is located based on the authorization information, so that the working nodes joining the cluster are entitled to use the software.

[0086] It should be noted that in the embodiments of the present invention, when software authorization needs to be performed on a working node in a distributed cluster, the authorization client 41 can first send an authorization request to the authorization server 42. The authorization request includes a software authorization identifier and a master node identifier. The authorization server 42 establishes a mapping relationship between the software authorization identifier and the master node identifier based on the authorization request, then generates an authorization file, and sends the authorization file to the authorization client 41. After obtaining the authorization file, the authorization client 41 parses the authorization file to obtain authorization information, and then performs software authorization on the cluster where the authorization client 41 is located based on the authorization information, so that the working nodes joining the cluster are entitled to use the software.

[0087] Further, the authorization client 41 is further configured to, when the current master node of the cluster goes offline, select a new master node from other management nodes of the cluster; send a new authorization request to the authorization server 42, where the new authorization request includes a master node identifier, a new master node identifier, and a software authorization identifier;

[0088] The authorization server 42 is further configured to modify the mapping relationship between the software authorization identifier and the master node identifier to the mapping relationship between the software authorization identifier and the new master node identifier according to the new authorization request, and generate a new authorization file to return to the client 41.

[0089] It can be understood that due to the dynamics in the distributed cluster, nodes can be added or deleted at any time, and the states of the nodes also change. In the case where the master node goes offline (either normally or due to a crash), the mapping relationship between the master node identifier and the software authorization identifier established by the authorization server 42 will become invalid. Since the cluster performs software authorization based on the existing authorization information, and the existing authorization information is generated based on the master node identifier of the offline master node, the invalidation of the master node identifier in the existing authorization information in the cluster will lead to software authorization failure in the cluster. Therefore, in the embodiments of the present invention, the authorization client 41 can detect the state of the master node. When it is detected that the master node has gone offline, a new master node can be reselected from other management nodes in the cluster. Specifically, the node identifiers of other management nodes can be obtained, and based on the node identifiers of other management nodes, a new master node can be selected therefrom. Then, the authorization client 41 resends a new authorization request (master node identifier, new master node identifier, and software authorization identifier) to the authorization server 42. After receiving the master node identifier, new master node identifier, and software authorization identifier, the authorization server 42 modifies the original mapping relationship between the master node identifier and the software authorization identifier to the mapping relationship between the new master node identifier and the software authorization identifier according to the master node identifier, new master node identifier, and software authorization identifier, and generates a new authorization file, and returns the new authorization file to the authorization client 41. The authorization client 41 receives the new authorization file and parses it to obtain new authorization information. Among them, the authorization start time, authorization medium time, and authorization resource quota in the new authorization information are the same as those in the old authorization information.

[0090] Among them, the process of detecting whether the current master node in the cluster has gone offline can specifically include:

[0091] Obtain the node identifiers of each management node in the cluster;

[0092] Determine whether the current master node identifier exists among the node identifiers. If not, it is determined that the current master node has gone offline.

[0093] Specifically, in order to simply and efficiently detect whether the current master node has gone offline, a daemon process can be pre-deployed on each management node, and it is set that the daemon process reports the node identifier of the corresponding management node at every preset time interval. After the authorization client 41 obtains the node identifiers of each management node, the node identifiers of each management node can be formed into an identifier set, and further determine whether the current master node identifier exists in the identifier set. If it exists, it means that the corresponding current master node has not gone offline. If it does not exist, it means that the corresponding current master node has gone offline, and a new master node needs to be reselected.

[0094] Based on the above embodiments, the embodiments of the present invention further provide an electronic device, which is applied to the authorization client. For details, please refer toFigure 5 , the electronic device includes:

[0095] A memory for storing computer programs;

[0096] A processor for implementing the steps of the distributed software cluster authorization method as described above when executing the computer program.

[0097] The electronic device provided in this embodiment may include, but is not limited to, a smart phone, a tablet computer, a laptop computer, or a desktop computer, etc.

[0098] Among them, the processor 21 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 21 may be implemented in at least one hardware form of DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), or PLA (Programmable Logic Array). The processor 21 may also include a main processor and a coprocessor. The main processor is a processor for processing data in the wake state, also known as the CPU (Central Processing Unit); the coprocessor is a low-power processor for processing data in the standby state. In some embodiments, the processor 21 may be integrated with a GPU (Graphics Processing Unit), and the GPU is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 21 may further include an AI (Artificial Intelligence) processor, and the AI processor is used to process computational operations related to machine learning.

[0099] The memory 20 may include one or more computer-readable storage media, and the computer-readable storage media may be non-transitory. The memory 20 may further include high-speed random access memory and non-volatile memory, such as one or more disk storage devices and flash storage devices. In this embodiment, the memory 20 is at least used to store the following computer program 201. After the computer program is loaded and executed by the processor 21, it can implement the relevant steps of the XXX method disclosed in any of the foregoing embodiments. In addition, the resources stored in the memory 20 may further include an operating system 202 and data 203, etc., and the storage method may be transient storage or permanent storage. Among them, the operating system 202 may include Windows, Unix, Linux, etc. The data 203 may include, but is not limited to, set offsets, etc.

[0100] In some embodiments, the electronic device may further include a display screen 22, an input / output interface 23, a communication interface 24, a power supply 25, and a communication bus 26.

[0101] Those skilled in the art can understand that Figure 4 the structure shown in does not constitute a limitation on the electronic device, and it may include more or fewer components than those shown in the figure.

[0102] It can be understood that if the distributed software licensing method in the above embodiments is implemented in the form of software functional units and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and executes all or part of the steps of the methods in the various embodiments of the present application. The aforementioned storage medium includes: USB flash drives, mobile hard disks, read-only memories (ROM), random access memories (RAM), electrically erasable programmable ROMs, registers, hard disks, removable disks, CD-ROMs, magnetic disks, or optical disks, etc., which can store program codes.

[0103] Based on this, the embodiments of the present invention further provide a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the distributed cluster software licensing method as described above are implemented.

[0104] In this specification, the various embodiments are described in a progressive manner. Each embodiment focuses on the differences from other embodiments. The same or similar parts among the various embodiments can be referred to each other. For the devices disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the description is relatively simple, and the relevant parts can be referred to the description of the method part.

[0105] It should also be noted that in this specification, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the term "comprising", "including" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article or device comprising a series of elements not only includes those elements but also includes other elements not expressly listed, or elements inherent to such process, method, article or device. Without further limitation, an element defined by the phrase "comprising an..." does not exclude the presence of additional identical elements in the process, method, article or device comprising the element.

[0106] The foregoing description of the disclosed embodiments enables those skilled in the art to practice or use the invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the invention. Therefore, the invention is not to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A distributed cluster software authorization method, characterized in that, Applied to an authorized client, including: Obtain an authorization file sent by an authorization server; the authorization file is generated by the authorization server based on an authorization request sent by the authorized client, and the authorization request includes a software authorization identifier and a master node identifier; Parse the authorization file to obtain authorization information; the authorization information includes an authorized resource quota, and the authorized resource quota is used to limit the total number of authorized nodes in the cluster; When the target resources of the working nodes in the cluster do not exceed the authorized resource quota, perform software authorization on the cluster where the authorized client is located based on the authorization information, so that the working nodes joining the cluster are entitled to use the software; When a node addition request is detected, determine the remaining resource quota based on the authorized resource quota and the currently used resource quota of the cluster; When the remaining resource quota is less than the resources of the working node to be added, reject the addition; further including: When it is detected that the current master node of the cluster goes offline, select a new master node from other management nodes of the cluster, and send a new authorization request to the authorization server, so that the authorization server generates a new authorization file according to the new authorization request, and the new authorization request includes a master node identifier, a new master node identifier, and a software authorization identifier.

2. The distributed cluster software authorization method according to claim 1, characterized in that, The performing software authorization on the cluster where the authorized client is located based on the authorization information includes: Perform a legality verification on the cluster where the authorized client is located according to the authorization information, and perform software authorization on the cluster when the verification is legal.

3. The distributed cluster software authorization method according to claim 2, characterized in that, The authorization information includes: An authorization start time, an authorization end time, and an authorized master node identifier.

4. The distributed cluster software authorization method according to claim 3, characterized in that, The performing a legality verification on the cluster where the authorized client is located according to the authorization information includes: Judge whether the authorized master node identifier is the same as the current master node identifier of the cluster. If they are the same, then judge whether the target resources of the working nodes in the cluster exceed the authorized resource quota. If not, the cluster where the authorized client is located is legal.

5. The distributed cluster software authorization method according to claim 3, characterized in that, When the software authorization on the cluster where the authorized client is located based on the authorization information is completed, further including: Start a logical clock, and delete the working nodes in the cluster when the counting value of the logical clock is greater than the authorization duration; the authorization duration is determined based on the authorization start time and the authorization end time.

6. The distributed cluster software authorization method according to claim 1, characterized in that, The authorized client is set on a management node of the cluster.

7. The distributed cluster software authorization method according to claim 1, characterized in that, Further including: Judge whether the resources of the working node to be added exceed the remaining resource quota. If not, add the working node to be added to the cluster.

8. A distributed cluster software authorization device, characterized in that, Applied to an authorized client, including: An obtaining module, configured to obtain an authorization file sent by an authorization server; the authorization file is generated by the authorization server based on an authorization request sent by the authorized client, and the authorization request includes a software authorization identifier and a master node identifier; A parsing module, configured to parse the authorization file to obtain authorization information; the authorization information includes an authorized resource quota, and the authorized resource quota is used to limit the total number of authorized nodes in the cluster; An authorization module, which is used to perform software authorization on the cluster where the authorization client is located based on the authorization information when the target resources of the working nodes in the cluster do not exceed the authorized resource quota, so that the nodes joining the cluster are entitled to use the software; it is also used to, when detecting a node addition request, determine the remaining resource quota based on the authorized resource quota and the currently used resource quota of the cluster, and reject the addition when the remaining resource quota is less than the resources of the working node to be added; The obtaining module is further configured to, when detecting that the current master node of the cluster goes offline, select a new master node from other management nodes of the cluster, send a new authorization request to the authorization server, and obtain a new authorization file; the new authorization file is generated by the authorization server according to the new authorization request; the new authorization request includes a master node identifier, a new master node identifier, and a software authorization identifier.

9. A distributed cluster software authorization system, characterized in that, Comprising: An authorization client, which is used to send an authorization request to an authorization server, and the authorization request includes a software authorization identifier and a master node identifier; An authorization server, which is used to establish a mapping relationship between the software authorization identifier and the master node identifier according to the authorization request, and generate an authorization file and return it to the authorization client; The authorization client is used to obtain the authorization file, parse the authorization file to obtain the authorization information, and perform software authorization on the cluster where the authorization client is located based on the authorization information when the target resources of the working nodes in the cluster do not exceed the authorized resource quota, so that the working nodes joining the cluster are entitled to use the software; It is also used to, when detecting a node addition request, determine the remaining resource quota based on the authorized resource quota and the currently used resource quota of the cluster, and reject the addition when the remaining resource quota is less than the resources of the working node to be added; wherein, the authorization information includes an authorized resource quota, and the authorized resource quota is used to limit the total number of authorized nodes in the cluster; The authorization client is further configured to, when the current master node of the cluster goes offline, select a new master node from other management nodes of the cluster; send a new authorization request to the authorization server, and the new authorization request includes the master node identifier, the new master node identifier, and the software authorization identifier; The authorization server is further configured to modify the mapping relationship between the software authorization identifier and the master node identifier to the mapping relationship between the software authorization identifier and the new master node identifier according to the new authorization request, and generate a new authorization file and return it to the client.

10. An electronic device, characterized in that Applied to an authorization client, comprising: A memory, which is used to store a computer program; A processor, which is used to implement the steps of the distributed cluster software authorization method according to any one of claims 1 to 7 when executing the computer program.

11. A computer-readable storage medium, characterized in that A computer program is stored on a computer-readable storage medium, and when the computer program is executed by a processor, the steps of the distributed cluster software authorization method according to any one of claims 1 to 7 are implemented.

Citation Information

Patent Citations

  • Software authorization method and system based on cluster deployment

    CN109977631A