Multi-tenant-based data efficient processing method, device and product

By allocating exclusive or shared databases to target tenants of a multi-tenant ERP system, the database lock contention problem in high-concurrency scenarios is resolved, system throughput and data processing efficiency are improved, real-time and security requirements are met, and operation and maintenance costs are reduced.

CN120523882BActive Publication Date: 2025-09-12LE SHRIMP (SHENZHEN) TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511013353.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-07-23
Publication Date
2025-09-12
Estimated Expiration
2045-07-23

AI Technical Summary

Technical Problem

Traditional multi-tenant SaaS ERP systems experience database lock contention in high-concurrency data writing scenarios, resulting in decreased system throughput and increased response latency, making it difficult to meet the requirements of strong transaction consistency and complex business logic.

Method used

Adopting a multi-tenant-based data efficient processing method, it receives business data processing requests from target tenants, verifies their validity, and allocates exclusive or shared databases to valid tenants according to pre-configured database allocation strategies, executes corresponding business data processing operations, and avoids database lock contention.

Benefits of technology

Improve system throughput, reduce response latency, enhance data processing efficiency, meet real-time requirements, resolve data security issues, and reduce deployment and operation and maintenance costs for individual tenants.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120523882B_ABST
    Figure CN120523882B_ABST
Patent Text Reader

Abstract

The present invention discloses a multi-tenant-based efficient data processing method, device and product, which relates to the field of business data processing technology. The data processing method includes: receiving a business data processing request initiated by a target tenant; verifying whether the target tenant is a valid tenant; if the target tenant is a valid tenant, then based on a pre-configured database allocation strategy, determining the database allocation strategy corresponding to the target tenant; if the database allocation strategy corresponding to the target tenant is an independent database allocation strategy, obtaining the target tenant's exclusive connection string, and determining the exclusive database corresponding to the target tenant based on the target tenant's exclusive connection string, and performing a business data processing operation corresponding to the business data processing request on the first business data in the exclusive database corresponding to the target tenant. The present invention can avoid the problem of database lock competition, improve system throughput, and reduce response delay.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of business data processing technology, and specifically relates to a multi-tenant-based data efficient processing method, device and product. Background Art

[0002] With the rapid development of cloud computing and SaaS (Software as a Service), multi-tenant architectures have become a mainstream technical solution for enterprise applications. Multi-tenant SaaS enterprise resource planning (ERP) systems significantly reduce deployment and maintenance costs for individual tenants by sharing infrastructure and software services, while also enabling centralized and efficient resource utilization. However, the technical limitations of traditional multi-tenant architectures based on shared databases are becoming increasingly apparent when dealing with high-concurrency data write scenarios.

[0003] Current mainstream multi-tenant SaaS ERP systems often utilize a shared database instance and unified table structure. All tenant data is logically isolated using a tenant identification field (such as tenant_id), but physical storage still shares the same database resource pool. This architecture offers high resource utilization and simplified maintenance in low-concurrency scenarios, but its technical bottlenecks gradually become apparent when faced with high-concurrency data writes. Specifically, data operation requests from different tenants create resource contention at the database level. In particular, write operations (such as transactional operations like order creation and inventory deductions) trigger database locking mechanisms. Because all tenants share the same table structure and indexes, even operations on data from different tenants may still be queued due to contention for row locks, gap locks, or table locks. For example, when multiple tenants simultaneously perform write operations on the same table, the database must use locking mechanisms to ensure transaction isolation. However, frequent lock contention significantly increases request latency, leading to a nonlinear decrease in system throughput and increased response latency. Furthermore, lock contention exponentially worsens with increasing numbers of tenants and data size. Although the pressure can be alleviated through technologies such as database and table sharding and read-write separation, these solutions require sacrificing data consistency or increasing system complexity, making it difficult to meet the ERP system's requirements for strong transaction consistency and complex business logic.

[0004] Therefore, how to design a data processing method that can maintain the advantages of a multi-tenant architecture while effectively solving the database lock contention problem in high-concurrency scenarios has become a technical problem that urgently needs to be overcome in the SaaS ERP field. Summary of the Invention

[0005] The purpose of the present invention is to provide a multi-tenant-based efficient data processing method, device and product to solve the above-mentioned problems existing in the prior art.

[0006] In order to achieve the above object, the present invention adopts the following technical solutions:

[0007] In a first aspect, the present invention provides a multi-tenant data efficient processing method, which is applied to a multi-tenant ERP system based on a SaaS model, comprising:

[0008] receiving a business data processing request initiated by a target tenant, wherein the target tenant is any tenant of the multi-tenant ERP system;

[0009] Verify whether the target tenant is a valid tenant;

[0010] If the target tenant is a valid tenant, determining a database allocation policy corresponding to the target tenant based on a pre-configured database allocation policy;

[0011] If the database allocation strategy corresponding to the target tenant is an independent database allocation strategy, the exclusive connection string of the target tenant is obtained, and the exclusive database corresponding to the target tenant is determined based on the exclusive connection string of the target tenant, and the business data processing operation corresponding to the business data processing request is performed on the first business data in the exclusive database corresponding to the target tenant.

[0012] Based on the above disclosure, the present invention receives a business data processing request initiated by a target tenant; verifies whether the target tenant is a valid tenant; if the target tenant is a valid tenant, then based on the pre-configured database allocation strategy, determines the database allocation strategy corresponding to the target tenant; if the database allocation strategy corresponding to the target tenant is an independent database allocation strategy, then obtains the exclusive connection string of the target tenant, and determines the exclusive database corresponding to the target tenant based on the exclusive connection string of the target tenant, and performs the business data processing operation corresponding to the business data processing request on the first business data in the exclusive database corresponding to the target tenant. In this way, for the corresponding database allocation strategy being an independent database allocation strategy, by introducing a dedicated database for business data processing, when high-concurrency data processing is performed, the data request processing of different tenants will not interfere with each other, avoiding the problem of database lock competition, improving system throughput, and reducing response delay. At the same time, when performing data processing, it is not necessary to scan all the data, further improving data processing efficiency and meeting the real-time requirements of data processing. In addition, by introducing a dedicated database, tenants can use a dedicated database to avoid data security and performance issues, solving the data security problem of the existing shared database.

[0013] In one possible design, the method further includes:

[0014] If the database allocation policy corresponding to the target tenant is a shared database allocation policy, filtering out the second business data corresponding to the target tenant from the shared database based on the tenant identifier of the target tenant, and performing a business data processing operation corresponding to the business data processing request on the second business data corresponding to the target tenant;

[0015] If the database allocation strategy corresponding to the target tenant is a mixed mode allocation strategy, determining whether the target tenant is a key tenant;

[0016] If the target tenant is a key tenant, determining a dedicated database corresponding to the target tenant based on the dedicated connection string of the target tenant, and performing a business data processing operation corresponding to the business data processing request on the third business data in the dedicated database corresponding to the target tenant;

[0017] If the target tenant is a non-critical tenant, the fourth business data corresponding to the target tenant is filtered out from the shared database based on the tenant identifier of the target tenant, and a business data processing operation corresponding to the business data processing request is performed on the fourth business data corresponding to the target tenant.

[0018] In one possible design, verifying whether the target tenant is a valid tenant includes:

[0019] Parsing the business data processing request to obtain a tenant identifier corresponding to the target tenant;

[0020] Determine whether the tenant identifier corresponding to the target tenant is recorded in the database;

[0021] If the tenant identifier corresponding to the target tenant is recorded in the database, the target tenant is determined to be a valid tenant;

[0022] Otherwise, the target tenant is determined to be an invalid tenant.

[0023] In one possible design, parsing the business data processing request includes:

[0024] The business data processing request is parsed through domain name resolution, request header resolution, cookie resolution, routing resolution and / or user declaration resolution.

[0025] In one possible design, the business data processing request is a data modification request, a data deletion request, or a data modification request;

[0026] Performing a business data processing operation corresponding to the business data processing request on the first business data in the dedicated database corresponding to the target tenant includes:

[0027] By adding a tenant identifier in a select statement to query the first business data in the exclusive database corresponding to the target tenant; or

[0028] Deleting the first business data in the dedicated database corresponding to the target tenant by adding a tenant identifier in a delete statement; or

[0029] The first business data in the dedicated database corresponding to the target tenant is modified by adding a tenant identifier in the update statement.

[0030] In one possible design, the method further includes:

[0031] If the target tenant is an invalid tenant, the business data processing request is returned to the host tenant.

[0032] In one possible design, after performing the business data processing operation corresponding to the business data processing request on the first business data in the dedicated database corresponding to the target tenant, the method further includes:

[0033] Return the business data processing result to the target tenant.

[0034] In a second aspect, the present invention provides a multi-tenant data efficient processing device, which is applied to a multi-tenant ERP system based on a SaaS model, comprising:

[0035] a receiving unit, configured to receive a business data processing request initiated by a target tenant, wherein the target tenant is any tenant of the multi-tenant ERP system;

[0036] A verification unit, configured to verify whether the target tenant is a valid tenant;

[0037] a determining unit, configured to determine, if the target tenant is a valid tenant, a database allocation policy corresponding to the target tenant based on a pre-configured database allocation policy;

[0038] A business data processing unit is used to obtain the exclusive connection string of the target tenant if the database allocation strategy corresponding to the target tenant is an independent database allocation strategy, and determine the exclusive database corresponding to the target tenant based on the exclusive connection string of the target tenant, and perform a business data processing operation corresponding to the business data processing request on the first business data in the exclusive database corresponding to the target tenant.

[0039] In a third aspect, the present invention provides a multi-tenant ERP system, comprising a memory, a processor, and a transceiver that are communicatively connected in sequence, wherein the memory is used to store computer programs, the transceiver is used to send and receive messages, and the processor is used to read the computer program and execute the multi-tenant-based efficient data processing method as described in the first aspect or any possible design of the first aspect.

[0040] In a fourth aspect, the present invention provides a computer-readable storage medium having instructions stored thereon. When the instructions are executed on a computer, the multi-tenant-based efficient data processing method described in the first aspect or any possible design of the first aspect is executed.

[0041] In a fifth aspect, the present invention provides a computer program product comprising instructions, which, when executed on a computer, enables the computer to execute the multi-tenant-based efficient data processing method as described in the first aspect or any possible design of the first aspect.

[0042] Beneficial effects:

[0043] The present invention provides a multi-tenant-based efficient data processing method, device, and product. The corresponding database allocation strategy is an independent database allocation strategy. By introducing a dedicated database for business data processing, during high-concurrency data processing, data request processing by different tenants will not interfere with each other, avoiding database lock competition problems, improving system throughput, and reducing response delays. At the same time, when processing data, it is not necessary to scan all data, further improving data processing efficiency and meeting the real-time requirements of data processing. In addition, by introducing a dedicated database, tenants can use the dedicated database to circumvent data security and performance issues, solving the data security issues of existing shared databases.

[0044] Furthermore, for tenants who do not have high-concurrency data processing requirements, business data processing can be performed through a shared database, reducing the deployment and operation and maintenance costs of individual tenants while achieving centralized and efficient use of resources. BRIEF DESCRIPTION OF THE DRAWINGS

[0045] Figure 1 A flowchart of a multi-tenant data efficient processing method provided in an embodiment of the present application;

[0046] Figure 2 A block diagram of a multi-tenant data efficient processing device provided in an embodiment of the present application;

[0047] Figure 3 A block diagram of a multi-tenant ERP system provided in an embodiment of the present application. DETAILED DESCRIPTION

[0048] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the present invention will be briefly introduced below in conjunction with the drawings and the description of the embodiments or the prior art. Obviously, the following description of the structure of the drawings is only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative work. It should be noted that the description of these embodiments is used to help understand the present invention, but does not constitute a limitation of the present invention.

[0049] It should be understood that although the terms "first," "second," etc. may be used herein to describe various elements, these elements should not be limited by these terms. These terms are only used to distinguish one element from another. For example, a first element can be referred to as a second element, and similarly, a second element can be referred to as a first element without departing from the scope of the exemplary embodiments of the present invention.

[0050] It should be understood that the term "and / or" that may appear in this document is merely a description of the association relationship between associated objects, indicating that three relationships may exist. For example, A and / or B may indicate three situations: A exists alone, B exists alone, and A and B exist at the same time. The term " / and" that may appear in this document describes another type of association object relationship, indicating that two relationships may exist. For example, A / and B may indicate two situations: A exists alone, and A and B exist alone. In addition, the character " / " that may appear in this document generally indicates that the previous and subsequent associated objects are in an "or" relationship.

[0051] In order to solve the problem of database lock contention in high-concurrency scenarios, the embodiments of the present application provide a multi-tenant-based data efficient processing method, device and product. The multi-tenant-based data efficient processing method, device and product can avoid the problem of database lock contention, improve system throughput and reduce response delay.

[0052] The multi-tenant data efficient processing method provided in the embodiment of the present application can be applied to a multi-tenant ERP system based on the SaaS model. It is understood that the execution subject does not constitute a limitation on the embodiment of the present application.

[0053] like Figure 1 , which is a flowchart of the multi-tenant-based efficient data processing method provided in the first aspect of this embodiment. The multi-tenant-based efficient data processing method may include, but is not limited to, the following steps S101 to S104.

[0054] Step S101: Receive a business data processing request initiated by a target tenant.

[0055] The target tenant may be any tenant of the multi-tenant ERP system, and the business data processing request may be, but is not limited to, a data modification request, a data deletion request, or a data modification request.

[0056] In one or more embodiments, after receiving a business data processing request initiated by a target tenant, the business data processing request may be handed over to the multi-tenant middleware of the multi-tenant ERP system for processing, and the multi-tenant middleware identifies the target tenant that initiated the business data processing request.

[0057] Step S102: Verify whether the target tenant is a valid tenant.

[0058] Specifically, verifying whether the target tenant is a valid tenant may include, but is not limited to, the following steps S1021-S0124.

[0059] Step S1021: Parse the business data processing request to obtain the tenant identifier corresponding to the target tenant.

[0060] Among them, the business data processing request can be parsed through, but not limited to, domain name resolution, request header resolution, cookie resolution, routing resolution and / or user declaration resolution, etc., which will not be repeated in the embodiments of this application.

[0061] Step S1022: Determine whether the database has a tenant identifier corresponding to the target tenant.

[0062] In one or more embodiments, a database for recording tenant identifiers of valid tenants can be pre-set, and when parsing a business data processing request to obtain the tenant identifier corresponding to the target tenant, it can be determined whether the tenant identifier corresponding to the target tenant is recorded in the database, thereby determining whether the target tenant is a valid tenant.

[0063] Step S1023: If the database records the tenant identifier corresponding to the target tenant, the target tenant is determined to be a valid tenant.

[0064] Step S1024: If the tenant identifier corresponding to the target tenant is not recorded in the database, the target tenant is determined to be an invalid tenant.

[0065] Step S103: If the target tenant is a valid tenant, a database allocation policy corresponding to the target tenant is determined based on a pre-configured database allocation policy.

[0066] A multi-tenant ERP system can be pre-configured with database allocation policies for each tenant. These policies may include, but are not limited to, independent database allocation policies, shared database allocation policies, and mixed-mode allocation policies. Independent database allocation policies indicate that a tenant uses a single database for data storage, shared database allocation policies indicate that a tenant uses a database shared with other tenants, and mixed-mode allocation policies indicate that a tenant can use a single database for data storage or share a database with other tenants.

[0067] After determining that the target tenant is a valid tenant, a database allocation policy corresponding to the target tenant may be determined based on a pre-configured database allocation policy.

[0068] In one or more embodiments, if the target tenant is determined to be a valid tenant, the tenant identifier may be added to the business data processing request initiated by the target tenant to facilitate subsequent business data processing. Furthermore, if the target tenant is determined to be an invalid tenant, the business data processing request initiated by the target tenant may be directly returned to the host tenant (i.e., the operator of the multi-tenant ERP system).

[0069] Step S104. If the database allocation strategy corresponding to the target tenant is an independent database allocation strategy, obtain the exclusive connection string of the target tenant, and determine the exclusive database corresponding to the target tenant based on the exclusive connection string of the target tenant, and perform a business data processing operation corresponding to the business data processing request on the first business data in the exclusive database corresponding to the target tenant.

[0070] The business data processing request may be, but is not limited to, a data modification request, a data deletion request, or a data modification request. In the business data processing operation corresponding to the business data processing request, if the business data processing request is a data modification request, the first business data in the exclusive database corresponding to the target tenant can be queried by adding the tenant identifier in the select statement. If the business data processing request is a data deletion request, the first business data in the exclusive database corresponding to the target tenant can be deleted by adding the tenant identifier in the delete statement. If the business data processing request is a data modification request, the first business data in the exclusive database corresponding to the target tenant can be modified by adding the tenant identifier in the update statement.

[0071] In one or more embodiments, after performing a business data processing operation corresponding to the business data processing request on the first business data in the dedicated database corresponding to the target tenant, a business data processing result may also be returned to the target tenant.

[0072] In one or more embodiments, if the database allocation policy corresponding to the target tenant is a shared database allocation policy, i.e., the target tenant shares a database with other tenants, then when processing business data, the second business data corresponding to the target tenant can be filtered out from the shared database based on the tenant identifier of the target tenant, and a business data processing operation corresponding to the business data processing request is performed on the second business data corresponding to the target tenant. The process of the business data processing operation can be seen in the aforementioned step S104 and will not be repeated here.

[0073] If the database allocation policy corresponding to the target tenant is a mixed-mode allocation policy, it can be determined whether the target tenant is a key tenant (whether the tenant is a key tenant can be pre-set). If the target tenant is a key tenant, the dedicated database corresponding to the target tenant can be determined based on the target tenant's dedicated connection string, and the business data processing operation corresponding to the business data processing request can be performed on the third business data in the dedicated database corresponding to the target tenant. If the target tenant is a non-key tenant, the fourth business data corresponding to the target tenant can be filtered out from the shared database based on the target tenant's tenant identifier, and the business data processing operation corresponding to the business data processing request can be performed on the fourth business data corresponding to the target tenant.

[0074] This allows tenants without high-concurrency data processing requirements to process their business data through a shared database, reducing deployment and maintenance costs for individual tenants while achieving centralized and efficient resource utilization. Furthermore, a hybrid allocation strategy allows for customized business data management to meet the needs of different tenants and address the issue of highly customized business processes for existing tenants.

[0075] In summary, the present invention provides a multi-tenant data efficient processing method; verify whether the target tenant is a valid tenant; if the target tenant is a valid tenant, then based on the pre-configured database allocation strategy, determine the database allocation strategy corresponding to the target tenant; if the database allocation strategy corresponding to the target tenant is an independent database allocation strategy, then obtain the exclusive connection string of the target tenant, and determine the exclusive database corresponding to the target tenant based on the exclusive connection string of the target tenant, and perform the business data processing operation corresponding to the business data processing request on the first business data in the exclusive database corresponding to the target tenant. In this way, for the corresponding database allocation strategy is an independent database allocation strategy, by introducing a dedicated database for business data processing, when high-concurrency data processing is performed, the data request processing of different tenants will not interfere with each other, avoiding the problem of database lock competition, improving system throughput, reducing response delay, and facilitating practical application and promotion. At the same time, when performing data processing, it is not necessary to scan all data, further improving data processing efficiency and meeting the real-time requirements of data processing. Secondly, by introducing a dedicated database, tenants can use a dedicated database to circumvent data security and performance issues, solving the data security problems of existing shared databases. Furthermore, for tenants without high-concurrency data processing requirements, business data can be processed through a shared database, reducing deployment and maintenance costs for individual tenants while achieving centralized and efficient resource utilization. Finally, a hybrid allocation strategy allows for customized business data management to meet the needs of different tenants and address the issue of highly customized business processes for existing tenants.

[0076] See also Figure 2 In a second aspect, an embodiment of the present application provides a multi-tenant-based data efficient processing device, which is applied to a multi-tenant ERP system based on a SaaS model. The multi-tenant-based data efficient processing device includes:

[0077] a receiving unit, configured to receive a business data processing request initiated by a target tenant, wherein the target tenant is any tenant of the multi-tenant ERP system;

[0078] A verification unit, configured to verify whether the target tenant is a valid tenant;

[0079] a determining unit, configured to determine, if the target tenant is a valid tenant, a database allocation policy corresponding to the target tenant based on a pre-configured database allocation policy;

[0080] A business data processing unit is used to obtain the exclusive connection string of the target tenant if the database allocation strategy corresponding to the target tenant is an independent database allocation strategy, and determine the exclusive database corresponding to the target tenant based on the exclusive connection string of the target tenant, and perform a business data processing operation corresponding to the business data processing request on the first business data in the exclusive database corresponding to the target tenant.

[0081] The working process, working details and technical effects of the multi-tenant-based data efficient processing device provided in the second aspect of this embodiment can be found in the first aspect of the embodiment and will not be repeated here.

[0082] like Figure 3 As shown, the third aspect of the embodiment of the present application provides a multi-tenant ERP system, including a memory, a processor and a transceiver that are communicatively connected in sequence, wherein the memory is used to store computer programs, the transceiver is used to send and receive messages, and the processor is used to read the computer program and execute the multi-tenant-based data efficient processing method as described in the first aspect of the embodiment.

[0083] For example, the memory may include, but is not limited to, random access memory (RAM), read-only memory (ROM), flash memory, first-in-first-out memory (FIFO) and / or first-in-last-out memory (FILO), etc.; the processor may include, but is not limited to, a microprocessor of the STM32F105 series, an ARM (Advanced RISC Machines), an X86 or other architecture processor, or a processor with an integrated NPU (neural-network processing units); the transceiver may include, but is not limited to, a WiFi (Wireless Fidelity) wireless transceiver, a Bluetooth wireless transceiver, a General Packet Radio Service (GPRS) wireless transceiver, a ZigBee protocol (a low-power local area network protocol based on the IEEE802.15.4 standard, ZigBee) wireless transceiver, a 3G transceiver, a 4G transceiver and / or a 5G transceiver, etc.

[0084] A fourth aspect of this embodiment provides a computer-readable storage medium storing instructions containing the multi-tenant-based efficient data processing method described in the first aspect of the embodiment, that is, the computer-readable storage medium stores instructions that, when executed on a computer, execute the multi-tenant-based efficient data processing method described in the first aspect. The computer-readable storage medium refers to a carrier for storing data, and may include, but is not limited to, a floppy disk, an optical disk, a hard disk, a flash memory, a USB flash drive, and / or a memory stick, and the computer may be a general-purpose computer, a dedicated computer, a computer network, or other programmable device.

[0085] The fifth aspect of this embodiment provides a computer program product comprising instructions, which, when executed on a computer, enables the computer to execute the multi-tenant-based efficient data processing method as described in the first aspect of the embodiment, wherein the computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device.

[0086] It should be understood that in the following description, certain details are provided to facilitate a thorough understanding of the example embodiments. However, one of ordinary skill in the art will appreciate that the example embodiments can be practiced without these specific details. For example, a system may be shown in block diagrams to avoid obscuring the example with unnecessary detail. In other instances, well-known processes, structures, and techniques may be shown in unnecessary detail to avoid obscuring the example embodiments.

[0087] Finally, it should be noted that the above description is only a preferred embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention shall be included in the scope of protection of the present invention.

Claims

1. A multi-tenant data efficient processing method, applied to a multi-tenant ERP system based on SaaS mode, characterized in that: include: receiving a business data processing request initiated by a target tenant, wherein the target tenant is any tenant of the multi-tenant ERP system; Verify whether the target tenant is a valid tenant; If the target tenant is a valid tenant, determining a database allocation policy corresponding to the target tenant based on a pre-configured database allocation policy; If the database allocation policy corresponding to the target tenant is an independent database allocation policy, obtaining a dedicated connection string for the target tenant, determining a dedicated database corresponding to the target tenant based on the dedicated connection string for the target tenant, and performing a business data processing operation corresponding to the business data processing request on the first business data in the dedicated database corresponding to the target tenant; If the database allocation policy corresponding to the target tenant is a shared database allocation policy, filtering out the second business data corresponding to the target tenant from the shared database based on the tenant identifier of the target tenant, and performing a business data processing operation corresponding to the business data processing request on the second business data corresponding to the target tenant; If the database allocation strategy corresponding to the target tenant is a mixed mode allocation strategy, determining whether the target tenant is a key tenant; If the target tenant is a key tenant, determining a dedicated database corresponding to the target tenant based on the dedicated connection string of the target tenant, and performing a business data processing operation corresponding to the business data processing request on the third business data in the dedicated database corresponding to the target tenant; If the target tenant is a non-critical tenant, the fourth business data corresponding to the target tenant is filtered out from the shared database based on the tenant identifier of the target tenant, and a business data processing operation corresponding to the business data processing request is performed on the fourth business data corresponding to the target tenant.

2. The multi-tenant-based data efficient processing method according to claim 1, characterized in that: Verify whether the target tenant is a valid tenant, including: Parsing the business data processing request to obtain a tenant identifier corresponding to the target tenant; Determine whether the tenant identifier corresponding to the target tenant is recorded in the database; If the tenant identifier corresponding to the target tenant is recorded in the database, the target tenant is determined to be a valid tenant; Otherwise, the target tenant is determined to be an invalid tenant.

3. The multi-tenant-based data efficient processing method according to claim 2, characterized in that: Parsing the business data processing request includes: The business data processing request is parsed through domain name resolution, request header resolution, cookie resolution, routing resolution and / or user declaration resolution.

4. The multi-tenant-based data efficient processing method according to claim 1, characterized in that: The business data processing request is a data modification request, a data deletion request, or a data modification request; Performing a business data processing operation corresponding to the business data processing request on the first business data in the dedicated database corresponding to the target tenant includes: By adding a tenant identifier in a select statement to query the first business data in the exclusive database corresponding to the target tenant; or Deleting the first business data in the dedicated database corresponding to the target tenant by adding a tenant identifier in a delete statement; or The first business data in the dedicated database corresponding to the target tenant is modified by adding a tenant identifier in the update statement.

5. The multi-tenant-based data efficient processing method according to claim 1, characterized in that: The method further comprises: If the target tenant is an invalid tenant, the business data processing request is returned to the host tenant.

6. The multi-tenant-based data efficient processing method according to claim 1, characterized in that: After performing the business data processing operation corresponding to the business data processing request on the first business data in the dedicated database corresponding to the target tenant, the method further includes: Return the business data processing result to the target tenant.

7. A multi-tenant data efficient processing device, applied to a multi-tenant ERP system based on SaaS mode, characterized in that: include: a receiving unit, configured to receive a business data processing request initiated by a target tenant, wherein the target tenant is any tenant of the multi-tenant ERP system; A verification unit, configured to verify whether the target tenant is a valid tenant; a determining unit, configured to determine, if the target tenant is a valid tenant, a database allocation policy corresponding to the target tenant based on a pre-configured database allocation policy; a business data processing unit configured to, if the database allocation policy corresponding to the target tenant is an independent database allocation policy, obtain a dedicated connection string for the target tenant, determine a dedicated database corresponding to the target tenant based on the dedicated connection string for the target tenant, and perform a business data processing operation corresponding to the business data processing request on first business data in the dedicated database corresponding to the target tenant; The business data processing unit is further configured to, if the database allocation policy corresponding to the target tenant is a shared database allocation policy, filter out second business data corresponding to the target tenant from the shared database based on the tenant identifier of the target tenant, and perform a business data processing operation corresponding to the business data processing request on the second business data corresponding to the target tenant; a judging unit, configured to judge whether the target tenant is a key tenant if the database allocation strategy corresponding to the target tenant is a mixed mode allocation strategy; The business data processing unit is further configured to, if the target tenant is a key tenant, determine a dedicated database corresponding to the target tenant based on a dedicated connection string of the target tenant, and perform a business data processing operation corresponding to the business data processing request on the third business data in the dedicated database corresponding to the target tenant; The business data processing unit is also used to filter out the fourth business data corresponding to the target tenant from the shared database based on the tenant identifier of the target tenant if the target tenant is a non-critical tenant, and perform a business data processing operation corresponding to the business data processing request on the fourth business data corresponding to the target tenant.

8. A computer program product comprising a computer program or instructions, characterized in that When the computer program or the instruction is executed by a computer, the computer program or the instruction implements the multi-tenant-based data efficient processing method according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • System, equipment and method for accessing database under multiple-tenant environment

    CN101777047A

  • Multi-tenant database isolation method and system, electronic equipment and computer storage medium

    CN110765489A