Data access method, device, computer equipment and storage medium
By receiving tenant access requests, querying target access applications and databases based on tenant registry, and determining access permissions, it solves the problem of poor coupling and isolation of database DDL in the traditional multi-tenant multi-application data storage method, realizing data sharing and isolation, and improving database security and usage efficiency.
Patent Information
- Application Number
- CN202310173266.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-02-20
- Publication Date
- 2025-08-29
- Estimated Expiration
- 2043-02-20
AI Technical Summary
In the traditional multi-tenant multi-application data storage method, the database DDL is coupled to each other, has poor isolation, is difficult to uninstall ecological applications, poor security, and the database metadata query performance is degraded, and data quality is difficult to guarantee.
By receiving tenant access requests, querying target access applications and databases based on the tenant registry, determining access permissions, and performing access operations, data sharing and privacy data isolation between different types of applications are realized, and ecological applications are prevented from modifying standard application data.
It improves the security and efficiency of data between databases, realizes data isolation between different types of applications, and enhances the security of databases and the rigor of data access.
Smart Images

Figure CN116074111B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a data access method, apparatus, computer device, and storage medium. Background Art
[0002] With the development of computer technology, multi-tenant and multi-application data storage methods have emerged. Traditional SaaS products have two main methods for multi-tenant and multi-application data storage: (1) assigning an independent database to each tenant, completely isolating the data between tenants; (2) using a schema-less database such as MongDB to achieve flexible storage.
[0003] However, in traditional technologies, the database DDLs of standard applications and ecological applications are coupled with each other, with poor isolation. Ecological applications are difficult to uninstall and can directly modify the data of standard data applications, resulting in poor security, difficulty in maintaining massive database tables, and reduced query performance of database metadata (table structure definition, field type definition, etc.). In addition, non-relational databases lack schema constraints, making data quality difficult to ensure, thereby reducing the efficiency of database security applications. Summary of the Invention
[0004] Based on this, it is necessary to provide a data access method, device, computer equipment and storage medium that can effectively access data to address the above technical problems, thereby improving the efficiency of database security applications.
[0005] A data access method, comprising:
[0006] Receive tenant access requests;
[0007] Based on the tenant access request, query the tenant registry to obtain a target access application and a target access database, wherein the tenant registry includes an association relationship between a tenant identifier, an access application, and an access database;
[0008] Determining target access permissions of the target access application to the target access database based on the permission relationship between the application type and the database;
[0009] Based on the target access permission, an access operation is performed on the target access database by the target access application.
[0010] In one embodiment, before querying the tenant registry based on the tenant access request to obtain the target access application and the target access database, the method further includes:
[0011] Obtaining a target tenant identifier based on the tenant access request;
[0012] Obtain the tenant registry, and perform a query operation on the target tenant identifier based on the tenant registry to obtain a tenant query result;
[0013] When the tenant query result is that the target tenant identifier does not exist, obtaining tenant registration information corresponding to the target tenant identifier, inserting the tenant registration information into the tenant registration table, obtaining preset data, adding the preset data to the corresponding access database, and continuing to perform the operation of querying the tenant registration table based on the tenant access request to obtain the target access application and the target access database;
[0014] When the tenant query result indicates that the target tenant identifier exists, an operation of directly querying the tenant registry based on the tenant access request to obtain the target access application and the target access database is performed.
[0015] In one embodiment, the access application includes a standard application and an ecological application, and the tenant access request is received through the standard application; the access database includes a non-ecological application database and an ecological application database;
[0016] The tenant registry is queried based on the tenant access request to obtain a target access application and a target access database, wherein the tenant registry includes an association relationship between the access application and the access database, including:
[0017] Based on the tenant access request, obtaining a requested access application and a requested access database;
[0018] When the access requesting application is a standard application and the access requesting database is not an ecological application database, taking the access requesting application as the target access application and taking the access requesting database as the target access database;
[0019] When the application requested for access is an ecological application, querying the application requested for access based on the tenant registry using the standard application to obtain an ecological application query result;
[0020] When the ecological application query result shows that there is an association relationship between the access requesting application and the access requesting database, the access requesting application is used as the target access application, and the access requesting database is used as the target access database;
[0021] When the ecological application query result is that there is no association between the requested access application and the requested access database, the ecological application record corresponding to the target tenant identifier is obtained through the standard application, and the ecological application record is inserted into the tenant registry. The requested access application is used as the target access ecological application, and an ecological application database of the target tenant identifier corresponding to the tenant access request is created through the target access ecological application. The target access ecological application is used as the target access application, and the ecological application database is used as the target access database.
[0022] In one embodiment, determining the target access permission of the target access application to the target access database based on the permission relationship between the application type and the database includes:
[0023] Obtaining a target application type corresponding to the target access application;
[0024] When the target application type is a standard application and the target access database is a standard database, the target access permission is a first permission; when the target application type is a standard application and the target access database is a public database, the target access permission is a second permission; the access permission of the first permission is greater than the access permission of the second permission;
[0025] When the target application type is an ecological application and the target access database is an ecological application database, the target access permission is the first permission; when the target application type is an ecological application and the target access database is a standard database, the target access permission is the third permission; when the target application type is an ecological application and the target access database is a public database, the target access permission is the second permission; the access permission of the third permission is less than that of the first permission and the second permission.
[0026] In one embodiment, the access application includes a standard application and an ecological application, and the tenant access request is received through the standard application; and performing the access operation on the target access database through the target access application based on the target access permission includes:
[0027] When the target access application is a standard application, performing an access operation on the target access database through the target access application based on the target access permission;
[0028] When the target access application is an ecological application, the standard application is switched to the target access application, and an access operation is performed on the target access database based on the target access permission through the target access application.
[0029] In one embodiment, the access application includes a standard application and an ecological application, and the tenant access request is received through the standard application; the method further includes:
[0030] receiving a tenant uninstallation request through the standard application;
[0031] Perform analysis based on the tenant uninstallation request to obtain a target ecological application;
[0032] Obtain the tenant registry through the target ecological application, and obtain the target uninstallation tenant identifier and target uninstallation application identifier of the tenant corresponding to the tenant uninstallation request based on the tenant registry;
[0033] Based on the target uninstall tenant identifier and the target uninstall application identifier, a data deletion operation is performed through the target ecological application and the standard application to complete the tenant uninstall request.
[0034] In one embodiment, the access database includes a non-ecological application database and an ecological application database; performing a data deletion operation based on the target uninstallation tenant identifier and the target uninstallation application identifier through the target ecological application and the standard application to complete the tenant uninstallation request includes:
[0035] Directly deleting the ecological application database corresponding to the target uninstallation tenant identifier through the target ecological application based on the target uninstallation tenant identifier;
[0036] Based on the target uninstall tenant identifier and the target uninstall application identifier, the standard application deletes the ecological application data corresponding to the target uninstall tenant identifier in the non-ecological application database, and deletes the ecological application record corresponding to the target uninstall tenant identifier in the tenant registry.
[0037] A data access device, comprising:
[0038] A receiving module, configured to receive a tenant access request;
[0039] An analysis module is configured to query a tenant registry based on the tenant access request to obtain a target access application and a target access database, wherein the tenant registry includes an association relationship between a tenant identifier, an access application, and an access database;
[0040] A permission determination module, configured to determine a target access permission of the target access application to the target access database based on a permission relationship between the application type and the database;
[0041] An execution module is configured to execute an access operation on the target access database through the target access application based on the target access permission.
[0042] A computer device includes a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:
[0043] Receive tenant access requests;
[0044] Based on the tenant access request, query the tenant registry to obtain a target access application and a target access database, wherein the tenant registry includes an association relationship between a tenant identifier, an access application, and an access database;
[0045] Determining target access permissions of the target access application to the target access database based on the permission relationship between the application type and the database;
[0046] Based on the target access permission, an access operation is performed on the target access database by the target access application.
[0047] A computer-readable storage medium stores a computer program, which, when executed by a processor, implements the following steps:
[0048] Receive tenant access requests;
[0049] Based on the tenant access request, query the tenant registry to obtain a target access application and a target access database, wherein the tenant registry includes an association relationship between a tenant identifier, an access application, and an access database;
[0050] Determining target access permissions of the target access application to the target access database based on the permission relationship between the application type and the database;
[0051] Based on the target access permission, an access operation is performed on the target access database by the target access application.
[0052] The above-mentioned data access method, device, computer equipment and storage medium receive a tenant access request; query the tenant registry based on the tenant access request to obtain the target access application and the target access database, and the tenant registry includes the tenant identifier, the association relationship between the access application and the access database; determine the target access permission of the target access application to the target access database based on the permission relationship corresponding to the application type and the database; based on the target access permission, perform an access operation on the target access database through the target access application, query the received tenant access request based on the tenant registry to determine the target access application and the target access database, and then determine the target access permission of the target access application to the target access database based on the permission relationship corresponding to the application type and the database, and perform an access operation on the target access database through the target access application based on the target access permission, thereby realizing data sharing between different types of applications and isolation of privacy data; in addition, the access application includes standard applications and ecological applications, and data isolation is also realized between different ecological applications, preventing ecological applications from modifying standard application data and modifying other ecological application data, improving the security of data between databases, and thus facilitating improving the efficiency of safe use of data in the database. BRIEF DESCRIPTION OF THE DRAWINGS
[0053] Figure 1 An application environment diagram of a data access method in one embodiment;
[0054] Figure 2 1 is a flow chart of a data access method in one embodiment;
[0055] Figure 3 A schematic diagram of a tenant query process in one embodiment;
[0056] Figure 4 A schematic diagram of a process for accessing an application and accessing a database in one embodiment;
[0057] Figure 5 A schematic diagram of a process for determining permissions in one embodiment;
[0058] Figure 6 A schematic diagram of an access execution flow in one embodiment;
[0059] Figure 7 A schematic diagram of a process of uninstalling an application in one embodiment;
[0060] Figure 8 Schematic diagram of a data deletion process in one embodiment;
[0061] Figure 9 A schematic diagram of an overall data storage framework in one embodiment;
[0062] Figure 10 This is a sequence diagram of a tenant initialization scenario in one embodiment;
[0063] Figure 11 A timing diagram of an ecological application enabling scenario in one embodiment;
[0064] Figure 12 This is a timing diagram of an ecological application uninstallation scenario in an embodiment;
[0065] Figure 13 is a structural block diagram of a data storage device in one embodiment;
[0066] Figure 14 is a diagram of the internal structure of a computer device in one embodiment;
[0067] Figure 15 FIG. 1 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0068] In order to make the purpose, technical solutions and advantages of this application more clear, the following further describes this application in detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain this application and are not intended to limit this application.
[0069] The data access method provided in the embodiment of the present application can be applied to Figure 1 In the application environment shown. Among them, the terminal 102 communicates with the server 104 through the network. The data storage system can store the data that the server 104 needs to process. The data storage system can be integrated on the server 104, or it can be placed on the cloud or other network servers. The terminal 102 is used to input the request data corresponding to the tenant. The server 104 is used to receive the tenant access request; based on the tenant access request, query the tenant registry to obtain the target access application and the target access database; based on the permission relationship corresponding to the application type and the database, determine the target access permission of the target access application to the target access database; based on the target access permission, perform the access operation on the target access database through the target access application. Among them, the terminal 102 can be, but is not limited to, various personal computers, laptops, smart phones, tablets, Internet of Things devices and portable wearable devices. The Internet of Things devices can be smart speakers, smart TVs, smart air conditioners, smart car devices, etc. Portable wearable devices can be smart watches, smart bracelets, head-mounted devices, etc. The server 104 can be implemented as an independent server or a server cluster consisting of multiple servers.
[0070] In one embodiment, Figure 2 As shown, a data access method is provided, which is applied to Figure 1The following steps are used as an example to illustrate the server in the example:
[0071] Step S200: receiving a tenant access request.
[0072] A tenant is a customer who uses a system or computing resources. In multi-tenancy, a tenant encompasses all data that identifies a specific user within the system, including account and statistical information, various data users create within the system, and their customized application environments. In this embodiment, a tenant is a customer using a SaaS system. A tenant access request is a request from a tenant to access a database, which can be a read, write, or append write operation.
[0073] Specifically, when a tenant needs to access a related database, it needs to first send a tenant access request. After the cloud server receives the tenant access request corresponding to the tenant, it can further verify the tenant to determine whether the tenant is a tenant of a standard corresponding SaaS (full name: Software as a Service) vendor.
[0074] Step S202: querying the tenant registry based on the tenant access request to obtain a target access application and a target access database. The tenant registry includes an association relationship between a tenant identifier, an access application, and an access database.
[0075] The target access application refers to the application initiated by a tenant through a tenant access request to complete certain services. It can be a standard application or an ecosystem application. A standard application refers to an application developed by the SaaS vendor. An ecosystem application refers to an application customized based on a standard application, such as one from a SaaS development partner. The target access database refers to the database specifically accessed in the tenant access request. This database can be an ecosystem application database or a non-eco application database. Different tenants have different ecosystem databases, and a tenant can have ecosystem application databases for multiple different ecosystem applications. Non-eco databases can include standard databases and public databases. A standard database refers to a database shared by tenants and used to store data related to standard and ecosystem applications. A public database refers to a database that stores data commonly used by standard and ecosystem applications. The tenant registry refers to a data table that stores tenant information, applications corresponding to the tenant, and databases corresponding to the application. It reflects the relationship between the tenant, applications, and databases. The tenant identifier refers to the tenant's unique identifier, which can be a tenant account or tenant ID. An access application refers to an application purchased by the tenant from the SaaS vendor and accessible to the tenant. An access database refers to a database accessible to the tenant.
[0076] Specifically, after the cloud server receives the tenant access request, it reads the information of the tenant registry and queries whether the tenant exists through the tenant registry. When the tenant exists, the target access application and target access database corresponding to the tenant access request are directly obtained from the tenant registry. The target access application can be a standard application or an ecological application, and the target access database can be a non-ecological database (including but not limited to standard databases and public databases) or an ecological database; when the tenant does not exist, it is necessary to register the tenant information and initialize the data before the target access application and target access database corresponding to the tenant access request can be obtained according to the tenant access request and the tenant registry.
[0077] Step S204 : determining the target access permission of the target access application to the target access database based on the permission relationship between the application type and the database.
[0078] The permission relationship refers to the permission correspondence between application type and database type. Different application types have different access permissions for different databases. The target access permission refers to the access permission of the target application to the target database.
[0079] Specifically, after determining the target access application and target access database to be accessed in the tenant access request through the tenant registry, it is necessary to determine the access rights of the target access application to the target access database based on the permission relationship between the application type and the database, wherein the permission relationship between the application type and the database can be that the standard application has read / write permissions for the standard database and read / append write permissions for the public database; or it can be that the ecological application has read / write permissions for the ecological application database, read / append write permissions for the public database, and read-only permissions for the standard database. Determine the application type corresponding to the target access application and the database type corresponding to the target access database, and then determine the target access rights of the target access application to the target access database based on the originally established corresponding relationship between the application type and the database, thereby limiting the access rights of various applications to various databases based on the permission relationship between different application types and different databases, realizing data isolation between databases corresponding to different applications and enhancing the security of the database.
[0080] Step S206: Based on the target access permission, perform an access operation on the target access database through the target access application.
[0081] Specifically, after determining the access rights of the target access application to the target access database, the target access application can perform operations corresponding to the target access rights on the target access database. Among them, the target access application can be a standard application and an ecological application, and the target access database can be a standard database, a public database, and an ecological application database, but the standard application can only access the database and the public database, and the access rights to these two databases are also different, while the ecological application can access the standard database, the public database, and the ecological application database, and the access rights to these three databases are also different. The differentiated access of the standard application to the standard database and the public database, and the unauthorized access to the ecological application database; the differentiated access of the ecological application to the standard database, the public database, and the corresponding multiple ecological databases realizes the isolation between databases, thereby improving the isolation and security between databases, which is conducive to the safe use of data in the database.
[0082] The above data access method receives a tenant access request; queries the tenant registry based on the tenant access request to obtain a target access application and a target access database; determines the target access application's target access permission for the target access database based on the permission relationship between the application type and the database; and performs an access operation on the target access database through the target access application based on the target access permission. This method enables data sharing between different types of applications and isolation of private data. Furthermore, access applications include standard applications and ecosystem applications, and data isolation is achieved between different ecosystem applications. This prevents ecosystem applications from modifying standard application data or modifying data in other ecosystem applications, thereby improving data security between databases and facilitating the efficient and secure use of data in databases.
[0083] In one embodiment, Figure 3 As shown, before step S202, the following steps are also included:
[0084] Step S300: obtaining a target tenant identifier based on the tenant access request.
[0085] The target tenant identifier refers to the identity information used to identify the tenant corresponding to the tenant access request.
[0086] Specifically, before a tenant wants to access a related database, it is necessary to ensure that the tenant has related registration record information. The tenant access request can know the initiator of the request, and the data ID card of the initiator is the target tenant identifier.
[0087] Step S302: Obtain a tenant registry, perform a query operation on the target tenant identifier based on the tenant registry, and obtain a tenant query result.
[0088] The query operation refers to the operation of reading the tenant registry to check whether there is relevant information about the tenant and whether the tenant has relevant application information recorded. The tenant query result refers to the result of whether the tenant exists in the tenant registry.
[0089] Specifically, the tenant registry is queried to determine whether there is any registration record information related to the tenant, whether there is data corresponding to the tenant in the standard database, public database, or ecological database, and whether the tenant has the relevant permissions to access the corresponding database. Therefore, it is necessary to query the tenant corresponding to the tenant access request so that subsequent processes can perform related operations based on the tenant query results.
[0090] Step S304: When the tenant query result shows that the target tenant identifier does not exist, obtain the tenant registration information corresponding to the target tenant identifier, insert the tenant registration information into the tenant registry, obtain the preset data, add the preset data to the corresponding access database, and continue to perform the query in the tenant registry based on the tenant access request to obtain the target access application and the target access database.
[0091] Among them, tenant registration information refers to the information that needs to be added to the tenant registration table when initializing the tenant. This information contains the association between the tenant, the application, and the database corresponding to the application. Preset data refers to data related to tenant initialization, which may include first preset data and second preset data. The first preset data refers to data that the tenant only applies to the standard database, and the second preset data refers to data that the tenant applies to both the standard database and the corresponding ecological application database. The access database refers to the database accessed by the tenant, which may include ecological application databases and non-ecological application databases. However, here, it is the initialization stage of the tenant, and the standard database and public database of the non-ecological application database are accessed. The ecological application database of the tenant has not yet been initialized. At this time, it is only necessary to add the preset data to the corresponding standard database and public database.
[0092] Specifically, if the tenant does not exist in the tenant registry, it means that the tenant has not stored relevant information data in the standard database, the public database and the corresponding ecological application database. At this time, it is necessary to initialize the tenant in the standard database and the public database. Since the standard database and the public database are shared by tenants, there is no need to execute the DDL (full name: Data Definition Language) statement for table creation in the standard database and the public database when the tenant is initialized. It is only necessary to insert the first preset data into the standard database in the standard application and the second preset data into the public database, and record the relationship between the tenant and the standard application, the standard database and the public database, that is, the tenant registration information in the tenant registry. Only the standard application has the modification (addition, deletion, modification) permission of the tenant registry, and the ecological application only has query permission on the tenant registry. DDL statements refer to data definition language, which mainly perform operations such as defining / changing the structure of the table, data type, and links between tables. Commonly used statement keywords include CREATE, DROP, ALTER, etc.
[0093] Step S306: When the tenant query result indicates that the target tenant identifier exists, the operation of directly querying the tenant registry based on the tenant access request to obtain the target access application and the target access database is performed.
[0094] Specifically, when the tenant exists in the tenant registry, the target tenant identifier can be used to query the tenant registry for the application and database in the tenant access request, and then the target access application and target access database obtained during the query process can be determined.
[0095] In this embodiment, a query operation is performed on the target tenant identifier based on the tenant registry. When the target tenant identifier does not exist, the tenant registration information corresponding to the target tenant identifier is inserted into the tenant registry, and the preset data is added to the corresponding access database. Then, the query is continued in the tenant registry based on the tenant access request to obtain the target access application and the target access database. When the target tenant identifier exists, the query is directly performed in the tenant registry based on the tenant access request to obtain the target access application and the target access database. This ensures the data access security to a certain extent, improves the rigor of data access, and is conducive to improving the security of the database.
[0096] In one embodiment, Figure 4 As shown, step S202 includes:
[0097] Step S400: Based on the tenant access request, obtain the requested application and the requested database.
[0098] The "application requested for access" refers to the application that the tenant needs to access in the access request, which can be a standard application or an ecological application. The "database requested for access" refers to the database that the tenant needs to access in the access request.
[0099] Specifically, in order to further determine the application type and database type that the tenant wants to access, it is necessary to parse the corresponding requested application and requested database from the tenant access request, thereby providing a data basis for subsequent application type judgment and related operations.
[0100] Step S402 : when the access requesting application is a standard application and the access requesting database is not an ecological application database, the access requesting application is used as the target access application and the access requesting database is used as the target access database.
[0101] Specifically, when the requested access application is a standard application, the requested access application can be directly used as the target access application and the requested access database can be used as the target access database, because as long as the tenant has been registered and the registration information or initialization data corresponding to the tenant already exists, the tenant can have the right to access the standard application. In other words, when the tenant needs to access the relevant database in the standard application, there is no need to determine whether the tenant has an association relationship with the standard application and the standard database and public database corresponding to the standard application, because the standard database and public database have already been initialized for the tenant during the tenant initialization process. Therefore, when the requested access application corresponding to the tenant access request is a standard application and the requested access database is a standard database or a public database, the tenant can perform relevant operations based on the corresponding target access rights in the standard application to determine what operations the tenant wants to perform on the standard database or public database.
[0102] Step S404: When the application requested for access is an ecological application, a query operation is performed on the application requested for access based on the tenant registration table through a standard application to obtain an ecological application query result.
[0103] The query operation refers to checking the tenant registry to see if there is an association between the tenant and the ecosystem application and the ecosystem application database corresponding to the ecosystem application. The ecosystem application query result indicates whether the tenant has an association with the ecosystem application they want to access, that is, whether the tenant has the ecosystem application database corresponding to the ecosystem application.
[0104] Specifically, when the application a tenant wants to access is an ecosystem application, the ecosystem application database corresponding to the tenant and the ecosystem application must exist in the tenant registry. Therefore, before the tenant switches to the corresponding ecosystem application through the interface in the standard application, it is necessary to first determine whether the tenant has an association with the ecosystem application. An interface is a reference type that defines a protocol, which specifies the members that must be provided by a class or other interfaces that implement it. Members can be methods, properties, indexers, events, etc.
[0105] Step S406 : When the ecological application query result shows that there is an association relationship between the access requesting application and the access requesting database, the access requesting application is used as the target access application, and the access requesting database is used as the target access database.
[0106] The association relationship refers to the correspondence between the tenant and the ecological application, which can be that the ecological application creates an ecological application database corresponding to the tenant.
[0107] Specifically, if an association relationship between a requested access application and a requested access database already exists in the tenant registry, it indicates that the tenant has purchased the requested access application and has the right to access the requested access database corresponding to the requested access application. The tenant can switch to the interface corresponding to the requested access application through the corresponding interface and perform access operations corresponding to the target access rights on the requested access database, where the requested access database can be a standard database, a public database, and an ecological database. It should also be noted that a tenant can purchase multiple ecological applications, but an ecological application tenant can only create one ecological application database. Different ecological applications can create multiple different ecological application databases and have the right to access these multiple different ecological application databases, but the corresponding access operations must also be performed on the corresponding ecological applications.
[0108] Step S408, when the ecological application query result is that there is no association between the requested access application and the requested access database, obtain the ecological application record corresponding to the target tenant identifier through the standard application, and insert the ecological application record into the tenant registry, use the requested access application as the target access ecological application, and create an ecological application database with the target tenant identifier corresponding to the tenant access request through the target access ecological application, use the target access ecological application as the target access application, and use the ecological application database as the target access database.
[0109] The target access ecological application refers to the ecological application that created the ecological application database corresponding to the target tenant identifier. The ecological application record includes but is not limited to the association relationship and access record between the tenant and the ecological application and the corresponding ecological application database.
[0110] Specifically, if there is no association between the requested access application and the requested access database in the tenant registry, it means that the tenant has not purchased the requested access application and needs to purchase the requested access application first and create the corresponding ecological application database before the tenant can perform the corresponding access permission operation on the database corresponding to the requested access application. At this time, the ecological application record corresponding to the requested access application can be recorded in the tenant registry through the standard application to complete the tenant's accessible registration of the requested access application; in addition, the requested access application can also be used as the target access ecological application, and then the ecological application database corresponding to the tenant can be created in the target access ecological application to complete the initialization of the ecological application database corresponding to the tenant. It should also be noted that the ecological application can only read the information of the tenant registry and cannot modify the tenant registry. Modification of relevant data in the tenant registry can only be performed by the standard application.
[0111] In this embodiment, by determining the type of requested access application corresponding to the tenant access request, the corresponding target access application and target access database are determined. For the determination of the ecological application, it is necessary to further confirm whether there is an ecological application database identified by the target tenant for the tenant access request. If it does not exist, the corresponding ecological application record needs to be inserted into the tenant registry through the standard application, and then the corresponding ecological application database is created. This ensures the security of the data in the ecological application database to a certain extent, prevents tenants from making changes to the corresponding ecological application database through standard applications or other ecological applications, thereby ensuring data security between databases.
[0112] In one embodiment, Figure 5 As shown, step S204 includes:
[0113] Step S500: Obtain a target application type corresponding to a target access application.
[0114] The target application type refers to the type of application that the tenant needs to access, which can be a standard application or an ecological application.
[0115] Specifically, the determination of the authority of the target access application to the target access database may also be determined according to the application type of the target access application and the corresponding database.
[0116] Step S502: When the target application type is a standard application and the target access database is a standard database, the target access permission is the first permission; when the target application type is a standard application and the target access database is a public database, the target access permission is the second permission; the access permission of the first permission is greater than the access permission of the second permission.
[0117] Among them, the first permission refers to the application's permission to access certain specified databases. This application includes standard applications and ecological applications. The database includes but is not limited to standard databases. The access permission can be a read / write operation. Read / write operations refer to operations that can browse and read related data, as well as modify the browsed and read data and the original data of the corresponding database. The second permission refers to the application's permission to access certain specific databases. This application is generally a standard application and an ecological application. The database includes but is not limited to public databases. The access permission can be a read / append write operation. Read / append write operations refer to operations that can browse and read the accessed data and add additional data based on the browsed and read data, but cannot modify the browsed and read data and the data in the database corresponding to the data.
[0118] Specifically, when the target application is a standard application, the tenant can perform first-level access operations on the standard database within the standard application, i.e., read or write operations on the standard database. The tenant can also perform second-level access operations on the public database within the standard application, i.e., read or append to the public database. While both the standard database and public data are shared by tenants, the standard application can only modify the public database in specific scenarios, such as when the tenant performs primary initialization operations and adds corresponding pre-set data to the public database. This protects the security of the data in the database to a certain extent.
[0119] Step S504, when the target application type is an ecological application and the target access database is an ecological application database, the target access permission is the first permission; when the target application type is an ecological application and the target access database is a standard database, the target access permission is the third permission; when the target application type is an ecological application and the target access database is a public database, the target access permission is the second permission; the access permission of the third permission is less than that of the first permission and the second permission.
[0120] The third permission refers to the app's access to certain designated databases. The app can be an ecosystem application, and the database can be a standard database. The access permission can be read-only. Read-only access means that the app can only browse and read the relevant data, but cannot modify or add data to the data or the corresponding database.
[0121] Specifically, when the application type corresponding to the target access application is an ecological application, it can be converted to the corresponding ecological application through the standard application. The tenant can perform the first permission access operation on the ecological application data corresponding to the ecological application in the corresponding ecological application, that is, the ecological application database corresponding to the ecological application can be read / written; the tenant can also perform the third permission access operation on the standard database, that is, read-only operation on the standard database; the tenant can also perform the second permission operation on the public database, that is, read / append write operation on the public database. The ecological application databases corresponding to the multiple ecological applications accessible to the tenant are isolated from each other and do not affect each other. For example, no access operation can be performed on the ecological application database corresponding to ecological application B in ecological application A. This ensures the security and quality of the data in the ecological application database to a certain extent, thereby realizing the isolation between ecological application databases, which is conducive to the safe use of data in the ecological application database.
[0122] In this embodiment, by obtaining the target application type corresponding to the target access application, the access rights to different data are determined according to different target application types, thereby achieving data isolation between the database corresponding to the standard application and the database corresponding to the ecological application, and between the ecological application databases and the ecological application databases. Through the differences in access rights, the security of data between various databases is guaranteed, thereby improving the efficiency of safe use of databases by various applications.
[0123] In one embodiment, Figure 6 As shown, step S206 includes:
[0124] Step S600: When the target access application is a standard application, an access operation is performed on a target access database through the target access application based on the target access permission.
[0125] Specifically, when the target access application that the tenant wants to access is a standard application, the corresponding standard application interface will be switched to. The tenant can use the standard application to perform operations corresponding to the target access permission on the target access database, which can be a standard database or a public database. When the target access database is a standard database, the standard application can perform read / write operations on the standard database; when the target access database is a public database, the standard application can perform read / append write operations on the public database; if the target access database is an ecological application database, the standard application has no access permission to the ecological application database.
[0126] Step S602 : when the target access application is an ecological application, switching from the standard application to the target access application, and performing an access operation on the target access database based on the target access permission through the target access application.
[0127] Specifically, when a tenant needs to access an ecological application, they can obtain the corresponding interface of the ecological application through a standard application, then switch from the standard application to the target access application, and then use the target access application to perform access operations corresponding to the target access permission on the target access database. When the target access database is a standard database, the target access application performs only operations on the standard database; when the target access database is a public database, the target access application performs read / append write operations on the public database; if the target access database is an ecological application database, the target access application performs read / write operations on the ecological application database.
[0128] In this embodiment, by performing corresponding access permission operations on the database corresponding to the standard application and performing corresponding access permission operations on the database corresponding to the ecological application, data changes and transformations between databases corresponding to different application types can be prevented from interfering with each other, thereby realizing the safe application of data between databases, which not only ensures the security of the data in the database, but also improves the efficiency of using data from different databases when applying security applications.
[0129] In one embodiment, Figure 7 As shown, it also includes:
[0130] Step S700: receiving a tenant uninstallation request through a standard application.
[0131] The tenant uninstall request refers to a request by a tenant to uninstall a corresponding ecological application.
[0132] Specifically, when a tenant wants to uninstall an ecological application corresponding to the tenant, the standard application first receives the tenant's uninstall request corresponding to the tenant and analyzes the tenant's uninstall request to determine which ecological application the tenant needs to uninstall.
[0133] Step S702: Perform analysis based on the tenant uninstallation request to obtain the target ecological application.
[0134] The target ecological application refers to the ecological application corresponding to the tenant uninstallation request.
[0135] Specifically, after receiving the tenant uninstallation request, the standard application analyzes which ecological application corresponding to the tenant needs to be uninstalled in the tenant uninstallation request, and uses the ecological application as the target ecological application.
[0136] Step S704: Obtain a tenant registry through the target ecological application, and obtain a target uninstallation tenant identifier and a target uninstallation application identifier of the tenant corresponding to the tenant uninstallation request based on the tenant registry.
[0137] The target uninstall tenant identifier is the unique identifier that can identify the tenant corresponding to the tenant uninstall request, namely the tenant ID (full name: Identity Document). The target uninstall application identifier is the identifier that can identify the ecosystem application corresponding to the tenant uninstall request, namely the ecosystem application ID.
[0138] Specifically, the tenant registry stores the association relationships between tenants and target ecological applications and the corresponding ecological application databases. These association relationships are recorded based on the tenant ID, ecological application ID and the corresponding ecological application database name. The target uninstall tenant identifier corresponding to the tenant and the target uninstall application identifier of the tenant corresponding to the target ecological application can be obtained through the tenant registry, providing key data for the subsequent uninstallation of the target ecological application data.
[0139] Step S706: Based on the target uninstall tenant identifier and the target uninstall application identifier, a data deletion operation is performed through the target ecological application and the standard application to complete the tenant uninstall request.
[0140] Specifically, the ecological application provides an uninstall interface for the standard application. The standard application searches for the association relationship between the target ecological application and the tenant through the tenant registry, and deletes the ecological application database corresponding to the tenant based on these association relationships, but does not delete the data of the tenant and the target ecological application in the standard database. In the target ecological application, the tenant can be directly deleted in the ecological application database corresponding to the target ecological application. However, for the ecological application data of the target ecological application in the public database, it is necessary to delete the relevant data in the standard application based on the joint primary key of the target uninstall tenant identifier and the target uninstall application identifier. Only in this way can the ecological application uninstallation operation for the tenant uninstallation request be realized, and the uninstallation of the ecological application includes the deletion of the ecological application database and the deletion of the ecological application data in the public database.
[0141] In this embodiment, a tenant uninstall request is received through a standard application, and the tenant uninstall request is analyzed to obtain a target ecological application. The target ecological application obtains the target uninstall tenant identifier and target uninstall application identifier of the tenant corresponding to the tenant uninstall request from the tenant registry. The standard application and the target ecological application perform data deletion operations based on the target uninstall tenant identifier and the target uninstall application identifier to complete the tenant uninstall request, realize the uninstall mechanism of the ecological application, improve the flexibility of deleting ecological application data related to the ecological application, and ensure the security of data between various databases.
[0142] In one embodiment, Figure 8 As shown, step S706 includes:
[0143] Step S800 : directly deleting the ecological application database corresponding to the target uninstallation tenant identifier through the target ecological application based on the target uninstallation tenant identifier.
[0144] Specifically, the ecological application can know the ecological application database name corresponding to the target uninstallation tenant identifier from the tenant registry according to the target uninstallation tenant identifier, and then directly delete the ecological application database, thereby releasing the relationship between the target uninstallation tenant identifier and the ecological application and the corresponding ecological application database, thereby realizing the deletion of the ecological application database during the ecological application uninstallation.
[0145] Step S802: Deleting the ecological application data corresponding to the tenant in the non-ecological database based on the target uninstall tenant identifier and the target uninstall application identifier through standard application, and deleting the ecological application record corresponding to the target uninstall tenant identifier in the tenant registration table.
[0146] Specifically, the operation of deleting data in a non-ecological database (which can be a public database) through a standard application can only be performed in a specific scenario, that is, when the tenant has an ecological application uninstallation request, the standard application is granted the modification operation of deleting the original data in the non-ecological database. In other scenarios, it still only has the permission to read / append write operations. In addition, since the public database contains the tenant's standard application data and the ecological application data corresponding to the tenant, when the ecological application data corresponding to the target ecological application in the public database is deleted through the standard application, the corresponding data deletion operation is performed according to the joint primary key of the target uninstall tenant identifier and the target uninstall application identifier. Since the association relationship between the tenant, the target ecological application and the corresponding ecological application database no longer exists after the target ecological application is uninstalled, the ecological application records corresponding to the tenant and the target ecological application in the tenant registration table can be deleted through the standard application to release the association relationship between the tenant, the target ecological application and the corresponding ecological application database.
[0147] In this embodiment, the ecological application database corresponding to the target uninstall tenant identifier is directly deleted through the target ecological application based on the target uninstall tenant identifier, and the standard application is provided to delete the ecological application data corresponding to the tenant in the public database based on the target uninstall tenant identifier and the target uninstall application identifier, and delete the ecological application record corresponding to the tenant in the tenant registry, thereby realizing the deletion of ecological application data. The difference in access rights of standard applications and ecological applications to different databases is also reflected in the data deletion process, and the problem that ecological applications are difficult to uninstall independently is solved.
[0148] In one embodiment, Figure 9 The overall architecture diagram of the present invention is as follows: the tenant registry records certain tenants' ecological applications or standard applications and the corresponding database information, which may be a standard database, a public database and ecological application data. Figure 9 It can be seen that standard applications can read / write the tenant registry, but ecological applications can only read the tenant registry. That is, the modification permission of the tenant registry is only in standard applications. Ecological applications cannot change the contents of the tenant registry and can only read the information in the tenant registry. Figure 9 It can also be seen that the standard database and the public database (i.e., the public database) are shared by tenants, but the ecological application databases of the ecological applications corresponding to the tenants are isolated from each other and cannot be modified by each other. In standard applications, read / write operations can be performed on the standard database, but ecological applications can only read operations on the standard database. Standard applications can read / append and write operations on the public database, and ecological applications can also read / append and write operations on the public database. They jointly store data that can be applied to standard applications and ecological applications in the public database; in ecological applications, ecological applications can only read / write operations on their own corresponding ecological application databases, and cannot read / write operations on the ecological application databases corresponding to other ecological applications. In summary, the standard application receives the tenant access request and analyzes it based on the tenant access request to obtain the target access object. When the target access object is the database corresponding to the standard application, the standard application's operating permission for the standard database is the first permission, and the operating permission for the public database is the second permission. The operating permission of the first permission is greater than the operating permission of the second permission. When the target access object is the database corresponding to the ecological application, the ecological application's operating permission for the corresponding ecological application database is the first permission, the operating permission for the standard database is the third permission, and the operating permission for the public database is the second permission. The operating permission of the third permission is less than the first permission and the second permission, thereby realizing data isolation between ecological application databases, ensuring the security of data in the database, and improving the efficiency of data security applications in the database through the information bridge of the tenant registry and the relationship between databases.
[0149] In addition, in some scenarios, the application also exchanges relevant data with the tenant registry and database. Figure 10 A timing diagram for tenant initialization scenarios, Figure 10 In the process, the tenant sends a request to the standard application. After receiving the request, the standard application will query whether the tenant exists through the tenant registry. If the tenant does not exist, the initialization data corresponding to the tenant will be stored in the standard database and the public database respectively, thereby completing the initialization of the tenant. Figure 11 A timing diagram for enabling scenarios for ecological applications, Figure 11In the process, the tenant sends an access request for the ecological application to the standard application. After receiving the request, the standard application inserts the ecological application record into the tenant registry. If there is an association relationship between the tenant and the ecological application to be accessed in the tenant registry, the corresponding ecological application database name is obtained in the ecological application, and then the corresponding ecological application database is accessed based on the ecological application database name; if there is no association relationship between the tenant and the ecological application to be accessed in the tenant registry and the tenant meets the corresponding creation conditions, the ecological application database corresponding to the tenant is created in the ecological application, and the association relationship between the tenant and the ecological application and the ecological application database is inserted into the tenant registry in the standard application. It should also be noted here that since the data of the ecological application database is not shared, a complete ecological application database is initialized for a tenant each time, so it will take longer than the initialization of the standard application. Figure 12 This is the timing diagram of the ecological application uninstallation scenario. Figure 12 In the process, the tenant sends an uninstall request for the ecological application to the standard application. After receiving the uninstall request, the standard application enters the relevant ecological application through the uninstall interface provided by the ecological application. The ecological application queries the ecological application database corresponding to the tenant through the tenant registry and deletes the ecological application database. The standard application deletes the corresponding ecological application data in the public database based on the joint primary key of the tenant ID and the ecological application ID, and deletes the corresponding ecological application record in the tenant registry to achieve the contact between the tenant, the uninstalled ecological application and the corresponding ecological application database, while the corresponding ecological application data in the standard database is still retained. It should be noted that the standard application can only delete the data in the public database in the ecological application uninstallation scenario. In other non-specific scenarios, it only has read / append write permissions to the public database. The data flows implemented in different scenarios are different, and different scenarios also reflect that the security of the data in the database is better guaranteed, and the efficiency of securely applying the data in the database is better.
[0150] Based on the same inventive concept, embodiments of the present application further provide a data storage device for implementing the aforementioned data storage method. The solution provided by this device is similar to the solution described in the aforementioned method. Therefore, the specific limitations of one or more data storage device embodiments provided below can be found in the above-described limitations of the data storage method and are not further elaborated here.
[0151] In one embodiment, Figure 13 As shown, a data access device is provided, including: a receiving module 1300, an analyzing module 1302, an authority determination operation module 1304 and an execution operation module 1306, wherein:
[0152] Receiving module 1300, for receiving a tenant access request.
[0153] The analysis module 1302 is configured to query a tenant registry based on the tenant access request to obtain a target access application and a target access database. The tenant registry includes an association relationship between a tenant identifier, an access application, and an access database.
[0154] The permission determination module 1304 is configured to determine the target access permission of the target access application to the target access database based on the permission relationship between the application type and the database.
[0155] The execution module 1306 is configured to execute an access operation on the target access database through the target access application based on the target access permission.
[0156] In one embodiment, the data access device also includes a tenant query module 1308, which is used to obtain a target tenant identifier based on the tenant access request; obtain the tenant registry, and based on the tenant registry, perform a query operation on the target tenant identifier to obtain a tenant query result; when the tenant query result is that the target tenant identifier does not exist, obtain the tenant registration information corresponding to the target tenant identifier, insert the tenant registration information into the tenant registry, obtain preset data, add the preset data to the corresponding access database, and continue to perform the operation of querying the tenant registry based on the tenant access request to obtain the target access application and the target access database; when the tenant query result is that the target tenant identifier exists, directly perform the operation of querying the tenant registry based on the tenant access request to obtain the target access application and the target access database.
[0157] In one embodiment, the analysis module 1302 is further used to obtain the requested access application and the requested access database based on the tenant access request; when the requested access application is a standard application and the requested access database is not an ecological application database, the requested access application is used as the target access application and the requested access database is used as the target access database; when the requested access application is an ecological application, the standard application is used to query the requested access application based on the tenant registry to obtain an ecological application query result; when the ecological application query result shows that there is an association relationship between the requested access application and the requested access database, the requested access application is used as the target access database. The request application is used as the target access application, and the requested access database is used as the target access database; when the ecological application query result shows that there is no association relationship between the requested access application and the requested access database, the ecological application record corresponding to the target tenant identifier is obtained through the standard application, and the ecological application record is inserted into the tenant registration table. The request application is used as the target access ecological application, and an ecological application database corresponding to the target tenant identifier of the tenant access request is created through the target access ecological application. The target access ecological application is used as the target access application, and the ecological application database is used as the target access database.
[0158] In one embodiment, the permission determination module 1304 is also used to obtain the target application type corresponding to the target access application; when the target application type is a standard application and the target access database is a standard database, the target access permission is the first permission; when the target application type is a standard application and the target access database is a public database, the target access permission is the second permission; the access permission of the first permission is greater than the access permission of the second permission; when the target application type is an ecological application and the target access database is an ecological application database, the target access permission is the first permission; when the target application type is an ecological application and the target access database is a standard database, the target access permission is the third permission; when the target application type is an ecological application and the target access database is a public database, the target access permission is the second permission; the access permission of the third permission is less than the first permission and the second permission.
[0159] In one embodiment, the execution module 1306 is also used to, when the target access application is a standard application, perform access operations on the target access database through the target access application based on the target access permission; when the target access application is an ecological application, switch from the standard application to the target access application, and perform access operations on the target access database through the target access application based on the target access permission.
[0160] In one embodiment, the data access device also includes an uninstall module 1310, which is used to receive a tenant uninstall request through the standard application; perform an analysis operation based on the tenant uninstall request to obtain a target ecological application; obtain the tenant registry through the target ecological application, and obtain the target uninstall tenant identifier and target uninstall application identifier of the tenant corresponding to the tenant uninstall request based on the tenant registry; based on the target uninstall tenant identifier and the target uninstall application identifier, perform a data deletion operation through the target ecological application and the standard application to complete the tenant uninstall request.
[0161] In one embodiment, the uninstall module 1310 is also used to directly delete the ecological application database corresponding to the target uninstall tenant identifier through the target ecological application based on the target uninstall tenant identifier; delete the ecological application data corresponding to the target uninstall tenant identifier in the non-ecological application database based on the target uninstall tenant identifier and the target uninstall application identifier through the standard application, and delete the ecological application record corresponding to the target uninstall tenant identifier in the tenant registry.
[0162] Each module in the above-mentioned data access device can be implemented in whole or in part by software, hardware, or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in the computer device in the form of software, so that the processor can call and execute the corresponding operations of each module.
[0163] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Figure 14 As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, abbreviated as I / O) and a communication interface. The processor, memory and input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and computer program in the non-volatile storage medium. The database of the computer device is used to store request data and data corresponding to each application. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a data access method is implemented.
[0164] In one embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as follows: Figure 15 As shown. The computer device includes a processor, a memory, an input / output interface, a communication interface, a display unit and an input device. The processor, the memory and the input / output interface are connected via a system bus, and the communication interface, the display unit and the input device are connected to the system bus via the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be achieved through WIFI, a mobile cellular network, NFC (near field communication) or other technologies. When the computer program is executed by the processor, a data access method is implemented. The display unit of the computer device is used to form a visually visible picture, which can be a display screen, a projection device or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covering the display screen, or a button, trackball or touchpad set on the computer device casing, or an external keyboard, touchpad or mouse.
[0165] Those skilled in the art will understand that Figure 14 and Figure 15 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.
[0166] In one embodiment, a computer device is further provided, including a memory and a processor. The memory stores a computer program, and the processor implements the steps in the above method embodiments when executing the computer program.
[0167] In one embodiment, a computer-readable storage medium is provided, storing a computer program, which implements the steps in the above-mentioned method embodiments when executed by a processor.
[0168] In one embodiment, a computer program product or computer program is provided, the computer program product or computer program including computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the steps of each of the above-described method embodiments.
[0169] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of relevant countries and regions.
[0170] Those skilled in the art will appreciate that all or part of the processes in the above-mentioned embodiment methods can be implemented by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, database or other media used in the embodiments provided in this application may include at least one of non-volatile and volatile memory. Non-volatile memory may include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory may include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in the various embodiments provided herein may include at least one of a relational database and a non-relational database. Non-relational databases may include, but are not limited to, distributed databases based on blockchains. The processor involved in the various embodiments provided herein may be, but are not limited to, a general-purpose processor, a central processing unit, a graphics processing unit, a digital signal processor, a programmable logic unit, a data processing logic unit based on quantum computing, and the like.
[0171] The technical features of the above embodiments can be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0172] The above-described embodiments merely represent several implementation methods of the present application. While the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the present application. It should be noted that a person of ordinary skill in the art may make various modifications and improvements without departing from the spirit of the present application, and these modifications and improvements fall within the scope of protection of the present application. Therefore, the scope of protection of the present application shall be determined by the appended claims.
Claims
1. A data access method, characterized in that: The method comprises: Receive tenant access requests; Based on the tenant access request, query the tenant registry to obtain a target access application and a target access database, wherein the tenant registry includes an association relationship between a tenant identifier, an access application, and an access database; Determine the target access permission of the target access application to the target access database based on the permission relationship between the application type and the database; the application type includes standard applications and ecological applications, and the database includes a standard database, a public database, and an ecological application database; different permissions of the standard application are used to access the standard database and the public database, and different permissions of the ecological application are used to access the standard database, the public database, and the ecological application database; Based on the target access permission, an access operation is performed on the target access database by the target access application.
2. The method according to claim 1, characterized in that Before querying the tenant registry based on the tenant access request to obtain the target access application and the target access database, the method further includes: Obtaining a target tenant identifier based on the tenant access request; Obtain the tenant registry, and perform a query operation on the target tenant identifier based on the tenant registry to obtain a tenant query result; When the tenant query result is that the target tenant identifier does not exist, obtaining tenant registration information corresponding to the target tenant identifier, inserting the tenant registration information into the tenant registration table, obtaining preset data, adding the preset data to the corresponding access database, and continuing to perform the operation of querying the tenant registration table based on the tenant access request to obtain the target access application and the target access database; When the tenant query result indicates that the target tenant identifier exists, an operation of directly querying the tenant registry based on the tenant access request to obtain the target access application and the target access database is performed.
3. The method according to claim 1, characterized in that The access application includes a standard application and an ecological application, and the tenant access request is received through the standard application; the access database includes a non-ecological application database and an ecological application database; The tenant registry is queried based on the tenant access request to obtain a target access application and a target access database, wherein the tenant registry includes an association relationship between the access application and the access database, including: Based on the tenant access request, obtaining a requested access application and a requested access database; When the access requesting application is a standard application and the access requesting database is not an ecological application database, taking the access requesting application as the target access application and taking the access requesting database as the target access database; When the application requested for access is an ecological application, querying the application requested for access based on the tenant registry using the standard application to obtain an ecological application query result; When the ecological application query result shows that there is an association relationship between the access requesting application and the access requesting database, the access requesting application is used as the target access application, and the access requesting database is used as the target access database; When the ecological application query result is that there is no association between the requested access application and the requested access database, the ecological application record corresponding to the target tenant identifier is obtained through the standard application, and the ecological application record is inserted into the tenant registry. The requested access application is used as the target access ecological application, and an ecological application database of the target tenant identifier corresponding to the tenant access request is created through the target access ecological application. The target access ecological application is used as the target access application, and the ecological application database is used as the target access database.
4. The method according to claim 1, wherein The determining, based on the permission relationship between the application type and the database, the target access permission of the target access application to the target access database includes: Obtaining a target application type corresponding to the target access application; When the target application type is a standard application and the target access database is a standard database, the target access permission is a first permission; when the target application type is a standard application and the target access database is a public database, the target access permission is a second permission; the access permission of the first permission is greater than the access permission of the second permission; When the target application type is an ecological application and the target access database is an ecological application database, the target access permission is the first permission; when the target application type is an ecological application and the target access database is a standard database, the target access permission is the third permission; when the target application type is an ecological application and the target access database is a public database, the target access permission is the second permission; the access permission of the third permission is less than that of the first permission and the second permission.
5. The method according to claim 1, wherein The access application includes a standard application and an ecological application, and the tenant access request is received through the standard application; and performing the access operation on the target access database through the target access application based on the target access permission includes: When the target access application is a standard application, performing an access operation on the target access database through the target access application based on the target access permission; When the target access application is an ecological application, the standard application is switched to the target access application, and an access operation is performed on the target access database based on the target access permission through the target access application.
6. The method according to claim 1, characterized in that The access application includes a standard application and an ecological application, and the tenant access request is received through the standard application; the method further includes: receiving a tenant uninstallation request through the standard application; Perform analysis based on the tenant uninstallation request to obtain a target ecological application; Obtain the tenant registry through the target ecological application, and obtain the target uninstallation tenant identifier and target uninstallation application identifier of the tenant corresponding to the tenant uninstallation request based on the tenant registry; Based on the target uninstall tenant identifier and the target uninstall application identifier, a data deletion operation is performed through the target ecological application and the standard application to complete the tenant uninstall request.
7. The method according to claim 6, characterized in that The access database includes a non-ecological application database and an ecological application database; the data deletion operation is performed through the target ecological application and the standard application based on the target uninstallation tenant identifier and the target uninstallation application identifier, and completing the tenant uninstallation request includes: Directly deleting the ecological application database corresponding to the target uninstallation tenant identifier through the target ecological application based on the target uninstallation tenant identifier; Based on the target uninstall tenant identifier and the target uninstall application identifier, the standard application deletes the ecological application data corresponding to the target uninstall tenant identifier in the non-ecological application database, and deletes the ecological application record corresponding to the target uninstall tenant identifier in the tenant registry.
8. A data access device, characterized in that: The device comprises: A receiving module, configured to receive a tenant access request; An analysis module is configured to query a tenant registry based on the tenant access request to obtain a target access application and a target access database, wherein the tenant registry includes an association relationship between a tenant identifier, an access application, and an access database; a permission determination module, configured to determine, based on a permission relationship between an application type and a database, a target access permission for the target access application to the target access database; the application types include standard applications and ecological applications, and the databases include standard databases, public databases, and ecological application databases; different permissions for the standard applications are used to access the standard databases and the public databases, and different permissions for the ecological applications are used to access the standard databases, the public databases, and the ecological application databases; An execution module is configured to execute an access operation on the target access database through the target access application based on the target access permission.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
Access control method and system, electronic equipment and readable medium
CN110300124A
Data access method and device in cloud service multi-tenant environment
CN113051038A