WO2023284722A1 - 一种租户的资源管理方法及租户管理系统 - Google Patents

一种租户的资源管理方法及租户管理系统 Download PDF

Info

Publication number
WO2023284722A1
WO2023284722A1 PCT/CN2022/105139 CN2022105139W WO2023284722A1 WO 2023284722 A1 WO2023284722 A1 WO 2023284722A1 CN 2022105139 W CN2022105139 W CN 2022105139W WO 2023284722 A1 WO2023284722 A1 WO 2023284722A1
Authority
WO
WIPO (PCT)
Prior art keywords
tenant
target
level
resource
activity level
Prior art date
Application number
PCT/CN2022/105139
Other languages
English (en)
French (fr)
Inventor
刘然
许鸿斐
汪健
Original Assignee
华为技术有限公司
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 华为技术有限公司 filed Critical 华为技术有限公司
Publication of WO2023284722A1 publication Critical patent/WO2023284722A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
    • G06F9/4881Scheduling strategies for dispatcher, e.g. round robin, multi-level priority queues
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5027Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2209/00Indexing scheme relating to G06F9/00
    • G06F2209/50Indexing scheme relating to G06F9/50
    • G06F2209/5011Pool
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2209/00Indexing scheme relating to G06F9/00
    • G06F2209/50Indexing scheme relating to G06F9/50
    • G06F2209/5018Thread allocation

Definitions

  • the present application relates to the field of cloud computing, and in particular to a tenant resource management method and a tenant management system.
  • Cloud services have emerged many new technologies that change traditional IT architecture and operation and maintenance methods, such as virtual machines, containers, and microservices. However, no matter in which scenarios these technologies are applied, reducing costs and improving efficiency are the eternal themes of cloud services.
  • multi-tenant shared resource platforms for example, serverless (serverless) cloud development, also known as serverless services, serverless platforms, etc.
  • serverless services also known as serverless services, serverless platforms, etc.
  • Pay-as-you-go is a feature of the multi-tenant shared resource platform, that is, developers only need to pay when they actually perform read and write operations, storage, etc.
  • serverless services As an example, after developers activate serverless services, if they do not operate Or the usage is very small (within the free quota), which will not incur any fees, but will consume the operating costs of serverless platform providers. Therefore, how to effectively control resource costs and support the access of a large number of large and small, especially free tenants (such as application programs (APP)) is a key concern of every serverless platform provider.
  • APP application programs
  • Method 1 Tenant resources are not reserved, that is, resources are scheduled in real time according to the priority of resource use by each tenant, and resources with higher priority are used first .
  • Method 2. Reserve a certain upper limit of resources for tenants in advance, so that tenants can use resources fairly.
  • method 1 can adjust resource allocation in real time according to the current needs of tenants, it is easy to cause resource preemption, and tenants with low priority may be in a long-term waiting state; while method 2 avoids Resource preemption between tenants, but there is a situation where reserved resources are wasted by completely inactive zombie tenants.
  • the embodiment of the present application provides a tenant resource management method and a tenant management system, which are used to calculate the activity level of the tenant in the statistical period based on the request information of the tenant in the statistical period, and realize the reservation of different tenants based on the active level. Dynamic differentiated management of resources.
  • the embodiment of the present application can dynamically adjust resource allocation in real time according to the resource requirements of tenants, so as to avoid the waste of reserved resources by inactive tenants (that is, zombie tenants), so that in the case of the same system resources , the resource multi-tenancy sharing platform can host more tenants at the same time, which improves the ability of the resource multi-tenancy sharing platform to serve tenants, and minimizes the operating costs of zombie tenants.
  • the embodiment of the present application firstly provides a resource management method for tenants, which can be used in the field of cloud computing.
  • the method includes: first, obtaining the request information (also called request event ), the request information sent by the tenant within the preset period can be one or multiple, which is not limited here.
  • the information sent by the tenant to the resource multi-tenancy sharing platform can be called request information, for example, information requesting access, information requesting subscription, information requesting storage, etc., specifically There is no limit here.
  • the target request information also called an active event
  • the target request information will be further determined from the obtained request information based on the preset information type.
  • the determined target request information There may be one or more than one, which is not limited in this application.
  • the target activity level of the tenant is determined according to the target request information.
  • the tenant After calculating the target activity level of the tenant, if the current activity level of the tenant is different from the target activity level, the tenant’s resources on the resource multi-tenancy sharing platform will be adjusted according to the calculated target activity level.
  • the adjustment methods include but Not limited to: resource upgrade, resource downgrade, release of resources occupied by the tenant on the resource multi-tenant sharing platform after cold backup, re-allocation of resources for the tenant after hot recovery, etc.
  • the specific adjustment method is determined by the tenant's current activity level and the calculated target activity level.
  • the tenant's activity level within the statistical period is calculated based on the tenant's request information within the statistical period, and dynamic differentiated management of resources reserved by different tenants is realized based on the activity level, that is, based on the tenant's status in the statistical period
  • the activity level within the statistical period adjusts the resources of the tenant on the resource multi-tenancy sharing platform.
  • Re-allocate resources for the tenant after recovery and the embodiment of the present application can dynamically adjust resource allocation in real time according to the resource requirements of the tenant, thereby avoiding the situation where inactive tenants (ie zombie tenants) waste reserved resources, so that resources in the same system
  • the resource multi-tenancy sharing platform can carry more tenants at the same time, which improves the ability of the resource multi-tenancy sharing platform to serve tenants, and minimizes the operating costs of zombie tenants.
  • the tenant is run on the resource multi-tenancy sharing platform
  • the data of the database instance is cold backed up on the preset backup node to obtain the backup data, and then release the resources occupied by the tenant on the resource multi-tenancy sharing platform (that is, release the database instance object of the tenant, for example, release
  • the tenant's thread pool, subscription cache pool, connection pool and other dynamic resources make it no longer occupy resources on the database node).
  • the database instance can be regarded as a database process in essence, and the instance is a database instance in the process.
  • the expression form of the database instance will be different according to the database structure, and will not be described here. What needs to be explained here is that the first level is used to indicate that the tenant is in an inactive state, specifically used to indicate that the number of information interactions between the tenant and the resource multi-tenancy and sharing platform within the period of time has not reached the first preset threshold.
  • the first preset threshold is the dividing line for judging whether a tenant is an inactive tenant (that is, a zombie tenant) or an active tenant. If the first preset threshold is not reached, it is judged as an inactive tenant. If the first preset threshold is reached, it means that the tenant It is not an inactive tenant. In the embodiment of this application, those that reach the first preset threshold can be collectively referred to as the first target level.
  • the first target level can actually be further divided into smaller granularity levels (such as the second level, the third level, etc.), where each level with a smaller granularity corresponds to a segment threshold interval, for example, the threshold interval [y1, y2] corresponds to a subdivision level, and the threshold interval [y2 , y3] corresponds to another subdivision level, ..., and so on, the first target level can be divided into multiple levels, and the specific division method can be customized based on actual needs, which will not be described in detail in this application.
  • resources are no longer reserved for inactive tenants on the resource multi-tenancy sharing platform, or when the tenant is degraded to an inactive state, the tenant's resources occupied by the tenant on the resource multi-tenancy sharing platform are withdrawn . Therefore, in the case of the same system resources, the resource multi-tenant sharing platform can provide services for more tenants and minimize the operating costs of inactive tenants. In addition, it is more friendly to the tenant business than the automatic warehouse clearing scheme that expires , more applicable.
  • the specific operation process includes: creating a new database instance on the resource multi-tenant sharing platform, and storing the tenant’s backup data on the preset backup node (the backup data was stored in a previous Within a cycle, the tenant is in an inactive state when the cold backup is obtained, specifically the backup data is the latest backup data from the current moment) and restored to the newly created database instance, and the tenant is allocated with the first target
  • the resources corresponding to the level multi-tenant the resources of the shared platform that is, allocate new dynamic resources such as thread pool, subscription cache pool, and connection pool corresponding to the first target level to the tenant.
  • the second level is an active level higher than the above first level.
  • the second level is used to indicate that the number of information interactions between the tenant and the resource multi-tenancy and sharing platform within the cycle time has reached the A preset threshold but has not yet reached the second preset threshold, the second preset threshold can also be customized, it can be an active level adjacent to the first level, or not adjacent to the first level
  • the activity level is not limited in this application.
  • the second target level is an activity level higher than the above-mentioned second level.
  • the second target level is used to indicate that the number of information interactions between the tenant and the resource multi-tenancy and sharing platform reaches
  • the second preset threshold is defined.
  • those that reach the second preset threshold can be collectively referred to as the second target level.
  • the second target level can actually be further divided into more Small-grained grades (such as the second grade, the third grade, etc.), wherein each grade with a smaller granularity corresponds to a segment threshold interval, and the correspondence between each grade with a smaller granularity and the threshold interval is the same as the above-mentioned first
  • the target level is similar and will not be described here.
  • the tenant's resource multi-tenancy and sharing platform when the tenant's current activity level and the target activity level are not the first level, by comparing the tenant's current activity level with the target activity level, the tenant's resource multi-tenancy and sharing platform is realized.
  • the dynamic and differentiated allocation of occupied resources can save the resource occupancy rate of the resource multi-rent sharing platform while meeting the resource needs of tenants with different levels of activity, so that the resource multi-rent sharing platform can serve more users under the same system resources. Active tenants provide services.
  • the second level in this adjustment method is an active level higher than the first level above, specifically, the second level is used to represent the information interaction between the tenant and the resource multi-tenancy sharing platform within the period of time
  • the number has reached the first preset threshold but has not yet reached the second preset threshold.
  • the second preset threshold can also be customized. It can be the active level adjacent to the first level, or it can be the Active levels with non-adjacent levels are not limited in this application.
  • the second target level is an activity level higher than the above-mentioned second level.
  • the second target level is used to indicate that the number of information interactions between the tenant and the resource multi-tenancy and sharing platform reaches
  • the second preset threshold is defined.
  • those that reach the second preset threshold can be collectively referred to as the second target level.
  • the second target level can actually be further divided into more Small-grained grades (such as the second grade, the third grade, etc.), wherein each grade with a smaller granularity corresponds to a segment threshold interval, and the correspondence between each grade with a smaller granularity and the threshold interval is the same as the above-mentioned first
  • the target level is similar and will not be described here.
  • the tenant's resource multi-tenancy and sharing platform is realized.
  • the dynamic and differentiated allocation of occupied resources timely meets the increased demand for resources from tenants with increased activity. Compared with online migration, it reduces the impact on tenant business.
  • the specific implementation manner of determining the target activity level of the tenant according to the target request information may be: first, determine the target quantity of the target request information belonging to the same information type, for example, a certain information The number of target request information under the type is large, and the corresponding weight is also large; after that, the target weight corresponding to each information type is determined according to the target number, and an information type corresponds to a target weight; finally, according to the target quantity and target weight calculation The tenant's target activity level.
  • the tenant's target activity level is calculated based on the target quantity of the target request information belonging to the same information type and their corresponding target weights, which is achievable.
  • the target activity level can be further used as the new current activity level of the tenant, and the above steps can be repeated until the preset condition is reached, for example, it can be repeated until the preset condition is reached.
  • the duration can also be set repeatedly until the preset number of iterations is reached, which is not limited in this application.
  • the advantage of using the target activity level as the tenant’s new current activity level and repeating the above steps is that the current activity level of the tenant can be updated periodically, thereby realizing real-time and dynamic adjustment of the tenant’s resource allocation.
  • the preset information type includes at least any one of the following: connection, query, write, and subscription.
  • the connection is used to represent the connection between the tenant and the resource multi-tenancy sharing platform at the same moment (it can be the current moment or a certain moment in the past, which is not limited here).
  • the tenant is APP1
  • user a is a user of this APP1
  • user b is also a user of this APP1.
  • this APP1 will have two connections with this resource multi-tenancy sharing platform.
  • the number of users logging in to APP1 is the number of connections between APP1 and the resource multi-tenancy sharing platform (may be referred to as the number of connections for short).
  • Query is used to represent the tenant's read operation
  • write is used to represent at least one of the tenant's delete operation, update operation, and create operation
  • subscription is used to represent the subscription conditions established by the tenant.
  • some typical information types are selected as the preset information types, which can be customized based on actual needs, and can be adjusted at any time according to actual conditions, with flexibility and wide practicability.
  • the resource downgrade operation includes at least any one of the following: reducing service thread resources of the tenant, reducing subscription cache resources of the tenant, and reducing database connection resources of the tenant.
  • the degree of downgrading can be determined based on the target activity level.
  • the downgrading principle that should be observed is: the closer the second target activity level is to the first level of the inactive state, the greater the degree of reduction.
  • the specific downgrading method can be based on this The downgrading principle is self-defined and will not be described here.
  • the resource upgrade operation includes at least any one of the following: increasing service thread resources of the tenant, increasing subscription cache resources of the tenant, and increasing database connection resources of the tenant.
  • the upgrade degree can also be determined based on the second target activity level, and the upgrade principle that should be strictly followed is: the greater the level difference between the second target activity level and the second level, the greater the increase degree, and the specific upgrade The method can be customized based on this upgrade principle and will not be described here.
  • the second aspect of the embodiments of the present application provides a tenant management system, and the tenant management system has a function of implementing the method of the first aspect or any possible implementation manner of the first aspect.
  • This function may be implemented by hardware, or may be implemented by executing corresponding software on the hardware.
  • the hardware or software includes one or more modules corresponding to the above functions.
  • the third aspect of the embodiment of the present application provides a tenant management system, which may include a memory, a processor, and a bus system, wherein the memory is used to store programs, and the processor is used to call the programs stored in the memory to execute the first Aspect or a method of any possible implementation of the first aspect.
  • the fourth aspect of the embodiment of the present application provides a computer-readable storage medium, the computer-readable storage medium stores instructions, and when it is run on a computer, the computer can execute any one of the above-mentioned first aspect or the first aspect. method of possible implementation.
  • the fifth aspect of the embodiments of the present application provides a computer program, which, when running on a computer, causes the computer to execute the method of the above-mentioned first aspect or any possible implementation manner of the first aspect.
  • the sixth aspect of the embodiment of the present application provides a chip, the chip includes at least one processor and at least one interface circuit, the interface circuit is coupled to the processor, the at least one interface circuit is used to perform the function of sending and receiving, and send instructions to At least one processor, at least one processor is used to run computer programs or instructions, which has the function of realizing the method of the above-mentioned first aspect or any possible implementation manner of the first aspect, and this function can be realized by hardware or by software Realization can also be achieved through a combination of hardware and software, where the hardware or software includes one or more modules corresponding to the above functions.
  • the interface circuit is used to communicate with other modules outside the chip.
  • Fig. 1 is a schematic diagram of the system architecture provided by the embodiment of the present application.
  • FIG. 2 is a schematic flowchart of a resource management method for a tenant provided in an embodiment of the present application
  • Fig. 3 is a schematic diagram of the component structure provided by the embodiment of the present application.
  • FIG. 4 is a schematic flowchart of a resource upgrade scenario provided by an embodiment of the present application.
  • FIG. 5 is a schematic flowchart of a resource degradation scenario provided by an embodiment of the present application.
  • FIG. 6 is a schematic flowchart of resource release and data cold backup scenarios provided by the embodiment of the present application.
  • FIG. 7 is a schematic flowchart of resource recovery and data hot recovery scenarios provided by the embodiment of the present application.
  • FIG. 8 is a schematic structural diagram of a tenant management system provided by an embodiment of the present application.
  • FIG. 9 is a schematic structural diagram of a tenant management system provided by an embodiment of the present application.
  • the embodiment of the present application provides a tenant resource management method and a tenant management system, which are used to calculate the activity level of the tenant in the statistical period based on the request information of the tenant in the statistical period, and realize the reservation of different tenants based on the active level. Dynamic differentiated management of resources.
  • the embodiment of the present application can dynamically adjust resource allocation in real time according to the resource requirements of tenants, so as to avoid the waste of reserved resources by inactive tenants (that is, zombie tenants), so that in the case of the same system resources , the resource multi-tenancy sharing platform can host more tenants at the same time, which improves the ability of the resource multi-tenancy sharing platform to serve tenants, and minimizes the operating costs of zombie tenants.
  • the embodiment of the present application involves a lot of relevant knowledge about the multi-tenant shared resource platform.
  • the following first introduces the relevant terms and concepts that may be involved in the embodiment of the present application. It should be understood that the interpretation of related concepts may be limited due to the specific conditions of the embodiment of the application, but it does not mean that the application is limited to the specific conditions, and there may be differences in the specific conditions of different embodiments. Specifically, there is no limitation here.
  • the resource multi-tenancy sharing platform can also be referred to as the multi-tenancy sharing platform for short. It is used to rent server resources as shared resources to different tenants. It provides developers with zero operation and maintenance services, and developers can use them out of the box. , there is no need to build and maintain the acquired infrastructure, and you only need to pay according to the usage.
  • Serverless cloud development can also be called serverless service, serverless platform, etc. It belongs to a typical architecture of resource multi-tenant sharing platform. Serverless cloud development integrates host management, operating system management, resource allocation, expansion, and even all components of application logic. Outsource them, and treat them as some form of commodity—the serverless platform provider provides the service, and the developer pays for it.
  • Serverless is a complete process for building and managing a microservice-based architecture that allows developers to manage application deployment at the service deployment level rather than at the server deployment level.
  • the difference between it and the traditional architecture is that it is completely managed by a third party, triggered by events, and exists in a stateless (stateless), temporary storage (may only exist in the process of one call) computing container.
  • Building serverless applications means that developers can focus on the production code without having to manage and operate servers or runtimes in the cloud or on-premises. Serverless truly achieves the deployment of applications without involving infrastructure construction, and automatically builds, deploys, and starts services.
  • Figure 1 is a schematic diagram of the system architecture provided by the embodiment of the present application.
  • the system architecture provided by the embodiment of the present application can be divided into three levels from top to bottom, which are respectively the application layer (also called the layer), control layer, and resource layer, the following describes the three layers respectively:
  • the application layer is the user of the resource multi-tenancy sharing platform, which can also be called a tenant.
  • each APP is a tenant for the resource multi-tenancy sharing platform, for example, tenant 1, tenant 2, ..., tenant n, the tenant accesses the resource multi-tenancy sharing platform through a unified application programming interface (application programming interface, API).
  • API application programming interface
  • the control layer is the control core of the resource multi-tenancy and sharing platform, which is used to control the core business logic of the entire platform and implement the tenant resource management method provided by the embodiment of this application. For example, it can be used to implement: tenant connection management, tenant request information statistics , tenant activity level calculation, tenant resource adjustment, etc.
  • control layer implements the process of the resource management method for tenants provided in the embodiments of the present application in the form of a tenant management system, which will not be described in detail below.
  • the resource layer is a collection of physical resource nodes that store the physical data of tenants on the resource multi-tenant sharing platform, including database nodes and backup nodes.
  • the database node is the actual data storage node of all tenants who rent the resource multi-tenant sharing platform.
  • the granularity of the library level realizes resource isolation, and the backup node is a new node in the resource layer, which is used to store inactive tenants (that is, the number of information interactions with the resource multi-tenancy sharing platform within the cycle time does not reach the preset Threshold tenants can be collectively referred to as inactive tenants, also known as zombie tenants), the backup data is from the cold backup on the database node, after the cold backup is completed, the data of the inactive tenant on the database node Because the backup node has low operating costs and only provides basic storage for inactive tenants, it can reduce the cost of storing inactive tenant data on the database node.
  • control layer and the resource layer in the system architecture provided by the embodiment of the present application are logic modules of the resource multi-tenancy sharing platform, but in other implementations of the present application, the control layer It can also be deployed not on the resource multi-tenancy sharing platform, but on other independent servers or computer devices.
  • the specific embodiment of the present application does not limit the deployment method of the control layer, and FIG. 1 is only for illustration.
  • the additional backup node is also deployed on the resource multi-tenancy sharing platform, but in other implementations of this application, the backup node may not be deployed on the resource multi-tenancy sharing platform Instead, it is deployed independently.
  • the specific embodiment of the present application does not limit the deployment mode of the backup node, and FIG. 1 is only a schematic illustration.
  • the system architecture provided by the embodiments of the present application may not be divided into three levels, but may be divided into fewer (such as two layers) or more (such as , four layers, five layers, etc.), if the levels are divided into fewer levels, then the essence is to merge some of the three levels into one level, if it is divided into more levels, then the essence is Ah Jing Some of the three levels are divided into finer levels, and the specific embodiment of the present application does not limit the specific manner of dividing the levels of the system architecture.
  • FIG. 2 is a schematic flow chart of the resource management method for tenants provided by this embodiment of the application. Including the following steps:
  • the tenant management system obtains the request information (also called request event) of the tenant within the preset cycle time.
  • the request information sent by the tenant within the preset cycle time can be one or multiple. Do limited. It should be noted that in the embodiment of this application, the information sent by the tenant to the resource multi-tenancy sharing platform can be called request information, for example, information requesting access, information requesting subscription, information requesting storage, etc., specifically There is no limit here.
  • the cycle duration is preset, which can also be called a statistical cycle, and the tenant management system can be customized based on actual needs.
  • a fixed time cycle (such as every day, every The request information sent by tenants to the resource multi-rent sharing platform from Monday to Sunday, every month, etc.) can also be counted in the form of a sliding window (such as 1 day, 7 days, etc.) The request information sent by the rental and sharing platform.
  • this application does not limit the selection method of the cycle time.
  • the tenant management system may obtain one or more request information of the tenant within the cycle duration: if the current latest activity level is calculated, then the current cycle duration is obtained One or more request information within; if the activity level corresponding to a previous period is calculated, then one or more request information within the corresponding period is obtained, which is not specifically limited in this application.
  • the resource multi-tenant sharing platform in order to ensure the service quality of all tenants simultaneously accessing the resource multi-tenant sharing platform, the resource multi-tenant sharing platform also needs to pre-allocate certain resources for each single tenant ( That is, resource reservation), for example, pre-allocate two database connections for each tenant to ensure that all tenants can respond to tenant requests during concurrent access to provide efficient services.
  • resource reservation for example, pre-allocate two database connections for each tenant to ensure that all tenants can respond to tenant requests during concurrent access to provide efficient services.
  • the tenant management system After the tenant management system acquires one or more request information of the tenant within the period, it will further determine the target request information (also called an active event) from the obtained request information based on the preset information type. There may be one or more target request information, which is not limited in this application.
  • the information type is preset and can be customized based on actual needs.
  • the preset information type can at least include any of the following: connection, query, write, subscription, etc., where the connection is used to indicate that the tenant is at the same time (it can be the current time, or a certain time in the past, which is not limited here) and the resource multi-tenant sharing platform, as an example, assuming that the tenant is APP1, user a is a user of APP1, and user b is also a user of APP1 User, when user a and user b log in to APP1 at the same time, then APP1 will have two connections with the resource multi-tenant sharing platform.
  • the number of users logging in to APP1 is the number of connections between the APP1 and the resource multi-tenancy sharing platform (may be referred to as the number of connections for short).
  • the query is used to represent the tenant's read operation
  • the write is used to represent at least one of the tenant's delete operation, update operation, and create operation
  • the subscription is used to represent the subscription condition established by the tenant.
  • the tenant management system determines one or more target request information from the obtained request information based on the preset information type, it then determines the target activity level of the tenant according to the target request information.
  • the preset information types include connections, queries, writes, and subscriptions
  • the number of connections (represented by L), query volume (represented by Q), and writes within the period can be counted.
  • Incoming amount (represented by W) and subscription amount (represented by S) wherein, the number of connections L refers to the number of connections between the tenant and the resource multi-tenant sharing platform at the same time, and the query amount Q refers to the tenant's query (such as reading operation) operation quantity, the write quantity W refers to the quantity of write (for example, at least one of delete operation, update operation and create operation) operation of the tenant, and the subscription quantity S refers to the quantity of subscription conditions established by the tenant.
  • calculate the activity value of the tenant based on the activity algorithm shown in the following formula (1):
  • L, Q, W, and S are the independent variables of the function f, and A is the calculated value of the activity of the tenant.
  • the active algorithm can specifically obtain the weight corresponding to the information type according to the number of target request information belonging to the same information type, for example, the target request information under a certain information type If the number is large, the corresponding weight is also large.
  • the activity value of the tenant can be obtained based on the method shown in the following formula (2):
  • a1, a2, a3, and a4 are the weights of L, Q, W, and S respectively (may be referred to as target weights), and the specific value of the target weights is specifically based on the quantity of target request information belonging to the same information type (may be referred to as target weights). is determined by the value of L, Q, W, and S in formula (2), for example, the more the number of target request information belonging to the same information type, the value of the corresponding target weight Relatively bigger.
  • One type of information corresponds to one target weight, and finally it is calculated according to the number of target request information belonging to the same type of information (that is, the values of L, Q, W, and S) and the corresponding target weights (that is, a1, a2, a3, a4) Display the activity value of the tenant.
  • connection, query, writing and subscription are all taking the preset information types including connection, query, writing and subscription as examples to illustrate how to calculate the activity of the tenant.
  • the preset information type is other, or includes one or more of connection, query, write and subscription, then only need to correspond to the amount of target request information under the corresponding information type in formula (1) or formula (2) It can be replaced or deleted, and the specific calculation process is similar and will not be repeated here.
  • the active level can be divided into 2, or 3, 4, or more, and the specific division is based on actual needs.
  • the specific division method is not limited.
  • the adjustment methods include but are not limited to: resource upgrade, resource downgrade, release of the occupied resources of the tenant on the resource multi-tenant sharing platform after cold backup, re-allocation of resources for the tenant after hot recovery, etc.
  • the specific adjustment method is determined by the current activity level of the tenant and the calculated target activity level, which may include but not limited to the following adjustment methods:
  • the data of the database instance running on the resource multi-tenancy sharing platform of the tenant will be stored in the preset backup Perform cold backup on the node to obtain backup data, and then release the resources occupied by the tenant on the resource multi-tenant sharing platform (that is, release the tenant's database instance object, for example, release the tenant's thread pool, subscription cache pool, Dynamic resources such as connection pools, so that they no longer occupy resources on the database node).
  • release the tenant's database instance object for example, release the tenant's thread pool, subscription cache pool, Dynamic resources such as connection pools, so that they no longer occupy resources on the database node.
  • Dynamic resources such as connection pools
  • the first level is used to indicate that the tenant is in an inactive state, specifically used to indicate that the number of information interactions between the tenant and the resource multi-tenancy and sharing platform within the period of time has not reached the first preset threshold.
  • the first preset threshold is the dividing line for judging whether a tenant is an inactive tenant (that is, a zombie tenant) or an active tenant. If the first preset threshold is not reached, it is judged as an inactive tenant. If the first preset threshold is reached, it means that the tenant It is not an inactive tenant. In the embodiment of this application, those that reach the first preset threshold can be collectively referred to as the first target level.
  • the first target level can actually be further divided into smaller granularity levels (such as the second level, the third level, etc.), where each level with a smaller granularity corresponds to a segment threshold interval, for example, the threshold interval [y1, y2] corresponds to a subdivision level, and the threshold interval [y2 , y3] corresponds to another subdivision level, ..., and so on, the first target level can be divided into multiple levels, and the specific division method can be customized based on actual needs, which will not be described in detail in this application.
  • the target activity level is the first level and the current activity level is the first target level
  • other processing methods including but not Limited to: Migrate inactive tenants to database nodes with lower operating costs (for example, lower configuration and lower capacity), thereby reducing the maintenance cost of a single tenant and providing high-quality resources to high-active tenants.
  • Migrate inactive tenants to database nodes with lower operating costs (for example, lower configuration and lower capacity), thereby reducing the maintenance cost of a single tenant and providing high-quality resources to high-active tenants.
  • the tenant management system cold-backs up the tenant’s data on the resource multi-tenancy sharing platform to the backup node, and releases the occupied resources of the tenant on the resource multi-tenancy sharing platform.
  • the target activity level calculated by the tenant management system is the first target level, and the current activity level of the tenant is the first level, temporarily suspend the task of the tenant in order to realize the hot recovery operation of the tenant.
  • the specific operation process Including: create a new database instance on the resource multi-tenant sharing platform, and store the tenant’s backup data on the preset backup node (the backup data was in a previous cycle, and the tenant was in an inactive state obtained from cold backup, specifically the backup data is the latest backup data from the current moment) to the newly created database instance, and allocate resources corresponding to the first target level to the tenant on the multi-tenant sharing platform , that is, allocate new dynamic resources such as thread pool, subscription cache pool, and connection pool corresponding to the first target level to the tenant. These resources can be called target resources.
  • run the previously suspended Task that is, the task will be rerouted to the database node recovered for the tenant, and the hot recovery has been completed since then.
  • first level and the first target level is the same as that of the first level and the second target level in the first adjustment method above.
  • the first level in the first adjustment method above please refer to the first level in the first adjustment method above.
  • the description of the second target level we won’t go into details this time.
  • the tenant management system performs hot recovery of the backup data of the tenant on the backup node, and reallocates resources for the tenant.
  • the resource downgrade operation performed by the tenant management system includes at least any of the following: reducing the tenant's business thread resources, reducing the tenant's subscription cache resources, reducing the tenant's database connection resources, and so on.
  • the degree of downgrading can be determined based on the second target activity level. The principle of downgrading that should be observed is: the closer the second target activity level is to the first level of inactive state, the greater the degree of reduction.
  • the specific downgrading method can be Based on this downgrading principle, it is customized and will not be described here.
  • the second level is an active level higher than the above first level. Specifically, the second level is used to indicate that the number of information interactions between the tenant and the resource multi-tenancy and sharing platform within the cycle time has reached the A preset threshold but has not yet reached the second preset threshold, the second preset threshold can also be customized, it can be an active level adjacent to the first level, or not adjacent to the first level
  • the activity level is not limited in this application.
  • the following example is used to illustrate: Assuming that the first preset threshold is y1, then the threshold interval of the first level is [0, y1], then the The threshold intervals are divided into [y1, y2] (corresponding to a subdivision level), [y2, y3] (corresponding to another subdivision level), [y3, y4] (corresponding to another subdivision level), ..., and so on.
  • the second preset threshold is y2
  • the corresponding threshold interval of the second level is [y1, y2] in this case, the second level is an adjacent level of the first level; assuming that the second preset Let the threshold be y3, then the corresponding threshold interval of the second level can be [y1, y2], or [y2, y3], if the threshold interval of the second level is [y2, y3], in this case
  • the second level is a non-adjacent level of the first level; assuming that the second preset threshold is y4, then the corresponding threshold interval of the second level can be [y1, y2] or [y2, y3 ], it can also be [y3, y4], if the threshold interval of the second level is [y2, y3] or [y3, y4], in this case, the second level is not adjacent to the first level Level, ..., and so on, which will not be described here.
  • the second target level is an activity level higher than the above-mentioned second level. Specifically, the second target level is used to indicate that the number of information interactions between the tenant and the resource multi-tenancy and sharing platform reaches The second preset threshold is defined. In the embodiment of this application, those that reach the second preset threshold can be collectively referred to as the second target level.
  • the second target level can actually be further divided into more Small-grained grades (such as the second grade, the third grade, etc.), wherein each grade with a smaller granularity corresponds to a segment threshold interval, and the correspondence between each grade with a smaller granularity and the threshold interval is the same as the above-mentioned first
  • the target level is similar and will not be described here.
  • the tenant management system performs a resource downgrade operation on resources occupied by the tenant on the resource multi-tenancy sharing platform.
  • the tenant's resource multi-tenancy and sharing platform when the tenant's current activity level and the target activity level are not the first level, by comparing the tenant's current activity level with the target activity level, the tenant's resource multi-tenancy and sharing platform is realized.
  • the dynamic and differentiated allocation of occupied resources can save the resource occupancy rate of the resource multi-rent sharing platform while meeting the resource needs of tenants with different levels of activity, so that the resource multi-rent sharing platform can serve more users under the same system resources. Active tenants provide services.
  • the resource upgrade operation performed by the tenant management system includes at least any one of the following: increasing the tenant's business thread resources, increasing the tenant's subscription cache resources, increasing the tenant's database connection resources, and so on.
  • the upgrade degree can also be determined based on the second target activity level, and the upgrade principle that should be followed is: the greater the level difference between the second target activity level and the second level, the greater the increase degree, and the specific upgrade The method can be customized based on this upgrade principle and will not be described here.
  • the second level in this adjustment method is an active level higher than the above-mentioned first level.
  • the number of information interactions between resource multi-tenancy and sharing platforms has reached the first preset threshold but has not yet reached the second preset threshold.
  • the second preset threshold can also be customized, and it can be an active
  • the level may also be an active level not adjacent to the first level, which is not specifically limited in this application.
  • the second target level is an activity level higher than the above-mentioned second level. Specifically, the second target level is used to indicate that the number of information interactions between the tenant and the resource multi-tenancy and sharing platform reaches The second preset threshold is defined. In the embodiment of this application, those that reach the second preset threshold can be collectively referred to as the second target level.
  • the second target level can actually be further divided into more Small-grained grades (such as the second grade, the third grade, etc.), wherein each grade with a smaller granularity corresponds to a segment threshold interval, and the correspondence between each grade with a smaller granularity and the threshold interval is the same as the above-mentioned first
  • the target level is similar and will not be described here.
  • the tenant management system performs a resource upgrade operation on resources occupied by the tenant on the resource multi-tenancy sharing platform.
  • the tenant's resource multi-tenancy and sharing platform is realized.
  • the dynamic and differentiated allocation of occupied resources timely meets the increased demand for resources from tenants with increased activity. Compared with online migration, it reduces the impact on tenant business.
  • step 205 may also be included, that is, the tenant management system uses the target activity level as the new current activity level of the tenant, and repeatedly executes steps 201 to 205 until the preset level is reached.
  • the condition for example, may be repeated execution until a preset duration is reached, or repeated execution until a preset number of iterations is reached, which is not specifically limited in this application.
  • the advantage of using the target activity level as the new current activity level of the tenant and repeatedly executing steps 201 to 205 is that the current activity level of the tenant can be updated periodically, thereby realizing real-time and dynamic adjustment of the tenant.
  • this resource a variety of shared platform resources.
  • FIG. 3 is a component structure provided by the embodiment of the present application Schematic diagram, wherein, at the application layer, there are an access response module, a service execution module, and a storage execution module. These modules are all existing modules and do not involve the invention of the present application, so they will not be described in detail here.
  • a tenant event statistics module In the control layer, a tenant event statistics module, a tenant activity calculation module, a tenant resource scheduling module, a business resource control module, and a database resource control module are added.
  • the network resource control module is an existing module, and the network resource control module mainly uses To manage the communication and connection resources between the application layer and the resource layer, and manage the connection of various communication protocols; the business resource control module focuses on the scheduling of resources such as business threads, subscription cache management, and database connection resources; the database resource control module is responsible for the database Scheduling management of cold backup and hot recovery of instances; the tenant event statistics module is used to count the request information (that is, request events) of tenants within the period of time, and determine the target request information from the statistical request information based on the preset information type ( active event); the tenant activity calculation module is used to calculate the tenant’s activity and activity level according to the target request information, and the tenant resource scheduling module is used to dynamically adjust the tenant’s resources on the resource multi-tenancy sharing platform, such as releasing connection resources , Data cold backup or hot recovery.
  • the tenant event statistics module is used to count the request information (that is, request events) of tenants within the period of time, and determine the target request information from the statistical request information based on the
  • the database connection pool can further include a business thread pool, a subscription cache pool, and a storage connection pool.
  • the divided active levels are low (equivalent to the above-mentioned first level, which can also be called inactive), medium (also called normal), and high (also called high) These three levels are taken as an example to describe several main scenarios.
  • first level which can also be called inactive
  • medium also called normal
  • high also called high
  • the default activity level of each tenant is medium level. It should also be noted that, in the embodiment of this application, the change of tenant activity level is limited to changes in adjacent levels (changes in non-adjacent levels are also possible, but the disadvantage is that resource shocks may occur, and changes in adjacent levels A smooth transition of resource adjustments can be guaranteed).
  • FIG. 4 is a schematic flowchart of a resource upgrade scenario provided by the embodiment of the present application, which may specifically include the following steps:
  • the tenant event statistics module counts the request information of the tenant A within the statistical period Ts, and samples the respective quantities of target request information belonging to different information types.
  • the tenant event statistics module counts all the request information of tenant A within the statistical period Ts, and samples and collects the tenant's connection number Ln, query volume Qn, write volume Wn, and subscription volume Sn (that is, belonging to different information types) according to the preset information type type of target request information, which may be referred to simply as statistical data).
  • tenant A is any tenant who rents the resource multi-tenancy sharing platform within the statistical period.
  • the tenant event statistics module sends the tenant A's statistical data to the tenant activity calculation module.
  • the tenant event statistics module sends the statistics data of tenant A to the tenant activity calculation module.
  • the tenant activity calculation module calculates the target activity level of the tenant A in the current period, and sends the target activity level information to the tenant resource scheduling module.
  • the tenant activity calculation module uses the activity algorithm An to calculate the target activity level of tenant A in the current period, assuming that the calculated target activity level is high (ie high), and sends the target activity level information to the tenant resource scheduling module.
  • the active algorithm An may specifically be the active algorithm shown in the above formula (1) or formula (2).
  • the active algorithm An may specifically be the active algorithm shown in the above formula (1) or formula (2).
  • the tenant resource scheduling module reads the current cached activity level of tenant A, compares the current cached activity level with the target activity level, and triggers resource upgrade.
  • the tenant resource scheduling module reads that the activity level currently cached by tenant A (that is, the current activity level) is a medium level (that is, normal), compares it with the update information of the tenant activity calculation module, and finds that the latest activity of tenant A has increased, A resource upgrade operation is triggered, for example, at least one of tenant A's service thread resource, subscription cache resource, and database connection resource is added respectively.
  • FIG. 5 is a schematic flowchart of a resource degradation scenario provided by the embodiment of the present application, which may specifically include the following steps:
  • the tenant event statistics module counts the request information of the tenant A within the statistical period Ts, and samples the respective quantities of target request information belonging to different information types.
  • the tenant event statistics module counts all the request information of tenant A within the statistical period Ts, and samples and collects the tenant's connection number Ln, query volume Qn, write volume Wn, and subscription volume Sn (that is, belonging to different information types) according to the preset information type type of target request information, which may be referred to simply as statistical data).
  • tenant A is any tenant who rents the resource multi-tenancy sharing platform within the statistical period.
  • the tenant event statistics module sends the statistics data of tenant A to the tenant activity calculation module.
  • the tenant event statistics module sends the statistics data of tenant A to the tenant activity calculation module.
  • the tenant activity calculation module calculates the target activity level of the tenant A in the current period, and sends the target activity level information to the tenant resource scheduling module.
  • the tenant activity calculation module uses the activity algorithm An to calculate the target activity level of tenant A in the current period, assuming that the calculated target activity level is a medium level (ie normal), and sends the target activity level information to the tenant resource scheduling module.
  • the active algorithm An may specifically be the active algorithm shown in the above formula (1) or formula (2).
  • the active algorithm An may specifically be the active algorithm shown in the above formula (1) or formula (2).
  • the tenant resource scheduling module reads the current cached activity level of tenant A, compares the current cached activity level with the target activity level, and triggers resource downgrade.
  • the tenant resource scheduling module reads that the activity level currently cached by tenant A (i.e. the current activity level) is a high level (i.e. high), compares it with the update information of the tenant activity calculation module, and finds that the latest activity level of tenant A has decreased, then A resource downgrade operation is triggered, for example, at least one of tenant A's service thread resources, subscription cache resources, and database connection resources is respectively reduced.
  • Scenario 3 Tenant A resource release and data cold backup (from medium level to low level) adjustment steps.
  • FIG. 6 is a schematic flowchart of resource release and data cold backup scenarios provided by the embodiment of the present application, which may specifically include the following steps:
  • the tenant event statistics module counts the request information of the tenant A within the statistical period Ts, and samples the respective quantities of the target request information belonging to different information types.
  • the tenant event statistics module counts all the request information of tenant A within the statistical period Ts, and samples and collects the tenant's connection number Ln, query volume Qn, write volume Wn, and subscription volume Sn (that is, belonging to different information types) according to the preset information type type of target request information, which may be referred to simply as statistical data).
  • tenant A is any tenant who rents the resource multi-tenancy sharing platform within the statistical period.
  • the tenant event statistics module sends the statistics data of tenant A to the tenant activity calculation module.
  • the tenant event statistics module sends the statistics data of tenant A to the tenant activity calculation module.
  • the tenant activity calculation module calculates the target activity level of the tenant A in the current period, and sends information about the target activity level to the tenant resource scheduling module.
  • the tenant activity calculation module uses the activity algorithm An to calculate the target activity level of tenant A in the current period, assuming that the calculated target activity level is low level (ie inactive), and sends the information of the target activity level to the tenant resource scheduling module.
  • the active algorithm An may specifically be the active algorithm shown in the above formula (1) or formula (2).
  • the active algorithm An may specifically be the active algorithm shown in the above formula (1) or formula (2).
  • the tenant resource scheduling module reads the current cache activity level of tenant A, compares the current cache activity level with the target activity level, and triggers data cold backup for tenant A.
  • the tenant resource scheduling module reads that the activity level currently cached by tenant A (i.e. the current activity level) is medium level (i.e. normal), compares it with the update information of the tenant activity calculation module, and finds that the latest activity level of tenant A has decreased to not In the active state, it triggers data cold backup processing for tenant A. Specifically, the tenant resource scheduling module first issues a cold standby data backup of tenant A on the database node (that is, the database resource pool in FIG. 3 ) to the database resource control module. command, the database resource control module issues a backup command to the database instance of tenant A, backs up all its data to the backup node, and then releases the database instance object of tenant A so that it no longer occupies the resources on the database node.
  • the database node that is, the database resource pool in FIG. 3
  • the tenant resource scheduling module releases the resource occupied by tenant A on the database node.
  • the tenant resource scheduling module releases dynamic resources such as the thread pool, subscription cache pool, and connection pool of tenant A respectively.
  • Tenant A's resource release and data cold backup operations are completed, triggering the execution of the next iteration.
  • FIG. 7 is a schematic flowchart of resource recovery and data hot recovery scenarios provided by the embodiment of the present application, which may specifically include the following steps:
  • the tenant event statistics module counts the request information of the tenant A within the statistical period Ts, and samples the respective quantities of target request information belonging to different information types.
  • the tenant event statistics module counts all the request information of tenant A within the statistical period Ts, and samples and collects the tenant's connection number Ln, query volume Qn, write volume Wn, and subscription volume Sn (that is, belonging to different information types) according to the preset information type type of target request information, which may be referred to simply as statistical data).
  • tenant A is any tenant who rents the resource multi-tenancy sharing platform within the statistical period.
  • the tenant event statistics module sends the statistics data of tenant A to the tenant activity calculation module.
  • the tenant event statistics module sends the statistics data of tenant A to the tenant activity calculation module.
  • the tenant activity calculation module calculates the target activity level of tenant A in the current period, and sends the information of the target activity level to the tenant resource scheduling module.
  • the tenant activity calculation module uses the activity algorithm An to calculate the target activity level of tenant A in the current period, assuming that the calculated target activity level is a medium level (ie normal), and sends the target activity level information to the tenant resource scheduling module.
  • the active algorithm An may specifically be the active algorithm shown in the above formula (1) or formula (2).
  • the active algorithm An may specifically be the active algorithm shown in the above formula (1) or formula (2).
  • the tenant resource scheduling module reads the current cache activity level of tenant A, compares the current cache activity level with the target activity level, and triggers data hot recovery for tenant A.
  • the tenant resource scheduling module reads that the activity level currently cached by tenant A (that is, the current activity level) is low (that is, inactive), compares it with the update information of the tenant activity calculation module, and finds that the latest activity level of tenant A is from inactive to If the status rises, it triggers data hot recovery for Tenant A.
  • the tenant resource scheduling module notifies the service execution module to suspend the task of tenant A.
  • the tenant resource scheduling module issues the hot recovery instruction of tenant A to the database resource control module.
  • the tenant resource scheduling module issues a hot recovery instruction for tenant A to the database resource control module, and creates a new database instance on the database node, and then restores the backup data of tenant A on the backup node to the newly created database instance.
  • the tenant resource scheduling module re-allocates new resources for tenant A.
  • the tenant resource scheduling module re-allocates dynamic resources such as new thread pools, subscription cache pools, and connection pools to the middle level for tenant A.
  • the tenant resource scheduling module notifies the service execution module to resume the suspended task.
  • the tenant resource scheduling module notifies the business execution module to restore the suspended task, and the restored task will be rerouted to the restored database node for tenant A.
  • Tenant A's resource recovery and data hot recovery operations are completed, triggering the execution of the next iteration.
  • Table 1 shows the methods and methods of the embodiments of the present application
  • 50% of the users in the cluster are inactive zombie tenants (that is, the first level or inactive) as an example
  • the number of tenants supported by the resource multi-tenancy sharing platform in the prior art is N.
  • the method can reclaim half of the database instance resources, and can increase the number of tenants that the system can serve for N/2, greatly increasing the number of tenants that the cluster can carry, thereby reducing the operating cost of a single tenant.
  • FIG. 8 is a schematic structural diagram of a tenant management system provided by an embodiment of the present application.
  • the tenant management system 800 may specifically include: a statistics module 801, a determination module 802, a calculation module 803, and an adjustment module 804, wherein, A statistical module 801, configured to obtain one or more request information of tenants within a period; a determination module 802, configured to determine one or more target request information from the request information based on a preset information type; a calculation module 803, It is used to determine the target activity level of the tenant according to the target request information; the adjustment module 804 is used to adjust the resource multi-tenancy of the tenant according to the target activity level when the current activity level of the tenant is different from the target activity level. Share platform resources.
  • the statistical module 801, the determination module 802, and the calculation module 803 in the tenant management system 800 calculate the activity level of the tenant in the statistical period based on the request information of the tenant in the statistical period, and the adjustment module 804 is based on The active level realizes dynamic and differentiated management of resources reserved by different tenants.
  • resources are no longer reserved for inactive tenants on the resource multi-tenancy sharing platform, or when a tenant is downgraded from active to inactive In the state, the tenant’s resources occupied by the tenant on the resource multi-tenant sharing platform will be taken back to minimize the operating costs of zombie tenants.
  • the adjustment module 804 is specifically configured to: when the target activity level is the first level and the current activity level is the first target level, place the tenant on the resource multi-tenancy sharing platform The data of the running database instance is cold backed up on the preset backup node to obtain the backup data, wherein the first level is used to represent the number of information interactions between the tenant and the resource multi-tenancy sharing platform within the period.
  • the first target level is used to indicate that the number of information interactions between the tenant and the resource multi-tenancy sharing platform within the period reaches the first preset threshold; finally, the tenant is released
  • the resource occupied by the multi-tenant sharing platform is to release the tenant’s database instance object, for example, release the tenant’s thread pool, subscription cache pool, connection pool and other dynamic resources so that they no longer occupy resources on the database node.
  • the adjustment module 804 can dynamically adjust the resource allocation of the resource multi-tenancy sharing platform according to the actual operation of the tenant (that is, determine whether it is active). Resources are reserved for inactive tenants on the sharing platform, or when a tenant is degraded to an inactive state, the resources occupied by the tenant on the resource multi-tenancy sharing platform are taken back. Therefore, under the condition of the same system resources, it can provide services for more tenants and minimize the operating costs of inactive tenants. In addition, it is more friendly and applicable to tenant business than the scheme of automatic inventory clearance after expiration.
  • the adjustment module 804 is further configured to: when the target activity level is the first target level and the current activity level is the first level, suspend the tenant's task, and The resource multi-tenancy sharing platform creates a new database instance, wherein the first level is used to indicate that the number of information interactions between the tenant and the resource multi-tenancy sharing platform within the period does not reach the first preset threshold, the The first target level is used to indicate that the number of information interactions between the tenant and the resource multi-tenant sharing platform within the period reaches the first preset threshold; after that, the information stored on the preset backup node corresponding to the tenant The backup data of the database is restored to the new database instance, and the target resource of the resource multi-tenant sharing platform corresponding to the first target level is allocated to the tenant; finally, the task of the tenant is run based on the target resource.
  • the adjustment module 804 when the tenant becomes active again, the adjustment module 804 re-establishes a connection for the tenant, and performs mirroring and hot recovery of the backup data of the tenant on the backup node to realize fast online and zero business of the tenant. Perception improves user experience.
  • the adjustment module 804 is specifically further configured to: when the target activity level is the second level and the current activity level is the second target level, the resource multi-tenant sharing platform for the tenant The resources occupied by the network are degraded, and the second level is used to indicate that the amount of information interaction between the tenant and the resource multi-tenancy and sharing platform within the period reaches the first preset threshold but does not reach the second preset threshold.
  • a threshold is set, and the second target level is used to indicate that the amount of information interaction between the tenant and the resource multi-tenancy and sharing platform within the period reaches the second preset threshold.
  • the adjustment module 804 realizes the resource multi-tenancy of the tenant by comparing the tenant's current activity level with the target activity level.
  • the dynamic and differentiated configuration of occupied resources on the shared platform so as to meet the resource requirements of tenants with different levels of activity, save resources
  • the resource occupancy rate of the multi-tenant shared platform enables the resource multi-tenant shared platform to be able to use the same system resources Serve more active tenants.
  • the adjustment module 804 is specifically further configured to: when the target activity level is the second target level and the current activity level is the second level, the resource multi-tenant sharing platform for the tenant
  • the resources occupied by the network are upgraded, and the second level is used to indicate that the amount of information interaction between the tenant and the resource multi-tenancy and sharing platform within the period reaches the first preset threshold but does not reach the second preset threshold.
  • a threshold is set, and the second target level is used to indicate that the amount of information interaction between the tenant and the resource multi-tenancy and sharing platform within the period reaches the second preset threshold.
  • the adjustment module 804 realizes the resource multi-tenancy of the tenant by comparing the tenant's current activity level with the target activity level.
  • the dynamic and differentiated allocation of resources occupied on the shared platform timely meets the increased demand for resources from tenants with increased activity, and reduces the impact on tenant business compared to online migration.
  • the calculation module 803 is specifically configured to: firstly determine the target number of target request information belonging to the same information type, and determine the target weight corresponding to each information type according to the target number, one information type Corresponding to a target weight, and finally calculate the target activity level of the tenant according to the target quantity and the target weight.
  • the calculation module 803 calculates the target activity level of the tenant based on the target quantity of the target request information belonging to the same information type and the respective target weights, which is achievable.
  • the tenant management system 800 also includes a trigger execution module 805, configured to: use the target activity level as the tenant's new current activity level, trigger the statistics module 801, the determination module 802, the calculation Module 803 and the adjustment module 804 repeatedly execute respective steps.
  • the preset information type includes at least any one of the following: connection, query, write, and subscription.
  • the connection is used to represent the connection between the tenant and the resource multi-tenancy sharing platform at the same moment (it can be the current moment or a certain moment in the past, which is not limited here).
  • the tenant is APP1
  • user a is a user of this APP1
  • user b is also a user of this APP1.
  • this APP1 will have two connections with this resource multi-tenancy sharing platform.
  • the number of users logging in to APP1 is the number of connections between APP1 and the resource multi-tenancy sharing platform (may be referred to as the number of connections for short).
  • the query is used to represent the tenant's read operation
  • the write is used to represent at least one of the tenant's delete operation, update operation, and create operation
  • the subscription is used to represent the subscription condition established by the tenant.
  • some typical information types are selected as the preset information types, which can be customized based on actual needs, and can be adjusted at any time according to actual conditions, with flexibility and wide practicability.
  • the resource downgrade operation includes at least any one of the following: reducing the tenant's business thread resources, reducing the tenant's subscription cache resources, and reducing the tenant's database connection resources.
  • the degree of downgrading can be determined based on the target activity level. The downgrading principle that should be observed is: the closer the second target activity level is to the first level of the inactive state, the greater the degree of reduction.
  • the specific downgrading method can be based on this The downgrading principle is self-defined and will not be described here.
  • the resource upgrade operation includes at least any one of the following: increasing the tenant's business thread resources, increasing the tenant's subscription cache resources, and increasing the tenant's database connection resources.
  • the upgrade degree can also be determined based on the second target activity level, and the upgrade principle that should be strictly followed is: the greater the level difference between the second target activity level and the second level, the greater the increase degree, and the specific upgrade The method can be customized based on this upgrade principle and will not be described here.
  • FIG. 9 is a schematic structural diagram of the tenant management system provided by the embodiment of this application.
  • the modules involved in the tenant management system 800 described in the embodiment are used to implement the functions of the tenant management system 800 in the embodiment corresponding to FIG. 8 .
  • the tenant management system 900 is implemented by one or more servers. Larger differences can be produced due to different configurations or performances, and can include one or more central processing units (central processing units, CPU) 922 and memory 932, one or more storage media 930 for storing application programs 942 or data 944 (such as one or more mass storage devices). Wherein, the memory 932 and the storage medium 930 may be temporary storage or persistent storage.
  • the program stored in the storage medium 930 may include one or more modules (not shown in the figure), and each module may include a series of instruction operations for the tenant management system 900 .
  • the central processor 922 may be configured to communicate with the storage medium 930 , and execute a series of instruction operations in the storage medium 930 on the tenant management system 900 .
  • the tenant management system 900 may also include one or more power supplies 926, one or more wired or wireless network interfaces 950, one or more input and output interfaces 958, and/or, one or more operating systems 941, such as Windows ServerTM, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM, etc.
  • the central processing unit 922 is configured to execute the steps performed by the tenant management system in the embodiment corresponding to FIG. 2 .
  • the central processing unit 922 can be used to: Firstly, obtain the request information (also called a request event) of the tenant within the preset cycle duration, and the request information sent by the tenant within the preset cycle duration can be one or There are multiple numbers, which are not limited here.
  • the information sent by the tenant to the resource multi-tenancy sharing platform can be called request information, for example, information requesting access, information requesting subscription, information requesting storage, etc., specifically There is no limit here.
  • the target request information (also called an active event) will be further determined from the obtained request information based on the preset information type.
  • the determined target request information There may be one or more than one, which is not limited in this application.
  • the target activity level of the tenant is determined according to the target request information.
  • the tenant After calculating the target activity level of the tenant, if the current activity level of the tenant is different from the target activity level, the tenant’s resources on the resource multi-tenancy sharing platform will be adjusted according to the calculated target activity level.
  • the adjustment methods include but Not limited to: resource upgrade, resource downgrade, release of resources occupied by the tenant on the resource multi-tenant sharing platform after cold backup, re-allocation of resources for the tenant after hot recovery, etc.
  • the specific adjustment method is determined by the tenant's current activity level and the calculated target activity level.
  • the device embodiments described above are only illustrative, and the units described as separate components may or may not be physically separated, and the components shown as units may or may not be A physical unit can be located in one place, or it can be distributed to multiple network units. Part or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
  • the connection relationship between the modules indicates that they have communication connections, which can be specifically implemented as one or more communication buses or signal lines.
  • the essence of the technical solution of this application or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product is stored in a readable storage medium, such as a floppy disk of a computer , U disk, mobile hard disk, read-only memory (read-only memory, ROM), random access memory (random access memory, RAM), magnetic disk or optical disk, etc., including several instructions to make a computer device (which can be A personal computer, or a network device, etc.) executes the methods described in various embodiments of the present application.
  • a computer device which can be A personal computer, or a network device, etc.
  • all or part of them may be implemented by software, hardware, firmware or any combination thereof.
  • software When implemented using software, it may be implemented in whole or in part in the form of a computer program product.
  • the computer program product includes one or more computer instructions.
  • the computer can be a general purpose computer, a special purpose computer, a computer network, or other programmable devices.
  • the computer instructions may be stored in or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions may be transferred from a website, computer, training device, or data
  • the center transmits to another website site, computer, training device or data center via wired (eg, coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (eg, infrared, wireless, microwave, etc.).
  • wired eg, coaxial cable, fiber optic, digital subscriber line (DSL)
  • wireless eg, infrared, wireless, microwave, etc.
  • the computer-readable storage medium may be any available medium that can be stored by a computer, or a data storage device such as a training device or a data center integrated with one or more available media.
  • the available medium may be a magnetic medium (such as a floppy disk, a hard disk, or a magnetic tape), an optical medium (such as a DVD), or a semiconductor medium (such as a solid state disk (solid state disk, SSD)), etc.

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

一种租户的资源管理方法及租户管理系统,可应用于云计算领域,该方法包括:获取租户在周期时长内的一个或多个请求信息(201),并基于预设的信息类型从请求信息中确定一个或多个目标请求信息(202),再根据目标请求信息确定租户的目标活跃等级(203),在租户的当前活跃等级与目标活跃等级不同的情况下,根据目标活跃等级调整租户在资源多租共享平台的资源(204)。该方法基于统计周期内租户的请求信息计算租户在统计周期内的活跃等级,并基于活跃等级实现对不同租户预留资源的动态差异化管理,避免出现不活跃租户(即僵尸租户)对预留资源浪费的情况,使得在相同系统资源的情况下资源多租共享平台能同时承载更多租户,最大化降低僵尸租户的运营成本。

Description

一种租户的资源管理方法及租户管理系统
本申请要求于2021年7月14日提交中国专利局、申请号为202110797687.6、申请名称为“一种租户的资源管理方法及租户管理系统”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及云计算领域,尤其涉及一种租户的资源管理方法及租户管理系统。
背景技术
云服务涌现了很多改变传统IT架构和运维方式的新技术,比如,虚拟机、容器、微服务等,但无论这些技术应用在哪些场景,降低成本、提升效率是云服务永恒的主题。基于此,多租共享资源平台(如,无服务器(serverless)云开发,也可称为serverless服务、serverless平台等)成为云服务的研究热点,相比传统开发模式,多租共享资源平台免去了开发者构建并维护后台服务的工作,无需构建维护后台的基础设施,从而可实现业务的快速上线和迭代,大幅减低了开发成本。按量收费是多租共享资源平台的特色,即只有开发者产生了实际的读写操作、存储等时,才需要交费,以serverless服务为例,当开发者开通serverless服务后,如果不操作或者用量很小(免费额度内),不会产生任何费用,但会消耗serverless平台商的运营成本。因此,如何有效控制资源成本,支撑海量大型、小型,尤其是免费租户(如,应用程序(application,APP))接入,是每个serverless平台商重点关注的问题。
业界管理租户在多租共享资源平台的资源一般有2种方式,方式1、租户资源不做预留,即按照各租户对资源的使用优先级对资源进行实时调度,优先级高的优先使用资源。方式2、提前给租户预留一定资源上限,租户公平使用资源。
然而,上述两种方式各有缺点:方式1虽然能够根据租户的当前需求,实时调整资源分配,但容易导致资源抢占,优先级低的租户可能长期处于排队等候的状态;而方式2虽然避免了租户间的资源抢占,但存在完全不活跃的僵尸租户对预留资源浪费的情况。
发明内容
本申请实施例提供了一种租户的资源管理方法及租户管理系统,用于基于统计周期内租户的请求信息来计算租户在该统计周期内的活跃等级,并基于活跃等级实现对不同租户预留资源的动态差异化管理,本申请实施例能够根据租户的资源需求实时动态调整资源分配,从而避免出现不活跃租户(即僵尸租户)对预留资源浪费的情况,使得在相同系统资源的情况下,该资源多租共享平台能同时承载更多租户,提高了资源多租共享平台服务租户的能力,且最大化降低僵尸租户的运营成本。
基于此,本申请实施例提供以下技术方案:
第一方面,本申请实施例首先提供一种租户的资源管理方法,可用于云计算领域中,该方法包括:首先,获取租户在预设的周期时长内的请求信息(也可称为请求事件),在预设周期时长内租户发送的请求信息可以是一个,也可以是多个,此处不做限定。需要说明 的是,在本申请实施例中,租户向资源多租共享平台发送的信息都可称为请求信息,例如,请求接入的信息、请求订阅的信息、请求存储的信息等等,具体此处不做限定。在获取租户在周期时长内的一个或多个请求信息之后,将进一步基于预设的信息类型从获取到的这些请求信息中确定目标请求信息(也可称为活跃事件),确定的目标请求信息可以是一个,也可以是多个,具体本申请对此不做限定。在基于预设的信息类型从获取到的请求信息中确定出一个或多个目标请求信息之后,再根据目标请求信息确定该租户的目标活跃等级。在计算得到该租户的目标活跃等级后,如果该租户的当前活跃等级与该目标活跃等级不同,则根据计算得到的目标活跃等级调整该租户在资源多租共享平台上的资源,调整方式包括但不限于:资源升级、资源降级、冷备份后释放该租户在资源多租共享平台上的占用资源、热恢复后重新为该租户分配资源等。具体的调整方式由租户的当前活跃等级以及计算得到的目标活跃等级来确定。
在本申请上述实施方式中,基于统计周期内租户的请求信息来计算租户在该统计周期内的活跃等级,并基于活跃等级实现对不同租户预留资源的动态差异化管理,即基于租户在该统计周期内的活跃等级调整该租户在资源多租共享平台上的资源,调整方式包括但不限于:资源升级、资源降级、冷备份后释放该租户在资源多租共享平台上的占用资源、热恢复后重新为该租户分配资源等,本申请实施例能够根据租户的资源需求实时动态调整资源分配,从而避免出现不活跃租户(即僵尸租户)对预留资源浪费的情况,使得在相同系统资源的情况下,该资源多租共享平台能同时承载更多租户,提高了资源多租共享平台服务租户的能力,且最大化降低僵尸租户的运营成本。
在第一方面的一种可能的实现方式中,若计算得到的目标活跃等级为第一等级,且该租户当前的活跃等级为第一目标等级,则将该租户在资源多租共享平台上运行的数据库实例的数据在预设的备份节点上进行冷备份,得到备份数据,之后,再释放该租户在该资源多租共享平台上占用的资源(即释放该租户的数据库实例对象,例如,释放该租户的线程池、订阅缓存池、连接池等动态资源,使其不再占用数据库节点上的资源)。需要注意的是,数据库实例实质可看做是一个数据库进程,实例则是进程里面的一个database实例,根据数据库的架构不同数据库实例的表现形式会有所不同,此处不予赘述。这里需要说明的是,第一等级用于表示该租户处于不活跃状态,具体用于表征该租户在周期时长内与资源多租共享平台之间信息交互的数量没有达到第一预设阈值,该第一预设阈值就是判断租户是不活跃租户(即僵尸租户)还是活跃租户的分界线,未达到该第一预设阈值则判定为不活跃租户,达到该第一预设阈值则说明该租户不是不活跃租户,在本申请实施例中,达到该第一预设阈值的可以统称为第一目标等级,具体地,基于不同的划分方式,第一目标等级实际还可进一步划分为更小粒度的等级(如,第二等级、第三等级等),其中,每个更小粒度的等级均各自对应段阈值区间,例如,阈值区间[y1,y2]对应一个细分等级,阈值区间[y2,y3]对应另一个细分等级,……,以此类推,可将第一目标等级又划分为多个等级,具体的划分方式可基于实际需求自定义,本申请对此不予赘述。
在本申请上述实施方式中,由于在资源多租共享平台按量收费的情况下,很多不活跃租户(即僵尸租户)长期占用连接、缓存、database实例资源,最终制约该资源多租共享平 台的租户数量,而不活跃租户也不能给平台提供商带来流量进而贡献流水,这极大的增加了平台提供商的运营成本,因此,本申请实施例可以根据租户的实际运行情况(即判定是否活跃),动态调整资源多租共享平台的资源分配。在本申请实施例中,即不再在资源多租共享平台上为不活跃租户预留资源,或当租户降为不活跃状态时,收回该租户在资源多租共享平台上该租户的占用资源。因此在相同系统资源情况下,资源多租共享平台能为更多租户提供服务,最大化降低不活跃租户的运营成本,此外,相比那种超期自动清库的方案,对租户业务又更友好、更适用。
在第一方面的一种可能的实现方式中,若计算得到的目标活跃等级为第一目标等级,且该租户当前的活跃等级为第一等级,则将该租户的任务暂时挂起,以便对该租户实现热恢复操作,具体操作过程包括:在该资源多租共享平台创建一个新的数据库实例,并将存储于预设的备份节点上的该租户的备份数据(该备份数据是在之前某个周期内,该租户处于不活跃状态时冷备份得到的,具体该备份数据为距离当前时刻最近一次的备份数据)恢复到这个新创建的数据库实例中,并为该租户分配与该第一目标等级对应的资源多租共享平台的资源,即为该租户分配新的与该第一目标等级对应的线程池、订阅缓存池、连接池等动态资源,该资源可称为目标资源,最后,再基于目标资源运行该租户之前挂起的任务,即任务会重新路由到为该租户恢复的数据库节点上,自此热恢复完成。需要注意的是,在本申请实施例中,第一等级以及第一目标等级的含义与上述类似,此处不予赘述。
在本申请上述实施方式中,当租户重新活跃时,则为该租户重新建联,并通过对备份节点上该租户的备份数据进行镜像热恢复,实现了快速上线以及租户的业务零感知,提升了用户体验。
在第一方面的一种可能的实现方式中,若计算得到的目标活跃等级为第二等级,且该租户当前的活跃等级为第二目标等级,则对该租户在资源多租共享平台上占用的资源进行资源降级操作。这里需要说明的是,第二等级为高于上述第一等级的活跃等级,具体地,第二等级用于表征该租户在周期时长内与资源多租共享平台之间信息交互的数量达到了第一预设阈值但还没有达到第二预设阈值,该第二预设阈值也可自定义,可以是与该第一等级相邻的活跃等级,也可以是与该第一等级不相邻的活跃等级,具体本申请对此不作限定。还需要说明的是,第二目标等级为高于上述第二等级的活跃等级,具体地,第二目标等级用于表征该租户在周期时长内与资源多租共享平台之间信息交互的数量达到了第二预设阈值,在本申请实施例中,达到该第二预设阈值的可以统称为第二目标等级,具体地,基于不同的划分方式,第二目标等级实际还可进一步划分为更小粒度的等级(如,第二等级、第三等级等),其中,每个更小粒度的等级均各自对应段阈值区间,每个更小粒度的等级与阈值区间的对应方式与上述第一目标等级类似,此处不予赘述。
在本申请上述实施方式中,在租户的当前活跃等级和目标活跃等级都不为第一等级的情况下,通过对租户当前活跃等级与目标活跃等级的比较,实现租户在资源多租共享平台上占用资源的动态差异化配置,从而在能满足不同活跃程度租户的资源需求的情况下,节约资源多租共享平台的资源占用率,使得资源多租共享平台在相同的系统资源下能为更多活跃的租户提供服务。
在第一方面的一种可能的实现方式中,若计算得到的目标活跃等级为第二目标等级,且该租户当前的活跃等级为第二等级,则对该租户在资源多租共享平台上占用的资源进行资源升级操作。同样需要说明的是,该调整方式中的第二等级为高于上述第一等级的活跃等级,具体地,第二等级用于表征该租户在周期时长内与资源多租共享平台之间信息交互的数量达到了第一预设阈值但还没有达到第二预设阈值,该第二预设阈值也可自定义,可以是与该第一等级相邻的活跃等级,也可以是与该第一等级不相邻的活跃等级,具体本申请对此不作限定。还需要说明的是,第二目标等级为高于上述第二等级的活跃等级,具体地,第二目标等级用于表征该租户在周期时长内与资源多租共享平台之间信息交互的数量达到了第二预设阈值,在本申请实施例中,达到该第二预设阈值的可以统称为第二目标等级,具体地,基于不同的划分方式,第二目标等级实际还可进一步划分为更小粒度的等级(如,第二等级、第三等级等),其中,每个更小粒度的等级均各自对应段阈值区间,每个更小粒度的等级与阈值区间的对应方式与上述第一目标等级类似,此处不予赘述。
在本申请上述实施方式中,在租户的当前活跃等级和目标活跃等级都不为第一等级的情况下,通过对租户当前活跃等级与目标活跃等级的比较,实现租户在资源多租共享平台上占用资源的动态差异化配置,及时满足了活跃度升高的租户对所需资源增大的需求,相比于在线迁移的方式,降低了对租户业务的影响。
在第一方面的一种可能的实现方式中,根据目标请求信息确定租户的目标活跃等级的具体实现方式可以是:首先,确定属于同一信息类型的目标请求信息的目标数量,例如,某个信息类型下的目标请求信息数量多,其对应的权重也大;之后,根据目标数量确定与每个信息类型各自对应的目标权重,一个信息类型对应一个目标权重;最后,根据目标数量与目标权重计算租户的目标活跃等级。
在本申请上述实施方式中,具体阐述了是基于属于同一信息类型的目标请求信息的目标数量以及各自对应的目标权重来计算租户的目标活跃等级,具备可实现性。
在第一方面的一种可能的实现方式中,还可以进一步将该目标活跃等级作为该租户新的当前活跃等级,重复执行上述步骤,直至达到预设条件,例如,可以是重复执行直至达到预设时长,也可以是重复执行直至达到预设迭代次数,具体本申请对此不做限定。
在本申请实施例中,将目标活跃等级做该租户新的当前活跃等级,并重复执行上述步骤的好处在于:可周期性更新租户当前的活跃等级,从而实现了实时、动态调整租户在该资源多种共享平台的资源。
在第一方面的一种可能的实现方式中,预设的信息类型至少包括如下任意一种:连接、查询、写入、订阅。其中,连接用于表征该租户在同一时刻(可以是当前时刻,也可以是过去某个时刻,此处不做限定)与资源多租共享平台的连接,作为一种示例,假设该租户为APP1,用户a是该APP1的用户,用户b也是该APP1的用户,当用户a与用户b同时登入该APP1时,那么该APP1就会与该资源多租共享平台有2个连接,由于APP1除了用户a和用户b之外,还可能有其他更多用户,因此,在同一时刻,用户登入到APP1的数量就是该APP1与该资源多租共享平台的连接的数量(可简称为连接数)。查询则用于表征该租户的读取操作,写入则用于表征该租户的删除操作、更新操作、创建操作中的至少一 项,订阅则用于表征该租户建立的订阅条件。
在本申请上述实施方式中,选取一些典型的信息类型作为预设的信息类型,具体可基于实际需求自定义,且可根据实际情况随时进行调整,具备灵活性和广泛实用性。
在第一方面的一种可能的实现方式中,资源降级操作至少包括如下任意一种:减少所述租户的业务线程资源、减少所述租户的订阅缓存资源、减少所述租户的数据库连接资源。具体地,降级程度可基于目标活跃等级来确定,应准守的降级原则是:第二目标活跃等级越接近不活跃状态的第一等级,则减少程度越大,具体的降级方式则可基于这个降级原则自定义,此处不予赘述。
在本申请上述实施方式中,具体阐述了几种资源降级操作的具体实现方式,具体可基于实际需求自定义如何降级,具备可选择性。
在第一方面的一种可能的实现方式中,资源升级操作至少包括如下任意一种:增加所述租户的业务线程资源、增加所述租户的订阅缓存资源、增加所述租户的数据库连接资源。类似地,升级程度也可基于第二目标活跃等级来确定,应准守的升级原则是:第二目标活跃等级与第二等级之间的等级差越大,则增加程度越大,具体的升级方式则可基于这个升级原则自定义,此处不予赘述。
在本申请上述实施方式中,具体阐述了几种资源升级操作的具体实现方式,具体可基于实际需求自定义如何升级,具备可选择性。
本申请实施例第二方面提供一种租户管理系统,该租户管理系统具有实现上述第一方面或第一方面任意一种可能实现方式的方法的功能。该功能可以通过硬件实现,也可以通过硬件执行相应的软件实现。该硬件或软件包括一个或多个与上述功能相对应的模块。
本申请实施例第三方面提供一种租户管理系统,可以包括存储器、处理器以及总线系统,其中,存储器用于存储程序,处理器用于调用该存储器中存储的程序以执行本申请实施例第一方面或第一方面任意一种可能实现方式的方法。
本申请实施例第四方面提供一种计算机可读存储介质,该计算机可读存储介质中存储有指令,当其在计算机上运行时,使得计算机可以执行上述第一方面或第一方面任意一种可能实现方式的方法。
本申请实施例第五方面提供了一种计算机程序,当其在计算机上运行时,使得计算机执行上述第一方面或第一方面任意一种可能实现方式的方法。
本申请实施例第六方面提供了一种芯片,该芯片包括至少一个处理器和至少一个接口电路,该接口电路和该处理器耦合,至少一个接口电路用于执行收发功能,并将指令发送给至少一个处理器,至少一个处理器用于运行计算机程序或指令,其具有实现如上述第一方面或第一方面任意一种可能实现方式的方法的功能,该功能可以通过硬件实现,也可以通过软件实现,还可以通过硬件和软件组合实现,该硬件或软件包括一个或多个与上述功能相对应的模块。此外,该接口电路用于与该芯片之外的其它模块进行通信。
附图说明
图1为本申请实施例提供的系统架构的一个示意图;
图2为本申请实施例提供的租户的资源管理方法的一个流程示意图;
图3为本申请实施例提供的组件结构的一个示意图;
图4为本申请实施例提供的资源升级场景的一个流程示意图;
图5为本申请实施例提供的资源降级场景的一个流程示意图;
图6为本申请实施例提供的资源释放以及数据冷备份场景的一个流程示意图;
图7为本申请实施例提供的资源恢复以及数据热恢复场景的一个流程示意图;
图8为本申请实施例提供的一种租户管理系统的结构示意图;
图9为本申请实施例提供的租户管理系统的一种结构示意图。
具体实施方式
本申请实施例提供了一种租户的资源管理方法及租户管理系统,用于基于统计周期内租户的请求信息来计算租户在该统计周期内的活跃等级,并基于活跃等级实现对不同租户预留资源的动态差异化管理,本申请实施例能够根据租户的资源需求实时动态调整资源分配,从而避免出现不活跃租户(即僵尸租户)对预留资源浪费的情况,使得在相同系统资源的情况下,该资源多租共享平台能同时承载更多租户,提高了资源多租共享平台服务租户的能力,且最大化降低僵尸租户的运营成本。
本申请的说明书和权利要求书及上述附图中的术语“第一”、“第二”等是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。应该理解这样使用的术语在适当情况下可以互换,这仅仅是描述本申请的实施例中对相同属性的对象在描述时所采用的区分方式。此外,术语“包括”和“具有”以及他们的任何变形,意图在于覆盖不排他的包含,以便包含一系列单元的过程、方法、系统、产品或设备不必限于那些单元,而是可包括没有清楚地列出的或对于这些过程、方法、产品或设备固有的其它单元。
本申请实施例涉及了许多关于多租共享资源平台的相关知识,为了更好地理解本申请实施例的方案,下面先对本申请实施例可能涉及的相关术语和概念进行介绍。应理解的是,相关的概念解释可能会因为本申请实施例的具体情况有所限制,但并不代表本申请仅能局限于该具体情况,在不同实施例的具体情况可能也会存在差异,具体此处不做限定。
(1)资源多租共享平台
资源多租共享平台也可简称为多租共享平台,用于将服务器资源作为共享资源租给为不同租户使用,其给开发者提供的是一种零运维的服务,开发者开箱即用,无需构建维护后天的基础设施,只需按用量交费。
(2)无服务器(serverless)云开发
serverless云开发也可称为serverless服务、serverless平台等,属于资源多租共享平台的一种典型架构,serverless云开发把主机管理、操作系统管理、资源分配、扩容,甚至是应用逻辑的全部组件都外包出去,把它们看作某种形式的商品——serverless平台商提供服务,开发者掏钱购买。
serverless是一种构建和管理基于微服务架构的完整流程,允许开发者在服务部署级别而不是服务器部署级别来管理应用部署。它与传统架构的不同之处在于:完全由第三方管 理,由事件触发,存在于无状态(stateless)、暂存(可能只存在于一次调用的过程中)计算容器内。构建无服务器应用程序意味着开发者可以专注在产品代码上,而无须管理和操作云端或本地的服务器或运行时。serverless真正做到了部署应用无需涉及基础设施的建设,自动构建、部署和启动服务。
(3)多租
指云数据库服务的多个开发者共享后台的服务器资源,包括CPU、内存、存储,在逻辑上做资源隔离。
下面结合附图,对本申请的实施例进行描述。本领域普通技术人员可知,随着技术的发展和新场景的出现,本申请实施例提供的技术方案对于类似的技术问题,同样适用。
首先,在介绍本申请实施例之前,先对本申请实施例涉及的系统架构进行介绍,使得后续便于理解本申请实施例。具体请参阅图1,图1为本申请实施例提供的系统架构的一个示意图,本申请实施例提供的系统架构从上到下可以分为三个层级,分别为应用层(也可称为业务层)、控制层以及资源层,下面分别对着三个层级进行说明:
(1)应用层
应用层为资源多租共享平台的使用者,该使用者也可以称为租户,例如,每个APP对资源多租共享平台而言是一个租户,例如,图1中的租户1、租户2、……、租户n,租户是通过统一的应用程序接口(application programming interface,API)接入到资源多租共享平台,这里需要注意的是,租户在请求接入时,资源多租共享平台需要对租户的接入请求进行鉴权认证,鉴权通过后才会被允许接入。
(2)控制层
控制层为资源多租共享平台的控制核心,用于控制整个平台的核心业务逻辑以及实现本申请实施例提供的租户的资源管理方法,例如,可用于实现:租户连接管理、租户请求信息的统计、租户活跃等级计算、租户资源调整等。
为便于阐述,在本申请下述实施例中,该控制层以租户管理系统的形式实现本申请实施例提供的租户的资源管理方法的过程,以下不再赘述。
(3)资源层
资源层是资源多租共享平台存储租户物理数据的物理资源节点的集合,包括数据库节点和备份节点,其中,数据库节点为租用该资源多租共享平台的所有租户实际的数据存储的节点,其以库级别的粒度实现资源隔离,备份节点是在资源层新增的一个节点,用于存储不活跃租户(即在周期时长内与资源多租共享平台之间信息交互的数量未达到预先设定的阈值的租户可统称为不活跃租户,也可称为僵尸租户)的备份数据,该备份数据是从数据库节点上冷备份而来,冷备份完成后就将该不活跃租户在数据库节点上的数据删除,由于该备份节点的运营成本低,只为不活跃租户提供基本的存储,因此可降低数据库节点上存储不活跃租户数据的成本。
这里需要说明的是,在图1中,本申请实施例提供的系统架构中的控制层和资源层都为资源多租共享平台的逻辑模块,但在本申请的另一些实施方式中,控制层也可以不部署在资源多租共享平台上,而部署在其他独立的服务器或计算机设备上,具体本申请实施例 对控制层的部署方式不做限定,图1仅为示意。
还需要说明的是,在图1中,额外新增的备份节点也是部署在资源多租共享平台内,但在本申请的另一些实施方式中,备份节点也可以不部署在资源多租共享平台上,而是独立部署,具体本申请实施例对备份节点的部署方式不做限定,图1仅为示意。
还需要说明的是,在本申请的一些实施方式中,本申请实施例提供的系统架构也可以不是分为三个层级,而是可以分为更少(如,两层)或更多(如,四层、五层等)的层级,若是分为更少的层级,那么本质就是将三个层级中的某几个层级合并为了一个层级,若是分为更多的层级,那么本质就是阿静三个层级中的某些层级拆分为了更细的层级,具体本申请实施例对系统架构的层级划分的具体方式不做限定。
基于上述所述的系统架构,下面对本申请实施例提供的租户的资源管理方法进行说明,具体请参阅图2,图2为本申请实施例提供的租户的资源管理方法的一个流程示意图,具体可以包括如下步骤:
201、获取租户在周期时长内的一个或多个请求信息。
首先,租户管理系统获取租户在预设的周期时长内的请求信息(也可称为请求事件),在预设周期时长内租户发送的请求信息可以是一个,也可以是多个,此处不做限定。需要说明的是,在本申请实施例中,租户向资源多租共享平台发送的信息都可称为请求信息,例如,请求接入的信息、请求订阅的信息、请求存储的信息等等,具体此处不做限定。
需要注意的是,在本申请实施例中,周期时长是预先设置的,也可称为统计周期,租户管理系统可基于实际需求自定义,例如,可以统计固定时间周期(如,每一天、每周一至周日、每个月等)内租户向资源多租共享平台发送的请求信息,也可以是以滑动窗口的方式统计某周期时长(如,1天、7天等)内租户向资源多租共享平台发送的请求信息,具体本申请对周期时长的选定方式不做限定。
还需要注意的是,在本申请实施例中,租户管理系统获取租户在周期时长内的一个或多个请求信息具体可以是:若计算的是当前最新的活跃等级,则获取的是当前周期时长内的一个或多个请求信息;若计算的是之前某个周期时长对应的活跃等级,那么获取的是对应周期时长内的一个或多个请求信息,具体本申请对此不作限定。
这里还需要注意的是,在本申请实施例中,为了保障对所有租户同时访问该资源多租共享平台的服务质量,该资源多租共享平台也需要为每个单个租户预先分配一定的资源(即资源预留),例如,为每个租户预分配两个数据库连接,以保障所有租户同时并发访问时都能响应租户请求,以提供高效的服务。具体地,假设资源多租共享平台的总资源数为T,且单个租户预分配的资源包为Tn,那么该资源多租共享平台可服务的租户数量N就为:N=T/Tn。
202、基于预设的信息类型从请求信息中确定一个或多个目标请求信息。
租户管理系统在获取租户在周期时长内的一个或多个请求信息之后,将进一步基于预设的信息类型从获取到的这些请求信息中确定目标请求信息(也可称为活跃事件),确定的目标请求信息可以是一个,也可以是多个,具体本申请对此不做限定。
需要说明的是,在本申请的一些实施方式中,信息类型是预先设定的,可基于实际需 求自定义,例如,可基于租户的类型(如,内存密集型的租户对内存需求大)来设定信息类型,在本申请实施例中,预设的信息类型至少可以包括如下任意一种:连接、查询、写入、订阅等,其中,连接用于表征该租户在同一时刻(可以是当前时刻,也可以是过去某个时刻,此处不做限定)与资源多租共享平台的连接,作为一种示例,假设该租户为APP1,用户a是该APP1的用户,用户b也是该APP1的用户,当用户a与用户b同时登入该APP1时,那么该APP1就会与该资源多租共享平台有2个连接,由于APP1除了用户a和用户b之外,还可能有其他更多用户,因此,在同一时刻,用户登入到APP1的数量就是该APP1与该资源多租共享平台的连接的数量(可简称为连接数)。查询则用于表征该租户的读取操作,写入则用于表征该租户的删除操作、更新操作、创建操作中的至少一项,订阅则用于表征该租户建立的订阅条件。
这里需要注意的是,为便于阐述,在本申请下述实施例中,以预设的信息类型包括连接、查询、写入和订阅为例进行说明,后续不再赘述。
203、根据目标请求信息确定租户的目标活跃等级。
租户管理系统在基于预设的信息类型从获取到的请求信息中确定出一个或多个目标请求信息之后,再根据目标请求信息确定该租户的目标活跃等级。
具体地,假设预设的信息类型包括连接、查询、写入、订阅,那么根据该目标请求信息可统计到该周期时长内的连接数(可用L表示)、查询量(可用Q表示)、写入量(可用W表示)以及订阅量(可用S表示),其中,连接数L就是指该租户同时与该资源多租共享平台的连接数量,查询量Q指该租户的查询(如,读取操作)操作的数量,写入量W指该租户的写(如,删除操作、更新操作以及创建操作中的至少一项)操作的数量,订阅量S指该租户建立的订阅条件的数量。之后,基于如下式(1)所示的活跃算法计算该租户的活跃度取值:
A=f(L,Q,W,S)      (1)
其中,L、Q、W、S为函数f的自变量,A为计算得到的该租户的活跃度的取值。
需要说明的是,在本申请的一些实施方式中,该活跃算法具体可根据属于同一信息类型的目标请求信息的数量来得到对应该信息类型的权重,例如,某个信息类型下的目标请求信息数量多,其对应的权重也大,具体地,可基于如下式(2)所示的方式得到该租户的活跃度取值:
A=a1*L+a2*Q+a3*W+a4*S        (2)
其中,a1、a2、a3、a4分别为L、Q、W、S的权重(可称为目标权重),该目标权重的具体取值具体是根据属于同一信息类型的目标请求信息的数量(可称为目标数量)确定,即由式(2)中的L、Q、W、S的取值确定,例如,属于同一信息类型的目标请求信息的数量越多,则对应的目标权重的取值相对就越大。一种信息类型对应一个目标权重,最后根据属于同一信息类型的目标请求信息的数量(即L、Q、W、S的取值)以及对应的目标权重(即a1、a2、a3、a4)计算出该租户的活跃度的取值。需要注意的是,在本申请实施例中,a1、a2、a3、a4可以是归一化的权重,即a1+a2+a3+a4=1。
这里需要注意的是,上述都是以预设的信息类型包括连接、查询、写入和订阅为例说 明如何计算该租户的活跃度,在本申请的另一些实施方式中,若预设的信息类型是其他,或者包括的是连接、查询、写入和订阅中的一项或多项,那么只需将式(1)或式(2)中对应的信息类型下目标请求信息的数量进行对应替换或删除即可,具体计算过程则是类似的,此处不予赘述。
还需要说明的是,在根据上述式(1)或式(2)计算得到该租户的活跃度的取值后,即可基于预设设定的活跃度的取值区间与活跃等级之间的映射关系(即一个活跃度的取值区间对应一个活跃等级,不同取值区间之间无交集),得到该租户与算得的活跃度取值对应的活跃等级。
需要注意的是,在本申请实施例中,活跃等级可以划分为2个,也可以划分为3个、4个,或者更多个,具体根据实际需求进行划分,本申请实施例对活跃等级的具体划分方式不做限定。
204、在租户的当前活跃等级与目标活跃等级不同的情况下,根据目标活跃等级调整租户在资源多租共享平台的资源。
租户管理系统在计算得到该租户的目标活跃等级后,如果该租户的当前活跃等级与该目标活跃等级不同,则需要根据上述步骤203计算得到的目标活跃等级调整该租户在资源多租共享平台上的资源,调整方式包括但不限于:资源升级、资源降级、冷备份后释放该租户在资源多租共享平台上的占用资源、热恢复后重新为该租户分配资源等。具体的调整方式由租户的当前活跃等级以及计算得到的目标活跃等级来确定,具体可包括但不限于如下几种调整方式:
一、当目标活跃等级为第一等级,且当前活跃等级为第一目标等级,则冷备份
若租户管理系统计算得到的目标活跃等级为第一等级,且该租户当前的活跃等级为第一目标等级,则将该租户在资源多租共享平台上运行的数据库实例的数据在预设的备份节点上进行冷备份,得到备份数据,之后,再释放该租户在该资源多租共享平台上占用的资源(即释放该租户的数据库实例对象,例如,释放该租户的线程池、订阅缓存池、连接池等动态资源,使其不再占用数据库节点上的资源)。需要注意的是,数据库实例实质可看做是一个数据库进程,实例则是进程里面的一个database实例,根据数据库的架构不同数据库实例的表现形式会有所不同,此处不予赘述。
这里需要说明的是,第一等级用于表示该租户处于不活跃状态,具体用于表征该租户在周期时长内与资源多租共享平台之间信息交互的数量没有达到第一预设阈值,该第一预设阈值就是判断租户是不活跃租户(即僵尸租户)还是活跃租户的分界线,未达到该第一预设阈值则判定为不活跃租户,达到该第一预设阈值则说明该租户不是不活跃租户,在本申请实施例中,达到该第一预设阈值的可以统称为第一目标等级,具体地,基于不同的划分方式,第一目标等级实际还可进一步划分为更小粒度的等级(如,第二等级、第三等级等),其中,每个更小粒度的等级均各自对应段阈值区间,例如,阈值区间[y1,y2]对应一个细分等级,阈值区间[y2,y3]对应另一个细分等级,……,以此类推,可将第一目标等级又划分为多个等级,具体的划分方式可基于实际需求自定义,本申请对此不予赘述。
还需要说明的是,在本申请的一些实施方式中,当目标活跃等级为第一等级且当前活 跃等级为第一目标等级,除了可以冷备份之外,还可以是其他处理方法,包括但不限于:将不活跃租户整体迁移至运营成本更低的数据库节点(如,配置更低、容量更低),从而降低单个租户的维护成本,把腾出来的优质资源提供给高活跃度的租户,满足其业务弹性需求,最终实现平台提供商的盈利以及可持续发展。
综上所述,当租户管理系统计算得到的该租户的目标活跃等级为不活跃状态的第一等级,且该租户的当前活跃等级为高于该第一等级的任意一个等级(统称为第一目标等级)的情况下,租户管理系统对该租户在资源多租共享平台上的数据冷备份至备份节点,并释放该租户在资源多租共享平台上的占用资源。
在本申请上述实施方式中,由于在资源多租共享平台按量收费的情况下,很多不活跃租户(即僵尸租户)长期占用连接、缓存、database实例资源,最终制约该资源多租共享平台的租户数量,而不活跃租户也不能给平台提供商带来流量进而贡献流水,这极大的增加了平台提供商的运营成本,因此,本申请上述实施方式可以根据租户的实际运行情况(即判定是否活跃),动态调整资源多租共享平台的资源分配,在本申请实施例中,即不再在资源多租共享平台上为不活跃租户预留资源,或当租户降为不活跃状态时,收回该租户在资源多租共享平台上该租户的占用资源。因此在相同系统资源情况下,资源多租共享平台能为更多租户提供服务,最大化降低不活跃租户的运营成本,此外,相比那种超期自动清库的方案,对租户业务又更友好、更适用。
二、当目标活跃等级为第一目标等级,且当前活跃等级为第一等级,则热恢复
若租户管理系统计算得到的目标活跃等级为第一目标等级,且该租户当前的活跃等级为第一等级,则将该租户的任务暂时挂起,以便对该租户实现热恢复操作,具体操作过程包括:在该资源多租共享平台创建一个新的数据库实例,并将存储于预设的备份节点上的该租户的备份数据(该备份数据是在之前某个周期内,该租户处于不活跃状态时冷备份得到的,具体该备份数据为距离当前时刻最近一次的备份数据)恢复到这个新创建的数据库实例中,并为该租户分配与该第一目标等级对应的资源多租共享平台的资源,即为该租户分配新的与该第一目标等级对应的线程池、订阅缓存池、连接池等动态资源,该资源可称为目标资源,最后,再基于目标资源运行该租户之前挂起的任务,即任务会重新路由到为该租户恢复的数据库节点上,自此热恢复完成。
这里需要注意的是,第一等级以及第一目标等级与上述第一种调整方式中第一等级以及第二目标等级的说明是一样的,具体请参阅上述第一种调整方式中对第一等级以及第二目标等级的说明,此次不予赘述。
综上所述,当该租户的当前活跃等级为不活跃状态的第一等级,且租户管理系统计算得到的目标活跃等级为高于该第一等级的任意一个等级(统称为第一目标等级)的情况下,租户管理系统对该租户在备份节点上的备份数据进行热恢复,并为该租户重新分配资源。
在本申请上述实施方式中,当租户重新活跃时,则为该租户重新建联,并通过对备份节点上该租户的备份数据进行镜像热恢复,实现了快速上线以及租户的业务零感知,提升了用户体验。
三、当目标活跃等级为第二等级,且当前活跃等级为第二目标等级,则资源降级
若租户管理系统计算得到的目标活跃等级为第二等级,且该租户当前的活跃等级为第二目标等级,则对该租户在资源多租共享平台上占用的资源进行资源降级操作。租户管理系统执行的资源降级操作至少包括如下任意一项:减少该租户的业务线程资源、减少该租户的订阅缓存资源、减少该租户的数据库连接资源等。具体地,降级程度可基于第二目标活跃等级来确定,应准守的降级原则是:第二目标活跃等级越接近不活跃状态的第一等级,则减少程度越大,具体的降级方式则可基于这个降级原则自定义,此处不予赘述。
这里需要说明的是,第二等级为高于上述第一等级的活跃等级,具体地,第二等级用于表征该租户在周期时长内与资源多租共享平台之间信息交互的数量达到了第一预设阈值但还没有达到第二预设阈值,该第二预设阈值也可自定义,可以是与该第一等级相邻的活跃等级,也可以是与该第一等级不相邻的活跃等级,具体本申请对此不作限定。
为便于理解第二等级以及第二预设阈值的含义,下面举例进行示意:假设第一预设阈值为y1,则第一等级的阈值区间为[0,y1],那么高于第一等级的阈值区间分别被划分为了[y1,y2](对应一个细分等级)、[y2,y3](对应另一个细分等级),[y3,y4](对应另一个细分等级),……,以此类推。假设该第二预设阈值是y2,那么对应的第二等级的阈值区间为[y1,y2],在这种情况下,该第二等级是第一等级的相邻等级;假设该第二预设阈值是y3,那么对应的第二等级的阈值区间可以是[y1,y2],也可以是[y2,y3],若该第二等级的阈值区间为[y2,y3],在这种情况下,该第二等级是第一等级的不相邻等级;假设该第二预设阈值是y4,那么对应的第二等级的阈值区间可以是[y1,y2],也可以是[y2,y3],还可以是[y3,y4],若该第二等级的阈值区间为[y2,y3]或[y3,y4],在这种情况下,该第二等级是第一等级的不相邻等级,……,以此类推,此处不予赘述。
还需要说明的是,第二目标等级为高于上述第二等级的活跃等级,具体地,第二目标等级用于表征该租户在周期时长内与资源多租共享平台之间信息交互的数量达到了第二预设阈值,在本申请实施例中,达到该第二预设阈值的可以统称为第二目标等级,具体地,基于不同的划分方式,第二目标等级实际还可进一步划分为更小粒度的等级(如,第二等级、第三等级等),其中,每个更小粒度的等级均各自对应段阈值区间,每个更小粒度的等级与阈值区间的对应方式与上述第一目标等级类似,此处不予赘述。
综上所述,当租户管理系统计算得到的该租户的目标活跃等级为高于第一等级(即不活跃状态)的第二等级,且该租户的当前活跃等级为高于该第二等级的任意一个等级(统称为第二目标等级)的情况下,租户管理系统对该租户在资源多租共享平台上的占用资源进行资源降级操作。
在本申请上述实施方式中,在租户的当前活跃等级和目标活跃等级都不为第一等级的情况下,通过对租户当前活跃等级与目标活跃等级的比较,实现租户在资源多租共享平台上占用资源的动态差异化配置,从而在能满足不同活跃程度租户的资源需求的情况下,节约资源多租共享平台的资源占用率,使得资源多租共享平台在相同的系统资源下能为更多活跃的租户提供服务。
四、当目标活跃等级为第二目标等级,且当前活跃等级为第二等级,则资源升级
若租户管理系统计算得到的目标活跃等级为第二目标等级,且该租户当前的活跃等级 为第二等级,则对该租户在资源多租共享平台上占用的资源进行资源升级操作。租户管理系统执行的资源升级操作至少包括如下任意一项:增加该租户的业务线程资源、增加该租户的订阅缓存资源、增加该租户的数据库连接资源等。类似地,升级程度也可基于第二目标活跃等级来确定,应准守的升级原则是:第二目标活跃等级与第二等级之间的等级差越大,则增加程度越大,具体的升级方式则可基于这个升级原则自定义,此处不予赘述。
同样需要说明的是,与上述第三种调整方式类似,该调整方式中的第二等级为高于上述第一等级的活跃等级,具体地,第二等级用于表征该租户在周期时长内与资源多租共享平台之间信息交互的数量达到了第一预设阈值但还没有达到第二预设阈值,该第二预设阈值也可自定义,可以是与该第一等级相邻的活跃等级,也可以是与该第一等级不相邻的活跃等级,具体本申请对此不作限定。
还需要说明的是,第二目标等级为高于上述第二等级的活跃等级,具体地,第二目标等级用于表征该租户在周期时长内与资源多租共享平台之间信息交互的数量达到了第二预设阈值,在本申请实施例中,达到该第二预设阈值的可以统称为第二目标等级,具体地,基于不同的划分方式,第二目标等级实际还可进一步划分为更小粒度的等级(如,第二等级、第三等级等),其中,每个更小粒度的等级均各自对应段阈值区间,每个更小粒度的等级与阈值区间的对应方式与上述第一目标等级类似,此处不予赘述。
综上所述,当租户的当前活跃等级为高于第一等级(即不活跃状态)的第二等级,且租户管理系统计算得到的该租户的目标活跃等级为高于该第二等级的任意一个等级(统称为第二目标等级)的情况下,租户管理系统对该租户在资源多租共享平台上的占用资源进行资源升级操作。
在本申请上述实施方式中,在租户的当前活跃等级和目标活跃等级都不为第一等级的情况下,通过对租户当前活跃等级与目标活跃等级的比较,实现租户在资源多租共享平台上占用资源的动态差异化配置,及时满足了活跃度升高的租户对所需资源增大的需求,相比于在线迁移的方式,降低了对租户业务的影响。
205、将目标活跃等级作为租户新的当前活跃等级,重复执行步骤201至步骤205。
需要说明的是,在本申请的一些实施方式中,还可以包括步骤205,即租户管理系统将该目标活跃等级作为该租户新的当前活跃等级,重复执行步骤201至步骤205,直至达到预设条件,例如,可以是重复执行直至达到预设时长,也可以是重复执行直至达到预设迭代次数,具体本申请对此不做限定。
在本申请实施例中,将目标活跃等级做该租户新的当前活跃等级,并重复执行步骤201至步骤205的好处在于:可周期性更新租户当前的活跃等级,从而实现了实时、动态调整租户在该资源多种共享平台的资源。
为进一步理解本申请实施例提供的租户的资源管理方法,下面以一个具体的实例为例对本申请实施例方法进行说明,具体请参阅图3,图3为本申请实施例提供的组件结构的一个示意图,其中,在应用层,有接入响应模块、业务执行模块以及存储执行模块,这些模块均为已有模块,不涉及本申请发明,此处不予赘述。在控制层,则新增租户事件统计模块、租户活跃度计算模块、租户资源调度模块、业务资源控制模块、数据库资源控制模 块,其中,网络资源控制模块为已有模块,网络资源控制模块主要用于管理应用层与资源层之间的通信连接资源,对多种通信协议进行连接管理;业务资源控制模块聚焦业务线程、订阅缓存管理以及与数据库连接资源等资源的调度;数据库资源控制模块负责数据库实例的冷备份、热恢复的调度管理;租户事件统计模块用于统计租户在周期时长内的请求信息(即请求事件),并基于预设的信息类型从统计的请求信息中确定目标请求信息(即活跃事件);租户活跃度计算模块用于根据目标请求信息计算租户的活跃度以及活跃等级,租户资源调度模块用于对租户在资源多租共享平台上的资源进行动态调节,比如释放连接资源、数据冷备份或者热恢复。在资源层,新增用于进行数据冷备/热恢复的备份池(即图1中所述的备份节点),其中,通信连接池以及数据库连接池(即图1中所述的数据库节点)为已有模块,需要注意的是,数据库连接池进一步可以包括业务线程池、订阅缓存池、存储连接池。
下面基于图3所示的组件结构,以划分的活跃等级为低(相当于上述所述的第一等级,也可称为inactive)、中(也可称为normal)、高(也可称为high)这3个等级为例,对几种主要的场景进行陈述。当租户活跃等级为低时,对租户触发冷备份;当租户从低等级又重新上升为中等级或高等级时,则对租户做热恢复。
需要注意的是,在本申请实施例中,每个租户默认的活跃等级为中等级。还需要说明的是,在本申请实施例中,租户活跃等级变化限定是相邻等级进行变化(不相邻等级进行变化也是可以的,但缺点是可能会出现资源震荡的问题,相邻等级变化可保证资源调整的平滑过渡)。
场景1、租户A资源升级(从中等级→高等级)调整步骤。
具体请参阅图4,图4为本申请实施例提供的资源升级场景的一个流程示意图,具体可以包括如下步骤:
401、租户事件统计模块在统计周期Ts内统计租户A的请求信息,并采样得到属于不同信息类型的目标请求信息各自的数量。
租户事件统计模块在统计周期Ts内统计租户A所有的请求信息,并根据预设的信息类型,采样收集租户的连接数Ln、查询量Qn、写入量Wn及订阅量Sn(即属于不同信息类型的目标请求信息的数量,可简称为统计数据)。其中,租户A为在统计周期内租用该资源多租共享平台的任意一个租户。
402、租户事件统计模块将租户A的统计数据发送给租户活跃度计算模块。
一个统计周期Ts结束后,租户事件统计模块将租户A的统计数据发送给租户活跃度计算模块。
403、租户活跃度计算模块计算租户A当前周期的目标活跃等级,并将该目标活跃等级的信息发送给租户资源调度模块。
租户活跃度计算模块使用活跃算法An,计算租户A当前周期的目标活跃等级,假设计算得到的目标活跃等级为高等级(即high),并将该目标活跃等级的信息发送给租户资源调度模块。
需要注意的是,在本申请实施例中,活跃算法An具体可以是上述式(1)或式(2) 所示的活跃算法,具体请参阅上述所述,此处不予赘述。
404、租户资源调度模块读取租户A当前缓存的活跃等级,并将当前缓存的活跃等级与目标活跃等级进行比较,触发资源升级。
租户资源调度模块读取租户A当前缓存的活跃等级(即当前活跃等级)为中等级(即normal),与租户活跃度计算模块的更新信息进行比对,发现租户A最新的活跃度升高,则触发资源升级操作,如,分别增加租户A的业务线程资源、订阅缓存资源、数据库连接资源中的至少一项。
租户A资源升级操作完成,触发执行下一轮迭代。
场景2、租户A资源降级(从高等级→中等级)调整步骤。
具体请参阅图5,图5为本申请实施例提供的资源降级场景的一个流程示意图,具体可以包括如下步骤:
501、租户事件统计模块在统计周期Ts内统计租户A的请求信息,并采样得到属于不同信息类型的目标请求信息各自的数量。
租户事件统计模块在统计周期Ts内统计租户A所有的请求信息,并根据预设的信息类型,采样收集租户的连接数Ln、查询量Qn、写入量Wn及订阅量Sn(即属于不同信息类型的目标请求信息的数量,可简称为统计数据)。其中,租户A为在统计周期内租用该资源多租共享平台的任意一个租户。
502、租户事件统计模块将租户A的统计数据发送给租户活跃度计算模块。
一个统计周期Ts结束后,租户事件统计模块将租户A的统计数据发送给租户活跃度计算模块。
503、租户活跃度计算模块计算租户A当前周期的目标活跃等级,并将该目标活跃等级的信息发送给租户资源调度模块。
租户活跃度计算模块使用活跃算法An,计算租户A当前周期的目标活跃等级,假设计算得到的目标活跃等级为中等级(即normal),并将该目标活跃等级的信息发送给租户资源调度模块。
需要注意的是,在本申请实施例中,活跃算法An具体可以是上述式(1)或式(2)所示的活跃算法,具体请参阅上述所述,此处不予赘述。
504、租户资源调度模块读取租户A当前缓存的活跃等级,并将当前缓存的活跃等级与目标活跃等级进行比较,触发资源降级。
租户资源调度模块读取租户A当前缓存的活跃等级(即当前活跃等级)为高等级(即high),与租户活跃度计算模块的更新信息进行比对,发现租户A最新的活跃度降低,则触发资源降级操作,如,分别减少租户A的业务线程资源、订阅缓存资源、数据库连接资源中的至少一项。
租户A资源降级操作完成,触发执行下一轮迭代。
场景3、租户A资源释放以及数据冷备份(从中等级→低等级)调整步骤。
具体请参阅图6,图6为本申请实施例提供的资源释放以及数据冷备份场景的一个流程示意图,具体可以包括如下步骤:
601、租户事件统计模块在统计周期Ts内统计租户A的请求信息,并采样得到属于不同信息类型的目标请求信息各自的数量。
租户事件统计模块在统计周期Ts内统计租户A所有的请求信息,并根据预设的信息类型,采样收集租户的连接数Ln、查询量Qn、写入量Wn及订阅量Sn(即属于不同信息类型的目标请求信息的数量,可简称为统计数据)。其中,租户A为在统计周期内租用该资源多租共享平台的任意一个租户。
602、租户事件统计模块将租户A的统计数据发送给租户活跃度计算模块。
一个统计周期Ts结束后,租户事件统计模块将租户A的统计数据发送给租户活跃度计算模块。
603、租户活跃度计算模块计算租户A当前周期的目标活跃等级,并将该目标活跃等级的信息发送给租户资源调度模块。
租户活跃度计算模块使用活跃算法An,计算租户A当前周期的目标活跃等级,假设计算得到的目标活跃等级为低等级(即inactive),并将该目标活跃等级的信息发送给租户资源调度模块。
需要注意的是,在本申请实施例中,活跃算法An具体可以是上述式(1)或式(2)所示的活跃算法,具体请参阅上述所述,此处不予赘述。
604、租户资源调度模块读取租户A当前缓存的活跃等级,并将当前缓存的活跃等级与目标活跃等级进行比较,触发对租户A进行数据冷备份。
租户资源调度模块读取租户A当前缓存的活跃等级(即当前活跃等级)为中等级(即normal),与租户活跃度计算模块的更新信息进行比对,发现租户A最新的活跃度降低为不活跃状态,则触发对租户A进行数据冷备份处理,具体地,租户资源调度模块首先对数据库资源控制模块下发冷备租户A在数据库节点(即图3中的数据库资源池)上数据的备份指令,数据库资源控制模块再将租户A的数据库实例下达备份命令,将其数据全部备份至备份节点,之后释放租户A的数据库实例对象,使其不再占用数据库节点上的资源。
605、租户资源调度模块释放租户A在数据库节点上占用的资源。
最后,租户资源调度模块再分别释放租户A的线程池、订阅缓存池、连接池等动态资源。
租户A资源释放以及数据冷备份操作完成,触发执行下一轮迭代。
场景4、租户A资源恢复以及数据热恢复(从低等级→中等级)调整步骤。
具体请参阅图7,图7为本申请实施例提供的资源恢复以及数据热恢复场景的一个流程示意图,具体可以包括如下步骤:
701、租户事件统计模块在统计周期Ts内统计租户A的请求信息,并采样得到属于不同信息类型的目标请求信息各自的数量。
租户事件统计模块在统计周期Ts内统计租户A所有的请求信息,并根据预设的信息类型,采样收集租户的连接数Ln、查询量Qn、写入量Wn及订阅量Sn(即属于不同信息类型的目标请求信息的数量,可简称为统计数据)。其中,租户A为在统计周期内租用该资源多租共享平台的任意一个租户。
702、租户事件统计模块将租户A的统计数据发送给租户活跃度计算模块。
一个统计周期Ts结束后,租户事件统计模块将租户A的统计数据发送给租户活跃度计算模块。
703、租户活跃度计算模块计算租户A当前周期的目标活跃等级,并将该目标活跃等级的信息发送给租户资源调度模块。
租户活跃度计算模块使用活跃算法An,计算租户A当前周期的目标活跃等级,假设计算得到的目标活跃等级为中等级(即normal),并将该目标活跃等级的信息发送给租户资源调度模块。
需要注意的是,在本申请实施例中,活跃算法An具体可以是上述式(1)或式(2)所示的活跃算法,具体请参阅上述所述,此处不予赘述。
704、租户资源调度模块读取租户A当前缓存的活跃等级,并将当前缓存的活跃等级与目标活跃等级进行比较,触发对租户A进行数据热恢复。
租户资源调度模块读取租户A当前缓存的活跃等级(即当前活跃等级)为低等级(即inactive),与租户活跃度计算模块的更新信息进行比对,发现租户A最新的活跃度由不活跃状态上升了,则触发对租户A进行数据热恢复处理。
705、租户资源调度模块通知业务执行模块将租户A的任务挂起。
706、租户资源调度模块对数据库资源控制模块下发租户A的热恢复指令。
租户资源调度模块对数据库资源控制模块下发租户A的热恢复指令,并在数据库节点创建一个新的数据库实例,然后将备份节点上租户A的备份数据重新恢复到刚创建的数据库实例中。
707、租户资源调度模块重新为租户A分配新的资源。
租户资源调度模块重新为租户A分配新的线程池、订阅缓存池、连接池等动态资源至中等级的级别。
708、租户资源调度模块通知业务执行模块将挂起的任务恢复。
最后,租户资源调度模块通知业务执行模块将挂起的任务恢复,恢复后的任务会重新路由到为租户A恢复的数据库节点上。
租户A资源恢复以及数据热恢复操作完成,触发执行下一轮迭代。
为了对本申请实施例所带来的有益效果有更为直观的认识,以下对本申请实施例所带来的技术效果作进一步的对比,请参阅表1,表1给出了本申请实施例方法与现有技术下资源多租共享平台可支持的租户数量的效果对比。以集群内50%用户均为不活跃状态的僵尸租户(即第一等级或inactive)场景为例,现有技术下资源多租共享平台支持的租户数量为N,通过上述本申请实施例提供的方法可回收一半的数据库实例资源,能够为额外增加系统N/2可服务租户数量,大幅提升了集群能承载的租户数量,从而降低了单个租户的运营成本。
表1、本申请实施例方法与现有技术下系统可支持的租户数量的效果对比
  现有技术方法 本申请实施例方法
资源多租共享平台支持租户数量 N N+N/2
在上述实施例的基础上,为了更好的实施本申请实施例的上述方案,下面还提供用于 实施上述方案的相关设备。具体参阅图8,图8为本申请实施例提供的一种租户管理系统的结构示意图,该租户管理系统800具体可以包括:统计模块801、确定模块802、计算模块803以及调整模块804,其中,统计模块801,用于获取租户在周期时长内的一个或多个请求信息;确定模块802,用于基于预设的信息类型从该请求信息中确定一个或多个目标请求信息;计算模块803,用于根据该目标请求信息确定该租户的目标活跃等级;调整模块804,用于在该租户的当前活跃等级与该目标活跃等级不同的情况下,根据该目标活跃等级调整该租户在资源多租共享平台的资源。
在本申请上述实施方式中,租户管理系统800中的统计模块801、确定模块802以及计算模块803基于统计周期内租户的请求信息来计算租户在该统计周期内的活跃等级,调整模块804再基于活跃等级实现对不同租户预留资源的动态差异化管理,在本申请实施例中,即不再在资源多租共享平台上为不活跃租户预留资源,或当租户由活跃状态降级为不活跃状态时,收回该租户在资源多租共享平台上该租户的占用资源,最大化降低僵尸租户的运营成本。
在一种可能的设计中,调整模块804,具体用于:在该目标活跃等级为第一等级且该当前活跃等级为第一目标等级的情况下,将该租户在该资源多租共享平台上运行的数据库实例的数据在预设备份节点上进行冷备份,得到备份数据,其中,该第一等级用于表征该租户在该周期时长内与该资源多租共享平台之间信息交互的数量未达到第一预设阈值,该第一目标等级用于表征该租户在该周期时长内与该资源多租共享平台之间的信息交互的数量达到该第一预设阈值;最后再释放该租户在该资源多租共享平台上占用的资源,即释放该租户的数据库实例对象,例如,释放该租户的线程池、订阅缓存池、连接池等动态资源,使其不再占用数据库节点上的资源。
在本申请上述实施方式中,调整模块804可以根据租户的实际运行情况(即判定是否活跃),动态调整资源多租共享平台的资源分配,在本申请实施例中,即不再在资源多租共享平台上为不活跃租户预留资源,或当租户降为不活跃状态时,收回该租户在资源多租共享平台上该租户的占用资源。因此在相同系统资源情况下,能为更多租户提供服务,最大化降低不活跃租户的运营成本,此外,相比那种超期自动清库的方案,对租户业务又更友好、更适用。
在一种可能的设计中,调整模块804,具体还用于:在该目标活跃等级为第一目标等级且该当前活跃等级为第一等级的情况下,将该租户的任务挂起,并在该资源多租共享平台创建新的数据库实例,其中,该第一等级用于表征该租户在该周期时长内与该资源多租共享平台之间信息交互的数量未达到第一预设阈值,该第一目标等级用于表征该租户在该周期时长内与该资源多租共享平台之间信息交互的数量达到该第一预设阈值;之后,将存储于预设备份节点上的与该租户对应的备份数据恢复到该新的数据库实例中,并为该租户分配与该第一目标等级对应的该资源多租共享平台的目标资源;最后,基于该目标资源运行该租户的任务。
在本申请上述实施方式中,当租户重新活跃时,则调整模块804为该租户重新建联,并通过对备份节点上该租户的备份数据进行镜像热恢复,实现了快速上线以及租户的业务 零感知,提升了用户体验。
在一种可能的设计中,调整模块804,具体还用于:在该目标活跃等级为第二等级且该当前活跃等级为第二目标等级的情况下,对该租户在该资源多租共享平台上占用的资源进行资源降级操作,其中,该第二等级用于表征该租户在该周期时长内与该资源多租共享平台之间信息交互的数量达到第一预设阈值但未达到第二预设阈值,该第二目标等级用于表征该租户在该周期时长内与该资源多租共享平台之间信息交互的数量达到该第二预设阈值。
在本申请上述实施方式中,在租户的当前活跃等级和目标活跃等级都不为第一等级的情况下,调整模块804通过对租户当前活跃等级与目标活跃等级的比较,实现租户在资源多租共享平台上占用资源的动态差异化配置,从而在能满足不同活跃程度租户的资源需求的情况下,节约资源多租共享平台的资源占用率,使得资源多租共享平台在相同的系统资源下能为更多活跃的租户提供服务。
在一种可能的设计中,调整模块804,具体还用于:在该目标活跃等级为第二目标等级且该当前活跃等级为第二等级的情况下,对该租户在该资源多租共享平台上占用的资源进行资源升级操作,其中,该第二等级用于表征该租户在该周期时长内与该资源多租共享平台之间信息交互的数量达到第一预设阈值但未达到第二预设阈值,该第二目标等级用于表征该租户在该周期时长内与该资源多租共享平台之间信息交互的数量达到该第二预设阈值。
在本申请上述实施方式中,在租户的当前活跃等级和目标活跃等级都不为第一等级的情况下,调整模块804通过对租户当前活跃等级与目标活跃等级的比较,实现租户在资源多租共享平台上占用资源的动态差异化配置,及时满足了活跃度升高的租户对所需资源增大的需求,相比于在线迁移的方式,降低了对租户业务的影响。
在一种可能的设计中,计算模块803,具体用于:首先确定属于同一信息类型的目标请求信息的目标数量,并根据该目标数量确定与每个信息类型各自对应的目标权重,一个信息类型对应一个目标权重,最后根据该目标数量与该目标权重计算该租户的目标活跃等级。
在本申请上述实施方式中,具体阐述了计算模块803是基于属于同一信息类型的目标请求信息的目标数量以及各自对应的目标权重来计算租户的目标活跃等级,具备可实现性。
在一种可能的设计中,该租户管理系统800还包括触发执行模块805,用于:将该目标活跃等级作为该租户新的当前活跃等级,触发该统计模块801、该确定模块802、该计算模块803以及该调整模块804重复执行各自步骤。
在一种可能的设计中,该预设的信息类型至少包括如下任意一种:连接、查询、写入、订阅。其中,连接用于表征该租户在同一时刻(可以是当前时刻,也可以是过去某个时刻,此处不做限定)与资源多租共享平台的连接,作为一种示例,假设该租户为APP1,用户a是该APP1的用户,用户b也是该APP1的用户,当用户a与用户b同时登入该APP1时,那么该APP1就会与该资源多租共享平台有2个连接,由于APP1除了用户a和用户b之外,还可能有其他更多用户,因此,在同一时刻,用户登入到APP1的数量就是该APP1与该资 源多租共享平台的连接的数量(可简称为连接数)。查询则用于表征该租户的读取操作,写入则用于表征该租户的删除操作、更新操作、创建操作中的至少一项,订阅则用于表征该租户建立的订阅条件。
在本申请上述实施方式中,选取一些典型的信息类型作为预设的信息类型,具体可基于实际需求自定义,且可根据实际情况随时进行调整,具备灵活性和广泛实用性。
在一种可能的设计中,资源降级操作至少包括如下任意一种:减少该租户的业务线程资源、减少该租户的订阅缓存资源、减少该租户的数据库连接资源。具体地,降级程度可基于目标活跃等级来确定,应准守的降级原则是:第二目标活跃等级越接近不活跃状态的第一等级,则减少程度越大,具体的降级方式则可基于这个降级原则自定义,此处不予赘述。
在本申请上述实施方式中,具体阐述了几种资源降级操作的具体实现方式,具体可基于实际需求自定义如何降级,具备可选择性。
在一种可能的设计中,资源升级操作至少包括如下任意一种:增加该租户的业务线程资源、增加该租户的订阅缓存资源、增加该租户的数据库连接资源。类似地,升级程度也可基于第二目标活跃等级来确定,应准守的升级原则是:第二目标活跃等级与第二等级之间的等级差越大,则增加程度越大,具体的升级方式则可基于这个升级原则自定义,此处不予赘述。
在本申请上述实施方式中,具体阐述了几种资源升级操作的具体实现方式,具体可基于实际需求自定义如何升级,具备可选择性。
需要说明的是,租户管理系统800中各模块/单元之间的信息交互、执行过程等内容,与本申请中上述方法实施例基于同一构思,具体内容可参见本申请前述所示的方法实施例中的叙述,此处不再赘述。
接下来介绍本申请实施例提供的另一种租户管理系统,请参阅图9,图9为本申请实施例提供的租户管理系统的一种结构示意图,租户管理系统900上可以部署有图8对应实施例中所描述的租户管理系统800所涉及的模块,用于实现图8对应实施例中租户管理系统800的功能,具体的,租户管理系统900由一个或多个服务器实现,租户管理系统900可因配置或性能不同而产生比较大的差异,可以包括一个或一个以上中央处理器(central processing units,CPU)922和存储器932,一个或一个以上存储应用程序942或数据944的存储介质930(例如一个或一个以上海量存储设备)。其中,存储器932和存储介质930可以是短暂存储或持久存储。存储在存储介质930的程序可以包括一个或一个以上模块(图示没标出),每个模块可以包括对租户管理系统900中的一系列指令操作。更进一步地,中央处理器922可以设置为与存储介质930通信,在租户管理系统900上执行存储介质930中的一系列指令操作。
租户管理系统900还可以包括一个或一个以上电源926,一个或一个以上有线或无线网络接口950,一个或一个以上输入输出接口958,和/或,一个或一个以上操作系统941,例如Windows ServerTM,Mac OS XTM,UnixTM,LinuxTM,FreeBSDTM等等。
本申请实施例中,中央处理器922,用于执行图2对应实施例中的租户管理系统执行 的步骤。例如,中央处理器922可以用于:首先,获取租户在预设的周期时长内的请求信息(也可称为请求事件),在预设周期时长内租户发送的请求信息可以是一个,也可以是多个,此处不做限定。需要说明的是,在本申请实施例中,租户向资源多租共享平台发送的信息都可称为请求信息,例如,请求接入的信息、请求订阅的信息、请求存储的信息等等,具体此处不做限定。在获取租户在周期时长内的一个或多个请求信息之后,将进一步基于预设的信息类型从获取到的这些请求信息中确定目标请求信息(也可称为活跃事件),确定的目标请求信息可以是一个,也可以是多个,具体本申请对此不做限定。在基于预设的信息类型从获取到的请求信息中确定出一个或多个目标请求信息之后,再根据目标请求信息确定该租户的目标活跃等级。在计算得到该租户的目标活跃等级后,如果该租户的当前活跃等级与该目标活跃等级不同,则根据计算得到的目标活跃等级调整该租户在资源多租共享平台上的资源,调整方式包括但不限于:资源升级、资源降级、冷备份后释放该租户在资源多租共享平台上的占用资源、热恢复后重新为该租户分配资源等。具体的调整方式由租户的当前活跃等级以及计算得到的目标活跃等级来确定。
需要说明的是,中央处理器922执行上述各个步骤的具体方式,与本申请中图2对应的方法实施例基于同一构思,其带来的技术效果也与本申请上述实施例相同,具体内容可参见本申请前述所示的方法实施例中的叙述,此处不再赘述。
另外需说明的是,以上所描述的装置实施例仅仅是示意性的,其中所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部模块来实现本实施例方案的目的。另外,本申请提供的装置实施例附图中,模块之间的连接关系表示它们之间具有通信连接,具体可以实现为一条或多条通信总线或信号线。
通过以上的实施方式的描述,所属领域的技术人员可以清楚地了解到本申请可借助软件加必需的通用硬件的方式来实现,当然也可以通过专用硬件包括专用集成电路、专用CPU、专用存储器、专用元器件等来实现。一般情况下,凡由计算机程序完成的功能都可以很容易地用相应的硬件来实现,而且,用来实现同一功能的具体硬件结构也可以是多种多样的,例如模拟电路、数字电路或专用电路等。但是,对本申请而言更多情况下软件程序实现是更佳的实施方式。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在可读取的存储介质中,如计算机的软盘、U盘、移动硬盘、只读存储器(read-only memory,ROM)、随机存取存储器(random access memory,RAM)、磁碟或者光盘等,包括若干指令用以使得一台计算机设备(可以是个人计算机,或者网络设备等)执行本申请各个实施例所述的方法。
在上述实施例中,可以全部或部分地通过软件、硬件、固件或者其任意组合来实现。当使用软件实现时,可以全部或部分地以计算机程序产品的形式实现。
所述计算机程序产品包括一个或多个计算机指令。在计算机上加载和执行所述计算机程序指令时,全部或部分地产生按照本申请实施例所述的流程或功能。所述计算机可以是通用计算机、专用计算机、计算机网络、或者其他可编程装置。所述计算机指令可以存储 在计算机可读存储介质中,或者从一个计算机可读存储介质向另一计算机可读存储介质传输,例如,所述计算机指令可以从一个网站站点、计算机、训练设备或数据中心通过有线(例如同轴电缆、光纤、数字用户线(DSL))或无线(例如红外、无线、微波等)方式向另一个网站站点、计算机、训练设备或数据中心进行传输。所述计算机可读存储介质可以是计算机能够存储的任何可用介质或者是包含一个或多个可用介质集成的训练设备、数据中心等数据存储设备。所述可用介质可以是磁性介质,(例如,软盘、硬盘、磁带)、光介质(例如,DVD)、或者半导体介质(例如固态硬盘(solid state disk,SSD))等。

Claims (22)

  1. 一种租户的资源管理方法,其特征在于,包括:
    获取租户在周期时长内的一个或多个请求信息;
    基于预设的信息类型从所述请求信息中确定一个或多个目标请求信息;
    根据所述目标请求信息确定所述租户的目标活跃等级;
    在所述租户的当前活跃等级与所述目标活跃等级不同的情况下,根据所述目标活跃等级调整所述租户在资源多租共享平台的资源。
  2. 根据权利要求1所述的方法,其特征在于,所述在所述租户的当前活跃等级与所述目标活跃等级不同的情况下,根据所述目标活跃等级调整所述租户在资源多租共享平台的资源包括:
    在所述目标活跃等级为第一等级且所述当前活跃等级为第一目标等级的情况下,将所述租户在所述资源多租共享平台上运行的数据库实例的数据在预设备份节点上进行冷备份,得到备份数据,其中,所述第一等级用于表征所述租户在所述周期时长内与所述资源多租共享平台之间信息交互的数量未达到第一预设阈值,所述第一目标等级用于表征所述租户在所述周期时长内与所述资源多租共享平台之间信息交互的数量达到所述第一预设阈值;
    释放所述租户在所述资源多租共享平台上占用的资源。
  3. 根据权利要求1-2中任一项所述的方法,其特征在于,所述在所述租户的当前活跃等级与所述目标活跃等级不同的情况下,根据所述目标活跃等级调整所述租户在资源多租共享平台的资源包括:
    在所述目标活跃等级为第一目标等级且所述当前活跃等级为第一等级的情况下,将所述租户的任务挂起,并在所述资源多租共享平台创建新的数据库实例,其中,所述第一等级用于表征所述租户在所述周期时长内与所述资源多租共享平台之间信息交互的数量未达到第一预设阈值,所述第一目标等级用于表征所述租户在所述周期时长内与所述资源多租共享平台之间信息交互的数量达到所述第一预设阈值;
    将存储于预设备份节点上的与所述租户对应的备份数据恢复到所述新的数据库实例中,并为所述租户分配与所述第一目标等级对应的所述资源多租共享平台的目标资源;
    基于所述目标资源运行所述租户的任务。
  4. 根据权利要求1-3中任一项所述的方法,其特征在于,所述在所述租户的当前活跃等级与所述目标活跃等级不同的情况下,根据所述目标活跃等级调整所述租户在资源多租共享平台的资源包括:
    在所述目标活跃等级为第二等级且所述当前活跃等级为第二目标等级的情况下,对所述租户在所述资源多租共享平台上占用的资源进行资源降级操作,其中,所述第二等级用于表征所述租户在所述周期时长内与所述资源多租共享平台之间信息交互的数量达到第一预设阈值但未达到第二预设阈值,所述第二目标等级用于表征所述租户在所述周期时长内与所述资源多租共享平台之间信息交互的数量达到所述第二预设阈值。
  5. 根据权利要求1-4中任一项所述的方法,其特征在于,所述在所述租户的当前活跃等级与所述目标活跃等级不同的情况下,根据所述目标活跃等级调整所述租户在资源多租 共享平台的资源包括:
    在所述目标活跃等级为第二目标等级且所述当前活跃等级为第二等级的情况下,对所述租户在所述资源多租共享平台上占用的资源进行资源升级操作,其中,所述第二等级用于表征所述租户在所述周期时长内与所述资源多租共享平台之间信息交互的数量达到第一预设阈值但未达到第二预设阈值,所述第二目标等级用于表征所述租户在所述周期时长内与所述资源多租共享平台之间信息交互的数量达到所述第二预设阈值。
  6. 根据权利要求1-5中任一项所述的方法,其特征在于,所述根据所述目标请求信息确定所述租户的目标活跃等级包括:
    确定属于同一信息类型的目标请求信息的目标数量;
    根据所述目标数量确定与每个信息类型各自对应的目标权重,一个信息类型对应一个目标权重;
    根据所述目标数量与所述目标权重计算所述租户的目标活跃等级。
  7. 根据权利要求1-6中任一项所述的方法,其特征在于,所述在根据所述目标活跃等级调整所述租户在资源多租共享平台的资源之后,所述方法还包括:
    将所述目标活跃等级作为所述租户新的当前活跃等级,重复执行上述步骤。
  8. 根据权利要求1-7中任一项所述的方法,其特征在于,所述预设的信息类型至少包括如下任意一种:
    连接、查询、写入、订阅;
    所述连接用于表征所述租户在同一时刻与所述资源多租共享平台的连接;
    所述查询用于表征所述租户的读取操作;
    所述写入用于表征所述租户的删除操作、更新操作以及创建操作中的至少一项;
    所述订阅用于表征所述租户建立的订阅条件。
  9. 根据权利要求4所述的方法,其特征在于,所述资源降级操作至少包括如下任意一种:
    减少所述租户的业务线程资源、减少所述租户的订阅缓存资源、减少所述租户的数据库连接资源。
  10. 根据权利要求5所述的方法,其特征在于,所述资源升级操作至少包括如下任意一种:
    增加所述租户的业务线程资源、增加所述租户的订阅缓存资源、增加所述租户的数据库连接资源。
  11. 一种租户管理系统,其特征在于,包括:
    统计模块,用于获取租户在周期时长内的一个或多个请求信息;
    确定模块,用于基于预设的信息类型从所述请求信息中确定一个或多个目标请求信息;
    计算模块,用于根据所述目标请求信息确定所述租户的目标活跃等级;
    调整模块,用于在所述租户的当前活跃等级与所述目标活跃等级不同的情况下,根据所述目标活跃等级调整所述租户在资源多租共享平台的资源。
  12. 根据权利要求11所述的系统,其特征在于,所述调整模块,具体用于:
    在所述目标活跃等级为第一等级且所述当前活跃等级为第一目标等级的情况下,将所述租户在所述资源多租共享平台上运行的数据库实例的数据在预设备份节点上进行冷备份,得到备份数据,其中,所述第一等级用于表征所述租户在所述周期时长内与所述资源多租共享平台之间信息交互的数量未达到第一预设阈值,所述第一目标等级用于表征所述租户在所述周期时长内与所述资源多租共享平台之间信息交互的数量达到所述第一预设阈值;
    释放所述租户在所述资源多租共享平台上占用的资源。
  13. 根据权利要求11-12中任一项所述的系统,其特征在于,所述调整模块,具体还用于:
    在所述目标活跃等级为第一目标等级且所述当前活跃等级为第一等级的情况下,将所述租户的任务挂起,并在所述资源多租共享平台创建新的数据库实例,其中,所述第一等级用于表征所述租户在所述周期时长内与所述资源多租共享平台之间信息交互的数量未达到第一预设阈值,所述第一目标等级用于表征所述租户在所述周期时长内与所述资源多租共享平台之间信息交互的数量达到所述第一预设阈值;
    将存储于预设备份节点上的与所述租户对应的备份数据恢复到所述新的数据库实例中,并为所述租户分配与所述第一目标等级对应的所述资源多租共享平台的目标资源;
    基于所述目标资源运行所述租户的任务。
  14. 根据权利要求11-13中任一项所述的系统,其特征在于,所述调整模块,具体还用于:
    在所述目标活跃等级为第二等级且所述当前活跃等级为第二目标等级的情况下,对所述租户在所述资源多租共享平台上占用的资源进行资源降级操作,其中,所述第二等级用于表征所述租户在所述周期时长内与所述资源多租共享平台之间信息交互的数量达到第一预设阈值但未达到第二预设阈值,所述第二目标等级用于表征所述租户在所述周期时长内与所述资源多租共享平台之间信息交互的数量达到所述第二预设阈值。
  15. 根据权利要求11-14中任一项所述的系统,其特征在于,所述调整模块,具体还用于:
    在所述目标活跃等级为第二目标等级且所述当前活跃等级为第二等级的情况下,对所述租户在所述资源多租共享平台上占用的资源进行资源升级操作,其中,所述第二等级用于表征所述租户在所述周期时长内与所述资源多租共享平台之间信息交互的数量达到第一预设阈值但未达到第二预设阈值,所述第二目标等级用于表征所述租户在所述周期时长内与所述资源多租共享平台之间信息交互的数量达到所述第二预设阈值。
  16. 根据权利要求11-15中任一项所述的系统,其特征在于,所述计算模块,具体用于:
    确定属于同一信息类型的目标请求信息的目标数量;
    根据所述目标数量确定与每个信息类型各自对应的目标权重,一个信息类型对应一个目标权重;
    根据所述目标数量与所述目标权重计算所述租户的目标活跃等级。
  17. 根据权利要求11-16中任一项所述的系统,其特征在于,所述系统还包括触发执 行模块,用于:
    将所述目标活跃等级作为所述租户新的当前活跃等级,触发所述统计模块、所述确定模块、所述计算模块以及所述调整模块重复执行各自步骤。
  18. 根据权利要求11-17中任一项所述的系统,其特征在于,所述预设的信息类型至少包括如下任意一种:
    连接、查询、写入、订阅;
    所述连接用于表征所述租户在同一时刻与所述资源多租共享平台的连接;
    所述查询用于表征所述租户的读取操作;
    所述写入用于表征所述租户的删除操作、更新操作以及创建操作中的至少一项;
    所述订阅用于表征所述租户建立的订阅条件。
  19. 一种租户管理系统,包括处理器和存储器,所述处理器与所述存储器耦合,其特征在于,
    所述存储器,用于存储程序;
    所述处理器,用于执行所述存储器中的程序,使得所述租户管理系统执行如权利要求1-10中任一项所述的方法。
  20. 一种计算机可读存储介质,包括程序,当其在计算机上运行时,使得计算机执行如权利要求1-10中任一项所述的方法。
  21. 一种包含指令的计算机程序产品,当其在计算机上运行时,使得计算机执行如权利要求1-10中任一项所述的方法。
  22. 一种芯片,所述芯片包括处理器与数据接口,所述处理器通过所述数据接口读取存储器上存储的指令,执行如权利要求1-10中任一项所述的方法。
PCT/CN2022/105139 2021-07-14 2022-07-12 一种租户的资源管理方法及租户管理系统 WO2023284722A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202110797687.6A CN115617468A (zh) 2021-07-14 2021-07-14 一种租户的资源管理方法及租户管理系统
CN202110797687.6 2021-07-14

Publications (1)

Publication Number Publication Date
WO2023284722A1 true WO2023284722A1 (zh) 2023-01-19

Family

ID=84854934

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/105139 WO2023284722A1 (zh) 2021-07-14 2022-07-12 一种租户的资源管理方法及租户管理系统

Country Status (2)

Country Link
CN (1) CN115617468A (zh)
WO (1) WO2023284722A1 (zh)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116760639A (zh) * 2023-08-18 2023-09-15 深圳市大恒数据安全科技有限责任公司 一种用于多租户的数据安全隔离与共享框架实现方法
CN116887192A (zh) * 2023-08-08 2023-10-13 国能智慧科技发展(江苏)有限公司 一种基于共享载具的车载无线定位器管理系统、方法

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105095055A (zh) * 2015-07-22 2015-11-25 北京奇虎科技有限公司 用户活跃度统计方法及系统
US20170364345A1 (en) * 2016-06-15 2017-12-21 Microsoft Technology Licensing, Llc Update coordination in a multi-tenant cloud computing environment
CN109902921A (zh) * 2019-01-17 2019-06-18 平安城市建设科技(深圳)有限公司 用户成长体系的管理方法、装置、设备及存储介质
CN109992403A (zh) * 2017-12-30 2019-07-09 中国移动通信集团福建有限公司 多租户资源调度的优化方法、装置、终端设备及存储介质
CN111104226A (zh) * 2019-12-25 2020-05-05 东北大学 一种多租户服务资源的智能管理系统及方法

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105095055A (zh) * 2015-07-22 2015-11-25 北京奇虎科技有限公司 用户活跃度统计方法及系统
US20170364345A1 (en) * 2016-06-15 2017-12-21 Microsoft Technology Licensing, Llc Update coordination in a multi-tenant cloud computing environment
CN109992403A (zh) * 2017-12-30 2019-07-09 中国移动通信集团福建有限公司 多租户资源调度的优化方法、装置、终端设备及存储介质
CN109902921A (zh) * 2019-01-17 2019-06-18 平安城市建设科技(深圳)有限公司 用户成长体系的管理方法、装置、设备及存储介质
CN111104226A (zh) * 2019-12-25 2020-05-05 东北大学 一种多租户服务资源的智能管理系统及方法

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116887192A (zh) * 2023-08-08 2023-10-13 国能智慧科技发展(江苏)有限公司 一种基于共享载具的车载无线定位器管理系统、方法
CN116887192B (zh) * 2023-08-08 2024-02-13 国能智慧科技发展(江苏)有限公司 一种基于共享载具的车载无线定位器管理系统、方法
CN116760639A (zh) * 2023-08-18 2023-09-15 深圳市大恒数据安全科技有限责任公司 一种用于多租户的数据安全隔离与共享框架实现方法
CN116760639B (zh) * 2023-08-18 2023-10-31 深圳市大恒数据安全科技有限责任公司 一种用于多租户的数据安全隔离与共享框架实现方法

Also Published As

Publication number Publication date
CN115617468A (zh) 2023-01-17

Similar Documents

Publication Publication Date Title
CN112199194B (zh) 基于容器集群的资源调度方法、装置、设备和存储介质
WO2023284722A1 (zh) 一种租户的资源管理方法及租户管理系统
KR102154446B1 (ko) 분산·협업형 컨테이너 플랫폼 환경에서의 자원 균등 배분을 위한 고속 스케줄링 방법
Urgaonkar et al. Sharc: Managing CPU and network bandwidth in shared clusters
US8769238B1 (en) Load rebalancing for shared resource
US9497139B2 (en) Client-allocatable bandwidth pools
US8479211B1 (en) Dynamic resource commitment management
JP6372074B2 (ja) 情報処理システム,制御プログラム及び制御方法
US20170126583A1 (en) Method and electronic device for bandwidth allocation based on online media services
JP2011521319A (ja) 管理システムのコンピューティングリソースを管理するための方法および装置
JP2005182796A (ja) グリッド・システム資源の自律的制御のための装置、システム、および方法
US8706858B2 (en) Method and apparatus for controlling flow of management tasks to management system databases
US10379834B2 (en) Tenant allocation in multi-tenant software applications
CN105159775A (zh) 基于负载均衡器的云计算数据中心的管理系统和管理方法
KR20070005558A (ko) 그리드 시스템 자원의 온-디맨드 제어 장치, 시스템 및방법
US11249790B1 (en) Scheduling usage of oversubscribed computing resources
WO2024016596A1 (zh) 容器集群调度的方法、装置、设备及存储介质
CN111488121A (zh) 基于动态应用存取的映射系统和方法
US10846788B1 (en) Resource group traffic rate service
WO2017075967A1 (zh) 在线媒体服务的带宽分配方法及系统
WO2016041446A1 (zh) 一种资源分配方法、装置及设备
US20230327875A1 (en) Data flow control in distributed computing systems
WO2022057001A1 (zh) 一种设备纳管方法、系统及纳管集群
WO2019011262A1 (zh) 分配资源的方法和装置
JP2016086225A (ja) ネットワークシステム、ゲートウェイ装置用プログラム及び管理装置用プログラム

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 22841358

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 22841358

Country of ref document: EP

Kind code of ref document: A1