Identification code generation, identification code verification method, and related devices

The identification code generated by the main organization and database feature information solves the problem of frequent changes in the identification code in the container environment, and realizes the stability and expansion of the identification code during the container creation and destruction process.

CN116186676BActive Publication Date: 2025-08-15SHENZHEN AOZHE NETWORK TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310204386.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-02-22
Publication Date
2025-08-15
Estimated Expiration
2043-02-22

AI Technical Summary

Technical Problem

In a container environment, the application runs in a container created and destroyed at any time. The CPU and network card information of the container may change at any time, causing the generated identification code to change frequently, resulting in the license invalidation and the authorization process cannot be completed normally.

Method used

When generating the identification code, the main organization information and database feature information of the distributed container are used as the basis to generate identification codes that do not change with the creation and destruction of the container through MD5 encryption and string operations.

Benefits of technology

The generated identification code has nothing to do with the hardware on which the container relies. It can remain stable during the creation and destruction of the container, meeting the capacity expansion and shrinking requirements in distributed containers without reapplying for a license file.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116186676B_ABST
    Figure CN116186676B_ABST
Patent Text Reader

Abstract

Based on the above problems, the embodiment of the present application proposes an identification code generation, identification code verification method, and related devices, which relate to the field of cloud computing. According to the identification code generation method of the present application, it includes: obtaining the main organization of the distributed container and the main organization information of the main organization; the main organization represents the cluster where the distributed container is located, and the main organization is connected to the database; obtaining the database feature information of the database; generating identification information based on the main organization information and the database feature information; generating an identification code according to a preset identification code generation algorithm based on the identification information. According to the identification code generation method of the first aspect of the present application, an identification code is generated based on two types of information: database feature information and main organization information. The generated identification code can be made independent of the hardware on which the container relies and will not change with the creation and destruction of the container.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of cloud computing, and in particular to an identification code generation and verification method, and related devices. Background Art

[0002] In the distributed cluster licensing mechanism, the most important authorization data is the identification code of the authorized machine. Existing technologies typically use the machine's local CPU and network card information to perform specific calculations, generating a machine code strongly associated with the local machine as the identification code. This identification code is then used to complete license application and authentication.

[0003] The problem with existing technologies is that in a container environment, applications run in containers that are created and destroyed at any time. The container's CPU and network card information may change at any time, causing the generated identification code to change frequently. This will invalidate the obtained license and prevent the authorization process from completing normally. Summary of the Invention

[0004] The following is a summary of the subject matter described in detail herein. This summary is not intended to limit the scope of the claims.

[0005] In response to the above issues, the embodiments of the present application propose an identification code generation and verification method, and related devices. The identification code generated by this method is independent of the hardware on which the container relies and will not change with the creation and destruction of the container.

[0006] According to the first aspect of the present application, a method for generating an identification code is proposed, which is applied to a distributed container, including: obtaining a primary organization of the distributed container and primary organization information of the primary organization; the primary organization represents the cluster where the distributed container is located, and the primary organization is connected to a database; obtaining database feature information of the database; generating identification information based on the primary organization information and the database feature information; and generating an identification code according to a preset identification code generation algorithm based on the identification information.

[0007] According to the identification code generation method of the first aspect of the present application, the identification code is generated based on database feature information and primary organization information. Because database feature information and primary organization information are immutable in a distributed container system, the generated identification code is independent of the hardware underlying the container and does not change with the creation or destruction of the container.

[0008] In some embodiments, obtaining the database characteristic information of the database includes: obtaining at least one of the connection port of the database, the database address of the database, and the database name of the database through the primary organization; generating database connection information based on at least one of the connection port, the database address, and the database name; communicating with the database based on the database connection information, and obtaining the data table name of the database and the database hardware information of the database; generating the database characteristic information based on at least one of the database connection information, the data table name, and the database hardware information.

[0009] In some embodiments, the main organization information includes: a main organization name and a main organization identification code, and generating identification information based on the main organization information and the database characteristic information includes: parsing the main organization identification code from the main organization information; obtaining the main organization name and using string operations to splice the main organization information and the main organization identification code to obtain first splicing information; performing MD5 encryption on the first splicing information to obtain first encrypted information; performing MD5 encryption on the database characteristic information to obtain second encrypted information; generating the identification information based on the first encrypted information and the second encrypted information.

[0010] In some embodiments, generating an identification code according to a preset identification code generation algorithm based on the identification information includes: using string operations to truncate the first encrypted information and the second encrypted information according to preset truncation rules to obtain multiple truncated information; using string operations to splice the multiple truncated information according to preset splicing rules to generate an identification code.

[0011] According to the second aspect of the present application, an identification code verification method is proposed for a distributed container, the method comprising: obtaining a license file; the license file is applied for an identification code generated by any of the identification code generation methods described above; parsing the license file to obtain an identification code; using a preset parsing algorithm to obtain primary organization information and database feature information from the identification code; obtaining the primary organization of the distributed container and the primary organization verification information and database feature verification information of the primary organization; the primary organization represents the cluster in which the distributed container is located; when the primary organization information is consistent with the primary organization verification information, and the database feature information is consistent with the database feature verification information, the identification code verification is deemed to have passed.

[0012] In some embodiments, the primary organization information includes: a primary organization name and a primary organization identification code; the database feature information includes: database connection information, and / or database hardware information, and / or a data table name.

[0013] According to the third aspect of the present application, an identification code verification device is proposed for a distributed container, comprising: a license generation module: used to obtain a license file; the license file is applied for by an identification code generated by any of the identification code generation methods described above; a license parsing module, used to parse the license file and obtain an identification code; a data parsing module, used to obtain main organization information and database feature information from the identification code using a preset parsing algorithm; an information acquisition module, used to obtain the main organization of the distributed container and the main organization verification information and database feature verification information of the main organization; the main organization represents the cluster where the distributed container is located; a comparison verification module, used to deem the verification to be passed when the main organization information is consistent with the main organization verification information and the database feature information is consistent with the database feature verification information.

[0014] According to the fourth aspect of the present application, an identification code generation device is proposed for a distributed container, including: a main organization information acquisition module, used to obtain the main organization of the distributed container and the main organization information of the main organization; the main organization represents the cluster where the distributed container is located, and the main organization is connected to the database; a database feature information acquisition module, used to obtain database feature information of the database; an identification information generation module, used to generate identification information based on the main organization information and the database feature information; an identification code generation module, used to generate an identification code according to a preset identification code generation algorithm based on the identification information.

[0015] According to the fifth aspect of the present application, an electronic device is proposed, comprising a memory, a processor, a communication bus, a communication interface, and a computer program stored on the memory and runnable on the processor, wherein the communication bus is used to realize connection and communication between the processor and the memory; when the processor executes the computer program, an identification code generation method as described in any one of the above items is realized.

[0016] According to the sixth aspect of the present application, a storage medium is proposed, which is a readable storage medium, and the readable storage medium stores a computer program, and the computer program is used to enable a computer to execute: an identification code generation method as described in any one of the above items, and / or, one of the above identification code verification methods.

[0017] It can be understood that the beneficial effects of the above-mentioned second to sixth aspects compared with the relevant technologies are the same as the beneficial effects of the above-mentioned first aspect compared with the relevant technologies. Please refer to the relevant description in the above-mentioned first aspect and will not be repeated here.

[0018] Other features and advantages of the present application will be described in the following description, and in part will become apparent from the description, or will be understood by practicing the present application. The purposes and other advantages of the present application can be achieved and obtained through the structures particularly pointed out in the description, claims and drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] Figure 1 It is a schematic diagram of the implementation architecture of an embodiment of the present application.

[0020] Figure 2 This is a flowchart of the identification code generation method of an embodiment of the present application.

[0021] Figure 3 This is an embodiment of the present application Figure 2 Flowchart of S130.

[0022] Figure 4 Flowchart of the identification code verification method according to an embodiment of the present application.

[0023] Figure 5 Schematic diagram of an identification code verification device according to an embodiment of the present application.

[0024] Figure 6 2 is a schematic diagram of an identification code generating device according to an embodiment of the present application.

[0025] Figure 7 It is a structural diagram of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION

[0026] In the following description, specific details such as specific system structures and technologies are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the embodiments of the present application can also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, optical paths, and methods are omitted to prevent unnecessary details from obstructing the description of the embodiments of the present application.

[0027] It should be noted that although a logical order is shown in the flowcharts, in some cases, the steps shown or described may be performed in a different order than that shown in the flowcharts. The terms "first," "second," and the like in the specification, claims, and drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence.

[0028] It should also be understood that the references to "one embodiment" or "some embodiments" described in the description of the embodiments of the present application mean that one or more embodiments of the embodiments of the present application include the specific features, structures or characteristics described in conjunction with the embodiment. Therefore, the phrases "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in the description of the embodiments of the present application, unless otherwise clearly defined, words such as setting, installing, connecting, etc. should be understood in a broad sense, and those skilled in the art can reasonably determine the specific meanings of the above words in the embodiments of the present application in combination with the specific content of the technical solution.

[0029] In order to make the objectives, technical solutions and advantages of this application clearer, the implementation methods of this application will be further described in detail below with reference to the accompanying drawings.

[0030] Containerization is a software deployment process that bundles an application's code with all the files and libraries it needs to run on any infrastructure. Typically, to run any application on a computer, you must install the version of the application that matches the computer's operating system. However, with containerized devices, a single software package, or container, can be created that runs on all types of devices and operating systems.

[0031] Distributed computing is a method of enabling multiple computers to work together to solve common problems. It makes a computer network appear like a single, powerful computer, providing massive resources to tackle complex challenges. Distributed systems can evolve with workloads and demand. Therefore, new nodes—that is, more computing devices—can be added to a distributed computing network as needed.

[0032] The K8S (Kubernetes) architecture uses distributed containers. A distributed container cluster in the Kubernetes architecture consists of a master node and multiple slave nodes. Multiple application components run in the cluster, which is a collection of computing, storage, and network resources, providing resource management, scheduling, and maintenance functions for various running applications. In the embodiments of the present application, each slave node can include multiple container groups (Pods), which run various applications in the container groups (Pods).

[0033] A license is a categorized authorization method used for software licensing. Currently, software licensing authentication typically involves first obtaining the server's physical characteristics (typically the network card MAC address and hard drive serial number), then adding authorization information (such as the number of CPUs permitted and the expiration date) to create a license file using a pre-set encryption method.

[0034] Figure 1 It is a schematic diagram of the implementation architecture of an embodiment of the present application.

[0035] The identification code generation method and identification code verification method of the present application can be run on Figure 1 In the distributed container architecture 10 shown, the distributed container architecture 10 consists of a terminal 11, a server cluster 12, a distributed cache 13, and a persistence layer 14. Terminal 11 can be a consumer-grade computer system such as a desktop, laptop, handheld computer, notebook computer, or ultra-mobile personal computer (UMPC), or a portable small terminal device such as a smartphone, PDA, tablet computer, or industrial terminal. Specifically, terminal 11 can connect to server cluster 12 and perform interactive tasks. In some embodiments, terminal 11 may not be present, and server cluster 12 may include a human-computer interaction device through which interaction can be performed. Server cluster 12 is composed of at least one server. This can be a cloud server or a standalone physical server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms. Server cluster 12 includes at least one first slave node 15. Specifically, it may include a first slave node 15, a second slave node 16, ..., and an Nth slave node 17. Each slave node may include a first container group 18, a second container group 19, ..., and an Nth container group 20. Distributed cache 13 may be, for example, a Redis cache, and persistence layer 14 may be, for example, a database such as MySQL, Oracle, or an external cloud storage. Although not shown in the figure, in some embodiments, distributed cache 13 is connected to persistence layer 14 and stores frequently queried data in persistence layer 14. Distributed container architecture 10 may illustratively utilize the K8S (Kubernetes) architecture.

[0036] Based on the above-mentioned distributed container architecture 10, the present application proposes an identification code generation method, verification method, device, electronic device, and storage medium.

[0037] The most important piece of data in a license authorization is the identification code of the authorized machine. In conventional technology, software uses a pre-set algorithm to calculate an identification code strongly associated with the local machine using the CPU and network card information of the machine being run. This identification code is then used to complete the license application and authentication process.

[0038] In the distributed container architecture 10 described above, applications and software all run in containerized containers. Containers can be created or destroyed at any time, or servers can be switched. Therefore, when using the aforementioned identification code that is strongly associated with the local machine, if the hardware information changes, the license file that has been applied for will become invalid, making it impossible to complete the verification and authorization process.

[0039] Some known technologies use the unique information of a distributed container architecture's machine group to generate an identification code, which is then used to apply for a license. However, capacity expansion is common in distributed container architectures 10, and the identification codes of the expanded machines are not included in the existing machine group's license file. Therefore, existing technologies require adding the expanded machines to the machine group and reapplying for a new license file, which is complex and inconvenient.

[0040] In order to solve the above problems, the present application proposes Figure 2 The identification code generation method applied to a distributed container includes:

[0041] S110: Obtaining the primary organization of the feature information distributed container and the primary organization information of the feature information primary organization; the feature information primary organization represents the cluster where the feature information distributed container is located, and the feature information primary organization is connected to the database;

[0042] S120: Acquire database feature information of the feature information database;

[0043] S130: Generate identification information based on the characteristic information master organization information and characteristic information in the characteristic information database;

[0044] S140: Generate an identification code according to the characteristic information identification information and a preset identification code generation algorithm.

[0045] According to the above method, by using relatively stable primary organization information and database feature information to generate an identification code, it can be applied to a containerized environment and meet the requirements of expansion and contraction scenarios in distributed containers.

[0046] Specifically, in S110, the primary organization refers to a server cluster or distributed container architecture. The primary organization information includes the primary organization name and a unique identifier for identifying the primary organization. Specifically, the primary organization information is generated or obtained by connecting to or creating the primary organization. This connection or creation of the primary organization is accomplished via terminal 11, such as in distributed container architecture 10. As important data for identifying a server cluster or distributed container architecture, the primary organization information does not change after generation and can therefore be considered stable.

[0047] In S120, specifically, the following steps may be included.

[0048] S121: Obtain at least one of a database connection port, database address, and database name from the primary organization; for example, obtaining connection information for a database used by the primary organization, stored in the primary organization. The connection information may include at least one of the connection port, database host address, database connection method, and database name. In some embodiments, the primary organization is connected to multiple databases, and thus an array is obtained containing at least one of the connection port, database address, and database name corresponding to different databases.

[0049] Then, S122 is executed: database connection information is generated based on at least one of the connection port, database address, and database name, thereby obtaining the database connection information. This generation method can be, for example, by concatenating the aforementioned data head to tail, for example, concatenating the last digit of the connection port to the last digit of the database address. Alternatively, a predetermined conversion algorithm is used to convert the connection port, database address, and database name into a predetermined number of digits and then add them together. In other words, the generation method is not limited, as long as at least one of the original connection port, database address, and database name can be obtained through a corresponding decoding method during verification.

[0050] Further, execute S123: communicate and connect with the database according to the database connection information, and obtain the data table name of the database and the database hardware information of the database; specifically, the data table name can refer to the name of each table in the database, or select at least one table as the data table name according to a preset selection rule, for example, take a jump value, and take a table name for each table interval from small to large according to the address number. Database hardware information refers to the hardware information on which the database runs, and has nothing to do with the hardware on which the container runs. For example, the hard disk identification code of the database server, the network card MAC number, etc. Therefore, in some embodiments, if the database needs to be expanded, this application should regenerate a new identification code and apply for a license.

[0051] Finally, execute S124: generate database feature information according to at least one of the database connection information, the data table name, and the database hardware information.

[0052] Thus, database feature information is obtained.

[0053] Figure 3 This is a flow chart of S130 in the embodiment of the present application. Figure 3 S130 generates identification information based on the feature information master organization information and the feature information in the feature information database, which in some embodiments may include:

[0054] S131: Analyze and obtain the primary organization identification code from the primary organization information;

[0055] S132: Obtain the primary organization name and use string operations to concatenate the primary organization information and the primary organization identification code to obtain first concatenated information;

[0056] S133: Perform MD5 encryption on the first concatenated information to obtain first encrypted information;

[0057] S134: Perform MD5 encryption on the database characteristic information to obtain second encrypted information;

[0058] S135: Generate identification information based on the first encrypted information and the second encrypted information.

[0059] Specifically, in S132, the primary organization name and primary organization identification code can be truncated into two parts at a preset number of digits through string operations to obtain a first primary organization name, a second primary organization name, a first primary organization identification code, and a second primary organization identification code. These parts are then concatenated in pairs, for example, the first primary organization name and the first primary organization identification code, and the second primary organization name and the second primary organization identification code. The concatenation order needs to be recorded but is not specifically limited, thereby obtaining first concatenated information.

[0060] Then, in S132 and S134 , MD5 encryption is performed on the first concatenated information and the database characteristic information respectively to obtain first encrypted information and second encrypted information. It is easy to understand that after MD5 encryption, the number of bits of the first encrypted information and the second encrypted information is the same.

[0061] At S135, identification information is generated. In some embodiments, given that MD5 encryption is easily reverse-engineered, further truncation and concatenation are performed to encrypt and obtain the identification information. For example, the first and second encrypted information are truncated into a predetermined number of N segments, resulting in N first encrypted segments and N second encrypted segments. The second encrypted segments are then inserted into each first encrypted segment in the original order, and the segments are concatenated. For example, assuming the original first encrypted information is 1000, 0001 and the second encrypted information is 1111, 1111, after truncation and concatenation, the resulting identification information is 1101, 0101, 0101, 0111.

[0062] In some embodiments, the main organization information and database feature information may also be encrypted using encryption methods such as base64.

[0063] Finally, based on the identification information obtained in the above steps, an identification code that can be used for license application is generated.

[0064] In the above steps, if the primary organization information is not successfully obtained, the identification code is not generated. In other words, there is no need to generate an identification code before the primary organization is generated.

[0065] This application also proposes a method for verifying the license file generated based on the above identification code. Figure 4 , the identification code verification method of this application includes:

[0066] S210: Obtain a license file; the license file is applied for using an identification code generated by any of the above identification code generation methods;

[0067] S220: Parse the license file and obtain the identification code;

[0068] S230: Obtaining primary organization information and database feature information from the identification code using a preset parsing algorithm;

[0069] S240: Obtain the primary organization of the distributed container, primary organization verification information, and database feature verification information of the primary organization; the primary organization represents the cluster where the distributed container is located;

[0070] S250: When the primary organization information is consistent with the primary organization verification information, and the database feature information is consistent with the database feature verification information, it is considered that the identification code verification is passed.

[0071] It is understandable that the parsing algorithm in S230 corresponds to the aforementioned identification code generation method. Therefore, the components of the primary organization information and database feature information are identical to those used in the aforementioned identification code generation. Specifically, the primary organization information includes the primary organization name and primary organization identification code; the database feature information includes database connection information, and / or database hardware information, and / or data table names.

[0072] The above verification method can use the data generated by the identification code generation method above, which is independent of the container's device, to generate an identification code, meeting the requirements of containerized distributed systems. This eliminates the need to re-apply for license files when expanding distributed containers.

[0073] This application also proposes a Figure 5 As shown, an identification code verification device 500 is proposed for distributed containers, including: a license generation module 501: used to obtain a license file; the license file is applied for by an identification code generated by any of the above-mentioned identification code generation methods; a license parsing module 502, used to parse the license file and obtain the identification code; a data parsing module 503, used to use a preset parsing algorithm to obtain the main organization information and database feature information from the identification code; an information acquisition module 504, used to obtain the main organization of the distributed container and the main organization verification information and database feature verification information of the main organization; the main organization represents the cluster where the distributed container is located; a comparison verification module 505, used to consider the verification as passed when the main organization information is consistent with the main organization verification information and the database feature information is consistent with the database feature verification information.

[0074] This application also proposes a Figure 6 The identification code generation device 600 shown is used for a distributed container and includes: a main organization information acquisition module 601, which is used to obtain the main organization of the distributed container and the main organization information of the main organization; the main organization represents the cluster where the distributed container is located, and the main organization is connected to the database; a database feature information acquisition module 602, which is used to obtain database feature information of the database; an identification information generation module 603, which is used to generate identification information based on the main organization information and the database feature information; an identification code generation module 604, which is used to generate an identification code according to a preset identification code generation algorithm based on the identification information.

[0075] This application also proposes a Figure 7The electronic device 700 shown includes a memory 701, a processor 702, a communication bus 703, a communication interface 704, and a computer program stored in the memory 701 and executable on the processor 702. The communication bus 703 is used to implement connection and communication between the processor 702 and the memory 701. When the processor 702 executes the computer program, it implements any one of the identification code generation methods described above, or any one of the verification methods described above.

[0076] Embodiments of the present application also provide a computer-readable storage medium, comprising a volatile or non-volatile, removable or non-removable medium implemented in any method or technology for storing information (such as computer-readable instructions, data structures, computer program modules, or other data). Computer-readable storage media include, but are not limited to, RAM (Random Access Memory), ROM (Read-Only Memory), EEPROM (Electrically Erasable Programmable Read-Only Memory), flash memory or other memory technology, CD-ROM (Compact Disc Read-Only Memory), digital versatile disk (DVD) or other optical disk storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other medium that can be used to store desired information and can be accessed by a computer.

[0077] It should be understood by those skilled in the art that all or some of the steps, systems, and functional modules / units in the methods disclosed above may be implemented as software (which may be implemented using computer program code executable by a computing device), firmware, hardware, or appropriate combinations thereof. In hardware implementations, the division between the functional modules / units mentioned in the above description does not necessarily correspond to the division of physical components; for example, a physical component may have multiple functions, or a function or step may be performed collaboratively by several physical components. Some or all of the physical components may be implemented as software executed by a processor, such as a central processing unit, a digital signal processor, or a microprocessor, or as hardware, or as an integrated circuit, such as an application-specific integrated circuit.

[0078] It should also be understood that the references to "one embodiment" or "some embodiments" described in the description of the embodiments of the present application mean that one or more embodiments of the embodiments of the present application include the specific features, structures or characteristics described in conjunction with the embodiment. Therefore, the phrases "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in the description of the embodiments of the present application, unless otherwise clearly defined, words such as setting, installing, connecting, etc. should be understood in a broad sense, and those skilled in the art can reasonably determine the specific meanings of the above words in the embodiments of the present application in combination with the specific content of the technical solution.

[0079] The embodiments of the present invention are described in detail above with reference to the accompanying drawings. However, the present invention is not limited to the above embodiments. Various changes can be made within the scope of knowledge possessed by ordinary technicians in the technical field without departing from the scope of the present invention.

Claims

1. A method for generating an identification code, applied to a distributed container, characterized in that: include: Obtaining the primary organization of the distributed container and primary organization information of the primary organization; The master organization represents the cluster where the distributed container is located, and the master organization is connected to a database; Acquiring database characteristic information of the database; generating identification information based on the primary organization information and the database characteristic information; generating an identification code according to the identification information and a preset identification code generation algorithm; The main organization information includes: the main organization name and the main organization identification code, The generating of identification information according to the primary organization information and the database characteristic information includes: Parsing the primary organization information to obtain the primary organization identification code; Obtain the primary organization name and use string operations to concatenate the primary organization information and the primary organization identification code to obtain first concatenated information; Performing MD5 encryption on the first splicing information to obtain first encrypted information; Performing MD5 encryption on the database characteristic information to obtain second encrypted information; The identification information is generated according to the first encrypted information and the second encrypted information.

2. The identification code generation method according to claim 1, characterized in that: The acquiring of database characteristic information of the database includes: Obtaining at least one of a connection port of the database, a database address of the database, and a database name of the database through the primary organization; Generate database connection information according to at least one of the connection port, the database address, and the database name; Establishing a communication connection with the database according to the database connection information, and obtaining a data table name of the database and database hardware information of the database; The database characteristic information is generated according to at least one of the database connection information, the data table name, and the database hardware information.

3. The identification code generation method according to claim 1, wherein: Generating the identification code according to the identification information and a preset identification code generation algorithm includes: Using string operations, truncating the first encrypted information and the second encrypted information according to a preset truncation rule to obtain a plurality of truncation information; Using string operations, the plurality of truncated information are spliced according to a preset splicing rule to generate an identification code.

4. An identification code verification method for a distributed container, characterized in that: The method comprises: Obtain a license file; the license file is applied for by the identification code generated by the identification code generation method according to any one of claims 1 to 3; Parsing the license file to obtain an identification code; Using a preset parsing algorithm to obtain primary organization information and database feature information from the identification code; Acquire the primary organization of the distributed container and primary organization verification information and database feature verification information of the primary organization; the primary organization represents the cluster where the distributed container is located; When the primary organization information is consistent with the primary organization verification information, and the database feature information is consistent with the database feature verification information, it is deemed that the identification code verification is passed.

5. The identification code verification method according to claim 4, characterized in that: The database characteristic information includes: database connection information, and / or database hardware information, and / or data table name.

6. An identification code verification device for a distributed container, characterized in that: include: License generation module: used to obtain license files; The license file is applied for by an identification code generated by the identification code generation method according to any one of claims 1 to 3; A license parsing module, used to parse the license file and obtain an identification code; A data parsing module, configured to obtain primary organization information and database feature information from the identification code using a preset parsing algorithm; An information acquisition module, configured to acquire the primary organization of the distributed container, primary organization verification information of the primary organization, and database feature verification information; The primary organization represents the cluster where the distributed container is located; The comparison and verification module is used to regard the verification as passed when the main organization information is consistent with the main organization verification information and the database feature information is consistent with the database feature verification information.

7. An identification code generating device for a distributed container, characterized in that: include: A primary organization information acquisition module, configured to acquire the primary organization of the distributed container and the primary organization information of the primary organization; The master organization represents the cluster where the distributed container is located, and the master organization is connected to a database; A database characteristic information acquisition module, used to acquire database characteristic information of the database; an identification information generating module, configured to generate identification information based on the primary organization information and the database characteristic information; An identification code generation module, configured to generate an identification code according to the identification information and a preset identification code generation algorithm; The main organization information includes: the main organization name and the main organization identification code, The generating of identification information according to the primary organization information and the database characteristic information includes: Parsing the primary organization information to obtain the primary organization identification code; Obtain the primary organization name and use string operations to concatenate the primary organization information and the primary organization identification code to obtain first concatenated information; Performing MD5 encryption on the first splicing information to obtain first encrypted information; Performing MD5 encryption on the database characteristic information to obtain second encrypted information; The identification information is generated according to the first encrypted information and the second encrypted information.

8. An electronic device comprising a memory, a processor, a communication bus, a communication interface, and a computer program stored in the memory and executable on the processor, wherein: The communication bus is used to realize the connection and communication between the processor and the memory; When the processor executes the computer program, the identification code generation method according to any one of claims 1 to 3 and / or the identification code verification method according to claim 4 or 5 is implemented.

9. A storage medium, wherein the storage medium is a readable storage medium, characterized in that: The readable storage medium stores a computer program, and the computer program is used to enable a computer to execute: the identification code generation method according to any one of claims 1 to 3, and / or the identification code verification method according to claim 4 or 5.

Citation Information

Patent Citations

  • Application authorization verification method and device based on application container engine

    CN112613083A

  • Automatic Strong Identity Generation For Cluster Nodes

    US20150169875A1