Data isolation method, system and equipment for SaaS software multi-technology integration
By combining database isolation, Schema isolation, tenant ID isolation and data encryption technologies in SaaS software, a four-in-one data isolation model of multi-database, multi-schema and tenant ID is realized, and the isolation intensity and resource occupation in the existing technology is solved. The contradictions support large-scale tenant scenarios and improve data security.
Patent Information
- Application Number
- CN202311693928.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-11
- Publication Date
- 2024-11-22
- Estimated Expiration
- 2043-12-11
AI Technical Summary
When existing SaaS software implements data isolation, there is a contradiction between isolation intensity and resource occupation, and cannot support large-scale tenant use and high data security at the same time.
Using a multi-technology fusion method, combining database isolation technology, Schema isolation technology, tenant ID isolation technology and data encryption technology, by establishing multiple schemas in each database, introducing a TWID for each tenant, and TWID , database information and schema are triple encryption to realize a four-in-one data isolation model of multi-database, multi-schema and tenant ID.
It achieves a balance between high data isolation intensity and low system resource occupation, supports large-scale tenant scenarios, improves data security and isolation, and solves the problem of excessive resource occupation or insufficient isolation intensity in the existing technology.
Smart Images

Figure CN117971798B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of software service technology, and in particular relates to a data isolation method, system and device for SaaS software multi-technology integration. Background Art
[0002] At present, SaaS software is a service model provided through the Internet, which can provide software services to hundreds or thousands of different tenants (also known as customers) without the need to deploy a set of software for each tenant. Tenants can access and use the software through a browser or other terminal device without having to install and maintain the software locally. As the scale of tenants expands and the application deepens, a series of problems will also arise. Therefore, ensuring the data security of each tenant is a key technology of SaaS software, which is also called multi-tenant data isolation technology.
[0003] There are many technologies to achieve data isolation, including multi-database mode, data encryption, Schema, tenant ID isolation, etc., and there is usually a contradiction between isolation strength and efficiency. How to reduce the occupation of system resources and improve data processing efficiency while also improving the strength of data isolation is the key technology of data isolation methods.
[0004] The industry and academia have conducted a lot of research on the security issues of multi-tenant data isolation. So far, there are many isolation technologies. To this end, based on the security issues of multi-tenant data isolation, by searching patents, the existing technologies are summarized as follows:
[0005] 1. Multi-tenant architecture based on database or database instance isolation is a common data isolation method (DB method for short), which is a method of isolating and controlling access to data of different tenants at the database level. The data of different tenants can be stored in independent databases, and each tenant has its own database instance, which ensures the separation and security of data.
[0006] 2. Data isolation based on tenant ID and tenant access control is a common data isolation strategy (TID method for short). Access control technology can limit access to data. This includes identity authentication, authorization, and permission management. Only tenants who have been authenticated and authorized can access the corresponding data through their own IDs, ensuring that the data is not obtained by unauthorized personnel, thereby achieving data isolation.
[0007] 3. Data isolation based on Schema or namespace partitioning (Schema method for short) isolates and partitions different data in a logical way. Different Schemas or namespaces are used to partition data in a database to protect data security. In SaaS (Software as a Service), the Schema or namespace partitioning isolation method is used.
[0008] 4. Data encryption has high data security. By encrypting the data, it can effectively protect the user's data information and reduce the risk of data leakage. Even if a security breach occurs during data storage or transmission, since the data has been encrypted, the attacker cannot easily obtain useful information, effectively reducing the risk of data leakage. Prevent unauthorized access and data leakage.
[0009] Through the above analysis, the problems and defects of the existing technology are shown in the following table:
[0010]
[0011] (1) Based on the database or database instance isolation method, namely the DB method. It has the highest isolation strength, occupies more resources, and cannot support large-scale tenant use and fast data access speed under high isolation or security conditions.
[0012] (2) Isolation method based on tenant ID, namely TID method. The data isolation strength is relatively low, the isolation strength of tenant information is weak (privacy protection is relatively poor), and the data access speed is fast.
[0013] (3) Data isolation based on schema or namespace partitioning, also known as the Schema method. The isolation strength is medium (stronger than the TID method but weaker than the DB method), the resource usage is medium, and the data access speed is also medium.
[0014] (4) The data encryption method has high isolation strength, high resource usage, inconvenience in data retrieval, and slow data access speed. Summary of the invention
[0015] In view of the problems existing in the prior art, the present invention provides a data isolation method, system and device for SaaS software multi-technology integration.
[0016] The present invention provides a data isolation method for SaaS software multi-technology integration, and the data isolation method for SaaS software multi-technology integration is specifically as follows:
[0017] The multi-technology integration of the data isolation method of the SaaS software multi-technology integration refers to: combining database isolation technology, Schema isolation technology, tenant ID isolation technology, and data encryption technology to achieve a four-in-one data isolation model of multiple databases, multiple schemas, and tenant IDs;
[0018] Specifically, in each database, several schemas are established;
[0019] In each Schema, multiple tenants are created and a TWID (tenant work ID) is introduced for each tenant. The tenant's TWID is encrypted, the database information of the tenant's data storage is encrypted, and the Schema of the tenant storage is encrypted to implement a triple encryption mechanism.
[0020] Triple encryption mechanism: First, the SaaS administrator creates cloud system information, configures basic tenant database information, and maintains the corresponding database; uses the AES algorithm to encrypt the necessary fields of the database information, database account information, and tenant information table; the first encryption is to encrypt the database IP and database name important fields in the database information table through the AES algorithm; the second encryption is to encrypt the database account name and database password important fields in the database account information table through the AES algorithm; the third encryption is to encrypt the TWID field in the tenant information table through the AES algorithm to implement a triple encryption mechanism;
[0021] Decryption before access: Decryption refers to decrypting the tenant's TWID and the database IP, database name, database account name, and database password. After the tenant logs in, the system will automatically decrypt according to the tenant database relationship. At this time, the decryption mainly decrypts the database IP, database name, database account name, and database password information, uses the AES algorithm to decrypt all encrypted data, and generates the relationship between the tenant and the data source. When the tenant performs business operations, the AES algorithm is used to decrypt according to the current tenant's encrypted TWID, and the plain text of the TWID is obtained for corresponding operations.
[0022] Furthermore, the data isolation method of the SaaS software multi-technology integration specifically includes:
[0023] Cloud platform database administrator: maintains the database, configures the tenant database, uses the AES algorithm to encrypt data in necessary fields, and stores them in the cloud database. The cloud platform administrator reviews the tenant's registration information, generates the tenant's TWID plain text, encrypts the tenant's TWID using the AES algorithm, stores it in the cloud data, associates the tenant with the corresponding Schema, and stores it in the cloud data.
[0024] After the tenant registration is completed, log in to the system. After the tenant logs in to the system, the system will save the tenant information to the session, and then store the session in the Redis database for caching.
[0025] Start business operations.
[0026] Get the encrypted TWID of the current tenant, decrypt it using the AES algorithm, and get the tenant's TWID plaintext; get the data source through the tenant's TWID plaintext to perform business operations.
[0027] System: After the project is started, it will search for all tenant database configuration relationship data, tenant encrypted database links and tenant information, use the AES algorithm to decrypt all encrypted data according to the tenant database relationship, generate data sources, establish tenant and data source relationships, and put them into memory; use the AES algorithm to decrypt the encrypted fields in the database information and database account information tables.
[0028] Furthermore, the data isolation method of the SaaS software integrating multiple technologies has n databases, creates m schemas in each database, and creates multiple tenant information in each schema; introduces a TWID for each tenant to achieve isolated access to each tenant's data.
[0029] Furthermore, the tenant information acquisition comparison of the data isolation method of the SaaS software multi-technology integration includes:
[0030] S11. Log in to the system;
[0031] S12. Open the tenant registration form;
[0032] S13. Obtain the tenant's TWID;
[0033] S14. Open the Schema and its tables respectively;
[0034] S15, querying the information whose main code is TWID;
[0035] S16. Obtain tenant information;
[0036] If encrypted, to obtain tenant information, you need to decrypt it. The specific steps are as follows:
[0037] S21. Log in to the system;
[0038] S22. Open the tenant registration form;
[0039] S23, automatically decrypt the database account password, decrypt the database name and IP;
[0040] S24, obtaining the tenant's TWID ciphertext;
[0041] S25. Decrypt the TWID to obtain the tenant's TWID plaintext;
[0042] S26, querying the information whose main code is TWID;
[0043] S27. Obtain tenant information;
[0044] The encryption algorithm uses the AES algorithm for encryption. The fields to be encrypted are divided into groups, each group has the same length, and one group of data is encrypted each time until the entire plaintext is encrypted. After that, the ciphertext blocks are pieced together to form the ciphertext. The plaintext P and the key K are input as parameters of the encryption function, and the encryption function E will output the ciphertext C. The encryption and decryption keys are the same. If decryption is required, the AES decryption function is set to D, then P = D (K + C), where C is the ciphertext, K is the key, and P is the plaintext. The ciphertext C and the key K are input as parameters of the decryption function, and the decryption function will output the plaintext P. A TWID is introduced for each tenant, and the AES algorithm is used to encrypt the tenant's TWID, the database information of the tenant's data storage, and the Schema of the tenant's storage. If you need to view a tenant's data, you need to decrypt it.
[0045] Furthermore, the database allocation of the data isolation method of the SaaS software multi-technology integration includes the following steps:
[0046] 1) The cloud platform SaaS administrator logs in to create system information;
[0047] 2) The administrator configures basic database information;
[0048] 3) The administrator configures database access information;
[0049] 4) The administrator configures the Schema information;
[0050] 5) The system sends an email notification to the DBA to create a database offline. The content of the email includes the database IP, database name, database account name, database password, and database Schema name;
[0051] The specific steps of tenant information registration and storage allocation of the data isolation method of the SaaS software multi-technology integration include:
[0052] First register as a platform tenant, generate a LOGIN account, fill in the mobile phone number and password, and register as a cloud platform tenant through SMS verification;
[0053] After successful registration, the system generates a LOGIN account;
[0054] Select the authentication tenant type, and the tenant submits the tenant review information. After the platform business administrator reviews and approves it, the tenant ID and account will be bound.
[0055] After the cloud platform administrator passes the review, the tenant's TWID will be generated and encrypted, and the tenant information will be written to change the review status;
[0056] Bind the TM permissions assigned by the default system;
[0057] Randomly assign databases and schemas, write the tenant's TWID in plain text into the schema relationship table, match the database through the cloud platform's random algorithm, and select the schema;
[0058] The specific implementation of tenant data access and storage of the data isolation method of the SaaS software multi-technology integration is as follows:
[0059] The tenant logs in.
[0060] After the system verification is passed, obtain the corresponding permissions of the system role, obtain the basic information of the tenant, get the tenant-account, obtain the relationship between the account and the tenant through the account, and obtain the tenant ID;
[0061] According to the tenant ID, query the encrypted tenant's TWID;
[0062] Decrypt TWID through the decryption algorithm to obtain TWID plaintext, and then obtain the Schema name and database ID in the Schema table through the tenant's TWID plaintext; the name, account, password, and IP have been decrypted in the data source connection pool; access the tenant's database through the known IP, database name, Schema, account name, and password to display the tenant data.
[0063] Another object of the present invention is to provide a computer device, comprising a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the data isolation method of the SaaS software multi-technology integration.
[0064] Another object of the present invention is to provide a computer-readable storage medium storing a computer program, which, when executed by a processor, enables the processor to execute the data isolation method of the SaaS software multi-technology integration.
[0065] Another object of the present invention is to provide an information data processing terminal, which is used to implement the data isolation method of the SaaS software multi-technology integration.
[0066] Another object of the present invention is to provide a SaaS software multi-technology fusion data isolation system based on the SaaS software multi-technology fusion data isolation method, the information entity of the SaaS software multi-technology fusion data isolation system includes: database number, system ID, system name, and descriptive information attributes.
[0067] Database basic information entity: includes database ID, database business name, database IP, database name, and system ID attributes;
[0068] Database access information entity: includes database ID, database account, access password, and schema number attributes;
[0069] Schema information entity: contains the schema name, database ID, TWID, and schema number attributes;
[0070] Tenant information entity: includes tenant ID unified organization code, TWID, contact person, contact number, WeChat, email, tenant type, and tenant name attributes;
[0071] Tenant system information entities: tenant-account, tenant ID, tenant password, TWID.
[0072] In combination with the above technical solutions and the technical problems solved, the advantages and positive effects of the technical solutions to be protected by the present invention are as follows:
[0073] First, the present invention realizes a data isolation model of multiple databases, multiple schemas and tenant IDs by integrating four technical methods: database mode isolation strategy, tenant ID isolation strategy, Schema data isolation method and data encryption.
[0074] 1) Create several schemas in each database;
[0075] 2) Secondly, in each Schema, create multiple tenants and introduce a TWID for each tenant.
[0076] 3) The tenant's TWID is encrypted, the database information of the tenant's data storage is encrypted, and the schema of the tenant's storage is encrypted to improve the isolation effect of the tenant's data and realize the isolated access of each tenant's data. It can support SaaS applications in large-scale tenant scenarios, and the effect is better than any single method. It effectively improves the security and isolation of data.
[0077] Second, the present invention integrates multiple technologies to achieve higher data isolation strength, while taking up less system resources and processing faster. Figure 2 As shown:
[0078] 1) The tenant ID-based isolation method has the advantage of fast access speed;
[0079] 2) The advantages of using schema-based and database-based isolation are good;
[0080] 3) Use multi-database and multi-Schema technology to enhance isolation effect;
[0081] 4) The concept of TWID is innovatively introduced, and the tenant ID is not used to access data, which further enhances the isolation strength;
[0082] 5) Innovatively introduce data encryption technology to encrypt TWID, stored schema and database information, further enhancing isolation strength;
[0083] 6) Each tenant only has TWID, stored database and Schema information encrypted, and memory cache technology is used in the implementation technology, and the decryption time cost is extremely small. The present invention can achieve the purpose of high data isolation strength with small system resource occupation and short processing time.
[0084] In summary, the database-based data isolation method has the best data isolation effect because each tenant has a database, but it takes up the most resources and cannot support large-scale tenant application scenarios. The Schema-based data isolation method has weaker data isolation than the database-based data isolation method, but it can support more tenant applications under the same server resources. When the number of schemas increases, it will also consume more resources and cannot support SaaS systems with large-scale tenant applications. The tenant ID-based data isolation method can support SaaS applications in large-scale tenant scenarios, but because different tenant data are in the same data table, the isolation strength is the weakest.
[0085] The present invention integrates database isolation technology, Schema isolation technology, tenant ID isolation technology and data encryption technology, which can effectively balance the contradiction between isolation strength and storage system resource usage, and introduces a TWID for each tenant, encrypts the TWID, the database information of the tenant data storage, and the Schema of the tenant storage to implement a triple encryption mechanism, which effectively improves the isolation of data information and greatly improves the strength of tenant information data protection.
[0086] Third, as auxiliary evidence of the inventiveness of the claims of the present invention, it is also reflected in the following important aspects:
[0087] (1) The expected benefits and commercial value of the technical solution of the present invention after transformation are:
[0088] After the transformation of this technical solution, the data isolation effect of the system can be improved. It can enable some tenants who have concerns about the security of their own data to give up their concerns and become tenants of the cloud platform, thereby improving the commercial value.
[0089] (2) The technical solution of the present invention fills the technical gap in the industry at home and abroad:
[0090] Through patent search, most of the patents that can be retrieved currently use a single isolation strategy to ensure data security, which has certain limitations. No integration of the four technologies of database mode isolation strategy, tenant ID isolation strategy, Schema data isolation strategy and data encryption has been found to solve the security and isolation of data. The present invention solves the following problems through technical integration:
[0091] 1) The database mode or database instance mode consumes too many system resources and cannot support large-scale tenant use under high isolation or security conditions.
[0092] 2) Under the tenant ID isolation strategy, the data isolation strength is relatively low and the tenant information data is not secure.
[0093] 3) The existing technology has poor effects in strengthening data security and isolation, poor system access efficiency, and cannot significantly improve the isolation and security of tenant data.
[0094] 4) Under the existing technology, DBAs can directly view tenant data. Through data encryption, DBAs cannot directly obtain tenant data information.
[0095] This has filled the technological gap in the industry at home and abroad.
[0096] (3) Whether the technical solution of the present invention solves the technical problems that people have been eager to solve but have not been able to solve successfully:
[0097] The present invention solves the problem of high isolation effect, small resource occupation and fast processing of SaaS cloud system, which has always been a difficult problem to overcome for SaaS cloud system.
[0098] (4) Whether the technical solution of the present invention overcomes technical prejudice:
[0099] The technical solution of the present invention overcomes the following technical biases: 1) SaaS systems with high isolation effects must occupy more resources and run slower; 2) tenant bias, SaaS systems are prone to data leakage.
[0100] Fourth, the technical progress of the SaaS data isolation method provided by the present invention is mainly reflected in the following aspects:
[0101] 1. Multi-technology integration: By integrating four technical methods, namely, database mode isolation strategy, tenant ID isolation strategy, Schema data isolation method, and data encryption, a complex but powerful data isolation model is implemented. This model can handle the isolation requirements of multiple databases, multiple schemas, and tenant IDs.
[0102] 2. Data security: By encrypting TWID, database information of tenant data storage, and schema of tenant storage, data security is greatly enhanced. At the same time, triple encryption using AES algorithm ensures the security of data information.
[0103] 3. Flexibility and scalability: Multiple schemas can be established in each database, and multiple tenants can be created in each schema. This design provides good flexibility and scalability and can easily adapt to different business needs.
[0104] 4. The system can automatically decrypt the database-related information without requiring manual operation by tenants. This greatly simplifies the tenants’ usage process and reduces the risk of data leakage.
[0105] The SaaS data isolation method provided by the present invention can effectively protect the isolation and security of data, and can also provide a convenient and flexible data management environment.
[0106] The present invention is compared with the prior art. As shown in the following table, the tenant data of the previous three methods are in plain text format for the database administrator, and all tenant data can be directly read. The present invention combines multiple isolation technologies, with high isolation strength and fast data access speed. On this basis, a triple encryption mechanism is designed, which can efficiently decrypt and securely access tenant information. The tenant data of the present invention is in cipher text format for the database administrator to ensure data security.
[0107] Table 1 Comparison of the present invention with DB method, TID method, Schema method and data encryption method
[0108] BRIEF DESCRIPTION OF THE DRAWINGS
[0109] Figure 1 This is a flow chart of a data isolation method for SaaS software multi-technology integration provided by an embodiment of the present invention;
[0110] Figure 2 This is an architecture diagram of a data isolation method for SaaS software multi-technology integration provided by an embodiment of the present invention;
[0111] Figure 3This is a schematic diagram of a data isolation method for SaaS software multi-technology integration provided by an embodiment of the present invention;
[0112] Figure 4 is a flowchart for comparing tenant information acquisition provided by an embodiment of the present invention;
[0113] Figure 5 is a flowchart of database allocation provided by an embodiment of the present invention;
[0114] Figure 6 is a flowchart of tenant information registration and storage allocation provided by an embodiment of the present invention;
[0115] Figure 7 is a tenant data access and storage flow chart provided by an embodiment of the present invention;
[0116] Figure 8 It is a block diagram of a data isolation system integrating multiple technologies of SaaS software provided by an embodiment of the present invention.
[0117] Fig. 9 It is a SaaS software digital investment promotion-cloud platform provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0118] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.
[0119] For cloud service providers and large group enterprises, the technical solution of the present invention provides an effective data isolation method to ensure data security and isolation in a multi-tenant environment. The following are the adjusted technical solutions for these two scenarios:
[0120] Example 1: Cloud Service Provider
[0121] 1) Database instance creation: Create a separate database instance for each tenant (enterprise) to ensure physical isolation of data between different tenants.
[0122] 2) Tenant Identification: A unique tenant work ID (TWID) is assigned to each enterprise tenant and stored in the system to accurately identify different tenants during operations.
[0123] 3) Data encryption: Use the AES algorithm to encrypt all tenant data including TWID, including the encryption of database information and Schema information of tenant data storage to ensure data security and confidentiality.
[0124] 4) Dynamic decryption and access control: When an enterprise tenant logs into the system, the system automatically decrypts the relevant information, establishes a relationship between the tenant and its data source, and ensures that only authorized tenants can access their data.
[0125] Example 2: Large Group Enterprise
[0126] 1) Enterprise-level database architecture: Create an independent database instance for each subsidiary of the group (each enterprise is a tenant), and establish multiple schemas in each database instance to achieve logical isolation of data.
[0127] 2) Enterprise identity allocation and management: The system allocates a unique TWID to each subsidiary enterprise as its identity in the system.
[0128] 3) Comprehensive data encryption: Use the AES encryption algorithm to encrypt each enterprise's TWID, database information and schema information of enterprise data storage to enhance data security.
[0129] 4) Automated identity authentication and data access: When an enterprise user logs into the system, the system automatically decrypts the data and implements precise data access control based on the enterprise's TWID, ensuring that only authorized users can access their enterprise's data.
[0130] Through the above solutions, data in cloud service providers and large group enterprise environments can be effectively isolated and protected, thereby ensuring data security and isolation.
[0131] Embodiment 3:
[0132] The multi-technology integration provided by the embodiment of the present invention refers to: combining database isolation technology, Schema isolation technology, tenant ID isolation technology and data encryption technology. Database isolation technology uses a database to store each tenant's information separately, which has the best data isolation effect, but occupies the most resources and cannot support large-scale tenant application scenarios. Therefore, multiple schemas are created in each database, and multiple tenant information is created in each schema, and isolated by tenant ID. This technology can solve four scalable isolation schemes (ID isolation, Schema isolation, isolation of database instances, and data encryption), and can support more tenant applications under the same server resources.
[0133] Triple encryption mechanism: First, the SaaS administrator creates cloud system information, configures basic tenant database information, and maintains the corresponding database. Use the AES algorithm to encrypt the necessary fields of the database information, database account information, and tenant information table. Among them, the first encryption is to encrypt the database IP and database name important fields in the database information table through the AES algorithm; the second encryption is the database account name and database password important fields in the database account information table through the AES algorithm; the third encryption is to encrypt the TWID field in the tenant information table with the AES algorithm to implement a triple encryption mechanism.
[0134] Decryption refers to decrypting TWID and decrypting database IP, database name, database account name and database password. After the tenant logs in, the system will automatically decrypt according to the tenant database relationship. At this time, decryption mainly decrypts database IP, database name, database account name and database password information. Use the AES algorithm to decrypt all encrypted data and generate the relationship between the tenant and the data source. When the tenant performs business operations, the AES algorithm is used to decrypt according to the current tenant's TWID ciphertext, and the decrypted TWID is obtained for corresponding operations.
[0135] Embodiment 4:
[0136] Figure 2 An architecture diagram of a data isolation method for SaaS software that integrates multiple technologies is provided in one embodiment of the present invention. If only a single isolation strategy is used, for example, only the database is used for isolation strategy, and a database is allocated to each tenant, the data isolation effect is the best, but the resources occupied are the largest, and it cannot support large-scale tenant application scenarios; if several schemas are introduced in each database, more tenant applications can be supported under the same server resources. However, the data isolation method based on schema is weaker in data isolation strength than the data isolation method based on database. Therefore, the method of the embodiment of the present invention is, Figure 2 As shown in the figure: There are n databases, m schemas are created in each database, k tables are created in each schema, and the tables contain information of multiple tenants. A TWID is introduced for each tenant to achieve isolated access to the data of each tenant. This effectively improves the security and isolation of data.
[0137] Figure 3 A flowchart of a data isolation method for SaaS software multi-technology integration provided by an embodiment of the present invention. Figure 3 As shown, a data isolation method for SaaS software integrating multiple technologies in this embodiment, the main process of the method is described as follows:
[0138] Cloud platform database administrator: Figure 3 As shown, the cloud platform database administrator maintains the database, configures the tenant database, uses the AES algorithm to encrypt data in necessary fields, and stores them in the Mysql cloud database. Figure 3 As shown, the cloud platform administrator reviews the tenant's registration information, generates TWID plain text, encrypts TWID using the AES algorithm, and stores it in the Mysql cloud data. Figure 3 As shown, tenants are associated with corresponding schemas and stored in MySQL cloud data.
[0139] Tenants: After the tenants have completed registration, they can log in to the system. After the tenants log in to the system, the system will store the tenant information (including the tenant's encrypted TWID) in the session, and then store the session in the Redis database for caching. By caching data, the time consumption of frequent queries to the database or other data sources is avoided, thereby improving the data access speed;
[0140] At this point, business operations can begin;
[0141] Get the encrypted TWID of the current tenant, decrypt it using the AES algorithm, and get the TWID plaintext. Get the data source through the TWID plaintext to perform business operations.
[0142] System: After the project is started, it will search for all tenant database configuration relationship data, tenant encrypted database links and tenant information, decrypt all encrypted data using the AES algorithm according to the tenant database relationship, generate data sources, establish tenant and data source relationships, and store them in memory. At this time, the AES algorithm will be used to decrypt the encrypted fields in the database information and database account information tables.
[0143] Figure 4 A flowchart of tenant information acquisition comparison of a data isolation method for SaaS software multi-technology integration provided by an embodiment of the present invention. Figure 4 As shown, the flowchart on the left does not perform the encryption process. Its main process is described as follows:
[0144] S11. Log in to the system;
[0145] S12. Open the tenant registration form;
[0146] S13. Obtain tenant TWID;
[0147] S14. Open the Schema and its tables respectively;
[0148] S15, querying the information whose main code is TWID;
[0149] S16. Obtain tenant information.
[0150] Without encryption, it is easy for the DBA to see the tenants’ data. Figure 4 As shown, the process in the flowchart on the right is encrypted. If you want to obtain tenant information, you need to decrypt it. Its main process is described as follows:
[0151] S21. Log in to the system;
[0152] S22. Open the tenant registration form;
[0153] S23, automatically decrypt the database account password, decrypt the database name and IP;
[0154] S24. Obtain the tenant's TWID ciphertext;
[0155] S25. Decrypt TWID to obtain the tenant TWID plain text;
[0156] S26, querying the information whose main code is TWID;
[0157] S27. Obtain tenant information.
[0158] The encryption algorithm mainly uses the AES algorithm for encryption. AES is one of the most popular symmetric encryption algorithms. It divides the encrypted fields (plaintext) into groups of equal length. It encrypts a group of data each time until the entire plaintext is encrypted. Then, the ciphertext blocks are spliced together to form ciphertext. For example, if the AES encryption function is E, then C=E(K+P), where P is the plaintext, K is the key, and C is the ciphertext. In other words, if the plaintext P and the key K are input as parameters of the encryption function, the encryption function E will output the ciphertext C. The encryption and decryption keys are the same. If decryption is to be performed, the AES decryption function is D, then P=D(K+C), where C is the ciphertext, K is the key, and P is the plaintext. In other words, if the ciphertext C and the key K are input as parameters of the decryption function, the decryption function will output the plaintext P. The present embodiment is a data isolation method for SaaS software that integrates multiple technologies. This method introduces a TWID for each tenant, uses the AES algorithm to encrypt the TWID, the database information of the tenant data storage, and the schema of the tenant storage. Under the triple encryption mechanism, the tenant's data cannot be directly seen. If you need to view a tenant's data, you need to decrypt it to find the corresponding tenant information. This is how to improve isolation, that is, the data security of the tenant.
[0159] Figure 5 This is an initial flow chart of a data isolation method for SaaS software multi-technology integration provided by an embodiment of the present invention. Figure 5 As shown, a data isolation method for SaaS software integrating multiple technologies in this embodiment, the database allocation process of the method is described as follows.
[0160] 1) The cloud platform SaaS administrator logs in to create system information. For example, the system information for creating two clouds is shown in the following table:
[0161] System ID System Name Number of databases (encrypted) describe HGZSsys01 Hanguang Merchants Cloud No. 1 (3) Unicorn01 HGTRsys01 Hanguang Investment and Financing Cloud No. 1 (2) Unicorn 02
[0162] 2) The administrator configures the basic information of the database: For example, the system: (Hanguang Merchants Cloud No. 1) has 3 databases, and the system: (Hanguang Investment and Financing Cloud No. 1) has 2 databases, as shown in the following table:
[0163]
[0164] 4) The administrator configures database access information (supports multiple accounts for one database), for example, the investment database: ZSDB01, has 3 login accounts, the investment database: ZSDB03, has 2 login accounts, the investment and financing database: TRDB01, has 1 login account, the investment and financing database: TRDB02, has 1 login account. As shown in the following table:
[0165] Database ID Database account name (encrypted) Database password (encrypted) Schema number (encrypted) ZSDB01 (ZSDB01LG01) (1123456) (5) ...... ZSDB01 (ZSDB01LG03) (3123456) (5) ZSDB03 (ZSDB02LG01) (112533) (8) ZSDB03 (ZSDB02LG02) (585858) (8) TRDB01 (TRDB01LG01) (336364) (4) TRDB02 (TRDB02LG01) (846996) (6)
[0166] 4) The administrator configures the Schema information. For example, the Merchants Database: ZSDB01 has 5 schemas, the Merchants Database: ZSDB03 has 8 schemas, the Investment and Financing Database: TRDB01 has 4 schemas, the Investment and Financing Database: TRDB02 has 6 schemas, the Merchants Cloud 1 Database 1 has 6 schemas, and the Merchants Cloud 1 Database 2 has 12 schemas, as shown in the following table:
[0167]
[0168]
[0169] 5) The system sends an email notification to the DBA to create a database offline. The content of the email mainly includes the database IP, database name, database account name, database password, database Schema name, etc., as shown below:
[0170]
[0171] Figure 6 A flowchart of the specific steps of tenant information registration and storage allocation provided by an embodiment of the present invention. Figure 6 As shown, specifically including:
[0172] First register as a platform tenant and generate a LOGIN account to facilitate tenants to view the tenant review status. The tenant fills in the mobile phone number and password, and passes the SMS verification to register as a cloud platform tenant, as shown in the following table;
[0173] Account(LOGIN) Phone number password SMS verification code 15266666666 123456 456385
[0174] After successful registration, the system will encrypt the password 123456. At the same time, the system will generate a LOGIN account (cannot be changed), as shown in the following table;
[0175] Account(LOGIN) Phone number Password (encryption) T010101 15266666666
[0176] Select the authentication tenant type. The tenant (ID: AdF54256856233231) submits the tenant review information. After the platform business administrator reviews and approves it, the relationship between the tenant ID and the account will be bound, as shown in the following table;
[0177] Tenant TID Tenant account TUID(LOGIN) AdF54256856233231 T010101
[0178] After the cloud platform administrator passes the review, a TWID (tenant work ID) will be generated, and the TWID will be encrypted to generate TWID_M (Zh12552152222221), and the tenant information will be written, and the review status will be changed: 1 Reviewed, as shown in the following table;
[0179]
[0180] Bind the TM (tenant administrator) permissions assigned by the default system;
[0181] Randomly assign databases and schemas, write TWID in plain text into the schema relationship table, and match the database through the cloud platform random algorithm. For example, ZSDB03, select Schema: ZSScm0307. As shown in the following table:
[0182] schema name Database ID TWID (Tenant Work ID) Plain text ZSScm0101 ZSDB01 ...... ZSScm0104 ZSDB01 ZSScm0105 ZSDB01 ZSScm0301 ZSDB03 ...... ZSScm0307 ZSDB03 Zh12552152222221 ZSScm0308 ZSDB03 TRScm0101 TRDB01 .... TRScm0104 TRDB01 TRScm0201 TRDB02 .... TRScm0206 TRDB02
[0183] Figure 7 A flowchart of the specific steps of tenant data access and storage provided by an embodiment of the present invention. Figure 7 As shown, specifically including:
[0184] The tenant logs in.
[0185] Account / Mobile Number password T010101 / 15266666666
[0186] After the system verification is passed, obtain the corresponding permissions of the system role (tenant administrator), obtain the basic information of the tenant, get the tenant-(LOGIN) account T010101, obtain the relationship between the account and the tenant through the account (LOGIN) T010101, and get the tenant ID: AdF54256856233231
[0187] Tenant TID Tenant TUID(LOGIN) AdF54256856233231 T010101
[0188] According to the tenant ID: AdF54256856233231, query the encrypted TWID.
[0189]
[0190] Tenant type: =0(park)|1(enterprise)
[0191] Tag: =0 (tenant to be reviewed) | 1 (tenant reviewed)
[0192] Decrypt TWID through the decryption algorithm and obtain the plaintext TWID, as shown in the following table: Zh12552152222221.
[0193] Get the Schema name and database ID in the Schema table through TWID plain text: Zh12552152222221.
[0194] schema name Database ID TWID (Tenant Work ID) (plain text) ZSScm0307 ZSDB03 Zh12552152222221 ZSScm0307 ZSDB03 Zh12552152222229 ... ... ... ZSScm0303 ZSDB03 Zh12552152222222 ZSScm0303 ZSDB03 Zh12552152222226 ... ... ...
[0195] The data source connection pool has decrypted the name, account, password, and IP address, including:
[0196] Database ID Database account name (encrypted) Database password (encrypted) Schema number (encrypted) ZSDB03 (ZSDB02LG02) (585858) (8)
[0197]
[0198] Decrypt database account and password: (ZSDB01LG01), (123456);
[0199] Access the tenant's database through the known IP, database name, Schema, account name, and password to display the tenant data.
[0200] Embodiment 5:
[0201] like Figure 8 As shown, the information entity of the data isolation system for SaaS software multi-technology integration provided by the embodiment of the present invention includes the number of databases, system ID, system name, and description information attributes.
[0202] Database basic information entity: includes database ID, database business name, database IP (D), database name (D), and system ID attributes.
[0203] Database access information entity: includes database ID (FK), database account (D), access password (D), and schema number attributes.
[0204] Schema information entity: contains the schema name, database ID, TWID, and schema number attributes.
[0205] Tenant information entity: includes tenant ID unified organization code, TWID, contact person, contact number, WeChat, email, tenant type, and tenant name attributes.
[0206] Tenant system information entities: tenant-account, tenant ID, tenant password (D), TWID.
[0207] The present invention is used in the development of Merchants Cloud (Merchants SaaS). The backend data storage mode of Merchants Cloud adopts the same technology as the present invention. Fig. 9 SaaS software digital investment promotion-cloud platform.
[0208] The embodiments of the present invention have achieved some positive effects during the development or use process:
[0209] 1) Currently, most of the patents that can be retrieved use a single isolation strategy to ensure data security. The present invention combines the four technologies of database mode isolation strategy, tenant ID isolation strategy, Schema data isolation strategy and data encryption, which is better than any single method strategy and greatly improves the isolation and security of tenant data.
[0210] 2) The triple encryption mechanism designed by the present invention, such as Figure 4 This is a comparative flowchart of tenant information acquisition provided by an embodiment of the present invention. The flowchart on the left is not encrypted, and there is no encryption scheme. It is relatively easy for the DBA to see the tenant's data. The flowchart on the right is encrypted. If you need to view a tenant's data, you need to decrypt it to find the corresponding tenant information, thereby improving isolation, that is, the tenant's data security.
[0211] 3) After the project is started, it will automatically decrypt once to obtain the database and other information. After the tenant logs in, the encrypted TWID of the current tenant is decrypted using the AES algorithm to obtain the TWID plaintext, and then the tenant information is searched. This is highly time-efficient and takes almost the same amount of time as the non-encrypted process.
[0212] It should be noted that the embodiments of the present invention can be implemented by hardware, software, or a combination of software and hardware. The hardware part can be implemented using dedicated logic; the software part can be stored in a memory and executed by an appropriate instruction execution system, such as a microprocessor or dedicated design hardware. It can be understood by a person of ordinary skill in the art that the above-mentioned devices and methods can be implemented using computer executable instructions and / or contained in a processor control code, such as a carrier medium such as a disk, CD or DVD-ROM, a programmable memory such as a read-only memory (firmware), or a data carrier such as an optical or electronic signal carrier. Such code is provided on the carrier medium. The device and its modules of the present invention can be implemented by hardware circuits such as very large-scale integrated circuits or gate arrays, semiconductors such as logic chips, transistors, etc., or programmable hardware devices such as field programmable gate arrays, programmable logic devices, etc., can also be implemented by software executed by various types of processors, and can also be implemented by a combination of the above-mentioned hardware circuits and software, such as firmware.
[0213] The above description is only a specific implementation mode of the present invention, but the protection scope of the present invention is not limited thereto. Any modifications, equivalent substitutions and improvements made by any technician familiar with the technical field within the technical scope disclosed by the present invention and within the spirit and principle of the present invention should be covered by the protection scope of the present invention.
Claims
1. A data isolation method for SaaS software multi-technology integration, characterized in that: The following steps are involved: By integrating the four technical methods of database mode isolation strategy, tenant ID isolation strategy, Schema data isolation method and data encryption, a data isolation model integrating multiple databases, multiple schemas and tenant IDs is implemented. Create multiple databases and establish several schemas in each database; Create several tables in each schema, each table contains information about multiple tenants, and introduce a tenant work ID TWID for each tenant; encrypt the tenant's TWID, encrypt the database information for tenant data storage, and encrypt the schema for tenant storage; The data isolation method of SaaS software multi-technology integration also adopts a triple encryption mechanism: first, the cloud system information is created by the cloud platform SaaS administrator, and the basic information of the tenant database is configured to maintain the corresponding database; the necessary fields of the database information, database account information, and tenant information table are encrypted using the AES algorithm; the first encryption is to encrypt the database IP and database name in the database information table using the AES algorithm; the second encryption is to encrypt the database account name and database password in the database account information table using the AES algorithm; the third encryption is to encrypt the TWID field in the tenant information table using the AES algorithm to implement a triple encryption mechanism; The data isolation method of SaaS software multi-technology integration also includes a decryption process, which refers to decrypting the TWID and decrypting the database IP, database name, database account name and database password; after the tenant logs in, the cloud platform system automatically decrypts according to the tenant database relationship. At this time, the decryption object includes the database IP, database name, database account name and database password information; the AES algorithm is used to decrypt all encrypted data, and the relationship between the tenant and the data source is generated. When the tenant performs business operations, the AES algorithm is used to decrypt according to the encrypted TWID of the current tenant, and the decrypted TWID is obtained to perform corresponding operations; The data isolation method of the SaaS software multi-technology integration also includes: The cloud platform SaaS administrator terminal maintains the database, configures the tenant database, uses the AES algorithm to encrypt data in necessary fields, and stores it in the relational database. The cloud platform SaaS administrator reviews the tenant's registration information, generates TWID plain text, encrypts TWID using the AES algorithm, stores it in the MySQL cloud database, associates the tenant with the corresponding Schema, and stores it in the MySQL cloud database; After the tenant registration is completed, the tenant terminal logs in to the cloud platform system. After the tenant logs in to the cloud platform system, the cloud platform system stores the tenant information in the session, and then stores the session in the Redis database for caching and starts business operations; The tenant terminal obtains the encrypted TWID of the current tenant, decrypts it using the AES algorithm, and obtains the TWID plaintext; obtains the data source through the TWID plaintext to perform business operations; After the project is started, the cloud platform system searches for all tenant database configuration relationship data, tenant encrypted database links and tenant information, decrypts all encrypted data using the AES algorithm according to the tenant database relationship, generates a data source, establishes a tenant and data source relationship, and puts it into memory; uses the AES algorithm to decrypt the encrypted fields in the database information and database account information tables.
2. The data isolation method for SaaS software multi-technology integration as claimed in claim 1 is characterized in that: The data isolation method of SaaS software multi-technology integration also includes a login process, specifically: S21. Log in to the cloud platform system; S22. Open the tenant registration form; S23, automatically decrypt the database account password, decrypt the database name and IP; S24. Obtain the tenant's TWID ciphertext; S25. Decrypt TWID to obtain the tenant TWID plain text; S26, querying the information whose main code is TWID; S27. Obtain tenant information; The encryption algorithm uses the AES algorithm for encryption. The field to be encrypted is divided into multiple groups, each with equal length. One group of data is encrypted each time until the entire plaintext is encrypted. The multiple ciphertext blocks obtained by encryption are then concatenated to form a ciphertext. The plaintext P and the key K are input as parameters of the encryption function, and the encryption function E will output the ciphertext C. The encryption and decryption keys are the same. If decryption is required, the AES decryption function is set to D, then P=D(K+C); the ciphertext C and the key K are input as parameters of the decryption function, and the decryption function will output the plaintext P. A TWID is introduced for each tenant, and the AES algorithm is used to encrypt the tenant's TWID, the database information of the tenant's data storage, and the schema of the tenant's storage. If you need to view a tenant's data, you need to decrypt it.
3. The data isolation method for SaaS software multi-technology integration as claimed in claim 1 is characterized in that: The data isolation method of SaaS software multi-technology integration also includes a database allocation process, specifically: 1) The cloud platform SaaS administrator logs in to the cloud platform system and creates n multiple databases; 2) The cloud platform SaaS administrator configures basic database information and accesses the database; 3) The cloud platform SaaS administrator configures m schemas for the i-th database; 4) The cloud platform SaaS administrator configures the Schema information; 5) The cloud platform system sends an email notification to the database administrator DBA to create a database offline. The content of the email includes the database IP, database name, database account name, database password, and database Schema name; The data isolation method of SaaS software multi-technology integration also includes the process of tenant information registration and storage allocation, specifically: First register as a cloud platform tenant, generate a LOGIN account, fill in the mobile phone number and password, and pass the SMS verification to become a cloud platform tenant; Select the authentication tenant type and submit the tenant review information. The cloud platform SaaS administrator will bind the tenant ID to the account after reviewing it. After the cloud platform SaaS administrator has reviewed and approved it, the cloud platform system generates a TWID, encrypts the TWID, writes the tenant information, and changes the review status; Bind the tenant administrator permissions assigned by the system; Randomly assign databases and schemas, write TWID in plain text into the schema relationship table, match databases through the cloud platform system random algorithm: ZSDB_X, and select schema: ZSScm_Y; The data isolation method of SaaS software multi-technology integration also includes tenant data access and storage process, specifically: The tenant logs in. After the cloud platform system is verified, the corresponding permissions of the system role are obtained, the basic information of the tenant is obtained to obtain the tenant's account, and the tenant's ID is obtained through the tenant's account, thereby obtaining the tenant's TWID; According to the tenant's ID, query the encrypted TWID; When the project is started, the cloud platform system automatically decrypts the database name, account, password, and IP in the data source connection pool; Decrypt TWID using the decryption algorithm to obtain the tenant's TWID plaintext. Obtain the Schema name and database ID in the Schema table using the TWID plaintext. At this point, access the tenant's database through the known IP, database name, Schema, account name, and password to display the tenant data.
4. A computer device, characterized in that: The computer device includes a memory and a processor, the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the data isolation method for SaaS software multi-technology integration as described in any one of claims 1 to 3.
5. A computer-readable storage medium storing a computer program, wherein when the computer program is executed by a processor, the processor executes the data isolation method for multi-technology integration of SaaS software as described in any one of claims 1 to 3.
6. An information data processing terminal, characterized in that: The information data processing terminal is used to implement the data isolation method of SaaS software multi-technology integration as described in any one of claims 1 to 3.
7. A SaaS software multi-technology fusion data isolation system based on the SaaS software multi-technology fusion data isolation method according to any one of claims 1 to 3, characterized in that: The information entity of the data isolation system of the SaaS software multi-technology integration: including the number of databases, system ID, system name, and description information attributes; Database basic information entity: includes database ID, database business name, database IP, database name, and system ID attributes; Database access information entity: includes database ID, database account, access password, and Schema attributes; Schema information entity: includes Schema name, database ID, TWID, and Schema attributes; Tenant information entity: includes tenant ID unified organization code, TWID, contact person, contact number, WeChat, email, tenant type, and tenant name attributes; Tenant system information entities: tenant-account, tenant ID, tenant password, TWID.
Citation Information
Patent Citations
Method and system for controlling multi-tenant database
CN103577457A
A banking enterprise interconnection and docking method and system based on a SaaS mode
CN109711845A
Method for isolating SaaS software tenant data
CN110163002A
Encryption system and encryption method for multi-tenant SaaS platform
CN111917725A
Multi-tenant API gateway data management method and system
CN114372041A
