Data access control method, device and equipment in multi-tenant environment and storage medium
By building integrated security credentials in a multi-tenant environment, atomic linkage between identity and data routing is achieved, which solves the risk of data mismatch and performance loss caused by the disconnect between identity authentication and data source switching, and improves the security and efficiency of the system.
Patent Information
- Application Number
- CN202611483281.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-22
- Publication Date
- 2026-11-17
AI Technical Summary
In multi-tenant application systems, the disconnect between identity authentication and data source switching mechanisms in existing technologies leads to data mismatch risks and performance degradation, making it difficult to meet the data processing efficiency and security collaboration requirements in high-concurrency scenarios.
By constructing a unified security credential, tenant identity identifiers, data source routing identifiers, and business data verification information are encapsulated in the same data structure. This enables the acquisition of key control parameters through a single parsing process, simultaneous execution of identity legitimacy verification and business data anti-tampering verification, and, upon successful verification, direct binding of the current execution thread to the target physically isolated data source based on the routing identifier within the credential.
It eliminates the risk of data mismatch, improves the throughput and response time of request processing, and ensures the security and performance of data storage in a multi-tenant environment.
Smart Images

Figure CN123122980A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer network security management technology, and in particular to a data access control method, apparatus, device and storage medium in a multi-tenant environment. Background Technology
[0002] In multi-tenant application system architectures, to ensure data security and business isolation between different tenants, a combination of identity authentication and data source routing is typically used. In existing technologies, the identity authentication mechanism and the data source switching mechanism are often executed sequentially as independent modules. That is, the legitimacy of the user's identity is verified first, and then the corresponding database connection is queried and switched according to the request parameters.
[0003] However, this fragmented approach presents security risks and performance bottlenecks: on the one hand, the lack of atomic binding between identity credentials and business data during transmission and verification may lead to the risk of data mismatch, where the identity is legitimate but the submitted data is tampered with or misattributed; on the other hand, repeatedly parsing request messages and repeatedly querying configuration information increases system overhead, making it difficult to meet the dual requirements of data processing efficiency and security coordination in high-concurrency scenarios. Summary of the Invention
[0004] To address the risks of data mismatch and performance degradation caused by the separation of security verification and data routing in existing technologies for multi-tenant request processing, this application provides a data access control method, apparatus, device, and medium in a multi-tenant environment, which achieves collaborative processing of authentication based on integrated security credentials, data anti-tampering verification, and physical data source routing.
[0005] In a first aspect, embodiments of this application provide a data access control method in a multi-tenant environment, the method comprising: Obtain the converged security credential sent by the client, wherein the converged security credential includes a tenant identity identifier, a data source routing identifier, and business data verification information; The converged security credentials are parsed to extract the tenant identity identifier, the data source routing identifier, and the business data verification information; Based on the tenant identity identifier and the business data verification information, identity legitimacy verification and business data anti-tampering verification are performed simultaneously; If both verification and validation pass, the data operation of the currently executing thread is routed to the target physically isolated data source based on the data source routing identifier.
[0006] Secondly, embodiments of this application provide a data access control device for a multi-tenant environment, the device comprising: The credential acquisition module is used to acquire the converged security credential sent by the client. The converged security credential includes the tenant identity identifier, the data source routing identifier, and the business data verification information. The credential parsing module is used to parse the converged security credential and extract the tenant identity identifier, the data source routing identifier, and the business data verification information; The collaborative verification module is used to simultaneously perform identity legitimacy verification and business data anti-tampering verification based on the tenant identity identifier and the business data verification information; The data source switching module is used to route the data operation of the currently executing thread to the target physically isolated data source based on the data source routing identifier, provided that both verification and validation are passed.
[0007] Thirdly, embodiments of this application also provide an electronic device, which includes: One or more processors; Storage device for storing one or more programs. When one or more programs are executed by one or more processors, the one or more processors implement the data access control method in a multi-tenant environment as provided in any embodiment of this application.
[0008] Fourthly, embodiments of this application also provide a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the data access control method in a multi-tenant environment as provided in any embodiment of this application.
[0009] The technical solution of this application embodiment constructs a fused security credential containing tenant identity identifiers, data source routing identifiers, and business data verification information. This encapsulates the originally discrete identity authentication elements, routing addressing elements, and data integrity protection elements into a single data structure. This allows the backend service to obtain all key control parameters with just one parsing of the credential, avoiding the computational resource consumption caused by multiple parsings of request headers and bodies in traditional solutions. Furthermore, by synchronously executing identity legitimacy verification and business data tamper-proof verification, cryptographic binding ensures the indivisibility and consistency of identity information and business data during transmission, fundamentally eliminating the risk of data mismatch or unauthorized access caused by fragmented verification logic. Moreover, after successful verification, the current execution thread is directly bound to the target physically isolated data source based on the routing identifier within the credential, achieving atomic linkage between security decisions and data routing. This not only ensures the physical-level isolation security of data storage in a multi-tenant environment but also significantly improves request processing throughput and response time. Attached Figure Description
[0010] Figure 1A flowchart illustrating the data access control method in a multi-tenant environment provided in Embodiment 1 of this application; Figure 2 This is a schematic diagram of the structure of a data access control device in a multi-tenant environment provided in Embodiment 5 of this application; Figure 3 This is a schematic diagram of the structure of an electronic device provided in Embodiment Six of this application. Detailed Implementation
[0011] The present application will now be described in further detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the application and not intended to limit it. Furthermore, it should be noted that, for ease of description, the accompanying drawings show only the parts relevant to the present application, not the entire structure.
[0012] Example 1 Figure 1 This is a flowchart illustrating the data access control method in a multi-tenant environment provided in Embodiment 1 of this application, as follows: Figure 1 As shown, the data access control method in a multi-tenant environment provided in this embodiment can be applied to a data access control platform in a multi-tenant environment mounted on devices with data processing capabilities, such as computers. It can be used in conjunction with some application software to achieve a better experience. Specifically, it can include the following steps: Step 101: Obtain the converged security credential sent by the client. The converged security credential includes the tenant identity identifier, the data source routing identifier, and the business data verification information.
[0013] Specifically, a converged security credential is a composite credential that encapsulates multiple security control elements within the same data structure.
[0014] Unlike existing technologies that distribute identity tokens, routing parameters, and data signatures during transmission, the integrated security credentials in this embodiment structurally bind tenant identity identifiers, data source routing identifiers, and business data verification information during the generation phase.
[0015] For example, the credential can use a custom binary protocol format or a standardized object representation to serialize and encapsulate the three types of information as indivisible fields. This integrated design allows the backend service to process only a single credential object when receiving a request, avoiding the parsing overhead and consistency maintenance problems caused by extracting information from multiple request headers or request body fields separately, thus laying a data foundation for subsequent collaborative processing.
[0016] Step 102: Parse the converged security credential to extract the tenant identity identifier, the data source routing identifier, and the business data verification information.
[0017] Specifically, after receiving the converged security credential, the server performs a one-time deserialization or decoding operation to extract the tenant identity identifier for authentication, the data source routing identifier for data addressing, and the business data verification information for integrity verification.
[0018] It should be understood that "extraction" here refers to constructing a context object containing these three elements in memory, rather than multiple independent read operations. Obtaining all key control parameters through a single parsing not only reduces CPU instruction cycles and memory accesses, but more importantly, ensures the homogeneity and consistency of the three elements in both the temporal and logical dimensions, preventing inconsistencies in intermediate states caused by step-by-step extraction.
[0019] Step 103: Based on the tenant identity identifier and the business data verification information, simultaneously perform identity legitimacy verification and business data anti-tampering verification.
[0020] Specifically, in this embodiment, "synchronous execution" refers to logical atomic processing, that is, in the same verification transaction or processing chain, identity verification and data verification are regarded as an inseparable whole determination process, rather than a simple time concurrency or a simple serial order relationship.
[0021] For example, the system can use the tenant's identity identifier to obtain the corresponding verification key, and use the key to perform signature verification or decryption operations on the business data verification information; if the operation is successful, it can further compare whether the identity information inside the credential matches the data digest.
[0022] The verification is considered successful only when both the identity is legitimate and the data has not been tampered with. This collaborative mechanism fundamentally eliminates the data mismatch risks that may occur in the traditional serial verification mode, such as "legitimate identity but submitted data being replaced" or "complete data but identity credentials being stolen." At the same time, by avoiding two independent verification processes and their accompanying database queries or cache accesses, it significantly reduces the system's response latency and resource consumption in high-concurrency scenarios.
[0023] Step 104: If both verification and validation pass, based on the data source routing identifier, route the data operation of the currently executing thread to the target physically isolated data source.
[0024] Specifically, once the collaborative verification in step 103 passes, the system uses the data source routing identifier carried in the trust credential as the addressing basis to directly switch the database operation context of the currently executing thread to the corresponding target physically isolated data source.
[0025] The target physically isolated data source here refers to a physical storage entity that is completely independent of other tenant data storage, such as an independent database instance or an independent storage volume, rather than a shared database that is only distinguished by logical fields.
[0026] By directly linking security verification results with physical routing actions, this embodiment achieves atomic control of "verification as routing". This not only eliminates the risk of unauthorized access caused by hijacking of routing logic or misconfiguration after verification, but also eliminates the need for additional routing queries and authentication steps. Thus, while ensuring the physical isolation security of multi-tenant data, it maximizes the throughput efficiency and real-time performance of data access control.
[0027] Through the collaborative processing described above, this embodiment establishes a processing paradigm based on integrated security credentials, involving one-time parsing, synchronous verification, and direct routing. This paradigm not only technically solves the data mismatch vulnerability caused by the separation of security verification and data routing, but also optimizes system performance by reducing redundant processing steps, providing efficient and reliable underlying support for secure data access in multi-tenant environments.
[0028] Example 2 Based on Example 1, this example further details the internal structure of the fused security credentials, the specific judgment logic of synchronous verification, and the exception handling mechanism.
[0029] As an optional implementation, the business data verification information includes: joint signing or encryption of the tenant identity identifier, data source routing identifier and business data digest based on a preset key, generating signature data or ciphertext data.
[0030] Specifically, joint signature or encryption here refers to inputting three types of heterogeneous data—tenant identity identifier, data source routing identifier, and business data digest—as an indivisible whole into a cryptographic operation function, rather than signing each field independently and then simply concatenating them.
[0031] For example, the three elements mentioned above can be serialized in a predetermined order, and their hash values can be calculated. Then, the hash values can be asymmetrically encrypted using the private key held by the server to generate a digital signature; or a symmetric key can be used to encrypt the structured object containing these three elements as a whole to generate ciphertext.
[0032] This deep cryptographic binding mechanism ensures the atomicity and consistency of identity, routing, and data during transmission. From a technical perspective, this design effectively defends against component substitution and replay attacks. Even if an attacker intercepts a legitimate fusion security credential, they cannot tamper with any field (such as replacing the routing identifier with another tenant's route) without possessing the preset key, thus compromising the overall signature or encryption structure. This safeguards the integrity and non-repudiation of multi-tenant request data at the source.
[0033] Furthermore, regarding how to simultaneously perform identity verification and business data tamper-proof verification based on tenant identity identifiers and business data verification information, this embodiment provides a specific collaborative judgment logic. Specifically, it includes: obtaining corresponding verification parameters based on the tenant identity identifier; using the verification parameters to verify or decrypt the business data verification information; and, if the verification or decryption is successful, comparing the mapping validity between the tenant identity identifier and the data source routing identifier to simultaneously complete identity verification and business data tamper-proof verification.
[0034] In this process, synchronous execution does not refer to multi-threaded concurrent processing, but rather to the atomical completion of multiple security checks within the same verification transaction chain. First, the system retrieves the corresponding public key or decryption key from the local cache or configuration center based on the parsed tenant identity identifier as a verification parameter. This step avoids the performance overhead of a full scan. Then, this verification parameter is used to perform reverse operations on the business data verification information. If the signature verification is successful or the plaintext in the expected format is obtained after decryption, it simultaneously proves that the credential source is trustworthy and the content has not been tampered with. Next, within the same memory context, the tenant identity identifier carried in the credential is directly compared with the data source routing identifier to see if they conform to a pre-defined valid mapping relationship.
[0035] It should be understood that this mapping comparison is completed instantly upon successful signature verification, without requiring additional database queries or network interactions. Compared to the traditional approach of first verifying token validity, then separately querying user permissions, and finally verifying data signatures in a sequential manner, this embodiment couples cryptographic verification and logical mapping verification into the same processing pipeline. This not only eliminates the accumulated latency caused by multiple I / O operations but, more importantly, constructs a robust security loop: verification will only pass when all three conditions—authenticity, data integrity, and correct routing—are met simultaneously. No single-dimensional legitimacy can bypass the overall verification, thus completely eliminating the risk of unauthorized access caused by fragmented verification logic.
[0036] To ensure high-concurrency security in a multi-tenant environment, this embodiment also introduces a strict abnormal state cleanup mechanism. If either identity verification or business data anti-tampering verification fails, a global interception command is triggered, and the parsed credential context and temporary routing state in the currently executing thread are cleared.
[0037] Specifically, in scenarios where the server uses a thread pool to handle requests, thread resources are reused by multiple tenant requests. If a malicious or erroneous request fails during the verification phase but fails to promptly clean up the intermediate state it leaves in the current thread (such as the extracted tenant ID, the initially matched data source handle, etc.), then when that thread is assigned to the next legitimate request, the residual dirty data is very likely to cause subsequent requests to be incorrectly routed to the data source pointed to by the previous erroneous request, resulting in serious cross-tenant data leakage or state pollution.
[0038] Therefore, this embodiment forcibly injects context cleanup actions into the branch path where verification fails, ensuring that the thread is restored to a clean initial state before being released back to the connection pool. For example, when a signature verification failure is detected, the system not only immediately returns a 403 Forbidden response and blocks subsequent business logic, but also actively calls the thread context manager's reset method to set or remove the thread-local variables storing credential information and routing parameters.
[0039] Although this defensive programming strategy adds a very small amount of CPU overhead, it is crucial for maintaining the security boundary of a multi-tenant physically isolated architecture. It compensates for the potential state remnants that are difficult to completely avoid by relying solely on static code logic at the runtime level, and significantly improves the robustness and reliability of the system when facing high-frequency attacks or abnormal traffic.
[0040] Example 3 This embodiment further details the specific execution mechanism of data source routing and the technical implications of physically isolating data sources.
[0041] As an optional implementation, the process of routing the data operations of the currently executing thread to the target physically isolated data source based on the data source routing identifier specifically includes: matching the target connection parameters corresponding to the data source routing identifier from the pre-registered data source connection pool; and binding the target connection parameters to the context variables of the currently executing thread to route the database operations of the currently executing thread to the target physically isolated data source.
[0042] Specifically, a pre-registered data source connection pool refers to a collection of multiple database connection resources pre-built and maintained during the system initialization phase. Each connection resource corresponds to a specific physical data source and is associated with a unique data source routing identifier. Once the co-verification is successful, the system does not need to establish a new database connection in real time. Instead, it directly retrieves and obtains the corresponding target connection parameters, such as the database address, port, authentication credentials, and connection handle, from the connection pool based on the parsed data source routing identifier.
[0043] Subsequently, the system utilizes thread-local storage to write the target connection parameters into a context variable specific to the currently executing thread. Since modern server-side applications typically employ a thread pool model to handle concurrent requests, with each thread serving only one tenant request at a time, binding routing parameters to the thread context ensures that all subsequent database operation instructions executed by that thread automatically point to the correct physically isolated data source, without needing to explicitly pass data source information in each SQL statement or business logic.
[0044] This dynamic route binding mechanism based on context variables not only avoids the performance loss caused by frequent creation and destruction of database connections at runtime, but also effectively prevents cross-tenant data access errors caused by chaotic routing states in high-concurrency scenarios through thread-level resource isolation.
[0045] Furthermore, to clearly define data security boundaries, this embodiment strictly limits the architectural characteristics of the target physically isolated data source. The target physically isolated data source is an independently deployed database instance or an independent physical storage space, and there are no shared data tables or shared storage volumes between target physically isolated data sources corresponding to different tenants.
[0046] Specifically, the "physical isolation" here differs from the "logical isolation" solutions commonly found in existing technologies. Under a logical isolation architecture, all tenant data is stored in the same database instance or even the same table, distinguished only by the tenant ID field. If the application has SQL injection vulnerabilities or flaws in permission verification logic, attackers can easily bypass application-layer protection and directly access other tenant data.
[0047] In the physically isolated architecture defined in this embodiment, each tenant has a completely independent underlying storage entity. For example, the target physically isolated data source can be a database process instance running in an independent virtual machine or container, or a file system mounted on an independent physical disk or cloud storage volume.
[0048] Regardless of the specific deployment method adopted, its core technical feature is that the storage media of different tenants are completely decoupled at the physical or virtualization resource level, and there is no shared data table structure, shared memory buffer or shared underlying storage block.
[0049] It should be understood that even if multiple tenants’ database instances may run on the same physical server, as long as they are allocated independent process spaces, independent I / O channels and independent storage volumes, and cannot directly read each other’s data through internal mechanisms, they meet the physical isolation requirements referred to in this application.
[0050] This architecture design creates an insurmountable security barrier at the infrastructure level. Even if there are unknown vulnerabilities in the application layer code, attackers cannot use technical means to cross physical boundaries and steal other tenants' data, thus providing the highest level of protection for data sovereignty and compliance in a multi-tenant environment.
[0051] By combining the aforementioned routing binding mechanism with a physical isolation architecture, this embodiment achieves deep collaboration between security control and data access. On the one hand, dynamic routing based on context variables ensures that requests can accurately locate the dedicated data source at any stage of the processing chain, eliminating the risks caused by human coding errors or configuration omissions. On the other hand, the strict physical isolation definition completely blocks the possibility of data interference between tenants, enabling the results of security verification to truly translate into reliable data access behavior.
[0052] Compared to traditional solutions that rely on application-layer logic to switch data sources, this embodiment significantly improves the system's robustness and resistance to attacks by delegating routing decisions to thread context management and security boundaries to the physical storage architecture. It also provides a clear and verifiable technical baseline for potential security audits and compliance checks in the future.
[0053] Example 4 This embodiment further details the specific form of business data in the fused security credential and the basis for generating its verification information. As an optional implementation, the fused security credential also includes business data, which is ciphertext data obtained by encrypting the original input data at the front end.
[0054] Specifically, the business data here refers to the actual business payload involving privacy or sensitive information that tenants input or submit on the front-end interface, such as user personal information, transaction amounts, and medical records. To ensure the confidentiality of this data during network transmission, the front-end client uses a pre-built encryption algorithm to encrypt the original input data before encapsulating the converged security credential, ensuring that the business data fields carried in the converged security credential are always in encrypted form.
[0055] This design ensures that even if the fused security credentials are intercepted in the transmission link, attackers cannot directly obtain the plaintext content of the business data, thus forming a three-dimensional protection system from the transport layer to the application layer together with the aforementioned identity authentication and routing control mechanisms.
[0056] It should be understood that although this embodiment uses encrypted data as a preferred example, in some internal trusted network environments with lower requirements for transmission security, business data can also be transmitted in plaintext form, as long as it can be correctly encapsulated in the converged security credential and participate in the subsequent verification process.
[0057] Furthermore, this embodiment provides a flexible configuration strategy regarding the basis for generating business data verification information. Business data verification information is calculated based on either ciphertext data or the original input data. This means that when the front-end generates a digest or signature for tamper-proof verification, the calculation object can be either the encrypted ciphertext data or the original input data before encryption.
[0058] These two generation benchmarks are adapted to different business scenarios and security requirements, and neither affects the effectiveness of the joint binding mechanism described in Example 2, because the joint signature or encryption operation acts on the digest result itself, and is unrelated to the digest calculation source.
[0059] When business data verification information is generated based on ciphertext data, the front end directly performs hash operations or extracts the digest from the encrypted ciphertext. The core advantage of this approach is that it supports the backend's "verify first, then decrypt" processing mode.
[0060] Specifically, upon receiving the fused security credential, the server can directly verify data integrity and source trustworthiness using the ciphertext digest without consuming computing resources to decrypt business data. If verification fails, the system can immediately trigger a global interception and discard the request, thus avoiding invalid requests consuming expensive decryption computing power. This mechanism is particularly suitable for high-concurrency access scenarios or environments with high decryption algorithm complexity, significantly improving the overall throughput efficiency and denial-of-service capability of the system.
[0061] When business data verification information is generated based on the original input data, the front end performs a digest calculation on the plaintext original input data before encrypting the data. The core value of this approach lies in supporting "secondary verification after decryption" on the back end.
[0062] Specifically, after completing the collaborative verification and decrypting the plaintext data, the server can calculate a digest based on the plaintext data again and compare it with the verification information carried in the credential. This process not only verifies the integrity of data transmission but also effectively detects whether the decryption operation itself was executed correctly, preventing situations where garbled characters are decrypted undetected due to key errors, algorithm version mismatches, or memory corruption. This mechanism is more suitable for scenarios with extremely high requirements for data accuracy and compliance auditing, such as financial settlement and medical record archiving, providing dual protection for the integrity of data throughout its entire lifecycle.
[0063] By flexibly choosing between the two generation benchmarks described above, this embodiment enables the converged security credentials to adapt to diverse business security needs. Regardless of the benchmark used, since business data verification information is always jointly bound to the tenant identity identifier and the data source routing identifier, the logical inseparability of identity, routing, and data can be ensured.
[0064] This design not only prevents competitors from circumventing infringement by simply changing the summary calculation object, but also reserves sufficient technical space for performance optimization and security enhancement in actual deployment, demonstrating the adaptability and robustness of the technical solution in this application at the engineering implementation level.
[0065] Example 5 Figure 2 This is a schematic diagram of a data access control device in a multi-tenant environment provided in Embodiment 5 of this application. The data access control device in a multi-tenant environment provided in this embodiment can execute the data access control method in a multi-tenant environment provided in any embodiment of this application, and has the corresponding functional modules and beneficial effects for executing the method. This device can be implemented in software and / or hardware, such as... Figure 2 As shown, the data access control device in a multi-tenant environment specifically includes: The credential acquisition module 201 is used to acquire the converged security credential sent by the client. The converged security credential includes a tenant identity identifier, a data source routing identifier, and business data verification information. The credential parsing module 202 is used to parse the converged security credential and extract the tenant identity identifier, the data source routing identifier, and the business data verification information. The collaborative verification module 203 is used to simultaneously perform identity legitimacy verification and business data anti-tampering verification based on the tenant identity identifier and the business data verification information; The data source switching module 204 is used to route the data operation of the currently executing thread to the target physically isolated data source based on the data source routing identifier, provided that both verification and validation are passed.
[0066] Example 6 Figure 3 This is a schematic diagram of the structure of an electronic device provided in Embodiment Six of this application, as shown below. Figure 3 As shown, the electronic device includes a processor 310, a memory 320, an input device 330, and an output device 340; the number of processors 310 in the electronic device can be one or more. Figure 3 Taking a processor 310 as an example; the processor 310, memory 320, input device 330, and output device 340 in the electronic device can be connected via a bus or other means. Figure 3 Taking the example of a connection between China and Israel via a bus.
[0067] The memory 320, as a computer-readable storage medium, can be used to store software programs, computer-executable programs, and modules, such as the program instructions / modules corresponding to the data access control method in a multi-tenant environment in this embodiment of the invention. The processor 310 executes various functional applications and data processing of the electronic device by running the software programs, instructions, and modules stored in the memory 320, thereby implementing the aforementioned data access control method in a multi-tenant environment. Obtain the converged security credential sent by the client, wherein the converged security credential includes a tenant identity identifier, a data source routing identifier, and business data verification information; The converged security credentials are parsed to extract the tenant identity identifier, the data source routing identifier, and the business data verification information; Based on the tenant identity identifier and the business data verification information, identity legitimacy verification and business data anti-tampering verification are performed simultaneously; If both verification and validation pass, the data operation of the currently executing thread is routed to the target physically isolated data source based on the data source routing identifier.
[0068] The memory 320 may primarily include a program storage area and a data storage area. The program storage area may store the operating system and at least one application program required for a given function; the data storage area may store data created based on terminal usage. Furthermore, the memory 320 may include high-speed random access memory and non-volatile memory, such as at least one disk storage device, flash memory device, or other non-volatile solid-state storage device. In some instances, the memory 320 may further include memory remotely located relative to the processor 310, which can be connected to the electronic device via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.
[0069] Example 7 This embodiment provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the data access control method in a multi-tenant environment as described below: Obtain the converged security credential sent by the client, wherein the converged security credential includes a tenant identity identifier, a data source routing identifier, and business data verification information; The converged security credentials are parsed to extract the tenant identity identifier, the data source routing identifier, and the business data verification information; Based on the tenant identity identifier and the business data verification information, identity legitimacy verification and business data anti-tampering verification are performed simultaneously; If both verification and validation pass, the data operation of the currently executing thread is routed to the target physically isolated data source based on the data source routing identifier.
[0070] It is worth noting that in the embodiments of the above-mentioned device, the various units and modules included are only divided according to functional logic, but are not limited to the above division, as long as the corresponding functions can be realized; in addition, the specific names of each functional unit are only for easy differentiation and are not used to limit the scope of protection of this application.
[0071] Note that the above description is merely a preferred embodiment and the technical principles employed in this application. Those skilled in the art will understand that this application is not limited to the specific embodiments described herein, and various obvious changes, readjustments, and substitutions can be made without departing from the scope of protection of this application. Therefore, although this application has been described in detail through the above embodiments, this application is not limited to the above embodiments. Many other equivalent embodiments may be included without departing from the concept of this application, and the scope of this application is determined by the scope of the appended claims.
Claims
1. A data access control method in a multi-tenant environment, characterized in that, The method includes: Obtain the converged security credential sent by the client, wherein the converged security credential includes a tenant identity identifier, a data source routing identifier, and business data verification information; The converged security credentials are parsed to extract the tenant identity identifier, the data source routing identifier, and the business data verification information; Based on the tenant identity identifier and the business data verification information, identity legitimacy verification and business data anti-tampering verification are performed simultaneously; If both verification and validation pass, the data operation of the currently executing thread is routed to the target physically isolated data source based on the data source routing identifier.
2. The method according to claim 1, characterized in that, The business data verification information includes: Based on a preset key, the tenant identity identifier, the data source routing identifier, and the digest of the business data are jointly signed or encrypted to generate signature data or ciphertext data.
3. The method according to claim 2, characterized in that, The simultaneous execution of identity verification and business data tamper-proof verification based on the tenant identity identifier and the business data verification information includes: Obtain the corresponding verification parameters based on the tenant's identity identifier; The verification parameters are used to verify or decrypt the business data verification information. If the signature verification or decryption is successful, the mapping between the tenant identity identifier and the data source routing identifier is compared to verify the legitimacy of the identity and the anti-tampering verification of the business data are completed simultaneously.
4. The method according to claim 3, characterized in that, The method further includes: If either the identity verification or the business data anti-tampering verification fails, a global interception instruction is triggered, and the parsed credential context and temporary routing state in the currently executing thread are cleared.
5. The method according to claim 1, characterized in that, The step of routing the data operations of the currently executing thread to the target physically isolated data source based on the data source routing identifier includes: Match the target connection parameters corresponding to the data source routing identifier from the pre-registered data source connection pool; The target connection parameters are bound to the context variables of the currently executing thread to route the database operations of the currently executing thread to the target physically isolated data source.
6. The method according to claim 5, characterized in that, The target physically isolated data source is an independently deployed database instance or an independent physical storage space, and there are no shared data tables or shared storage volumes between the target physically isolated data sources corresponding to different tenants.
7. The method according to claim 1, characterized in that, The fused security credential also includes business data, which is encrypted data obtained by the front end after encrypting the original input data. The business data verification information is calculated and generated based on the encrypted data or the original input data.
8. A data access control device for a multi-tenant environment, characterized in that, The device includes: The credential acquisition module is used to acquire the converged security credential sent by the client. The converged security credential includes the tenant identity identifier, the data source routing identifier, and the business data verification information. The credential parsing module is used to parse the converged security credential and extract the tenant identity identifier, the data source routing identifier, and the business data verification information; The collaborative verification module is used to simultaneously perform identity legitimacy verification and business data anti-tampering verification based on the tenant identity identifier and the business data verification information; The data source switching module is used to route the data operation of the currently executing thread to the target physically isolated data source based on the data source routing identifier, provided that both verification and validation are passed.
9. An electronic device, characterized in that, include: At least one processor; as well as, A memory communicatively connected to the at least one processor; wherein, The memory stores a computer program that can be executed by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to perform the data access control method in a multi-tenant environment as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the data access control method in a multi-tenant environment as described in any one of claims 1 to 7.
