A method and apparatus for allocating a multi-tenant environment based on process orchestration
By using process orchestration and BPMN mechanism for tenant pool management, the problems of resource allocation delay and insufficient flexibility in multi-tenant environments are solved, and efficient and flexible resource allocation and rapid response to user needs are achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- 广州市玄瞳科技有限公司
- Filing Date
- 2024-12-09
- Publication Date
- 2026-06-19
AI Technical Summary
Existing technologies suffer from response latency and insufficient flexibility in multi-tenant, multi-version, and dynamic tenant request application environments, resulting in a poor user experience.
By introducing a tenant pool and pre-account opening tasks, user needs are obtained through process orchestration, and resources that meet the tenant environment are dynamically generated. The BPMN mechanism is used for resource configuration and priority sorting to achieve rapid resource search and reuse, ensuring the timeliness and flexibility of resource allocation.
It significantly improves the efficiency and flexibility of resource allocation, increases resource utilization, enhances the real-time nature of user account opening and the adaptability of the system, and ensures accurate resource allocation in complex or dynamic scenarios.
Smart Images

Figure CN119788674B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of multi-tenant SaaS platform resource management, and in particular to a method, apparatus, electronic device, and computer storage medium for allocating multi-tenant environments based on process orchestration. Background Technology
[0002] In platforms such as SaaS (Software as a Service) that require providing multiple different configuration environments, users typically need to obtain the corresponding tenant environment based on their needs when applying for the corresponding service. The tenant environment may include the standard version, professional version, and enterprise version for customer management systems; the merchant version and cross-border e-commerce version for e-commerce platforms; and the team collaboration version or enterprise version for collaborative office platforms. The databases, product modules, and functional permissions corresponding to different tenant environment types are different. The platform needs to allocate and configure the corresponding resources according to the user's tenant environment request to build the requested tenant environment.
[0003] In the traditional tenant environment allocation process, manual configuration by administrators or staff is usually required, such as selecting product version, module combination, setting the number of licenses, setting the usage period, and initializing data. This process is prone to errors due to its cumbersome nature, which affects efficiency, causes allocation delays, and impacts user experience.
[0004] Based on this, existing technologies can automatically allocate corresponding environment configurations according to user-submitted tenant environment requests by employing preset rules and automated scripts, thereby reducing manual intervention and achieving automated configuration of user tenant environment requests. However, when users need to expand tenant environments or combine configurations across multiple environments, the preset rules may not meet the needs of all tenant environments. This can lead to untimely allocation or inaccurate configuration in complex or rapidly changing scenarios. Consequently, existing technologies suffer from response latency and insufficient flexibility in multi-tenant, multi-version, and dynamic tenant request application environments, making it impossible to meet users' complex or dynamic tenant environment requests. Summary of the Invention
[0005] Therefore, the purpose of this invention is to provide a method for allocating multi-tenant environments based on process orchestration.
[0006] A method for allocating a multi-tenant environment based on process orchestration includes the following steps:
[0007] S1. Obtain the tenant service application data submitted by the user;
[0008] S2. Parse the configuration based on the tenant service request data to obtain key configuration parameters;
[0009] S3. Search the tenant pool according to the key configuration parameters and determine whether there is a matching tenant environment: if yes, obtain the fully matching tenant environment and execute step S5; if no, execute step S4; wherein, the tenant pool is used to store several different types of tenant environments.
[0010] S4: Perform a pre-account opening task on the current tenant pool to generate a fully matching tenant environment;
[0011] S5: Generate a unique user binding identifier based on the fully matched tenant environment, and complete the allocation of the tenant environment.
[0012] The multi-tenant environment allocation method based on process orchestration described in this invention, compared with existing technologies, significantly improves the efficiency and flexibility of resource allocation by introducing a tenant pool and pre-account opening tasks. Furthermore, by storing various types of tenant environments in the tenant pool, it supports rapid resource lookup and reuse, greatly improving resource utilization and enhancing the real-time nature of user account opening. Simultaneously, when the tenant pool cannot fully match user needs, a pre-account opening task is automatically triggered to dynamically generate a tenant environment that meets the user's requirements, thereby ensuring timely resource allocation. Therefore, this invention possesses advantages such as high resource reuse rate, strong dynamic expansion capability, and timely allocation.
[0013] Further, step S3 includes the following sub-steps:
[0014] Dynamic queries are performed based on key configuration parameters to combine tenant environments in the tenant pool that meet the corresponding configurations, resulting in a set of candidate tenant environments.
[0015] Next, the status of the candidate tenant environment set is queried, and the following judgment is made according to the following logic:
[0016]
[0017] In the formula, status i Let env be the i-th candidate tenant environment. i The allocation status; env i ≡config is a fully matching tenant environment; Tenant environments configured for differences; option i Let env be the i-th candidate tenant environment. i The matching status with the current key configuration parameters; if it indicates that it is assignable, then the current tenant environment env will be... i If the tenant environment is a fully matched one, proceed to step S5; if it is not assigned, generate a differential configuration item and proceed to step S4.
[0018] Step S4 includes the following sub-steps:
[0019] A pre-account opening task is generated based on the differential configuration items. At the same time, non-differential configuration items that meet the key configuration parameters in the current tenant environment are extracted, and their corresponding resource initialization sub-processes are generated.
[0020] Next, once the pre-account opening task is completed, a fully matched tenant environment is obtained.
[0021] This invention implements a full-match priority strategy through status queries to maximize the utilization of existing tenant pool resources and effectively reduce resource waste. Simultaneously, for partially matched tenant environments, it extracts differential configuration items from key configuration parameters, independently generates and processes these differential configurations, thereby ensuring the system can quickly respond to users' dynamic needs and avoid allocation delays caused by insufficient resource types. Accordingly, this invention achieves precise resource allocation through status queries and differential configuration item extraction, thereby enhancing the flexible resource allocation capability for complex needs and dynamic scenarios, significantly improving the utilization rate, response speed, and adaptability of multi-tenant resource allocation.
[0022] Furthermore, the tenant pool is dynamically updated through the following steps:
[0023] SA1: Monitor the tenant pool and obtain the current status of the tenant pool;
[0024] SA2. Determine if the current tenant pool status meets a trigger condition: if yes, proceed to step SA3; if no, proceed to step SA1.
[0025] The triggering conditions are specifically represented as follows:
[0026]
[0027] In the formula, the tenant environment margin represents the number of tenant environments that can be allocated in the current tenant pool, Th is the threshold for the number of tenant environments under alert; the initialization flag indicates whether there is an account opening failure event; and the sampling timer represents the dynamic update cycle of the tenant pool.
[0028] When the update is triggered by the tenant environment balance being lower than a threshold Th or by a set time, the known tenant environment template is called to generate the corresponding pre-account opening task based on the current balance status of the tenant pool resources.
[0029] When the update is triggered by an account opening failure event, the pre-account opening task corresponding to the difference configuration item of the account opening failure is obtained, and the tenant environment template is called to generate a pre-account opening task with a low remaining amount in the current tenant pool.
[0030] SA3. Based on the BPMN mechanism, the pre-account opening task is divided into several tenant configuration sub-tasks.
[0031] SA4. Connect the configuration subtasks of several tenants according to the sequential flow to obtain the sub-processes and main process associated with the environment of several tenants;
[0032] SA5: Initializes the configuration based on the sub-processes and main process associated with several tenant environments, and completes the update of the tenant pool.
[0033] This invention ensures a sufficient supply of allocable tenant environments in the tenant pool by dynamically monitoring the tenant pool status, employing a multi-condition triggering mechanism, and utilizing BPMN task partitioning. Furthermore, in scenarios involving resource shortages, account opening failures, or dynamic demands, BPMN task partitioning can quickly generate and adjust resource configurations, significantly improving real-time response capabilities and resource utilization. This, in turn, ensures timely and efficient resource allocation in complex multi-tenant scenarios.
[0034] Furthermore, the tenant pool dynamic update step SA3 includes the following sub-steps:
[0035] The tenant environments that need to be updated in the pre-account opening task are prioritized and sorted to obtain the sorted tenant environments to be updated; wherein, the priority sorting sets the tenant environments that failed to open accounts as priority updates, the tenant environments with sufficient resources as secondary updates, and the tenant environments with insufficient resources as last updates.
[0036] Based on the sorted tenant environments to be updated (env) i Generate several corresponding tenant configuration subtasks. For the i-th tenant environment env i The specific representation of the subtask generation logic is as follows:
[0037] task(env i )={t k |t k =(type) k ,state k dependency k )}
[0038] In the formula, task(env) i ) represents the set of subtasks for the i-th tenant environment to be updated, including several subtasks t. k ;t k This represents the i-th tenant environment env to be updated. i The k-th subtask consists of resource type, resource status, and dependencies; type k This represents the resource type of the k-th subtask, such as a database, storage, or functional module; statek This represents the resource status of the k-th subtask, including allocable, pending allocation, and unavailable; dependency k This represents the dependency relationship of the k-th subtask;
[0039] The tenant pool dynamic update step SA4 includes the following sub-steps:
[0040] Based on the dependencies in several tenant configuration subtasks, a sequential flow is used to connect the interdependent tenant configuration subtasks to obtain a sub-process associated with several tenant environments.
[0041] The main process is obtained by integrating the sub-processes associated with several tenant environments based on the corresponding tenant environment.
[0042] The tenant pool dynamic update step SA5 includes the following sub-steps:
[0043] Concurrent initialization is performed on the sub-processes associated with the tenant environment based on the main process;
[0044] Once all the corresponding sub-processes in the main process have completed initialization, the current tenant environment status is updated to pending allocation and uploaded to the tenant pool, thus completing the update of the tenant pool.
[0045] Meanwhile, if the tenant environment initialized by the current pre-account opening task is a differential configuration item triggered by an account opening failure, the resources of the tenant environment template will be updated according to the corresponding configuration item.
[0046] Accordingly, when dealing with scenarios involving insufficient resources, failed account openings, or dynamic demands, the real-time nature and utilization of resource allocation are ensured through task priority strategies and concurrent initialization. Simultaneously, this invention enriches the resource types of the tenant pool through a tenant environment template update mechanism, thereby providing self-optimization and continuous expansion capabilities for complex multi-tenant scenarios, and thus better adapting to application environments with multiple tenants, multiple versions, and dynamic tenant requests.
[0047] A multi-tenant resource allocation device based on process orchestration includes a tenant application data acquisition unit, a configuration parsing unit, a tenant pool lookup unit, a pre-account opening unit, and a tenant environment initialization unit;
[0048] The tenant application data acquisition unit is used to acquire tenant service application data submitted by the user;
[0049] The configuration parsing unit is used to parse the configuration based on the tenant service application data and obtain key configuration parameters;
[0050] The tenant pool lookup unit is used to search the tenant pool according to key configuration parameters and determine whether a matching tenant environment exists: if so, a fully matching tenant environment is obtained and the tenant environment initialization unit is called; otherwise, the pre-account opening unit is called; wherein, the tenant pool is used to store several different types of tenant environments;
[0051] The pre-account opening unit is used to perform pre-account opening tasks on the current tenant pool and generate a fully matching tenant environment.
[0052] The tenant environment initialization unit is used to generate a unique user binding identifier based on a fully matched tenant environment, thereby completing the allocation of the tenant environment.
[0053] Furthermore, the tenant pool lookup unit is used to perform the following sub-steps:
[0054] Dynamic queries are performed based on key configuration parameters to combine tenant environments in the tenant pool that meet the corresponding configurations, resulting in a set of candidate tenant environments.
[0055] Next, the status of the candidate tenant environment set is queried, and the following judgment is made according to the following logic:
[0056]
[0057] In the formula, status i Let env be the i-th candidate tenant environment. i The allocation status; env i ≡config is a fully matching tenant environment; Tenant environments configured for differences; option i Let env be the i-th candidate tenant environment. i The matching status with the current key configuration parameters; if it indicates that it is assignable, then the current tenant environment env will be... i As a fully matched tenant environment, the tenant environment initialization unit is invoked; if it is indicated as unassignable, a differential configuration item is generated, and the pre-account opening unit is invoked.
[0058] The pre-account opening unit is used to perform the following sub-steps:
[0059] A pre-account opening task is generated based on the differential configuration items. At the same time, non-differential configuration items that meet the key configuration parameters in the current tenant environment are extracted, and their corresponding resource initialization sub-processes are generated.
[0060] Next, once the pre-account opening task is completed, a fully matched tenant environment is obtained.
[0061] Furthermore, the tenant pool is dynamically updated through the following steps:
[0062] SA1: Monitor the tenant pool and obtain the current status of the tenant pool;
[0063] SA2. Determine if the current tenant pool status meets a trigger condition: if yes, proceed to step SA3; if no, proceed to step SA1.
[0064] The triggering conditions are specifically represented as follows:
[0065]
[0066] In the formula, the tenant environment margin represents the number of tenant environments that can be allocated in the current tenant pool, Th is the threshold for the number of tenant environments under alert; the initialization flag indicates whether there is an account opening failure event; and the sampling timer represents the dynamic update cycle of the tenant pool.
[0067] When the update is triggered by the tenant environment balance being lower than a threshold Th or by a set time, the known tenant environment template is called to generate the corresponding pre-account opening task based on the current balance status of the tenant pool resources.
[0068] When the update is triggered by an account opening failure event, the pre-account opening task corresponding to the difference configuration item of the account opening failure is obtained, and the tenant environment template is called to generate a pre-account opening task with a low remaining amount in the current tenant pool.
[0069] SA3. Based on the BPMN mechanism, the pre-account opening task is divided into several tenant configuration sub-tasks.
[0070] SA4. Connect the configuration subtasks of several tenants according to the sequential flow to obtain the sub-processes and main process associated with the environment of several tenants;
[0071] SA5: Initializes the configuration based on the sub-processes and main process associated with several tenant environments, and completes the update of the tenant pool.
[0072] Furthermore, the tenant pool dynamic update step SA3 includes the following sub-steps:
[0073] The tenant environments that need to be updated in the pre-account opening task are prioritized and sorted to obtain the sorted tenant environments to be updated; wherein, the priority sorting sets the tenant environments that failed to open accounts as priority updates, the tenant environments with sufficient resources as secondary updates, and the tenant environments with insufficient resources as last updates.
[0074] Based on the sorted tenant environments to be updated (env) i Generate several corresponding tenant configuration subtasks. For the i-th tenant environment env i The specific representation of the subtask generation logic is as follows:
[0075] task(env i )={t k |t k =(type) k ,state k dependency k )}
[0076] In the formula, task(env) i ) represents the set of subtasks for the i-th tenant environment to be updated, including several subtasks t. k ;t k This represents the i-th tenant environment env to be updated. i The k-th subtask consists of resource type, resource status, and dependencies; type k This represents the resource type of the k-th subtask, such as a database, storage, or functional module; state k This represents the resource status of the k-th subtask, including allocable, pending allocation, and unavailable; dependency k This represents the dependency relationship of the k-th subtask;
[0077] The tenant pool dynamic update step SA4 includes the following sub-steps:
[0078] Based on the dependencies in several tenant configuration subtasks, a sequential flow is used to connect the interdependent tenant configuration subtasks to obtain a sub-process associated with several tenant environments.
[0079] The main process is obtained by integrating the sub-processes associated with several tenant environments based on the corresponding tenant environment.
[0080] The tenant pool dynamic update step SA5 includes the following sub-steps:
[0081] Concurrent initialization is performed on the sub-processes associated with the tenant environment based on the main process;
[0082] Once all the corresponding sub-processes in the main process have completed initialization, the current tenant environment status is updated to pending allocation and uploaded to the tenant pool, thus completing the update of the tenant pool.
[0083] Meanwhile, if the tenant environment initialized by the current pre-account opening task is a differential configuration item triggered by an account opening failure, the resources of the tenant environment template will be updated according to the corresponding configuration item.
[0084] To better understand and implement this invention, the following detailed description is provided in conjunction with the accompanying drawings. Attached Figure Description
[0085] Figure 1This is a simplified structural diagram of the multi-tenant resource allocation device based on process orchestration described in this invention;
[0086] Figure 2 This is a simplified flowchart illustrating the allocation method for a multi-tenant environment based on process orchestration as described in this invention.
[0087] Figure 3 This is a simplified schematic diagram illustrating a simulated process example of the allocation method for a multi-tenant environment based on process orchestration as described in this invention. Detailed Implementation
[0088] To address the issues of response latency and insufficient flexibility in existing technologies for multi-tenant, multi-version, and dynamic tenant request environments, this invention parses tenant application data to obtain key configuration parameters. Based on these parameters, it searches the tenant pool. If a matching tenant environment already exists in the pool, it is directly allocated; otherwise, a pre-account opening task is generated based on the key configuration parameters, and the pre-accounted, fully matching tenant environment is allocated to the user, thus completing the account opening process. The tenant pool is dynamically updated and replenished through an event-driven mechanism to ensure that tenant environments remain available. The pre-account opening task uses BPMN-based process orchestration to modularize the tenant environment initialization process, allowing for flexible resource combination based on user needs. Therefore, this invention, through dynamic tenant management, BPMN process orchestration for account opening, and an event-driven mechanism to supplement and expand the tenant pool, ensures that the system can provide real-time, accurate, and customized tenant environment allocation under high concurrency and rapidly changing user needs, significantly improving the flexibility and response speed of tenant allocation.
[0089] Based on the above design, this invention proposes a multi-tenant environment allocation method based on process orchestration, and based on this method, proposes a multi-tenant resource allocation device based on process orchestration.
[0090] Please also refer to Figure 1 , Figure 2 and Figure 3 , Figure 1 This is a simplified structural diagram of the multi-tenant resource allocation device based on process orchestration described in this invention. Figure 2 This is a simplified flowchart illustrating the allocation method for a multi-tenant environment based on process orchestration as described in this invention. Figure 3 This is a simplified schematic diagram illustrating a simulated process example of the allocation method for a multi-tenant environment based on process orchestration as described in this invention.
[0091] The multi-tenant resource allocation device based on process orchestration includes a tenant application data acquisition unit 1, a configuration parsing unit 2, a tenant pool search unit 3, a pre-account opening unit 4, and a tenant environment initialization unit 5.
[0092] The tenant application data acquisition unit 1 is used to perform step S1: acquire the tenant service application data submitted by the user.
[0093] Specifically, the tenant service application data may include product modules and subscription information. The product modules include basic modules, secondary modules, and value-added modules, etc., and the subscription information includes the number of licenses, subscription period, etc. The specific representation of the tenant service application data is as follows:
[0094] Apply={{d i =get(d i )|i∈[1,n]},{s j =get(s j |j∈[1,m]}}
[0095] In the formula, Apply represents tenant service request data; d i s represents the i-th selected product module, and n represents the total number of available product modules; j This indicates the j-th selected subscription information, and m represents the total number of available subscription information; get(·) means retrieving relevant product modules or subscription information based on data selected by the user in the front-end interface or submitted by the API interface.
[0096] Users can choose the corresponding product modules and subscription information according to their own needs, or choose the templates provided by the platform, such as the standard version of the AI function module, the demo version of the cloud service, etc., which may include different versions of services. For example, the same service can be selected as demo version, basic version, advanced version or customized version.
[0097] The subscription information may vary depending on the marketing methods of different platforms, such as the number of user-shared licenses, the number of device connection licenses, or the subscription period on a daily, monthly, quarterly, or annual basis. Accordingly, this invention does not specifically limit the product modules (services) and the specific details of the subscription information.
[0098] The configuration parsing unit 2 is used to perform step S2: perform configuration parsing based on the tenant service application data to obtain key configuration parameters.
[0099] Specifically, the configuration parsing will retrieve the product module d from the tenant service application data Apply. i and subscription information j The matching process is performed and converted into a configuration manifest, which is used to subsequently search for whether a tenant environment with the corresponding configuration exists in the tenant pool, thereby obtaining key configuration parameters. The specific representation of the key configuration parameter Config is as follows:
[0100] Config = {Cfg d ,Cfgs}
[0101] In the formula, Cfg d This is a set of configurations related to product module d, used to define the system requirements and environment dependencies for each product module. Specific options include operating system type, version number, database version, library file version, etc.; Cfg s This is a set of configurations related to the subscription information s, used to define the tenant's subscription requirements and resource limits, specifically including the number of users, the number of shared devices, storage capacity, the number of API calls, etc.
[0102] The matching rules are based on a system-preset template or processed by a rule engine to transform tenant service application data into standard configurations usable by the system. For example, if the tenant service application data submitted by the user is "demo version-trial-single user", the preset template will convert it into "system type A-functional limitation B-resource requirement C" to obtain key configuration parameters.
[0103] Since different matching rules can be customized according to different business needs, this invention does not specifically limit the selection of matching rules.
[0104] The tenant pool lookup unit 3 is used to perform step S3: search the tenant pool according to the key configuration parameters and determine whether there is a matching tenant environment: if yes, then call the tenant environment initialization unit 5; if no, then call the pre-account opening unit 4.
[0105] Specifically, based on the key configuration parameter Config, a dynamic query is performed to combine tenant environments in the tenant pool that match the corresponding configuration to obtain a set of candidate tenant environments;
[0106] The dynamic query uses a preset rule template or rule engine to query the tenant pool to quickly filter tenant environments with large configuration differences. The set of candidate tenant environments includes fully matching tenant environments and tenant environments with different configurations. The fully matching tenant environment... i ≡config indicates that all configuration items in this tenant environment are consistent with the key configuration parameters; the tenant environment with the differing configurations, This indicates that some configuration items in the tenant's environment meet the key difference parameters.
[0107] Next, the status of the candidate tenant environment set is queried, and the following judgment is made according to the following logic:
[0108]
[0109] In the formula, status i Let env be the i-th candidate tenant environment. iThe allocation status; option i Let env be the i-th candidate tenant environment. i The matching status with the current key configuration parameters; if it indicates that it is assignable, then the current tenant environment env will be... i As a fully matched tenant environment, the tenant environment initialization unit 5 is invoked; if it is indicated as unassignable, a differential configuration item is generated, and the pre-account opening unit 4 is invoked.
[0110] It should be noted that during the dynamic query and allocation process, in order to ensure that the tenant environment in the tenant pool is not repeatedly allocated in high-concurrency scenarios, this invention further performs state locking operations on the tenant environment in the tenant pool to ensure that the tenant pool state follows the ACID principle and to guarantee the accuracy and consistency of tenant environment allocation.
[0111] Based on this, the present invention can not only quickly find and allocate tenant environments that meet user needs, but also further perform pre-account opening tasks through differentially configured tenant environments in the absence of fully matching tenant environments, thereby maximizing resource utilization and significantly reducing account opening time.
[0112] The pre-account opening unit 4 is used to perform step S4: perform a pre-account opening task on the current tenant pool to generate a fully matching tenant environment.
[0113] Specifically, a pre-account opening task is generated based on the differential configuration items, and while waiting for pre-account opening, non-differential configuration items that have met the key configuration parameters in the current tenant environment are extracted, and a sub-process for initializing the corresponding required resources is generated; wherein, the pre-account opening task includes operations for supplementing and initializing resources corresponding to the differential configuration items.
[0114] Once the pre-account opening task is completed, a perfectly matching tenant environment is generated, and the tenant environment initialization unit 5 is called directly.
[0115] Accordingly, in the execution of the pre-account opening task, the present invention adopts an asynchronous parallel mechanism to achieve efficient coordination of resource replenishment and module initialization tasks, reuses the existing configured resource initialization sub-process, and quickly generates a fully matching tenant environment, thereby greatly improving the system response speed and significantly shortening the user's account opening waiting time.
[0116] The tenant environment initialization unit 5 is used to perform step S5: assign a fully matching tenant environment to the corresponding user and complete the account opening.
[0117] Specifically, a unique user binding identifier is generated based on the fully matched tenant environment to ensure the user's exclusive access to and use of the tenant environment, and the corresponding tenant environment allocation status in the tenant pool is updated to "allocated", thus completing the allocation of the tenant environment.
[0118] To ensure that the tenant pool maintains a sufficient number of allocable tenant environments, this invention employs an event-driven mechanism to monitor the tenant pool. When the monitored information meets the update triggering conditions, a pre-opening task is executed to dynamically update the tenant pool. The dynamic update of the tenant pool specifically includes the following steps:
[0119] SA1: Monitors the tenant pool and obtains the current status of the tenant pool.
[0120] The current tenant pool status includes the remaining resources of each version of the tenant environment, the initialization status, and the sampling timer. The remaining resources are the resource data that can be allocated to the current tenant pool. The initialization status is used to represent successful account opening events and failed account opening events. The sampling timer is the update interval of the tenant pool.
[0121] SA2: Determine whether the current tenant pool status meets a trigger condition: if yes, execute step SA3; if no, execute step SA1.
[0122] The triggering conditions are specifically represented as follows:
[0123]
[0124] In the formula, the tenant environment margin represents the number of tenant environments that can be allocated in the current tenant pool, Th is the tenant environment warning number threshold, which is used to ensure that the number of available tenant environments is not less than a certain number; the initialization flag indicates whether there is an account opening failure event. When an account opening failure event occurs, the dynamic update process of the tenant pool is immediately invoked to ensure that the corresponding tenant environment is allocated to the user as quickly as possible; the sampling timer represents the dynamic update cycle of the tenant pool.
[0125] When the update is triggered by the tenant environment balance falling below a threshold or by a set time, the known tenant environment template is invoked, and a corresponding pre-account opening task is generated based on the current balance status of the tenant pool resources, thereby ensuring that the configuration of commonly used tenant environments in the tenant pool is maintained at a reasonable level.
[0126] When the update is triggered by an account opening failure event, the pre-account opening task corresponding to the difference configuration item of the account opening failure is obtained, and the tenant environment template is called to generate a pre-account opening task with a low balance in the current tenant pool, thereby supplementing other common tenant environment types in the tenant pool.
[0127] The tenant environment template has different configuration templates for different resource types. Different tenant environments can be formed by combining different configuration templates.
[0128] It is important to note that since account opening failures may involve mismatched configuration parameters or missing tenant environment templates, to ensure the security and consistency of environment configurations, this invention records the difference in configuration items for failed account openings when generating the pre-account opening task. If the current template cannot directly support these configuration items, the reason for the failure is recorded in the template supplementary record, and the operations and maintenance personnel are notified to intervene. At the same time, logs are generated for the difference in configuration items for subsequent template optimization, thereby ensuring that the missing tenant environment types due to account opening failures are promptly supplemented. As a result, when the pre-account opening task succeeds, the tenant environment template resources of the tenant pool will be gradually enriched and improved to adapt to diverse user needs.
[0129] SA3: Based on the BPMN mechanism, the pre-account opening task is divided into several tenant configuration sub-tasks.
[0130] Specifically, the tenant environments that need to be updated in the pre-account opening task are prioritized and sorted to obtain the sorted tenant environments to be updated; wherein, the priority sorting sets the tenant environments that failed to open accounts as priority updates, the tenant environments with sufficient resources as secondary updates, and the tenant environments with insufficient resources as last updates.
[0131] Next, based on the sorted tenant environments (env) to be updated... i Generate several corresponding tenant configuration subtasks. For the i-th tenant environment env i The specific representation of the subtask generation logic is as follows:
[0132] task(env i )={t k |t k =(type) k ,state k dependency k )}
[0133] In the formula, task(env) i ) represents the set of subtasks for the i-th tenant environment to be updated, including several subtasks t. k ;t k This represents the i-th tenant environment env to be updated. i The k-th subtask consists of resource type, resource status, and dependencies;
[0134] type k Indicates the resource type of the k-th subtask, such as: database, storage, or functional module, etc.
[0135] state k This indicates the resource status of the k-th subtask, specifically including allocable, pending allocation, and unavailable. When the resource status is marked as allocable, it means that the current subtask has sufficient resources and can directly perform initialization.
[0136] When the resource status is pending allocation, it means that the resources required by the current subtask are missing and it is necessary to wait for the resources to be replenished.
[0137] When a resource is unavailable, it means that the resources required by the current subtask are abnormal and require intervention from operations and maintenance personnel.
[0138] dependency k This represents the dependency relationship of the k-th subtask. This dependency relationship indicates the association conditions between the current subtask and other subtasks in terms of resources and execution logic, ensuring that all subtasks can be executed in the correct order, thereby avoiding resource conflicts or task execution errors. For example, if the resources required by the current subtask are provided by other subtasks after completion: the database initialization task depends on the storage resource replenishment task; or, the current subtask depends on functional modules that have been completed by other tasks: the module deployment task is waiting for the basic module initialization to complete. Accordingly, dependencies can be used to sequentially associate related subtasks to avoid resource conflicts, duplicate resource calls, or execution errors, thereby ensuring efficient processing of pre-tasks.
[0139] Since the dependencies of subtasks vary greatly depending on the business scenarios, functional modules, and resource requirements of different SaaS services, this invention aggregates the dependencies of all tasks by having operations and maintenance personnel build a resource dependency tree, and generates the resource and function dependencies required by different tasks through parentheses sorting, thereby ensuring that the resource usage and execution logic of task components do not conflict.
[0140] However, this dependency relationship can be constructed or divided in different ways depending on the actual scenario. Therefore, this invention does not specifically limit the specific definition and generation rules of its dependency relationship in order to ensure that it meets the diverse needs of SaaS services and thus adapts to the complex dependency structure of different SaaS service scenarios.
[0141] It is important to note that for unavailable resource states involved in task generation, this invention will generate corresponding tagging information to notify operations and maintenance personnel to allocate resources and adjust permissions, thereby ensuring permission separation and preventing security risks caused by system automation processes, and ensuring that all resource allocations comply with the system's security policy.
[0142] SA4: Connect several tenant configuration subtasks according to the sequential flow to obtain the sub-processes and main process associated with several tenant environments.
[0143] Specifically, based on the dependencies in several tenant configuration subtasks, a sequential flow is used to connect the interdependent tenant configuration subtasks to obtain a sub-process associated with several tenant environments; wherein, the associated sub-process is used to represent a local task set and is used to complete the initialization configuration of the resources or modules required for the subtask.
[0144] Next, the sub-processes associated with several tenant environments are integrated according to the corresponding tenant environment to obtain the main process; the main process is used to represent the complete path for initializing and configuring the current tenant environment.
[0145] Accordingly, this invention integrates local subtasks into related subprocesses based on dependencies, thereby avoiding problems such as duplicate resource calls, invalid waiting, or resource contention, thus improving task execution efficiency and overall process visibility. Furthermore, the structured design of the main process and subprocesses ensures that the initialization process of each tenant environment completes initialization according to predetermined logic, thus avoiding process anomalies caused by resource conflicts. Simultaneously, by independently dividing the main process, this invention effectively solves the resource sharing problem that may exist in multi-tenant environments, ensuring the stability and flexibility of the system in high-concurrency scenarios, and meeting the requirements of multi-tenant SaaS platforms for resource isolation, configuration optimization, and task execution efficiency, significantly improving the overall performance and user experience of tenant environment initialization.
[0146] SA5: Initializes the configuration based on the sub-processes and main process associated with several tenant environments, and completes the update of the tenant pool.
[0147] Specifically, the sub-processes associated with the tenant environment are concurrently initialized according to the main process, and the status of the sub-processes that have completed initialization is marked.
[0148] Once all corresponding sub-processes in the main process have completed initialization, the current tenant environment status is updated to pending allocation and uploaded to the tenant pool, thus completing the update of the tenant pool.
[0149] Meanwhile, if the tenant environment initialized by the current pre-account opening task is a differential configuration item triggered by the account opening failure, the resources of the tenant environment template will be updated according to the corresponding configuration item so that other users can directly call it when applying for the same tenant environment configuration.
[0150] Accordingly, for newly added tenant environments or differential configuration tasks generated due to account opening failures, the tenant pool is dynamically updated to enable the corresponding preset template components in the tenant pool to cover more user needs scenarios, thereby realizing the self-iteration and optimization capabilities of the tenant pool and enabling the tenant pool to store more tenant environment templates that better meet the needs of platform users.
[0151] Compared to existing technologies, this invention, based on a tenant pool and priority matching mechanism, ensures real-time response to tenant environment opening requests. It ensures that the allocation of tenant environments has significant real-time performance and accuracy in complex scenarios or rapidly changing dynamic environments, thereby effectively avoiding allocation delays or inaccurate configurations and improving the adaptability to multi-tenant and multi-version requests.
[0152] Furthermore, through the dynamic update and expansion mechanism of the tenant pool, this invention can dynamically supplement resources by generating differential configuration tasks when dealing with scenarios of insufficient resources or failed account opening. At the same time, it updates the templates of newly added tenant environments, thereby continuously enriching the types of tenant environments and significantly improving the flexibility of tenant environment allocation. This, in turn, meets the needs of efficient processing of complex and dynamic changes in multi-tenant environments.
[0153] Based on the same inventive concept, this application also provides an electronic device, which can be a server, desktop computing device, or mobile computing device (e.g., laptop computing device, handheld computing device, tablet computer, netbook, etc.). The device includes one or more processors and a memory, wherein the processor is used to execute a program to implement the allocation method for a multi-tenant environment based on process orchestration according to embodiments of the present invention; the memory is used to store computer programs executable by the processor.
[0154] Based on the same inventive concept, this application also provides a computer-readable storage medium corresponding to the aforementioned embodiment of a process orchestration-based multi-tenant environment allocation method. The computer-readable storage medium stores a computer program thereon, which, when executed by a processor, implements the steps of the process orchestration-based multi-tenant environment allocation method described in any of the above embodiments.
[0155] This application may take the form of a computer program product implemented on one or more storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing program code. Computer storage media include permanent and non-permanent, removable and non-removable media, and information storage can be implemented by any method or technology. Information may be computer-readable instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to: phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transfer medium that can be used to store information accessible by a computing device.
[0156] The embodiments described above are merely examples of several implementations of the present invention, and while the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the invention. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of the present invention, and the present invention also intends to include these modifications and variations.
Claims
1. A method for allocating a process orchestration based multi-tenant environment, characterized in that, Includes the following steps: S1. Obtain the tenant service application data submitted by the user; S2, according to tenant service application data configuration analysis, obtain key configuration parameters; key configuration parameters The specific representation is as follows: In the formula, For product modules The relevant configuration set is used to define the system requirements and environment dependencies of each product module; For subscription information The relevant configuration set is used to define the tenant's subscription requirements and resource limits; S3. Search the tenant pool according to the key configuration parameters and determine whether there is a matching tenant environment: if yes, obtain the fully matching tenant environment and execute step S5; if no, execute step S4; wherein, the tenant pool is used to store several different types of tenant environments. S4: Perform a pre-opening task for the current tenant pool to generate a fully matching tenant environment: Generate a pre-opening task based on the differential configuration items, and while waiting for pre-opening, extract the non-differential configuration items in the current tenant environment that have met the key configuration parameters, and generate a sub-process for initializing the corresponding required resources; wherein, the pre-opening task includes operations for supplementing and initializing resources corresponding to the differential configuration items. S5: Generate a unique user binding identifier based on the fully matched tenant environment, and complete the allocation of the tenant environment.
2. The allocation method for a multi-tenant environment based on process orchestration according to claim 1, characterized in that, Step S3 includes the following sub-steps: Dynamic queries are performed based on key configuration parameters to combine tenant environments in the tenant pool that meet the corresponding configurations, resulting in a set of candidate tenant environments. Next, the status of the candidate tenant environment set is queried, and the following judgment is made according to the following logic: In the formula, Represented as the first Alternative tenant environments The allocation status; For a perfectly matched tenant environment; Tenant environments configured differently; Represented as the first Alternative tenant environments The matching status with the current key configuration parameters; if it indicates that it is allocable, then the current tenant environment will be... If the tenant environment is a fully matched one, proceed to step S5; if it is not assigned, generate a differential configuration item and proceed to step S4. Step S4 includes the following sub-steps: A pre-account opening task is generated based on the differential configuration items. At the same time, non-differential configuration items that meet the key configuration parameters in the current tenant environment are extracted, and their corresponding resource initialization sub-processes are generated. Next, once the pre-account opening task is completed, a fully matched tenant environment is obtained.
3. The allocation method for a multi-tenant environment based on process orchestration according to claim 2, characterized in that, The tenant pool is dynamically updated through the following steps: SA1: Monitor the tenant pool and obtain the current status of the tenant pool; SA2. Determine if the current tenant pool status meets a trigger condition: if yes, proceed to step SA3; if no, proceed to step SA1. The triggering conditions are specifically represented as follows: In the formula, the tenant environment margin represents the number of tenant environments that can be allocated in the current tenant pool. The threshold for the number of tenant environment alerts; the initialization flag indicates whether there is currently an account opening failure event; the sampling timer indicates the dynamic update cycle of the tenant pool; The update is triggered when the tenant's environment margin is below a threshold. When triggered by a set time, the known tenant environment template is invoked, and the corresponding pre-account opening task is generated based on the current tenant pool resource availability status. When the update is triggered by an account opening failure event, the pre-account opening task corresponding to the difference configuration item of the account opening failure is obtained, and the tenant environment template is called to generate a pre-account opening task with a low remaining amount in the current tenant pool. SA3. Based on the BPMN mechanism, the pre-account opening task is divided into several tenant configuration sub-tasks. SA4. Connect the configuration subtasks of several tenants according to the sequential flow to obtain the sub-processes and main process associated with the environment of several tenants; SA5: Initializes the configuration based on the sub-processes and main process associated with several tenant environments, and completes the update of the tenant pool.
4. The method of assigning a process orchestration based multi-tenant environment of claim 3, wherein, The tenant pool dynamic update step SA3 includes the following sub-steps: The tenant environments that need to be updated in the pre-account opening task are prioritized and sorted to obtain the sorted tenant environments to be updated; wherein, the priority sorting sets the tenant environments that failed to open accounts as priority updates, the tenant environments with sufficient resources as secondary updates, and the tenant environments with insufficient resources as last updates. Based on the sorted tenant environments to be updated This generates several corresponding tenant configuration subtasks. For the first... Individual tenant environment The specific representation of the subtask generation logic is as follows: In the formula, Indicates the first A set of subtasks for updating a tenant environment, comprising several subtasks. ; Indicates the first Tenant environment awaiting update The Each subtask consists of resource type, resource status, and dependencies; Indicates the first The resource type of each subtask, such as: database, storage; This indicates the resource status of the k-th subtask, including allocable, pending allocation, and unavailable. Indicates the first Dependencies between subtasks; The tenant pool dynamic update step SA4 includes the following sub-steps: Based on the dependencies in several tenant configuration subtasks, a sequential flow is used to connect the interdependent tenant configuration subtasks to obtain a sub-process associated with several tenant environments. The main process is obtained by integrating the sub-processes associated with several tenant environments based on the corresponding tenant environment. The tenant pool dynamic update step SA5 includes the following sub-steps: Concurrent initialization is performed on the sub-processes associated with the tenant environment based on the main process; Once all the corresponding sub-processes in the main process have completed initialization, the current tenant environment status is updated to pending allocation and uploaded to the tenant pool, thus completing the update of the tenant pool. Meanwhile, if the tenant environment initialized by the current pre-account opening task is a differential configuration item triggered by an account opening failure, the resources of the tenant environment template will be updated according to the corresponding configuration item.
5. A process-orchestration-based multi-tenant resource allocation apparatus for executing the allocation method for a process-orchestration-based multi-tenant environment as described in claim 1, characterized in that, It includes a tenant application data acquisition unit, a configuration parsing unit, a tenant pool lookup unit, a pre-account opening unit, and a tenant environment initialization unit; The tenant application data acquisition unit is used to acquire tenant service application data submitted by the user; The configuration parsing unit is used to parse the configuration based on the tenant service application data and obtain key configuration parameters; The tenant pool lookup unit is used to search the tenant pool according to key configuration parameters and determine whether a matching tenant environment exists: if so, a fully matching tenant environment is obtained and the tenant environment initialization unit is called; otherwise, the pre-account opening unit is called; wherein, the tenant pool is used to store several different types of tenant environments; The pre-account opening unit is used to perform pre-account opening tasks on the current tenant pool and generate a fully matching tenant environment. The tenant environment initialization unit is used to generate a unique user binding identifier based on a fully matched tenant environment, thereby completing the allocation of the tenant environment. 6.The process orchestration based multi-tenant resource allocation apparatus of claim 5, wherein, The tenant pool lookup unit performs the following sub-steps: Dynamic queries are performed based on key configuration parameters to combine tenant environments in the tenant pool that meet the corresponding configurations, resulting in a set of candidate tenant environments. Next, the status of the candidate tenant environment set is queried, and the following judgment is made according to the following logic: In the formula, Represented as the first Alternative tenant environments The allocation status; For a perfectly matched tenant environment; Tenant environments configured differently; Represented as the first Alternative tenant environments The matching status with the current key configuration parameters; if it indicates that it is allocable, then the current tenant environment will be... As a fully matched tenant environment, the tenant environment initialization unit is invoked; if it is indicated as unassignable, a differential configuration item is generated, and the pre-account opening unit is invoked. The pre-account opening unit is used to perform the following sub-steps: A pre-account opening task is generated based on the differential configuration items. At the same time, non-differential configuration items that meet the key configuration parameters in the current tenant environment are extracted, and their corresponding resource initialization sub-processes are generated. Next, once the pre-account opening task is completed, a fully matched tenant environment is obtained.
7. The multi-tenant resource allocation device based on process orchestration according to claim 6, characterized in that, The tenant pool is dynamically updated through the following steps: SA1: Monitor the tenant pool and obtain the current status of the tenant pool; SA2. Determine if the current tenant pool status meets a trigger condition: if yes, proceed to step SA3; if no, proceed to step SA1. The triggering conditions are specifically represented as follows: In the formula, the tenant environment margin represents the number of tenant environments that can be allocated in the current tenant pool. The threshold for the number of tenant environment alerts; the initialization flag indicates whether there is currently an account opening failure event; the sampling timer indicates the dynamic update cycle of the tenant pool; The update is triggered when the tenant's environment margin is below a threshold. When triggered by a set time, the known tenant environment template is invoked, and the corresponding pre-account opening task is generated based on the current tenant pool resource availability status. When the update is triggered by an account opening failure event, the pre-account opening task corresponding to the difference configuration item of the account opening failure is obtained, and the tenant environment template is called to generate a pre-account opening task with a low remaining amount in the current tenant pool. SA3. Based on the BPMN mechanism, the pre-account opening task is divided into several tenant configuration sub-tasks. SA4. Connect the configuration subtasks of several tenants according to the sequential flow to obtain the sub-processes and main process associated with the environment of several tenants; SA5: Initializes the configuration based on the sub-processes and main process associated with several tenant environments, and completes the update of the tenant pool. 8.The process orchestration based multi-tenant resource allocation apparatus of claim 7, wherein, The tenant pool dynamic update step SA3 includes the following sub-steps: The tenant environments that need to be updated in the pre-account opening task are prioritized and sorted to obtain the sorted tenant environments to be updated; wherein, the priority sorting sets the tenant environments that failed to open accounts as priority updates, the tenant environments with sufficient resources as secondary updates, and the tenant environments with insufficient resources as last updates. Based on the sorted tenant environments to be updated This generates several corresponding tenant configuration subtasks. For the first... Individual tenant environment The specific representation of the subtask generation logic is as follows: In the formula, Indicates the first A set of subtasks for updating a tenant environment, comprising several subtasks. ; Indicates the first Tenant environment awaiting update The Each subtask consists of resource type, resource status, and dependencies; Indicates the first The resource type of each subtask, such as: database, storage; This indicates the resource status of the k-th subtask, including allocable, pending allocation, and unavailable. Indicates the first Dependencies between subtasks; The tenant pool dynamic update step SA4 includes the following sub-steps: Based on the dependencies in several tenant configuration subtasks, a sequential flow is used to connect the interdependent tenant configuration subtasks to obtain a sub-process associated with several tenant environments. The main process is obtained by integrating the sub-processes associated with several tenant environments based on the corresponding tenant environment. The tenant pool dynamic update step SA5 includes the following sub-steps: Concurrent initialization is performed on the sub-processes associated with the tenant environment based on the main process; Once all the corresponding sub-processes in the main process have completed initialization, the current tenant environment status is updated to pending allocation and uploaded to the tenant pool, thus completing the update of the tenant pool. Meanwhile, if the tenant environment initialized by the current pre-account opening task is a differential configuration item triggered by an account opening failure, the resources of the tenant environment template will be updated according to the corresponding configuration item.
9. An electronic device comprising: A memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, when the processor executes the computer program, it implements an allocation method for a multi-tenant environment based on process orchestration as described in any one of claims 1-4.
10. A computer-readable storage medium storing computer-executable instructions, the computer-executable instructions comprising: When the computer-executable instructions are executed by the processor, they implement the allocation method for a multi-tenant environment based on process orchestration as described in any one of claims 1-4.