CN112905708A - Database operation method and system based on software as a service (SaaS) system - Google Patents

Database operation method and system based on software as a service (SaaS) system Download PDF

Info

Publication number
CN112905708A
CN112905708A CN202110347832.0A CN202110347832A CN112905708A CN 112905708 A CN112905708 A CN 112905708A CN 202110347832 A CN202110347832 A CN 202110347832A CN 112905708 A CN112905708 A CN 112905708A
Authority
CN
China
Prior art keywords
database
request
data source
tenant
databases
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202110347832.0A
Other languages
Chinese (zh)
Inventor
杨涛
张亚军
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhejiang Taimei Medical Technology Co Ltd
Original Assignee
Zhejiang Taimei Medical Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Zhejiang Taimei Medical Technology Co Ltd filed Critical Zhejiang Taimei Medical Technology Co Ltd
Priority to CN202110347832.0A priority Critical patent/CN112905708A/en
Publication of CN112905708A publication Critical patent/CN112905708A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/28Databases characterised by their database models, e.g. relational or object models
    • G06F16/284Relational databases

Landscapes

  • Engineering & Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computing Systems (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention relates to a database operation method and a system based on a software as a service (SaaS) system, wherein the method comprises the following steps: receiving a request from tenants, wherein the request comprises a creation application, one tenant corresponds to one database cluster, and one database cluster comprises a plurality of databases; confirming whether a data source rule exists according to the request, wherein the data source rule comprises a first corresponding relation between the request and one or more databases in the database cluster; if the data source rule exists, binding the request and one or more databases according to the first corresponding relation; and if the data source rule does not exist, creating the data source rule comprising the first corresponding relation, and binding the request and one or more databases according to the first corresponding relation. According to the database operation method and the database operation system, the request of the tenant and the database in the database cluster can be automatically bound, manual binding operation by a DBA is not needed, labor cost is saved, and human errors can be avoided.

Description

Database operation method and system based on software as a service (SaaS) system
Technical Field
The invention mainly relates to the field of clinical trial research, in particular to a database operation method and a database operation system based on a clinical SaaS system.
Background
With the development of internet technology, Software-as-a-Service (SaaS) Software is applied more and more widely. In the field of clinical trial studies, relevant subject information needs to be collected for research purposes, and as the study progresses, subject information is increasing, and reasonable management of subject information is required. The data is usually managed in the form of a database, however, the capacity of a database has a certain limit, and when the data stored in a database is too much, the speed of data access and the performance of data processing are affected, so that the number of databases needs to be increased, and it is necessary to perform database processing on the data, that is, to distribute the data to a certain database according to a certain logic.
The current banking process mainly relies on manual operation of a Database Administrator (DBA). When a user uses clinical SaaS software and executes operations of creating new tenants, projects and applications, the background program puts forward a database splitting application to the DBA, and after the DBA receives the database splitting application, a database is allocated for the new tenants, the projects and the applications, and the new tenants, the projects and the applications are bound with the database. Thus, when the user is using the application, the resulting data is stored in the database to which it is bound. However, this method depends on the DBA to perform the binding operation, which is labor-consuming, and on the other hand, the manual operation is prone to error, thereby causing a series of losses.
Disclosure of Invention
The invention aims to provide a database operation method and a database operation system for automatically binding tenant requests and databases.
The technical solution adopted to solve the above technical problems is a database operation method based on a SaaS system, and is characterized by including: receiving a request from tenants, wherein the request comprises a creation application, one tenant corresponds to one database cluster, and one database cluster comprises a plurality of databases; confirming whether a data source rule exists according to the request, wherein the data source rule comprises a first corresponding relation between the request and one or more databases in the database cluster; if the data source rule exists, binding the request and the one or more databases according to the first corresponding relation; and if the data source rule does not exist, creating the data source rule comprising the first corresponding relation, and binding the request and the one or more databases according to the first corresponding relation.
In an embodiment of the present invention, the method further includes: storing data source information and the data source rules in a data container, the data source information including information of the database cluster; after the step of receiving a request from a tenant, the method further comprises: and acquiring the data source information.
In an embodiment of the invention, the request further includes a create tenant and a create item, the application corresponds to the item, and the item corresponds to the tenant.
In an embodiment of the present invention, the tenant has a tenant ID, the item has an item ID, the application has an application ID, and after the step of receiving the request from the tenant, the method further includes: creating a user key in response to the request, the user key being collectively uniquely determined by the tenant ID, the item ID, and the application ID; and the data source rule includes a second correspondence of the user key and one or more databases in the database cluster.
In an embodiment of the present invention, the method further includes: and judging whether read-write separation is needed according to the request, wherein if the read-write separation is needed, the data source rule comprises a third corresponding relation between the request and a read database and a write database in the database cluster.
In an embodiment of the present invention, after the step of receiving the request from the tenant, the method further includes: the request is intercepted.
In an embodiment of the invention, the request is intercepted using a proxy object.
In one embodiment of the invention, the data container is arranged based on a Zookeeper framework.
In order to solve the above technical problems, the present invention further provides a database operating system based on a SaaS system, which is characterized by comprising: the software-as-a-service (SaaS) system comprises a micro-service module, a data container and a database cluster, wherein tenants of the SaaS system make requests through the micro-service module, the requests comprise created applications, and one tenant corresponds to one database cluster; the microservice module obtaining data source rules from the data container according to the request, the data source rules including a first correspondence between the request and one or more databases in the database cluster; if the micro service module successfully acquires the data source rule, binding the request and the one or more databases according to the first corresponding relation; and if the micro service module cannot acquire the data source rule, creating the data source rule comprising the first corresponding relation, and binding the request and the one or more databases according to the first corresponding relation.
In an embodiment of the present invention, the data management system further includes a data management module, through which a database administrator manages data source information in the data container, the data source information including information of a database cluster, the database cluster including a plurality of databases; and the micro-service module acquires the data source information from the data container according to the request and loads the data source information to the local.
In an embodiment of the invention, the request further includes a create tenant and a create item, the application corresponds to the item, and the item corresponds to the tenant.
In an embodiment of the invention, the tenant has a tenant ID, the project has a project ID, the application has an application ID, and the microservice module further creates a user key according to the request, wherein the user key is uniquely determined by the tenant ID, the project ID and the application ID; wherein the data source rule includes a second correspondence of the user key and one or more databases in the database cluster.
In an embodiment of the present invention, the micro service module includes a first sub-module and a second sub-module, the first sub-module is adapted to obtain the data source rule, and the second sub-module is adapted to create the data source rule.
In an embodiment of the present invention, the microservice module further determines whether read-write separation is required according to the request, and if the read-write separation is required, the data source rule includes a third corresponding relationship between the request and a read database and a write database in the database cluster.
In an embodiment of the present invention, the microservice module further includes a proxy object, and the proxy object intercepts the request, so that the microservice module obtains the request.
In one embodiment of the invention, the data container is arranged based on a Zookeeper framework.
The present invention further provides a database operating system based on a SaaS system to solve the above technical problems, including: a memory for storing instructions executable by the processor; a processor for executing the instructions to implement the method as described above.
The present invention also provides a computer readable medium storing computer program code, which when executed by a processor implements the method as described above.
According to the database operation method and the database operation system, the request of the tenant and the database in the database cluster can be automatically bound, manual binding operation by a DBA is not needed, labor cost is saved, and human errors can be avoided.
Drawings
In order to make the aforementioned objects, features and advantages of the present invention comprehensible, embodiments accompanied with figures are described in detail below, wherein:
fig. 1 is an exemplary flowchart of a database operation method based on a SaaS system according to an embodiment of the present invention;
fig. 2 is an exemplary flowchart of a database operation method based on a SaaS system according to another embodiment of the present invention;
fig. 3 is an exemplary block diagram of a database operating system based on a SaaS system according to an embodiment of the present invention;
fig. 4 is a system block diagram of a database operating system based on a SaaS system according to an embodiment of the present invention.
Detailed Description
In order to make the aforementioned objects, features and advantages of the present invention comprehensible, embodiments accompanied with figures are described in detail below.
In the following description, numerous specific details are set forth in order to provide a thorough understanding of the present invention, but the present invention may be practiced in other ways than those specifically described herein, and thus the present invention is not limited to the specific embodiments disclosed below.
As used in this application and the appended claims, the terms "a," "an," "the," and/or "the" are not intended to be inclusive in the singular, but rather are intended to be inclusive in the plural unless the context clearly dictates otherwise. In general, the terms "comprises" and "comprising" merely indicate that steps and elements are included which are explicitly identified, that the steps and elements do not form an exclusive list, and that a method or apparatus may include other steps or elements.
The relative arrangement of the components and steps, the numerical expressions, and numerical values set forth in these embodiments do not limit the scope of the present application unless specifically stated otherwise. Meanwhile, it should be understood that the sizes of the respective portions shown in the drawings are not drawn in an actual proportional relationship for the convenience of description. Techniques, methods, and apparatus known to those of ordinary skill in the relevant art may not be discussed in detail but are intended to be part of the specification where appropriate. In all examples shown and discussed herein, any particular value should be construed as merely illustrative, and not limiting. Thus, other examples of the exemplary embodiments may have different values. It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, further discussion thereof is not required in subsequent figures.
It should be noted that the terms "first", "second", and the like are used to define the components, and are only used for convenience of distinguishing the corresponding components, and the terms have no special meanings unless otherwise stated, and therefore, the scope of protection of the present application is not to be construed as being limited. Further, although the terms used in the present application are selected from publicly known and used terms, some of the terms mentioned in the specification of the present application may be selected by the applicant at his or her discretion, the detailed meanings of which are described in relevant parts of the description herein. Further, it is required that the present application is understood not only by the actual terms used but also by the meaning of each term lying within.
Flow charts are used herein to illustrate operations performed by systems according to embodiments of the present application. It should be understood that the preceding or following operations are not necessarily performed in the exact order in which they are performed. Rather, various steps may be processed in reverse order or simultaneously. Meanwhile, other operations are added to or removed from these processes.
Fig. 1 is an exemplary flowchart of a database operation method based on a SaaS system according to an embodiment of the present invention. Referring to fig. 1, the database operation method of this embodiment includes the steps of:
step S110: receiving a request from tenants, wherein the request comprises a creation application, one tenant corresponds to one database cluster, and one database cluster comprises a plurality of databases;
step S120: confirming whether a data source rule exists according to the request, wherein the data source rule comprises a first corresponding relation between the request and one or more databases in the database cluster;
step S130: if the data source rule exists, binding the request and one or more databases according to the first corresponding relation; and
step S140: and if the data source rule does not exist, creating the data source rule comprising the first corresponding relation, and binding the request and one or more databases according to the first corresponding relation.
The subject of each step S110 to S140 is not limited to the subject of the step, and the subject of each step may be a specific SaaS system, for example, a clinical SaaS system, or may be a certain application based on the SaaS system. The above steps S110 to S140 are specifically described below.
In step S110, the tenant refers to a tenant of the SaaS system. In clinical trial research, a tenant may be an entity object such as a company, a hospital, or the like having an authority to use a clinical SaaS system. The request usually comes from a user of the SaaS system, who should have certain tenant rights. For a tenant, the authority of the tenant can be exercised by a plurality of users. Therefore, the request in step S110 is actually from the user of the SaaS system. The request includes creating an application. Under the authority of one tenant, corresponding applications can be created in the SaaS system according to needs. Different tenants can individually set various applications meeting the needs of the tenants.
In the invention, the SaaS system provides a database cluster for each tenant, the database cluster comprises a plurality of databases, and a certain application can be corresponding to one or more databases according to a certain rule.
In step S120, it is confirmed whether a data source rule exists according to the request. The data source rule includes the first corresponding relationship between the request in step S110 and a database belonging to the database cluster of the tenant.
In some embodiments, a request to create an application corresponds to a database.
In other embodiments, one request to create an application may correspond to multiple databases.
The invention does not limit the storage mode of the data source rule. In step S120, the data source rule may be acquired from a storage device or an area storing the data source rule, and if the acquisition is successful, the data source rule is present, and if the acquisition is not successful, the data source rule is absent. In some embodiments, the data source rule may be queried in a storage device or area storing the data source rule by way of a query, and if the query is successful, the data source rule is present, and if the query is not successful, the data source rule is not present.
If the step S120 confirms that the data source rule exists, which indicates that the first corresponding relationship between the request of the tenant and the database corresponding to the tenant has been created in the SaaS system, the step S130 is executed to bind the request and the database. In actual execution, the name of the database corresponding to the request may be returned to the main program. In this way, when the user opens the application created by the request in step S110 next time, the SaaS system automatically stores the data in the application into the database or reads the required data from the database.
If it is determined in step S120 that the data source rule does not exist, indicating that the first corresponding relationship between the request and a certain database in the database cluster does not exist in the SaaS system, step S140 is executed to create the data source rule including the first corresponding relationship, and bind the request and one or more databases in the database cluster according to the first corresponding relationship. The data source rules created here may or may not be the same as the successfully obtained data source rules.
In step S140, creating a data source rule including the first corresponding relationship may be created according to a preset manner. For example, assuming that the database cluster of the tenant includes N databases, the preset manner is: and detecting the current N databases, and establishing a first corresponding relation between the request in the step S110 and the database with the minimum data usage amount. In this way, when the subsequent tenant uses the application in the request, the data is read and written in the database with the minimum data usage amount.
The preset manner is only an example and is not used to limit the specific manner of creating the data source rule of the present invention. Those skilled in the art can create the data source rule in any way based on the idea and the actual needs of the clinical trial.
According to the database operation method, the request of the tenant and the database in the database cluster can be automatically bound, manual binding operation by a DBA is not needed, labor cost is saved, and human errors can be avoided.
In some embodiments, the request in step S110 further includes creating a tenant and creating an item, the application corresponding to the item, the item corresponding to the tenant. In the SaaS system, it is assumed that tenant a creates item B using the SaaS system, and creates applications C1 and C2 in the item B. The applications C1 and C2 may both correspond to the database D1, or the application C1 may correspond to the database D1 and the application C2 may correspond to the database D2, respectively. In this way, a plurality of applications C1, C2 in the same project belonging to the same tenant can be managed as needed.
In some embodiments, the tenant has a tenant ID, the item has an item ID, the application has an application ID, and after the step of receiving the request from the tenant further comprises: creating a user key in response to the request, the user key being determined uniquely by the tenant ID, the item ID, and the application ID together; and the data source rule includes a second correspondence of the user key and one or more databases in the database cluster.
According to the embodiments, a user Key, namely, tenant ID + item ID + application ID, may be created, so as to create a second correspondence between each user Key and the corresponding database. Errors can be avoided when a request of a tenant is received, and the request is corresponding to an erroneous database.
In some embodiments, the database operation method of the present invention further comprises: storing data source information and data source rules in a data container, wherein the data source information comprises information of a database cluster; after the step of receiving the request from the tenant, the method further comprises the following steps: and acquiring data source information. In these embodiments, the data source information is information for tenants, including a database cluster corresponding to a certain tenant, where the number, name, attribute, usage, and the like of databases included in the database cluster may be included. The data source rule may be the data source rule created in step S140. The data source information is needed in the step of creating the data source rule, for example, the database is allocated according to the use condition of the database in the database cluster. In some embodiments, the data container is configured based on a Zookeeper framework.
Fig. 2 is an exemplary flowchart of a database operation method based on a SaaS system according to another embodiment of the present invention. Referring to fig. 2, the database operation method of this embodiment includes the steps of:
step S210: a request is received from a tenant.
Step S210 is similar to step S110. The explanation about step S110 can be used to explain step S210. The request includes at least a create application, which in some embodiments may also include a create tenant and a create project, wherein the created application corresponds to the project and the project corresponds to the tenant. A user Key, which is uniquely determined by the tenant ID, the item ID, and the application ID together, can be created upon request.
Step S220: the request is intercepted.
This step may be performed by an interceptor. In some embodiments, the operation of intercepting the request is performed using a proxy object.
Step S230: and acquiring data source information.
The data source information in this step may be stored in a data container. In this step, data source information is obtained from the data container, so that the subsequent step creates a data source rule according to the data source information.
In some embodiments, the data container is configured based on a Zookeeper framework.
Step S240: and judging whether read-write separation is needed, if so, continuing to execute the step S250, and otherwise, continuing to execute the step S260.
According to this step, the database operation method of this embodiment determines whether the application created in the request of the tenant needs to be read and written separately. If read-write separation is required, the data source rule includes a third correspondence between the request and a read database and a write database. In the third correspondence, one request corresponds to 2 different databases, and the 2 databases all belong to the database cluster corresponding to the tenant. In step S120, when the first correspondence is a correspondence between a request of the tenant and a plurality of databases, the plurality of databases may be 2 databases including 1 read database and 1 write database.
By default, an application will typically correspond to a database that is used for both reading and writing, a read-write database. Under some special conditions, the databases corresponding to the read operation and the write operation are separated according to the needs of users, which can bring beneficial effects such as improving the read-write speed.
Step S250: and acquiring a read-write data source rule.
In this step, the read-write data source rule may be obtained from the data container. The read-write data source rule includes a third correspondence.
Step S260: and acquiring the universal data source rule.
In this step, the universal data source rule refers to a data source rule corresponding to a common read-write database. The general data source rule comprises a first corresponding relation or a second corresponding relation.
Step S270: and judging whether a data source rule exists, if so, ending the process, and otherwise, executing the step S280.
The determination of whether the data source rule exists in this step is equivalent to determining whether the acquisition operation in step S250 or S260 is successfully performed. When the obtaining operation is successfully executed, the read-write data source rule or the universal data source rule is actually obtained. In any data source rule, if the acquisition is successful, the process is ended. According to the obtained data source rule, the database corresponding to the request of the tenant can be returned, and under the condition that read-write separation is needed, the information of 2 databases is returned; and returning the information of 1 database without reading and writing separation. That is, a tenant's request and its corresponding database are automatically bound.
Step S280: a data source rule is created.
This step is similar to step S140. The explanation about step S140 may be used to explain step S280.
According to the embodiment shown in fig. 2, an execution flow of the database operation method from the perspective of the client of the SaaS system is given. Whether the database needs to be read and written separately is judged, and the data source rule is automatically created under the condition that the data source rule does not exist, so that the tenant request and the database are automatically bound, and the process efficiency is improved.
Fig. 3 is an exemplary block diagram of a database operating system based on a SaaS system according to an embodiment of the present invention. The database operating system can be used to perform the database operating method described above, and therefore, the above description and the accompanying drawings can be used to describe the database operating system, and the same will not be expanded. Referring to fig. 3, the database operating system 300 includes a microservice module 310, a data container 320, and a database cluster 330.
The tenants of the SaaS system make requests through the microservice module 310, where the requests include creating applications, and one tenant corresponds to one database cluster 330. In step S110, a request of a tenant may be received through the microservice module 310.
In some embodiments, the request further includes creating the tenant and creating an item, the application corresponding to the item, the item corresponding to the tenant.
The microservice module 310 obtains data source rules from the data container 320 based on the request, the data source rules including a first correspondence of the request to one or more databases in the database cluster 330. According to this embodiment, step S120 may be performed by the microservice module 310.
In some embodiments, the tenant has a tenant ID, the item has an item ID, the application has an application ID, and the microservice module 310 further creates a user key upon request, the user key being uniquely determined by the tenant ID, the item ID, and the application ID; wherein the data source rule includes a second correspondence of the user key to one or more databases in the database cluster 330.
In some embodiments, the data container is configured based on a Zookeeper framework.
If the micro service module 310 successfully obtains the data source rule, binding the request and the database according to the first corresponding relationship; and if the micro service module 310 cannot acquire the data source rule, creating the data source rule including the first corresponding relationship, and binding the request and one or more databases in the database cluster 330 according to the first corresponding relationship. According to this embodiment, steps S130 and S140 may be performed by the microservice module 310.
Referring to fig. 3, in some embodiments, the database operating system 300 further includes a data management module 340, and a database administrator 341 manages data source information in the data container 320 through the data management module 340, the data source information including information of the database cluster 330, the database cluster 330 including a plurality of databases; the micro service module 310 obtains the data source information from the data container 320 according to the request, and loads the data source information to the local. According to this embodiment, the data source information may be acquired from the data container 320 through step S230, so as to create the data source rule according to the data source information in the subsequent step. And, the micro service module 310 also loads these data source information to the local, so that the micro service module 310 creates the data source rule according to the tenant's request and the data source information.
After the microservice module 310 creates the data source rules, the data source rules are stored in a data container 320.
In some embodiments, the microserver module 310 further determines whether read-write separation is required according to the request, and if the read-write separation is required, the data source rule includes a third corresponding relationship between the request and one or more read databases and one write database in the database cluster 330.
In some embodiments, the database operating system also includes a proxy object (not shown) that intercepts the request, causing microservice module 310 to obtain the request.
In some embodiments, microservice module 310 may include a first submodule and a second submodule, where the first submodule is to obtain data source rules from a data container; the second submodule is used for creating the data source rule and storing the data source rule into the data container.
According to the database operating system of the present invention, the micro-service module 310 processes the tenant request, automatically binds the request and the database in the database cluster, the database manager 341 does not need to manually perform the binding operation, the database manager 341 only needs to maintain the data source information in the data container 320, the workload of the database manager 341 is reduced, the labor cost is reduced, and human errors can be avoided.
The invention also comprises a database operating system based on the SaaS system, which comprises a memory and a processor. Wherein the memory is to store instructions executable by the processor; the processor is configured to execute the instruction to implement the foregoing database operation method based on the SaaS system.
Fig. 4 is a system block diagram of a database operating system based on a SaaS system according to an embodiment of the present invention. Referring to fig. 4, the database operating system 400 may include an internal communication bus 401, a processor 402, a Read Only Memory (ROM)403, a Random Access Memory (RAM)404, and a communication port 405. When implemented on a personal computer, the database operating system 400 may also include a hard disk 406. An internal communication bus 401 may enable communication of data among the components of the database operating system 400. The processor 402 may make the determination and issue the prompt. In some embodiments, processor 402 may be comprised of one or more processors. The communication port 405 may enable the database operating system 400 to communicate data with the outside. In some embodiments, the database operating system 400 may send and receive information and data from a network through the communication port 405. The database operating system 400 may also include various forms of program storage units and data storage units, such as a hard disk 406, Read Only Memory (ROM)403 and Random Access Memory (RAM)404, capable of storing various data files for computer processing and/or communication, as well as possibly program instructions for execution by the processor 402. The processor executes these instructions to implement the main parts of the method. The results processed by the processor are communicated to the user device through the communication port and displayed on the user interface.
The database operation method based on the SaaS system may be implemented as a computer program, stored in the hard disk 406, and loaded into the processor 402 to be executed, so as to implement the data processing method of the present application.
The present invention also includes a computer readable medium storing computer program code, which when executed by a processor implements the SaaS system based database operating method described above.
When the database operation method based on the SaaS system is implemented as a computer program, the database operation method may also be stored in a computer-readable storage medium as a product. For example, computer-readable storage media can include but are not limited to magnetic storage devices (e.g., hard disk, floppy disk, magnetic strips), optical disks (e.g., Compact Disk (CD), Digital Versatile Disk (DVD)), smart cards, and flash memory devices (e.g., electrically Erasable Programmable Read Only Memory (EPROM), card, stick, key drive). In addition, various storage media described herein can represent one or more devices and/or other machine-readable media for storing information. The term "machine-readable medium" can include, without being limited to, wireless channels and various other media (and/or storage media) capable of storing, containing, and/or carrying code and/or instructions and/or data.
It should be understood that the above-described embodiments are illustrative only. The embodiments described herein may be implemented in hardware, software, firmware, middleware, microcode, or any combination thereof. For a hardware implementation, the processor may be implemented within one or more Application Specific Integrated Circuits (ASICs), Digital Signal Processors (DSPs), Digital Signal Processing Devices (DSPDs), Programmable Logic Devices (PLDs), Field Programmable Gate Arrays (FPGAs), processors, controllers, micro-controllers, microprocessors, and/or other electronic units designed to perform the functions described herein, or a combination thereof.
Aspects of the present application may be embodied entirely in hardware, entirely in software (including firmware, resident software, micro-code, etc.) or in a combination of hardware and software. The above hardware or software may be referred to as "data block," module, "" engine, "" unit, "" component, "or" system. The processor may be one or more Application Specific Integrated Circuits (ASICs), Digital Signal Processors (DSPs), digital signal processing devices (DAPDs), Programmable Logic Devices (PLDs), Field Programmable Gate Arrays (FPGAs), processors, controllers, microcontrollers, microprocessors, or a combination thereof. Furthermore, aspects of the present application may be represented as a computer product, including computer readable program code, embodied in one or more computer readable media. For example, computer-readable media may include, but are not limited to, magnetic storage devices (e.g., hard disk, floppy disk, magnetic strips … …), optical disks (e.g., Compact Disk (CD), Digital Versatile Disk (DVD) … …), smart cards, and flash memory devices (e.g., card, stick, key drive … …).
The computer readable medium may comprise a propagated data signal with the computer program code embodied therein, for example, on a baseband or as part of a carrier wave. The propagated signal may take any of a variety of forms, including electromagnetic, optical, and the like, or any suitable combination. The computer readable medium can be any computer readable medium that can communicate, propagate, or transport the program for use by or in connection with an instruction execution system, apparatus, or device. Program code on a computer readable medium may be propagated over any suitable medium, including radio, electrical cable, fiber optic cable, radio frequency signals, or the like, or any combination of the preceding.
Having thus described the basic concept, it will be apparent to those skilled in the art that the foregoing disclosure is by way of example only, and is not intended to limit the present application. Various modifications, improvements and adaptations to the present application may occur to those skilled in the art, although not explicitly described herein. Such modifications, improvements and adaptations are proposed in the present application and thus fall within the spirit and scope of the exemplary embodiments of the present application.
Also, this application uses specific language to describe embodiments of the application. Reference throughout this specification to "one embodiment," "an embodiment," and/or "some embodiments" means that a particular feature, structure, or characteristic described in connection with at least one embodiment of the present application is included in at least one embodiment of the present application. Therefore, it is emphasized and should be appreciated that two or more references to "an embodiment" or "one embodiment" or "an alternative embodiment" in various places throughout this specification are not necessarily all referring to the same embodiment. Furthermore, some features, structures, or characteristics of one or more embodiments of the present application may be combined as appropriate.
Numerals describing the number of components, attributes, etc. are used in some embodiments, it being understood that such numerals used in the description of the embodiments are modified in some instances by the use of the modifier "about", "approximately" or "substantially". Unless otherwise indicated, "about", "approximately" or "substantially" indicates that the number allows a variation of ± 20%. Accordingly, in some embodiments, the numerical parameters used in the specification and claims are approximations that may vary depending upon the desired properties of the individual embodiments. In some embodiments, the numerical parameter should take into account the specified significant digits and employ a general digit preserving approach. Notwithstanding that the numerical ranges and parameters setting forth the broad scope of the range are approximations, in the specific examples, such numerical values are set forth as precisely as possible within the scope of the application.

Claims (18)

1. A database operation method based on a software as a service (SaaS) system is characterized by comprising the following steps:
receiving a request from tenants, wherein the request comprises a creation application, one tenant corresponds to one database cluster, and one database cluster comprises a plurality of databases;
confirming whether a data source rule exists according to the request, wherein the data source rule comprises a first corresponding relation between the request and one or more databases in the database cluster;
if the data source rule exists, binding the request and the one or more databases according to the first corresponding relation; and
and if the data source rule does not exist, creating the data source rule comprising the first corresponding relation, and binding the request and the one or more databases according to the first corresponding relation.
2. The database operation method of claim 1, further comprising: storing data source information and the data source rules in a data container, the data source information including information of the database cluster; after the step of receiving a request from a tenant, the method further comprises: and acquiring the data source information.
3. The database operation method of claim 1, wherein the request further comprises a create tenant and a create item, the application corresponding to the item, the item corresponding to the tenant.
4. The database operation method of claim 3, wherein the tenant has a tenant ID, the item has an item ID, the application has an application ID, further comprising, after the step of receiving a request from the tenant: creating a user key in response to the request, the user key being collectively uniquely determined by the tenant ID, the item ID, and the application ID; and the data source rule includes a second correspondence of the user key and one or more databases in the database cluster.
5. The database operation method of claim 1, further comprising: and judging whether read-write separation is needed according to the request, wherein if the read-write separation is needed, the data source rule comprises a third corresponding relation between the request and a read database and a write database in the database cluster.
6. The database operation method of claim 1, further comprising, after the step of receiving a request from a tenant: the request is intercepted.
7. The method of database operations of claim 6, wherein the request is intercepted using a proxy object.
8. The database operation method according to claim 2, wherein the data container is set based on a Zookeeper framework.
9. A database operating system based on a software as a service (SaaS) system, comprising: a microservice module, a data container, and a database cluster, wherein,
tenants of the SaaS system make requests through the micro-service module, wherein the requests comprise the creation of applications, and one tenant corresponds to one database cluster;
the microservice module obtaining data source rules from the data container according to the request, the data source rules including a first correspondence between the request and one or more databases in the database cluster;
if the micro service module successfully acquires the data source rule, binding the request and the one or more databases according to the first corresponding relation; and
and if the micro service module cannot acquire the data source rule, creating the data source rule comprising the first corresponding relation, and binding the request and the one or more databases according to the first corresponding relation.
10. The database operating system of claim 9, further comprising a data management module by which a database administrator manages data source information in the data container, the data source information including information for a database cluster, the database cluster including a plurality of databases; and the micro-service module acquires the data source information from the data container according to the request and loads the data source information to the local.
11. The database operating system of claim 9, the request further comprising a create tenant and a create item, the application corresponding to the item, the item corresponding to the tenant.
12. The database operating system of claim 11, wherein the tenant has a tenant ID, the item has an item ID, the application has an application ID, the microservice module further creates a user key from the request, the user key being collectively uniquely determined by the tenant ID, the item ID, and the application ID; wherein the data source rule includes a second correspondence of the user key and one or more databases in the database cluster.
13. The database operating system of claim 9, wherein the microservice module comprises a first submodule adapted to obtain the data source rule and a second submodule adapted to create the data source rule.
14. The database operating system of claim 9, wherein the microservice module further determines whether read-write separation is required based on the request, and if read-write separation is required, the data source rule includes a third correspondence between the request and a read database and a write database in the database cluster.
15. The database operating system of claim 9, further comprising a proxy object that intercepts the request, causing the microservice module to obtain the request.
16. The database operating system of claim 9, wherein the data container is arranged based on a Zookeeper framework.
17. A database operating system based on a software as a service (SaaS) system comprises:
a memory for storing instructions executable by the processor;
a processor for executing the instructions to implement the method of any one of claims 1-8.
18. A computer-readable medium having stored thereon computer program code which, when executed by a processor, implements the method of any of claims 1-8.
CN202110347832.0A 2021-03-31 2021-03-31 Database operation method and system based on software as a service (SaaS) system Pending CN112905708A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110347832.0A CN112905708A (en) 2021-03-31 2021-03-31 Database operation method and system based on software as a service (SaaS) system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110347832.0A CN112905708A (en) 2021-03-31 2021-03-31 Database operation method and system based on software as a service (SaaS) system

Publications (1)

Publication Number Publication Date
CN112905708A true CN112905708A (en) 2021-06-04

Family

ID=76109716

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110347832.0A Pending CN112905708A (en) 2021-03-31 2021-03-31 Database operation method and system based on software as a service (SaaS) system

Country Status (1)

Country Link
CN (1) CN112905708A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113760849A (en) * 2021-11-10 2021-12-07 深圳市明源云科技有限公司 Log processing method, system, electronic device and computer readable storage medium
CN115080537A (en) * 2022-06-07 2022-09-20 易保网络技术(上海)有限公司 Multi-tenant data partitioning method, program product and electronic device

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110264861A1 (en) * 2010-04-21 2011-10-27 Salesforce.Com Methods and systems for utilizing bytecode in an on-demand service environment including providing multi-tenant runtime environments and systems
CN102456028A (en) * 2010-10-27 2012-05-16 金蝶软件(中国)有限公司 Multi-tenant-oriented data acquisition method, device and system
CN107203575A (en) * 2016-03-18 2017-09-26 北京京东尚科信息技术有限公司 A kind of system, apparatus and method for being used to isolate multi-tenant data
CN110519361A (en) * 2019-08-22 2019-11-29 北京宝兰德软件股份有限公司 Container cloud platform multi-tenant construction method and device based on kubernetes
CN110765489A (en) * 2019-10-30 2020-02-07 深圳前海环融联易信息科技服务有限公司 Multi-tenant database isolation method and system, electronic device and computer storage medium
CN110799961A (en) * 2017-06-27 2020-02-14 易享信息技术有限公司 System and method for creating and deleting tenants in database
CN111092816A (en) * 2019-11-26 2020-05-01 金蝶软件(中国)有限公司 Gateway dynamic routing method, gateway dynamic routing device, computer equipment and storage medium
CN111491012A (en) * 2020-03-27 2020-08-04 北京尚医智信健康管理有限公司 SaaS multi-tenant data isolation access method and device, electronic equipment and storage medium
CN112100262A (en) * 2020-09-16 2020-12-18 南京智数云信息科技有限公司 Method and system for quickly building and dynamically expanding multi-tenant software as a service (SaaS) platform
CN112527310A (en) * 2020-12-15 2021-03-19 平安国际智慧城市科技股份有限公司 Multi-tenant data isolation method and device, computer equipment and storage medium

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110264861A1 (en) * 2010-04-21 2011-10-27 Salesforce.Com Methods and systems for utilizing bytecode in an on-demand service environment including providing multi-tenant runtime environments and systems
CN102456028A (en) * 2010-10-27 2012-05-16 金蝶软件(中国)有限公司 Multi-tenant-oriented data acquisition method, device and system
CN107203575A (en) * 2016-03-18 2017-09-26 北京京东尚科信息技术有限公司 A kind of system, apparatus and method for being used to isolate multi-tenant data
CN110799961A (en) * 2017-06-27 2020-02-14 易享信息技术有限公司 System and method for creating and deleting tenants in database
CN110519361A (en) * 2019-08-22 2019-11-29 北京宝兰德软件股份有限公司 Container cloud platform multi-tenant construction method and device based on kubernetes
CN110765489A (en) * 2019-10-30 2020-02-07 深圳前海环融联易信息科技服务有限公司 Multi-tenant database isolation method and system, electronic device and computer storage medium
CN111092816A (en) * 2019-11-26 2020-05-01 金蝶软件(中国)有限公司 Gateway dynamic routing method, gateway dynamic routing device, computer equipment and storage medium
CN111491012A (en) * 2020-03-27 2020-08-04 北京尚医智信健康管理有限公司 SaaS multi-tenant data isolation access method and device, electronic equipment and storage medium
CN112100262A (en) * 2020-09-16 2020-12-18 南京智数云信息科技有限公司 Method and system for quickly building and dynamically expanding multi-tenant software as a service (SaaS) platform
CN112527310A (en) * 2020-12-15 2021-03-19 平安国际智慧城市科技股份有限公司 Multi-tenant data isolation method and device, computer equipment and storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
周学权等: "面向多租户的多层次可伸缩SaaS软件架构研究", 《华中科技大学学报(自然科学版)》, 10 January 2014 (2014-01-10), pages 138 - 143 *

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113760849A (en) * 2021-11-10 2021-12-07 深圳市明源云科技有限公司 Log processing method, system, electronic device and computer readable storage medium
CN115080537A (en) * 2022-06-07 2022-09-20 易保网络技术(上海)有限公司 Multi-tenant data partitioning method, program product and electronic device
CN115080537B (en) * 2022-06-07 2023-11-10 易保网络技术(上海)有限公司 Multi-tenant database separation method and device, storage medium, chip device and electronic equipment
WO2023236756A1 (en) * 2022-06-07 2023-12-14 易保网络技术(上海)有限公司 Multi-tenant data database allocation method, and program product and electronic device

Similar Documents

Publication Publication Date Title
US9201697B2 (en) System and method to reduce memory usage by optimally placing VMS in a virtualized data center
CN109508326B (en) Method, device and system for processing data
US20200236171A1 (en) Partitioning data according to relative differences indicated by a cover tree
CN112905708A (en) Database operation method and system based on software as a service (SaaS) system
CN109033360B (en) Data query method, device, server and storage medium
KR20120037397A (en) Catalog-based software component management
US10983909B2 (en) Trading off cache space and write amplification for Bε-trees
US9535743B2 (en) Data processing control method, computer-readable recording medium, and data processing control device for performing a Mapreduce process
US11100047B2 (en) Method, device and computer program product for deleting snapshots
CN109145003B (en) Method and device for constructing knowledge graph
US20160203203A1 (en) Metadata peering with improved inodes
CN108108633A (en) A kind of data file and its access method, device and equipment
CN109522332A (en) Customer profile data merging method, device, equipment and readable storage medium storing program for executing
CN111209256A (en) File monitoring method and device, electronic equipment and storage medium
JP2021518021A (en) Data processing methods, equipment and computer readable storage media
CN111651424B (en) Data processing method, device, data node and storage medium
US9971789B2 (en) Selective disk volume cloning for virtual disk creation
CN106407442A (en) Massive text data processing method and apparatus
CN110222046B (en) List data processing method, device, server and storage medium
CN108304142A (en) A kind of data managing method and device
CN109388651B (en) Data processing method and device
CN110652728A (en) Game resource management method and device, electronic equipment and storage medium
EP3108400B1 (en) Virus signature matching method and apparatus
CN112084199A (en) Scene-based general parameter maintenance method and device
EP2981882A1 (en) Removable storage device identity and configuration information

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20210604