SaaS tenant customized service method
By generating independent database instances and container instances within the SaaS system, and utilizing graphical interface tools and DNS resolution technology, the customization needs and tenant isolation issues of the SaaS ERP system were addressed, enabling flexible customization services and improved stability.
Patent Information
- Application Number
- CN202511229898.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-29
- Publication Date
- 2026-01-13
- Estimated Expiration
- 2045-08-29
AI Technical Summary
Existing SaaS ERP systems are unable to meet the customized needs of enterprises for complex business processes, industry characteristics, or deep functional integration, and lack effective tenant isolation mechanisms, leading to performance interference and data loss risks.
By generating independent database instances or tablespaces, using a graphical interface tool to receive tenant configuration parameters and convert them into metadata in JSON format, allocating independent server nodes or container instances to deploy personalized code, and using DNS resolution and reverse proxy technology to achieve the mapping and dynamic loading of tenant identities and service nodes, it supports lightweight and deeply customized configurations.
It enables seamless migration from standard tenants to customized tenants, improves system flexibility, stability and security, reduces operational risks, and ensures data integrity and continuity of user experience.
Smart Images

Figure CN121326430A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application belongs to the technical field of software as a service system architecture, and particularly relates to a SaaS tenant customized service method. BACKGROUND
[0002] With the development of cloud computing technology, the SaaS (Software as a Service) mode has become an important way for enterprise informatization construction. The SaaS ERP system is widely used due to its advantages such as convenient deployment, centralized operation and maintenance, and low cost. However, the traditional SaaS ERP product usually adopts a standardized architecture design and only supports limited zero-code configuration functions, which is difficult to meet the customized needs of enterprises for complex business processes, industry characteristics or deep function integration.
[0003] When a customer proposes a function requirement beyond the scope of the standard product, the existing technology usually adopts two solutions: one is to provide an independent system for the customer through private deployment, but this way causes the customer to bear high server resources, operation and maintenance team and security compliance costs; the other is to rely on the manufacturer for secondary development and unified upgrade, but there are problems such as long development cycle, slow version iteration and affecting the stability of other tenants.
[0004] In addition, the existing SaaS system relies on database-level logical isolation in realizing tenant isolation, lacks deep isolation mechanisms for service instances, running environments and code levels, and causes high-customized tenants to interfere with the overall performance of the system. At the same time, once the customer moves from the standard SaaS environment to the deep customization environment, there is a lack of smooth migration mechanism, which is easy to cause data loss, service interruption or user experience decline.
[0005] Therefore, how to retain the advantages of centralized operation and maintenance and resource sharing of the SaaS system, support lightweight form and process configuration, allow deep code-level expansion, and realize seamless migration from standard tenants to customized tenants, has become a technical problem to be solved. SUMMARY
[0006] The application provides a SaaS tenant customized service method to solve one of the above technical problems.
[0007] The technical scheme adopted by the application is:
[0008] The application provides a SaaS tenant customized service method, which comprises:
[0009] receiving a lightweight customization request of a tenant, generating an independent database instance or table space according to a tenant identifier, receiving a form, a process and an application configuration parameter of the tenant through a graphical interface tool, converting the parameter into metadata in JSON format, and writing the metadata into the database instance or table space of the tenant to generate a customized configuration data file;
[0010] allocating an independent server node or container instance for the tenant according to a deep customization request of the tenant, deploying personalized code of the tenant into the server node or container instance, the personalized code including business logic extension code and dependent libraries, separating the personalized code from standard product code through a dynamic loading mechanism, and loading the personalized code at runtime based on the tenant identifier;
[0011] generating a unique second-level domain name according to the tenant identifier, mapping the domain name to an IP address of the server node or container instance through a DNS resolution service, and forwarding a domain name request of the tenant to the server node or container instance corresponding to the IP address by using a reverse proxy technology, wherein the forwarding rule is generated based on a mapping relationship between the tenant identifier and the IP address;
[0012] receiving a migration request of a standard tenant to a customized tenant, extracting the customized configuration data file and business data from the database instance of the standard tenant, synchronizing the customized configuration data file and business data to a database instance of a target server node or container instance, updating the domain name and IP address mapping relationship in the DNS resolution service, and modifying a reverse proxy configuration to route the domain name request of the tenant to the target server node or container instance.
[0013] According to one embodiment of the present application, the receiving a lightweight customization request of a tenant, generating an independent database instance or table space according to a tenant identifier, receiving a form, a process and an application configuration parameter of the tenant through a graphical interface tool, converting the parameter into metadata in JSON format, and writing the metadata into the database instance or table space of the tenant to generate a customized configuration data file, includes:
[0014] ensuring that the customized configuration data file of the tenant and standard product data are physically isolated through database sharding technology or table space division in a shared database;
[0015] At system startup, the metadata of the standard product is loaded first, and then the customized configuration data file is dynamically loaded according to the tenant identifier, and a cache mechanism is used to reduce the performance overhead of repeated loading.
[0016] According to one embodiment of the present application, the tenant is allocated an independent server node or container instance according to the tenant's deep customization request, the tenant's personalized code is deployed into the server node or container instance, the personalized code includes business logic extension code and dependent library, the personalized code is separated from standard product code through a dynamic loading mechanism, and the personalized code is loaded at runtime based on the tenant identifier, including:
[0017] An extension directory is reserved in standard product code engineering, the extension directory defines a loading rule through an independent configuration file, and the configuration file contains a mapping relationship between the tenant identifier and an extension code path;
[0018] The server node or container instance is allocated independent CPU and memory resources, and a use upper limit of the resources is limited through container orchestration technology to avoid resource contention between tenants.
[0019] According to one embodiment of the present application, a unique second-level domain name is generated according to the tenant identifier, the domain name is mapped to the IP address of the server node or container instance through a DNS resolution service, and the tenant's domain name request is forwarded to the server node or container instance corresponding to the IP address by using reverse proxy technology, wherein the forwarding rule is generated based on the mapping relationship between the tenant identifier and the IP address, including:
[0020] The unique second-level domain name is generated based on the tenant identifier;
[0021] The A record in the DNS resolution service is updated in real time through an API interface, so that the mapping relationship between the domain name and the IP address takes effect immediately after tenant migration;
[0022] Based on the mapping relationship between the tenant identifier and the IP address, an Nginx reverse proxy configuration file is dynamically generated, and configuration changes are made effective immediately through hot reloading technology.
[0023] According to one embodiment of the present application, the migration request of a standard tenant to a customized tenant is received, the customized configuration data file and business data are extracted from the database instance of the standard tenant, and the customized configuration data file and business data are synchronized to the database instance of the target server node or container instance; the domain name and IP address mapping relationship in the DNS resolution service is updated, and the reverse proxy configuration is modified to route the tenant's domain name request to the target server node or container instance, including:
[0024] The customized configuration data file and business data are packaged into a compressed file through a database backup tool, and the compressed file is synchronized to the target server node or container instance through a network transmission protocol;
[0025] After the data synchronization is completed, the domain name request of the tenant is gradually switched to the target server node or container instance by modifying the DNS resolution record and reverse proxy configuration, and user requests are intercepted during the switching process to display migration progress prompt information.
[0026] According to one embodiment of the present application, further comprising:
[0027] The progress of the data synchronization, the resource usage status of the target server node, and the migration failure rate are displayed in real time by the management background;
[0028] If the migration fails, the customized configuration data file and the business data are automatically restored to the source server node before migration, and the original DNS resolution record and reverse proxy configuration are reactivated.
[0029] According to one embodiment of the present application, further comprising:
[0030] The graphical interface tool supports drag-and-drop operations, parameter configuration, and flowchart design, and converts the operation results into the JSON format metadata in real time;
[0031] The customized configuration data file is version managed, supporting the tenant to roll back to a historical version through a version selector or to activate the configuration file of the current version through a release function.
[0032] According to one embodiment of the present application, further comprising:
[0033] A code hot update module is deployed in the server node or container instance to allow dynamic loading or updating of the individualized code without restarting the service.
[0034] The dependent libraries of the individualized code are version controlled by a package management tool, and missing dependent libraries are automatically downloaded during deployment.
[0035] The second aspect embodiment of the present application provides a computer readable storage medium having a program stored thereon, and the program is executed by a processor to implement the steps in the method.
[0036] The third aspect embodiment of the present application provides an electronic device, including a memory, a processor, and a program stored in the memory and executable on the processor, and the processor implements the steps in the method when executing the program.
[0037] Due to the adoption of the above technical solutions, the present application has the following beneficial effects:
[0038] The application converts the configuration parameters such as forms, processes and the like of tenants into structured JSON metadata and stores them in an independent database instance, so that the standard product can dynamically load the tenant-specific configuration at runtime. This technical means realizes personalized adaptation at zero code level, avoids modification of the core code, and improves the flexibility and maintainability of the system. At the same time, the "personalized code deployment" mechanism is provided for tenants that need deeper customization, the extended code is run through an independent server node or container instance, and the runtime dynamic loading is realized based on the tenant identifier, ensuring that complex business logic can be executed independently without affecting other tenants, thereby balancing the standardization and deep customization capabilities in the same platform architecture.
[0039] The application realizes resource isolation at the service level by allocating independent server nodes or container instances for deep customization tenants and separating personalized code from standard product code at the deployment and loading level. In combination with the limitation of resources such as CPU and memory by containerization technology, the influence of individual high-load tenants on the overall system performance is effectively prevented, and the system stability and security in a multi-tenant environment are improved.
[0040] The application uses the technical means of "generating a unique second-level domain name according to the tenant identifier" and "mapping to the corresponding IP address through DNS resolution service" to build a direct mapping relationship between tenant identity and service node. Then, the reverse proxy forwards the request according to the mapping relationship, so that the access of different tenants can be accurately directed to their exclusive service instances. This routing mechanism driven by tenant identifier not only improves the access efficiency, but also provides a foundation support for subsequent advanced functions such as load balancing and gray release.
[0041] In the migration process, the application "extracts customized configuration data files and business data from the standard tenant database" and migrates them to the target customized node through a synchronization mechanism, ensuring the integrity of the configuration and data. Further, "updating the DNS resolution record and the reverse proxy configuration" enables smooth switching of the tenant access path to the new service node. The entire migration process is automatically completed in the background, user requests are temporarily intercepted and the migration status is prompted, minimizing the business interruption time. This technical solution significantly reduces the technical threshold and operation and maintenance risk of customer upgrading the customization level, and improves the continuity of service and customer satisfaction.
[0042] The application forms a clear data flow closed loop: tenant configuration parameters generate customized configuration files → configuration files are bound with tenant identifiers → identifiers are used for service deployment and domain name generation → domain name mapping guides request routing → reuse of existing configuration files is used to complete environment reconstruction during migration. This whole-process linkage mechanism with tenant identifier as the core and data as the link makes all components of the system coordinate consistently, improving the overall automation level and manageability. BRIEF DESCRIPTION OF DRAWINGS
[0043] The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this application, illustrate embodiments of the application and together with the description serve to explain the application. In the drawings:
[0044] Figure 1 A flowchart of a SaaS tenant customization service method provided for an embodiment of the application is shown in the figure.
[0045] Figure 2 A structural diagram of an electronic device provided for an embodiment of the application is shown in the figure.
[0046] Reference signs:
[0047] 810, processor; 820, communication interface; 830, memory; 840, communication bus. DETAILED DESCRIPTION
[0048] In order to more clearly illustrate the overall concept of the application, the following will be described in detail with reference to the accompanying drawings.
[0049] In the following description, numerous specific details are set forth in order to provide a thorough understanding of the application. However, the application can be practiced without the specific details. In other instances, well-known methods, procedures, components, and circuits have not been described in detail since such can be readily understood by persons skilled in the art. It can be appreciated that the scope of the application is not limited to implementations that differ from the above-described ones.
[0050] In the present application, unless specifically defined and limited otherwise, the first feature is "on" or "under" the second feature, which can be direct contact between the first and second features, or indirect contact between the first and second features through an intermediate medium. In the description of the specification, the description of the terms "one embodiment", "some embodiments", "an example", "a specific example", or "some examples" means that the specific features, structures, materials or characteristics described in connection with the embodiment or example are included in at least one embodiment or example of the application. In the specification, the illustrative description of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in any appropriate manner in any one or more embodiments or examples.
[0051] Embodiment 1
[0052] As shown in the figure, a SaaS tenant customization service method includes: Figure 1
[0053] Receiving a lightweight customization request from a tenant, generating an independent database instance or table space according to the tenant identifier, receiving the tenant's form, flow and application configuration parameters through a graphical interface tool, converting the parameters into JSON format metadata, and writing the metadata into the tenant's database instance or table space to generate a customized configuration data file.
[0054] As described above, the non-code level individualization configuration information of the tenant is received and persistently stored in a structured manner, while ensuring data isolation and independent management between different tenants.
[0055] Firstly, the system receives a lightweight customization request from a specific tenant. This request is usually initiated by the tenant administrator through the web front-end interface, involving the adjustment requirements of the interface layout, field display, approval rules, business process order, etc. of the standard ERP function modules (such as purchase order, reimbursement process, customer file, etc.).
[0056] After receiving the request, the system creates an independent data storage environment for the tenant according to its unique tenant identifier (Tenant ID) in the platform. This environment can be a physically completely isolated independent database instance, or a dedicated table space or a dedicated data table set divided in a shared database. This design ensures that the tenant's customized data will not be mixed with other tenants, avoiding data pollution and permission boundary problems, and facilitating subsequent data migration, backup and recovery operations.
[0057] Subsequently, the system provides a visual operation interface to the user through a graphical configuration tool. The user can complete the configuration by dragging and dropping fields, setting condition branches, adjusting form styles, etc. The system parses the configuration intent expressed by these user operations into structured description information and serializes it in JSON format. JSON, as a lightweight, readable, cross-platform compatible data exchange format, can flexibly express nested structures, arrays, key-value pairs and other data forms, and is suitable for describing complex configurations such as form structure, flow node, permission rules, etc.
[0058] Finally, the system writes the generated JSON format metadata into the tenant's dedicated database instance or table space, forming a "customized configuration data file". This file can be logically considered as the "difference description" of the tenant to the standard product function, recording all the modification contents relative to the standard version. During system runtime, this configuration file will be dynamically loaded and merged with the standard product metadata, thus presenting the customized user interface and business behavior.
[0059] For example, a manufacturing enterprise tenant uses a SaaS ERP system. The enterprise wants to add an "environmental compliance approval" link to the standard "purchase application form" and add a "supplier carbon emission level" field to the form.
[0060] When the tenant administrator logs in to the system, he enters the "form designer" module and selects "purchase application form" for editing. Through the graphical interface, the administrator drags and drops a new "text input box" field and names it "supplier carbon emission level". Set it as a required item and limit the selectable values to "A level", "B level", "C level". Then, in the approval process design area, the administrator adds a new approval node "environmental officer audit" and sets its trigger condition as "when the purchase amount is greater than 500,000 yuan and the material category is chemical".
[0061] The system parses the above operations into a set of structured configuration information: including the name, type, constraint conditions, display position of the new field; the name, execution role, trigger condition of the process node. These information is organized into a JSON structure, such as a data block containing "fields", "rules", "workflow_nodes" key-value items.
[0062] According to the tenant identifier of the tenant (such as "tenant_2025_mfg"), the system writes the JSON data into its exclusive database table tenant_config, and the record type is marked as "form_customization". This record is the "customized configuration data file" generated by this lightweight customization. When the user accesses the purchase application form in the future, the system automatically loads this configuration and dynamically renders the interface containing the new field and approval process. Other tenants still use the original standard version and do not affect each other.
[0063] It should be noted that in specific implementation scenarios, on the basis of the above scheme, a version chain can be established in the database for each customized configuration data file, recording the timestamp, operator and change summary of each modification. The tenant can roll back to any historical version at any time, or preview the effect of the new configuration in the test environment, improving the security and flexibility of configuration management.
[0064] In specific implementation scenarios, on the basis of the above scheme, the system can export the customized configuration data file of a tenant as a reusable "configuration template" for other tenants with similar business needs to directly import and use, reducing the workload of repeated configuration and improving implementation efficiency.
[0065] In a specific implementation scenario, on the basis of the above scheme, the customized configuration can be customized not only for a single function module, but also for a cross-module business rule. For example, a rule is set that "when a sales order contains a specific product, automatically generate a pre-production task in the production plan". Such a rule can also be configured by a graphical tool and stored in JSON format to achieve lightweight integration between modules.
[0066] In a specific implementation scenario, on the basis of the above scheme, before writing the JSON metadata into the database, the JSON metadata can be encrypted to ensure the security of sensitive configuration information (such as approval rules and field permissions) at the storage level. At the same time, the read and write permissions of the configuration data can be defined based on the role definition to prevent unauthorized personnel from modifying the key business logic.
[0067] In a specific implementation scenario, on the basis of the above scheme, when the customized configuration data file is updated, the system can automatically trigger a preset test case set to verify whether the new configuration causes functional abnormalities or performance degradation, forming a closed-loop quality assurance mechanism.
[0068] In a specific implementation scenario, on the basis of the above scheme, in the subsequent "one-key migration" step, the customized configuration data file will be extracted and synchronized to the target customized service node as one of the core inputs, used to rebuild the tenant's personalized functions in the new environment, ensuring the consistency of user experience before and after migration.
[0069] According to the deep customization request of the tenant, an independent server node or container instance is allocated to the tenant, and the tenant's personalized code including business logic extension code and dependent libraries is deployed to the server node or container instance. The personalized code is separated from the standard product code through a dynamic loading mechanism, and the personalized code is loaded at runtime based on the tenant identifier.
[0070] As described above, through the resource isolation and code decoupling mechanism, while retaining the advantages of SaaS centralized operation, a specific tenant is given an independent running environment and code extension capability.
[0071] When the system receives a deep customization request from a tenant (for example, a special production scheduling algorithm needs to be implemented, complex cost accounting logic or deep integration with a third-party system), it indicates that the tenant's demand has exceeded the capability range of the graphical configuration tool and must be implemented by writing program code. At this time, the system starts the service isolation process.
[0072] First, a separate server node or container instance is allocated for the tenant according to its tenant identifier. The node can be a physical server, a virtual machine, or a lightweight runtime environment built based on container technologies such as Docker. This resource is independent of the standard SaaS shared service cluster, ensuring that the tenant's running load, security policy, and deployment rhythm are not affected by other tenants, while also avoiding interference with the overall stability of the platform caused by abnormal behavior.
[0073] Subsequently, the system deploys the tenant's personalized code package developed or provided by the service provider to the independent node. The code package not only contains business logic extension code that implements specific business functions, but also includes all external dependent libraries required for running (such as encryption components, report engines, communication middleware, etc.). These code and library files are placed in a preset extension directory, physically separated from the standard product code at the file system level.
[0074] Importantly, the system uses a dynamic loading mechanism to determine whether to load the tenant's personalized code based on the tenant identifier in the current access request at runtime. If the request belongs to the customized tenant, the system loads the standard product code as the basic running environment first, and then dynamically injects its personalized code modules to achieve function stacking; if it is for other standard tenants, only the standard code is loaded, without triggering extension logic. This on-demand loading mechanism ensures efficient resource utilization and system stability.
[0075] This step realizes a flexible combination mode of "one standard product architecture + multiple personalized extension capabilities", which not only guarantees that most tenants use unified and stable standard services, but also provides flexibility close to private deployment for tenants with special needs, without the need for customers to bear the responsibility of infrastructure operation and maintenance themselves.
[0076] For example, taking a certain automobile parts manufacturing enterprise tenant as an example, the enterprise needs to implement a set of "dynamic capacity prediction and production scheduling optimization" function based on AI algorithm in its ERP system. This function involves complex mathematical models and external AI service calls, which cannot be implemented through zero-code tools.
[0077] When the tenant submits a deep customization application, the system allocates a separate container instance for it according to its tenant identifier "tenant_auto_007". This instance runs in a dedicated customized resource pool and is configured with higher CPU and memory resources to support computationally intensive tasks.
[0078] The development team will package the "scheduling optimization service" code they have written (including algorithm logic, data interfaces, schedulers, etc.) and the dependent machine learning libraries, message queue clients, etc. into a deployment package and upload it to the system. The system automatically unpacks it and deploys it to the extension directory of the container instance (such as / opt / ext / scheduling).
[0079] During system operation, when the tenant user initiates the "generate production plan" operation, the request carries the tenant identifier. After the service gateway identifies it, it routes the request to the tenant's dedicated container instance. After the instance is started, it first loads the standard ERP core modules (such as material management, order processing), and then dynamically loads the "scheduling optimization" code module in the extension directory and registers it as a callable service. Finally, the user gets the intelligent scheduling result driven by the AI algorithm.
[0080] For other tenants who have not customized this function, their similar requests are still handled by the standard service cluster, only the basic scheduling logic is executed, and the overall system operation is not affected.
[0081] It should be noted that in specific implementation scenarios, on the basis of the above scheme, the personalized function module developed by a tenant, after security review and standardized packaging, can be used as an "industry plug-in" for other tenants with similar needs to subscribe to, realizing the reuse and commercialization of customization capabilities and improving the value of the platform ecosystem.
[0082] In specific implementation scenarios, on the basis of the above scheme, after deploying the new version of personalized code on the independent node, access can be opened to part of the users first, and by comparing and analyzing their behavior data and system performance, the stability of the function is verified, and then the coverage is gradually expanded to reduce the risk of going online.
[0083] In specific implementation scenarios, on the basis of the above scheme, the system can dynamically replace or update the personalized code module without interrupting service, realizing "hot deployment". For example, when an algorithm defect is found, the operation and maintenance personnel can upload a new version of the code package, and the system automatically unloads the old module and loads the new module, ensuring business continuity.
[0084] In specific implementation scenarios, on the basis of the above scheme, according to the load situation (such as CPU usage, number of concurrent requests) of the tenant's personalized service, the system can automatically adjust the resource configuration of its container instance, or start multiple instances to realize horizontal expansion, improving the response capability in high-load scenarios.
[0085] In a specific implementation scenario, on the basis of the above scheme, an independent log collection channel and performance monitoring index can be established for each customized tenant, which facilitates rapid problem positioning, analysis of call links, and provides data support for subsequent billing and optimization.
[0086] In a specific implementation scenario, on the basis of the above scheme, in the subsequent "one-key migration" process, the independent server node or container instance serves as the target running environment and receives configuration data and business data migrated from the standard tenant, thereby realizing smooth evolution from "light customization" to "deep customization".
[0087] In a specific implementation scenario, on the basis of the above scheme, a runtime security detection mechanism can be introduced in the container instance to limit the system call permissions of personalized code (such as prohibiting access to sensitive files and limiting network connection), thereby preventing malicious code or vulnerabilities from causing harm to the system and improving overall security.
[0088] A unique second-level domain name is generated according to the tenant identifier, and the domain name is mapped to the IP address of the server node or container instance through a DNS resolution service. Reverse proxy technology is used to forward the tenant's domain name request to the server node or container instance corresponding to the IP address, wherein the forwarding rule is generated based on the mapping relationship between the tenant identifier and the IP address.
[0089] As described above, after the system completes the light or deep customization configuration of the tenant, it is necessary to ensure that the user can enter the exclusive running environment through an independent and identifiable access portal. To this end, the system automatically generates a second-level domain name bound to the unique tenant identifier (TenantID) of the tenant. For example, if the tenant identifier is "comp_tech_2025", the system generates a corresponding second-level domain name such as "comp-tech-2025.platform.com". This domain name is globally unique, ensuring that there is no access conflict between different tenants.
[0090] After generating the domain name, the system establishes a mapping relationship between the second-level domain name and the service node IP address corresponding to the tenant through an integrated DNS resolution service (such as a PowerDNS-based or self-developed domain name management system). The service node can be a virtual host in a standard shared cluster, or an independent server or container instance allocated for a deep customization tenant. This mapping relationship is stored in the domain name management database and supports dynamic updates.
[0091] When a user accesses the secondary domain name through a browser, the DNS system returns the corresponding service node IP address, completing domain name resolution. Subsequently, the request reaches the reverse proxy server (such as Nginx, HAProxy, etc.) deployed in the front end, which further forwards the request to the target server node or container instance according to the pre-generated forwarding rules. The forwarding rules are not statically configured, but are dynamically generated routing strategies based on the "tenant identifier-IP address" mapping relationship, ensuring that even if the service node is migrated or the IP changes, as long as the mapping relationship is updated, the access path can be automatically synchronized and adjusted.
[0092] This mechanism realizes the decoupling of access entry and backend service instance, allowing the system to flexibly adjust the deployment location of tenants, implement load balancing, or perform migration operations without affecting user access, which is an important foundation for supporting the operation and scalability of the entire customized service system.
[0093] For example, taking a large retail enterprise tenant as an example, the enterprise has completed deep customization of the ERP system, and its business logic runs in a separate container instance, which is assigned an IP address of "192.168.10.55".
[0094] The system generates a unique secondary domain name "retail-group-cn.platform.com" based on the tenant identifier "retail_group_cn" of the tenant, and registers the domain name in the internal DNS resolution service through the DNS management interface, establishing an A record of "retail-group-cn.platform.com→192.168.10.55".
[0095] When an employee of the enterprise enters "https: / / retail-group-cn.platform.com" in the browser, the local DNS query first resolves the domain name to "192.168.10.55", and the request is sent to the reverse proxy cluster deployed at the data center entrance. After receiving the request, the reverse proxy server checks its internal routing table and confirms that the IP address corresponds to a container instance running a customized ERP service, and forwards the HTTP request to the host where the instance is located.
[0096] In the entire process, the user does not need to be aware of the specific deployment location of the backend service. Even if the container instance is later migrated to a new node due to resource expansion (such as IP changing to "192.168.12.33"), the system only needs to update the mapping relationship in the DNS service and synchronously refresh the forwarding rules of the reverse proxy, and the user can still seamlessly access the system through the original domain name, and the access continuity is not affected.
[0097] It should be noted that in a specific implementation scenario, on the basis of the above scheme, a regional secondary domain name (such as "cn.retail-group.platform.com") can be generated according to the geographical location of the tenant, and the request can be directed to the nearest data center node through DNS intelligent resolution, thereby reducing network delay and improving access experience.
[0098] In a specific implementation scenario, on the basis of the above scheme, when the system is upgraded, multiple secondary domain names or sub-paths (such as "beta.retail-group-cn.platform.com") can be configured for the same tenant, and part of the user traffic can be directed to the new version service node to implement gray verification, and then full switching can be performed after stabilization.
[0099] In a specific implementation scenario, on the basis of the above scheme, the tenant can use its own enterprise domain name (such as "erp.retailgroup.com") to point to the secondary domain name generated by the platform through CNAME record, and the system can automatically identify and match the corresponding tenant identifier and backend service instance, thereby improving brand consistency.
[0100] In a specific implementation scenario, on the basis of the above scheme, the system can automatically apply and deploy SSL / TLS certificates for each secondary domain name, support HTTPS encrypted transmission, and automatically trigger the renewal process when the certificate is about to expire, thereby ensuring communication security.
[0101] In a specific implementation scenario, on the basis of the above scheme, the forwarding rule is generated in real time based on the "tenant identifier-IP address" mapping in the database, and the proxy server can perceive the configuration change through the listening mechanism and dynamically update the routing table without restarting the service, thereby realizing zero-interruption configuration update.
[0102] In a specific implementation scenario, on the basis of the above scheme, when the tenant migrates from the standard environment to the customized environment, the system can seamlessly switch the original access path to the new service node after data synchronization is completed, and the user can complete the upgrade without sensing.
[0103] In a specific implementation scenario, on the basis of the above scheme, the domain name access of a specific tenant can be associated with IP white list, access frequency limit, identity authentication mode and other security policies to realize fine-grained access control.
[0104] In a specific implementation scenario, on the basis of the above scheme, in addition to HTTP / HTTPS, the mechanism can also be extended to WebSocket, gRPC and other protocols, so as to ensure that real-time communication, remote invocation and other functions in customized services can also be correctly routed through the unified domain name entry.
[0105] receiving a migration request of a standard tenant to a customized tenant, extracting the customized configuration data file and business data from a database instance of the standard tenant, synchronizing the customized configuration data file and business data to a database instance of a target server node or a container instance, updating a domain name and IP address mapping relationship in the DNS resolution service, and modifying a reverse proxy configuration to route a domain name request of the tenant to the target server node or the container instance.
[0106] As described above, when a standard tenant proposes a request for upgrading to a customized tenant due to business development needs (for example, independent code extension, exclusive resource isolation, or higher security level needs to be introduced), the system receives the migration request and starts the automated migration process. The request is usually initiated by a platform administrator or a tenant administrator in the unified management background. The system identifies the source environment (standard tenant) and the target environment (customized service node) according to the tenant identifier contained in the request.
[0107] Firstly, the system accesses the database instance currently used by the standard tenant, extracts two types of key data from it: one is the "customized configuration data file" (such as JSON format forms, processes, permissions, and other metadata) previously generated and stored through the graphical tool, and the other is the long-term accumulated business operation data (such as order records, customer archives, financial vouchers, etc.) of the tenant. These two types of data together constitute the core assets of the tenant's individualized capabilities and historical business.
[0108] Subsequently, the system synchronizes the extracted data to the target environment, i.e., the database instance in the newly allocated independent server node or container instance for the tenant, through a secure transmission channel. The synchronization process supports breakpoint resume and data verification mechanism to ensure data integrity and consistency. After the target database completes data writing, the system confirms data availability and establishes a connection with the target running environment.
[0109] Next, the system performs switching operation of access path. By calling the management interface of the DNS resolution service, the mapping relationship between the tenant's second-level domain name and IP address is updated, so that it points to the IP address of the newly allocated independent service node from the original shared cluster IP address. At the same time, the configuration of the reverse proxy server is also dynamically modified, so that it can accurately forward traffic to the new target node when receiving the tenant domain name request.
[0110] During the entire migration process, the system can temporarily intercept user access and return prompt information such as "system upgrading, please visit later". To avoid user operations in the inconsistent state of data. After the migration is completed and the service is verified to be normal, the system automatically restores access, and the user can seamlessly enter the upgraded customized environment through the original domain name, and the original functions, data, and use habits remain unchanged.
[0111] This step realizes the non-destructive evolution from "shared resources + configuration-level customization" to "independent resources + code-level extension", significantly reducing the technical threshold and business interruption risk of customer upgrade.
[0112] For example, a certain medium-sized manufacturing enterprise tenant initially uses the SaaS ERP system as a standard tenant, and its customization needs are limited to modifying the purchase order field and approval process, and the related configuration is stored in JSON format in its exclusive database. As the business expands, the enterprise needs to access the MES system and implement production scheduling algorithm customization, and decides to upgrade to a deeply customized tenant.
[0113] The administrator selects the tenant in the management background and clicks the "Upgrade to Customized Tenant" button, and the system automatically generates a migration task. The system locates the current database instance of the tenant according to the tenant identifier "mfg_2025_zj", extracts the customized configuration file (such as "purchase_form_config.json") and the business data of the past five years of procurement, inventory, production, etc.
[0114] The system encrypts and transmits these data and writes them into the database mounted by the newly created container instance (IP: 192.168.15.88). After the data synchronization is completed, the system calls the DNS service interface to update the record of the domain name "mfg-2025-zj.platform.com" originally pointing to the shared cluster IP "192.168.10.20" to "192.168.15.88". At the same time, the reverse proxy server updates its routing table to ensure that subsequent requests to this domain name are forwarded to the new node.
[0115] During the migration, users accessing the original domain name see a "System is upgrading" prompt page. After about 15 minutes, the migration is completed, and the system removes the interception. When the user accesses again, the system is running on the independent node, the original form configuration and business data are completely preserved, and the newly added production scheduling service is also available, realizing the no-sense upgrade.
[0116] It should be noted that in specific implementation scenarios, the system can support the customized tenant to be migrated back to the standard shared environment under certain conditions (such as business simplification, cost optimization), and the migration process can be reversed to ensure the flexibility of the architecture.
[0117] In specific implementation scenarios, on the basis of the above scheme, the system can first perform a full synchronization before formal migration, and continuously capture the change logs of the source database to realize incremental data synchronization. The administrator can start the "pre-migration mode" to verify the functional integrity in the target environment, reducing the risk of formal switching.
[0118] In a specific implementation scenario, on the basis of the above scheme, if the target environment database structure is changed (such as field type adjustment, index optimization), the system can automatically perform data format conversion during synchronization to ensure compatibility.
[0119] In a specific implementation scenario, on the basis of the above scheme, for tenants with large amounts of data, the migration can be performed gradually in modules (such as first migrating main data and then migrating transaction data) to reduce the pressure of single operation and improve the success rate.
[0120] In a specific implementation scenario, on the basis of the above scheme, the migration progress, data synchronization rate, target node resource usage, and failure retry count can be displayed in real time in the management background to facilitate the operation and maintenance personnel to master the overall state.
[0121] In a specific implementation scenario, on the basis of the above scheme, if service exceptions or data inconsistencies are detected after migration, the system can automatically trigger a rollback process to restore the DNS record and reverse proxy configuration to the state before migration, and prompt the administrator to intervene in processing to ensure business continuity.
[0122] In a specific implementation scenario, on the basis of the above scheme, the platform can initiate a migration task based on tenant resource usage, service load, and other indicators to migrate high-load tenants from a shared cluster to an independent node or recycle resources for low-activity tenants to achieve dynamic resource scheduling.
[0123] In a specific implementation scenario, on the basis of the above scheme, combined with the geographical DNS resolution capability, the system can migrate tenants from one data center to another regional data center to meet data localization compliance requirements or disaster recovery needs.
[0124] In a specific implementation scenario, on the basis of the above scheme, after migration is completed, the system automatically updates the tenant's service level identifier and triggers a change in billing strategy (such as from standard subscription fees to customized service fees) to realize the coordinated evolution of business and technology.
[0125] According to an embodiment of the present application, the receiving of the lightweight customization request of the tenant, the generation of an independent database instance or table space according to the tenant identifier, the receiving of the form, process and application configuration parameters of the tenant through the graphical interface tool, the conversion of the parameters into JSON format metadata, and the writing of the metadata into the database instance or table space of the tenant to generate a customized configuration data file, include:
[0126] Through database sharding technology or table space division in a shared database, the customized configuration data file of the tenant is ensured to be physically isolated from the standard product data.
[0127] At system startup, the metadata of the standard product is loaded first, and then the customized configuration data file is dynamically loaded according to the tenant identifier, and the performance overhead of repeated loading is reduced through a caching mechanism.
[0128] As described above, after receiving the lightweight customization request of a tenant, the system creates an independent data storage environment for the tenant according to the unique tenant identifier of the tenant. This storage environment can be implemented through database sharding technology, that is, an independent database instance is allocated for each tenant, and the data of each tenant is completely isolated physically; or under the architecture of a shared database, the isolation of tenant data can be achieved by dividing independent table spaces or using a dedicated set of data tables. Regardless of which way is used, it is ensured that the customized configuration data file of the tenant and the metadata of the standard product itself are separated from each other at the storage level, avoiding data confusion between different tenants or between the tenant and the standard system, and improving data security and management independence.
[0129] After the establishment of the data storage environment is completed, the system provides a visual configuration function to the tenant through a graphical interface tool. The tenant can adjust the form structure, field properties, approval process, application interface layout, etc. through the tool. The system parses the configuration parameters input by the tenant in the graphical interface and converts them into structured JSON format metadata. JSON format has good readability and extensibility, and can clearly express the hierarchical relationship, data type and constraint conditions of the configuration items. After the conversion is completed, the system writes the JSON metadata into the database instance or table space corresponding to the tenant, forming a complete customized configuration data file as a persistent record of the personalized settings of the tenant.
[0130] When the system starts or processes tenant-related requests, the system first loads the general metadata preset by the standard product to build a basic function framework. Then, the system locates the database instance or table space dedicated to the tenant according to the tenant identifier carried in the current access request, and reads the customized configuration data file of the tenant from it. The configuration content described in this file will be combined with the standard metadata to generate the interface and execution logic finally presented to the user. To improve loading efficiency and reduce performance loss caused by frequent database reading, the system introduces a caching mechanism. After loading the customized configuration data file of the tenant for the first time, it is stored in the memory cache, and a reasonable cache validity period or update strategy is set. Subsequent requests of the same tenant can directly read the configuration information from the cache, avoiding repeated database access operations, thereby reducing system response delay and improving overall operation performance.
[0131] According to one embodiment of the present application, the tenant is allocated an independent server node or container instance according to the tenant's deep customization request, the tenant's personalized code is deployed into the server node or container instance, the personalized code includes business logic extension code and dependent libraries, the personalized code is separated from the standard product code through a dynamic loading mechanism, and the personalized code is loaded at runtime based on the tenant identifier, including:
[0132] An extension directory is reserved in the standard product code engineering, the extension directory defines a loading rule through an independent configuration file, and the configuration file contains a mapping relationship between the tenant identifier and the extension code path;
[0133] The server node or container instance is allocated independent CPU and memory resources, and the use upper limit of the resources is limited through container orchestration technology to avoid resource contention between tenants.
[0134] As described above, according to the tenant's deep customization request, the system allocates an independent server node or container instance for the tenant to provide a dedicated running environment. The node can be a physical server, a virtual machine, or a running instance constructed based on container technology, used to carry the tenant's personalized business logic code. After allocation, the system deploys the personalized code developed by the tenant or provided by the service party into the independent node. The personalized code includes extension logic for standard product functions, such as custom business processing flow, data calculation rules, external system interface, etc., and also includes third-party library files or components dependent on running these codes.
[0135] In order to realize the decoupling of the personalized code and the standard product code, the system pre-sets an extension directory in the structure of the standard product code engineering, which is specially used to store the customization code modules of each tenant. The extension directory does not participate in the standard product main code compilation and release process, ensuring that the customization content does not affect the stability of the standard system. The system manages the loading behavior of the extension code through an independent configuration file, which records the mapping relationship between the tenant identifier of each tenant and the corresponding extension code storage path. When the system runs, the tenant identifier in the current request is used to find the configuration file, determine the code path to be loaded, and load the corresponding extension module according to the rules.
[0136] In the running process, the system uses a dynamic loading mechanism so that the personalized code can be identified and executed without modifying the standard product main program. Specifically, when the service starts or processes a request, the system first loads the standard product code to build a basic running environment; then it determines whether to load the extension code according to the tenant identifier. If there is a corresponding configuration, the tenant's personalized code module is dynamically loaded and integrated into the current execution context to realize on-demand addition of functions.
[0137] To ensure the stability and fairness of the system as a whole, and to avoid individual tenants from occupying too many resources and affecting other tenants or platform services, the system sets independent CPU and memory resource quotas for each allocated server node or container instance. In the containerized deployment scenario, the container orchestration technology (such as Kubernetes or Docker Swarm) is used to accurately control resource usage, such as setting CPU core limits and memory upper limits. When a tenant's code exceeds the set resource threshold during execution, the system will automatically perform resource isolation or throttling to prevent it from interfering with other services. This mechanism effectively realizes the reasonable allocation and isolation of resources in a multi-tenant environment, improving the reliability and maintainability of the system.
[0138] According to one embodiment of the present application, the unique second-level domain name is generated based on the tenant identifier, and the domain name is mapped to the IP address of the server node or container instance through the DNS resolution service. The tenant's domain name request is forwarded to the server node or container instance corresponding to the IP address using reverse proxy technology, where the forwarding rule is generated based on the mapping relationship between the tenant identifier and the IP address, including:
[0139] The unique second-level domain name is generated based on the tenant identifier;
[0140] The A record in the DNS resolution service is updated in real time through the API interface to ensure that the mapping relationship between the domain name and the IP address takes effect immediately after tenant migration;
[0141] Based on the mapping relationship between the tenant identifier and the IP address, the Nginx reverse proxy configuration file is dynamically generated, and the configuration changes are immediately effective through the hot reloading technology.
[0142] As mentioned above, a unique second-level domain name is generated based on the tenant identifier of the tenant. The naming rules of this domain name are based on the tenant identifier, and a resolvable domain name string is formed through a preset format conversion method. For example, the special characters in the tenant identifier are replaced with hyphens or underscores, and are concatenated before the platform main domain name to form a second-level domain name in the form of "tenant-id.platform.com". This generation method ensures that the access portal of each tenant is unique in the global scope, avoiding domain name conflicts.
[0143] After the secondary domain name is generated, the system establishes a mapping relationship between the domain name and its current corresponding service node IP address by calling the API interface provided by the DNS resolution service. This mapping is stored in the DNS server in the form of A record, so that the external network can obtain the correct IP address when resolving the domain name. When the tenant migrates, the service node changes or the IP address adjusts, the system updates the A record in the DNS in real time through the same API interface, deletes the old mapping and writes the new IP address. Since the API call is instant, this update process can be completed within seconds, ensuring that the domain name resolution result takes effect quickly after the change and reducing the user access interruption time.
[0144] After the request arrives at the network entrance, the reverse proxy server is responsible for further request forwarding. The forwarding rules of the reverse proxy depend on the mapping relationship between the tenant identifier and the IP address. The system automatically generates configuration file content suitable for reverse proxy software (such as Nginx) based on this mapping relationship, which contains the corresponding rules of each tenant domain name and its target IP address and port. The configuration file generation process is dynamically executed without manual intervention.
[0145] After the configuration file is generated, the system applies it to the running proxy service through the hot reloading technology supported by the reverse proxy software. Hot reloading can make the new forwarding rules take effect immediately without interrupting existing connections or restarting service processes. User requests can be correctly routed to the updated service node when accessed next time, realizing seamless switching of access paths. This mechanism guarantees the continuity and high availability of services while supporting frequent deployment changes and migration operations.
[0146] According to an embodiment of the present application, the receiving of the migration request of the standard tenant to the customized tenant, extracting the customized configuration data file and business data from the database instance of the standard tenant, synchronizing the customized configuration data file and business data to the database instance of the target server node or container instance; updating the domain name and IP address mapping relationship in the DNS resolution service, and modifying the reverse proxy configuration to route the domain name request of the tenant to the target server node or container instance, comprising:
[0147] The customized configuration data file and business data are packaged into a compressed file by a database backup tool, and the compressed file is synchronized to the target server node or container instance through a network transmission protocol;
[0148] After the data synchronization is completed, the domain name request of the tenant is gradually switched to the target server node or container instance by modifying the DNS resolution record and the reverse proxy configuration, and the user request is intercepted during the switching process to display the migration progress prompt information.
[0149] As mentioned above, when the system receives a migration request for a standard tenant to upgrade to a customized tenant, it first identifies the source tenant environment and the target deployment environment according to the tenant identifier in the request. The source environment is the shared database instance where the tenant is currently located, and the target environment is the database instance in the allocated independent server node or container instance.
[0150] The system starts the data migration process, first extracting the tenant's customized configuration data file and historical business data from the source database instance. The customized configuration data file includes the JSON format metadata generated and stored by the graphical tool before, such as form configuration, process rules, permission settings, etc.; the business data includes the actual running data of orders, customers, inventory, finance, etc. generated by the tenant during use. The system uses a database backup tool to package the above data, generating a compressed file containing all necessary data to improve transmission efficiency and ensure data integrity.
[0151] The compressed file is transmitted from the source environment to the data area where the target server node or container instance is located through a secure network transmission protocol (such as SFTP or HTTPS). After reaching the target location, the system automatically decompresses and imports it into the target database instance, completing the initialization of data writing. During the entire synchronization process, the system records the transmission progress, checks the data consistency, and supports breakpoint resume to deal with network interruptions or transmission abnormalities.
[0152] After the data synchronization is completed, the system enters the service switching phase. First, by calling the management interface of the DNS resolution service, the A record corresponding to the tenant's second-level domain name is updated, pointing it from the original shared cluster's IP address to the new IP address of the target independent node. At the same time, the system regenerates the configuration rules of the reverse proxy server according to the updated tenant identifier and IP address mapping relationship, and loads them into the reverse proxy component.
[0153] Before the configuration update takes effect, the system temporarily intercepts user requests from the tenant. When the user accesses its exclusive domain name, it is no longer forwarded to the backend service, but returns a preset prompt page displaying migration status information such as "System is migrating, current progress: completed", avoiding users from operating when data is not completely ready or services are not stable, preventing data inconsistency or operation failure.
[0154] After the DNS record propagation is completed, the reverse proxy configuration hot reload is successful, and the target service confirms that it can respond normally, the system removes the request interception and switches the user traffic to the new target server node or container instance. After that, all requests from the tenant are routed to its exclusive independent running environment, and the original configuration and business data remain complete, allowing users to continue using the system normally, realizing a smooth transition from a standard tenant to a customized tenant.
[0155] According to one embodiment of the present application, further comprising:
[0156] The progress of the data synchronization, the resource usage status of the target server node, and the migration failure rate are displayed in real time by a management background;
[0157] If the migration fails, the customized configuration data file and the business data are automatically restored to the source server node before migration, and the original DNS resolution record and reverse proxy configuration are reactivated.
[0158] As described above, the system further includes a centralized management background for monitoring the execution status of the tenant migration process. During the data synchronization phase, the management background displays the progress information of the migration task in real time, including the amount of data transmitted, the total data volume, the synchronization completion percentage, and the estimated remaining time. At the same time, the system continuously collects and displays the resource usage of the target server node or container instance, such as CPU utilization, memory occupation, disk IO, and network bandwidth, so that the administrator can evaluate the carrying capacity of the target environment.
[0159] In addition, the management background also records and displays abnormal events and failure rates during the migration process, such as the number of data packet transmission failures, the number of database import errors, service startup abnormalities, etc. These indicators are presented in a visual manner to help operations personnel discover potential problems in a timely manner and determine whether manual intervention is needed.
[0160] If the system detects critical errors during the migration process, causing the data synchronization or service switching to fail to continue, a rollback mechanism will be automatically triggered. The system first stops the current migration process, and then restores the backed up customized configuration data file and business data from the target environment or temporary storage to the database instance of the source server node before migration, ensuring that the original data state is complete and available.
[0161] Subsequently, the system restores the domain name resolution record of the tenant to the IP address before migration by calling the DNS management interface, and regenerates the original configuration rules of the reverse proxy, which takes effect through hot reloading technology. In this way, user requests will be re-routed back to the original standard tenant running environment.
[0162] The entire rollback process is automatically executed without the need for manual operation, minimizing service interruption time and ensuring the continuity of tenant business and data security. After the rollback is completed, the system records the failure cause and processing result in the management background for subsequent analysis and optimization.
[0163] According to one embodiment of the present application, further comprising:
[0164] The graphical interface tool supports drag-and-drop operations, parameter configuration, and flowchart design, and converts the operation results into the JSON format metadata in real time;
[0165] The customized configuration data file is version managed, supporting tenants to roll back to a historical version through a version selector or to make the current version of the configuration file effective through a release function.
[0166] As described above, the system also includes a fully functional graphical interface tool for supporting tenants to perform lightweight customization operations. The tool provides an intuitive user interaction interface, supports drag-and-drop operations, and tenants can drag fields, controls, or process nodes from a component library to a form or process design area through a mouse to realize self-definition of interface layout. At the same time, the tool provides a parameter configuration panel to allow tenants to set properties of selected components, such as field name, data type, verification rule, display condition, etc. For the definition of business processes, the tool supports a process diagram design mode, and tenants can build an approval chain or workflow by connecting nodes and set the execution role, processing time limit, and flow condition of each node.
[0167] In the process of the above operations performed by the user, the system listens to interface changes in real time and converts the configuration intention expressed by each operation into structured JSON format metadata in real time. The conversion process is based on preset mapping rules to ensure that user operations can be accurately reflected as a data structure that can be stored and parsed, without waiting for the operation to end to save the intermediate state, thereby improving configuration efficiency and response speed.
[0168] The system also implements a version management mechanism for the generated customized configuration data file. Each time the configuration content is modified and saved, the system automatically generates a new version record containing version number, creation time, operator, and change summary, and persists the JSON data of the version. All historical versions are retained to form a traceable version chain.
[0169] Tenants can view the current and historical configuration versions through the built-in version selector and select any historical version to perform a rollback operation. After rollback, the system reloads the JSON metadata of the historical version and sets it as the current effective configuration, so that the system interface and business behavior return to the corresponding state.
[0170] In addition, the system provides a release function to allow tenants to set the current version as the official effective version after completing the configuration modification of the current version by clicking the "release" button. The release operation can be accompanied by an audit process, supporting a multi-level confirmation mechanism to ensure that critical configuration changes are put online after being approved. This mechanism not only guarantees the flexibility of configuration changes, but also enhances the controllability and security of the system.
[0171] According to an embodiment of the present application, further comprising:
[0172] deploying a code hot update module in the server node or container instance, allowing dynamic loading or updating of the personalized code without restarting the service;
[0173] controlling the version of the dependent library of the personalized code through a package management tool, and automatically downloading the missing dependent library when deploying.
[0174] As described above, the system also includes a code hot update module deployed in the target server node or container instance, for supporting dynamic updating of the personalized code. The module continuously listens to changes in the personalized code files in the extension directory during service running. When detecting that a code file is modified, added or deleted, the hot update module automatically triggers a reloading mechanism to re-inject the changed code module into the current running environment, replacing the original version to realize instant updating of the function. The whole process does not need to interrupt the service process, nor does it affect other tenant requests or other function modules of the current tenant being processed, ensuring the continuity of system running and high availability of business.
[0175] At the same time, to ensure that the external library files relied on by the personalized code can run correctly and completely, the system introduces a package management tool to uniformly manage the dependent libraries. When deploying the personalized code, the system parses its dependency declaration file (such as the library name and version number listed in the description file), checks whether the required dependent library and its version exist in the target environment through the package management tool. For the missing or version-incompatible dependent library, the system automatically downloads and installs it into the specified dependent directory from the preset private or public repository, ensuring the integrity of the running environment.
[0176] The dependent library management mechanism supports version locking and compatibility checking, avoiding running abnormities caused by dependent conflicts. At the same time, the installation process of all dependent libraries is carried out in an isolated environment, preventing pollution to the system basic environment. Through the above technical means, the system realizes efficient, safe and automated deployment and updating of the personalized code and its dependencies, improving the operation and maintenance efficiency and stability of customized services.
[0177] The second aspect embodiment of the application provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the method in any of the embodiments of the first aspect when executing the program.
[0178] Figure 2 An example of an entity structure diagram of an electronic device is shown in FIG. 1. Figure 2As shown, the electronic device can include a processor 810, a communication interface 820, a memory 830, and a communication bus 840, wherein the processor 810, the communication interface 820, and the memory 830 complete communication with each other through the communication bus 840. The processor 810 can invoke the logical instructions in the memory 830 to execute the method in any of the embodiments of the first aspect described above, and the method includes:
[0179] receiving a lightweight customization request of a tenant, generating an independent database instance or table space according to a tenant identifier, receiving a form, a flow, and an application configuration parameter of the tenant through a graphical interface tool, converting the parameter into metadata in JSON format, and writing the metadata into the database instance or table space of the tenant to generate a customized configuration data file;
[0180] allocating an independent server node or container instance to the tenant according to a deep customization request of the tenant, deploying personalized code of the tenant into the server node or container instance, the personalized code including business logic extension code and dependent libraries, separating the personalized code from standard product code through a dynamic loading mechanism, and loading the personalized code at runtime based on the tenant identifier;
[0181] generating a unique second-level domain name according to the tenant identifier, mapping the domain name to an IP address of the server node or container instance through a DNS resolution service, and forwarding a domain name request of the tenant to the server node or container instance corresponding to the IP address by using a reverse proxy technology, wherein the forwarding rule is generated based on a mapping relationship between the tenant identifier and the IP address;
[0182] receiving a migration request of a standard tenant to a customized tenant, extracting the customized configuration data file and business data from the database instance of the standard tenant, synchronizing the customized configuration data file and business data to the database instance of a target server node or container instance, updating the domain name and IP address mapping relationship in the DNS resolution service, and modifying the reverse proxy configuration to route the domain name request of the tenant to the target server node or container instance.
[0183] In addition, the logic instructions in the memory 830 described above can be implemented in the form of software function units and sold or used as independent products, and can be stored in a computer readable storage medium. Based on such understanding, the technical solutions of the present application essentially or the parts that contribute to the prior art or parts of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a storage medium, and includes a plurality of instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present application. The aforementioned storage medium includes: a U disk, a mobile hard disk, a read-only memory, a random access memory, a magnetic disk or an optical disk, and various media that can store program codes.
[0184] In another aspect, the present application also provides a computer program product, which comprises a computer program, the computer program can be stored on a non-transitory computer readable storage medium, and the computer program can be executed by a processor to enable a computer to execute the method provided by the above-mentioned methods, the method comprising:
[0185] receiving a lightweight customization request of a tenant, generating an independent database instance or table space according to a tenant identifier, receiving a form, a flow and an application configuration parameter of the tenant through a graphical interface tool, converting the parameters into JSON format metadata, and writing the metadata into the database instance or table space of the tenant to generate a customized configuration data file;
[0186] allocating an independent server node or container instance to the tenant according to a deep customization request of the tenant, deploying personalized code of the tenant into the server node or container instance, the personalized code including business logic extension code and dependent libraries, separating the personalized code from standard product code through a dynamic loading mechanism, and loading the personalized code at runtime based on the tenant identifier;
[0187] generating a unique second-level domain name according to the tenant identifier, and mapping the domain name to an IP address of the server node or container instance through a DNS resolution service, forwarding a domain name request of the tenant to the server node or container instance corresponding to the IP address by using a reverse proxy technology, wherein the forwarding rule is generated based on the mapping relationship between the tenant identifier and the IP address;
[0188] receiving a migration request of a standard tenant to a customized tenant, extracting the customized configuration data file and business data from a database instance of the standard tenant, synchronizing the customized configuration data file and business data to a database instance of a target server node or container instance, updating a domain name and IP address mapping relationship in the DNS resolution service, and modifying a reverse proxy configuration to route a domain name request of the tenant to the target server node or container instance.
[0189] In another aspect, the present application also provides a non-transitory computer readable storage medium having a computer program stored thereon, which, when executed by a processor, implements a cigarette case image recognition method provided by the above method, the method comprising:
[0190] receiving a lightweight customization request of a tenant, generating an independent database instance or table space according to a tenant identifier, receiving a form, a process and an application configuration parameter of the tenant through a graphical interface tool, converting the parameter into metadata in JSON format, and writing the metadata into the database instance or table space of the tenant to generate a customized configuration data file;
[0191] allocating an independent server node or container instance to the tenant according to a deep customization request of the tenant, deploying personalized code of the tenant into the server node or container instance, the personalized code comprising business logic extension code and dependent libraries, separating the personalized code from standard product code through a dynamic loading mechanism, and loading the personalized code at runtime based on the tenant identifier;
[0192] generating a unique second-level domain name according to the tenant identifier, mapping the domain name to an IP address of the server node or container instance through a DNS resolution service, and forwarding a domain name request of the tenant to the server node or container instance corresponding to the IP address by using a reverse proxy technology, wherein the forwarding rule is generated based on a mapping relationship between the tenant identifier and the IP address;
[0193] receiving a migration request of a standard tenant to a customized tenant, extracting the customized configuration data file and business data from a database instance of the standard tenant, synchronizing the customized configuration data file and business data to a database instance of a target server node or container instance, updating a domain name and IP address mapping relationship in the DNS resolution service, and modifying a reverse proxy configuration to route a domain name request of the tenant to the target server node or container instance.
[0194] The places not mentioned in the present application can be implemented by using or referring to the existing technology.
[0195] The various embodiments in the specification are described in progressive manner, and the same or similar parts between the various embodiments can be mutually referred to, and each embodiment focuses on the difference from other embodiments.
[0196] The above merely provides an example of the present application, and is not intended to limit the present application. The present application can have various modifications and changes for those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the scope of the claims of the present application.
Claims
1. A method for customizing services for SaaS tenants, characterized in that, include: Receive a tenant’s lightweight customization request, generate an independent database instance or tablespace based on the tenant identifier, receive the tenant’s form, process and application configuration parameters through a graphical interface tool, convert the parameters into metadata in JSON format, and write the metadata into the tenant’s database instance or tablespace to generate a customized configuration data file. Based on the tenant's deep customization request, an independent server node or container instance is allocated to the tenant, and the tenant's personalized code is deployed to the server node or container instance. The personalized code includes business logic extension code and dependency libraries. The personalized code is separated from the standard product code through a dynamic loading mechanism, and the personalized code is loaded at runtime based on the tenant identifier. A unique second-level domain name is generated based on the tenant identifier, and the domain name is mapped to the IP address of the server node or container instance through DNS resolution service. The domain name request of the tenant is forwarded to the server node or container instance corresponding to the IP address using reverse proxy technology, wherein the forwarding rule is generated based on the mapping relationship between the tenant identifier and the IP address. Receive a migration request from a standard tenant to a customized tenant, extract the customized configuration data file and business data from the database instance of the standard tenant, and synchronize the customized configuration data file and business data to the database instance of the target server node or container instance; Update the domain name and IP address mapping relationship in the DNS resolution service and modify the reverse proxy configuration to route the tenant's domain name requests to the target server node or container instance.
2. The method according to claim 1, characterized in that, The process involves receiving a lightweight customization request from a tenant, generating an independent database instance or tablespace based on the tenant identifier, receiving the tenant's forms, processes, and application configuration parameters through a graphical interface tool, converting the parameters into JSON-formatted metadata, and writing the metadata into the tenant's database instance or tablespace to generate a customized configuration data file, including: By using database sharding technology or tablespace partitioning in a shared database, the customized configuration data files of the tenant are physically isolated from the standard product data; When the system starts, the metadata of the standard product is loaded first, and then the customized configuration data file is dynamically loaded according to the tenant identifier. The performance overhead of repeated loading is reduced through a caching mechanism.
3. The method according to claim 1, characterized in that, The process involves allocating an independent server node or container instance to the tenant based on their deep customization request, deploying the tenant's personalized code to the server node or container instance, and defining the personalized code as business logic extension code and dependency libraries. A dynamic loading mechanism separates the personalized code from the standard product code, and the personalized code is loaded at runtime based on the tenant identifier. This includes: An extension directory is reserved in the standard product code project. The extension directory defines loading rules through an independent configuration file. The configuration file contains the mapping relationship between the tenant identifier and the extension code path. Allocate independent CPU and memory resources to the server nodes or container instances, and limit the usage limit of the resources through container orchestration technology to avoid resource contention between tenants.
4. The method according to claim 1, characterized in that, The process involves generating a unique second-level domain name based on the tenant identifier, mapping the domain name to the IP address of the server node or container instance via DNS resolution, and forwarding the tenant's domain name requests to the server node or container instance corresponding to the IP address using reverse proxy technology. The forwarding rules are generated based on the mapping relationship between the tenant identifier and the IP address, and include: The unique second-level domain name is generated based on the tenant identifier; The A records in the DNS resolution service are updated in real time via the API interface to ensure that the mapping relationship between the domain name and the IP address takes effect immediately after the tenant migrates. Based on the mapping relationship between the tenant identifier and the IP address, the Nginx reverse proxy configuration file is dynamically generated, and the configuration changes are made effective immediately through hot reload technology.
5. The method according to claim 1, characterized in that, The process involves receiving a migration request from a standard tenant to a customized tenant, extracting the customized configuration data file and business data from the database instance of the standard tenant, and synchronizing the customized configuration data file and business data to the database instance of the target server node or container instance. Update the domain name and IP address mapping in the DNS resolution service and modify the reverse proxy configuration to route the tenant's domain name requests to the target server node or container instance, including: The customized configuration data file and business data are packaged into a compressed file using a database backup tool, and the compressed file is synchronized to the target server node or container instance via a network transmission protocol. After data synchronization is complete, the domain name requests of the tenant are gradually switched to the target server node or container instance by modifying the DNS resolution records and reverse proxy configuration. During the switching process, user requests are intercepted and migration progress prompts are displayed.
6. The method according to claim 5, characterized in that, Also includes: The management backend displays the data synchronization progress, resource usage status of the target server node, and migration failure rate in real time. If the migration fails, the customized configuration data file and business data will be automatically restored to the source server node before the migration, and the original DNS resolution records and reverse proxy configuration will be reactivated.
7. The method according to claim 2, characterized in that, Also includes: The graphical interface tool supports drag-and-drop operations, parameter configuration, and flowchart design, and converts the operation results into metadata in the JSON format in real time. Version management is implemented for the customized configuration data files, allowing tenants to roll back to historical versions via a version selector or apply the current version of the configuration file via the publish function.
8. The method according to claim 3, characterized in that, Also includes: Deploying a hot code update module in the server node or container instance allows the personalized code to be dynamically loaded or updated without restarting the service; The dependency libraries of the personalized code are version controlled by a package management tool, and missing dependency libraries are automatically downloaded during deployment.
9. A computer-readable storage medium having a program stored thereon, characterized in that, When the program is executed by the processor, it implements the steps of the method as described in any one of claims 1-8.
10. An electronic device comprising a memory, a processor, and a program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the steps of the method as described in any one of claims 1-8.
Citation Information
Patent Citations
Individual customization supporting method based on multi-tenant mode
CN103955384A
Method of multi- tenant data dynamic migration based on SaaS
CN107896250A
Multi-tenant online car-hailing system and dynamic isolation method
CN112035213A
Multi-tenant SaaS platform rapid building and dynamic expansion method and system
CN112100262A
Multi-tenant platform isolation management system and method based on integrated energy management system
CN116760705A
Cited By
Methods and systems for providing network connectivity to a secure access service edge (SASE) domain
US20250310864A1