An application of SAAS method, SAAS platform, medium
Through the architecture of container management nodes and host nodes, product images are used to create tenant containers and forward access requests, which solves the cost and speed challenges of migrating software to cloud platforms in existing technologies and realizes rapid SAAS and low-cost application product launch.
Patent Information
- Application Number
- CN202110265705.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-03-11
- Publication Date
- 2025-09-30
- Estimated Expiration
- 2041-03-11
AI Technical Summary
Existing technologies face problems such as long development cycles, high investment costs, high resource usage, and difficult deployment and maintenance when migrating third-party software to cloud platforms. In addition, SAAS service providers face cost and speed challenges in large-scale distributed transformation before market verification.
Adopting the architecture of container management node and container host node, the container management node obtains container creation request and sends creation instruction, uses product image to create tenant container, and forwards access request through container management node to realize rapid SAAS of container and avoid configuring separate communication address and interface for each tenant container.
It achieves the rapid SAAS transformation of application products, reduces creation costs and workload, solves the problem of communication network reuse, reduces the consumption of configuring communication resources for tenant containers, and takes into account both cost and product launch speed.
Smart Images

Figure CN115080176B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a SAAS application method, system, SAAS platform, and medium. Background Art
[0002] As the internet industry gradually shifts to cloud computing, internet infrastructure is gradually migrating to the cloud. Users can deploy their business simply by purchasing Infrastructure as a Service (IAAS) services in the cloud, eliminating the need to purchase and maintain hardware. Elastic scalability is also possible, reducing operational costs. Against this backdrop, third-party software vendors also face the challenge of migrating their existing offline software or equipment to the cloud. Deploying existing third-party software as virtual machines on a customer's cloud platform requires purchasing virtual machine resources, deploying software or system images, connecting to the network, monitoring hosts and services, and configuring high availability. This incurs significant maintenance costs and hinders the maximum value of cloud computing.
[0003] The emergence of SAAS (Software-as-a-Service) services can address the aforementioned issues. However, for SAAS service providers, when developing new products, large-scale distributed transformation of existing products before market validation presents long development cycles and high investment costs. Simply migrating existing products to cloud platforms using virtualization technology also leads to high resource usage, deployment and maintenance difficulties, and high costs.
[0004] Therefore, how to implement SAAS-based applications while balancing cost and product launch speed is an important issue that those skilled in the art need to solve. Summary of the Invention
[0005] In view of this, the purpose of this application is to provide a SAAS method, system, SAAS platform, and medium for application products, which can achieve rapid SAAS transformation of application products while taking into account both cost and application product launch speed. The specific solution is as follows:
[0006] In a first aspect, the present application discloses a SAAS application method, which is applied to a container management node on a SAAS platform, comprising:
[0007] Applied to the SAAS platform, the SAAS platform includes a container management node and a container host node, including:
[0008] The container management node obtains a container creation request, wherein the container creation request includes application product information;
[0009] The container management node sends a container creation instruction to the target container host node;
[0010] When the target container host node obtains the container creation instruction, the application container engine on the target container host node creates a target tenant container using the product image corresponding to the application product information;
[0011] When the container management node obtains a container access request, the container management node obtains the target container IP corresponding to the tenant ID in the container access request from the database, and forwards the container access request to the target tenant container according to the target container IP, so as to access the target tenant container.
[0012] Optionally, there are multiple container host nodes; before the container management node sends a container creation instruction to the target container host node, the method further includes:
[0013] The container management node determines the current load index of each container host node based on the weight of each container host node and the user resource usage parameter, wherein the weight is determined based on at least one of the number of CPU cores, CPU main frequency, and memory of each container host node, and the user resource usage parameter is determined based on at least one of the number of users, number of terminals, and number of concurrent connections connected to each tenant container of each container host node;
[0014] The container management node uses the container host node with the smallest current load index as the target container host node.
[0015] Optionally, the SAAS application method further includes:
[0016] The container management node receives the container IP and tenant ID reported by each tenant container on each container host node, establishes a correspondence between the container IP and tenant ID of each tenant container, and writes the correspondence into the database;
[0017] The container management node receives the heartbeat and / or running status regularly reported by each tenant container on each container host node, and restarts the abnormal tenant container when the heartbeat or the running status is abnormal.
[0018] Optionally, it also includes:
[0019] When the application product in the target tenant container needs to be upgraded, the target container host node obtains a new product image based on the new version of the application product;
[0020] The target container host node stops running and deletes the target tenant container;
[0021] The target container host node creates and runs a new target tenant container based on the new product image.
[0022] Optionally, it also includes:
[0023] The target container host node sends the data to be backed up sent by the target tenant container at regular intervals to the backup node in the SAAS platform for backup storage, so that the backup node synchronizes the data to be backed up to a device that is geographically different from the SAAS platform.
[0024] Optionally, when the container management node obtains the container access request, the container management node obtains the target container IP corresponding to the tenant ID in the container access request from a database, and forwards the container access request to the target tenant container according to the target container IP, including:
[0025] When the user access dynamic agent in the container management node obtains a container access request, the target container IP corresponding to the tenant ID in the container access request is obtained from the database through the user access dynamic agent, and the container access request is forwarded to the target tenant container according to the target container IP. The user access dynamic agent is implemented based on Nginx plus Lua extension.
[0026] Optionally, when the container management node obtains the container access request, the container management node obtains the target container IP corresponding to the tenant ID in the container access request from a database, and forwards the container access request to the target tenant container according to the target container IP, including:
[0027] When the device access dynamic agent in the container management node obtains a container access request, the device access dynamic agent obtains the target container IP corresponding to the tenant ID in the container access request from the database, and forwards the container access request to the target tenant container according to the target container IP.
[0028] Optionally, after forwarding the container access request to the target tenant container according to the target container IP, the method further includes:
[0029] The target tenant container performs single sign-on docking with the SAAS platform to complete user authentication of the container access request;
[0030] When the user authentication succeeds, the tenant ID in the container access request is compared with the tenant ID associated with the target tenant container. If they are consistent, it is determined that the container access request authentication succeeds.
[0031] In a second aspect, the present application discloses a SAAS application system, which is applied to a SAAS platform. The SAAS platform includes a container management node and a container host node, including:
[0032] The request acquisition module on the container management node is used to obtain a container creation request, wherein the container creation request includes application product information;
[0033] The container management module on the container management node is used to send a container creation instruction to the target container host node;
[0034] The application container engine on the target container host node is configured to create a target tenant container using the product image corresponding to the application product information upon obtaining the container creation instruction;
[0035] The request forwarding module on the container management node is configured to, upon receiving a container access request, obtain the target container IP corresponding to the tenant ID in the container access request from the database, and forward the container access request to the target tenant container according to the target container IP, so as to access the target tenant container.
[0036] In a third aspect, the present application discloses a SAAS platform, including:
[0037] memory and processor;
[0038] Wherein, the memory is used to store computer programs;
[0039] The processor is used to execute the computer program to implement the aforementioned disclosed application SAAS method.
[0040] In a fourth aspect, the present application discloses a computer-readable storage medium for storing a computer program, wherein the computer program, when executed by a processor, implements the aforementioned disclosed application SAAS method.
[0041] It can be seen that the present application is applied to a SAAS platform, and the SAAS platform includes a container management node and a container host node. First, the container management node obtains a container creation request, wherein the container creation request includes application product information. Then the container management node sends a container creation instruction to the target container host node; when the target container host node obtains the container creation instruction, the application container engine on the target container host node uses the product image corresponding to the application product information to create a target tenant container. When the container management node obtains a container access request, the container management node obtains the target container IP corresponding to the tenant ID in the container access request from the database, and forwards the container access request to the target tenant container according to the target container IP, so as to access the target tenant container. It can be seen that in this application, when the container management node obtains a container creation request, that is, when a container needs to be created, the container management node first sends a container creation instruction to the target container host node. After the target container host node obtains the container creation instruction, the application container engine uses the product image corresponding to the application product information in the container creation instruction to create a target tenant container. In this way, by creating a tenant container and running the application product in the tenant container, the application SAAS can be realized. Moreover, since creating a container and running the application product in the container is lighter than the virtualization solution, the application product can be quickly SAAS-ized. Moreover, since the creation cost is low and the workload is small, both the cost and the speed of application product launch can be taken into account. After obtaining the container access request through the container management node, the corresponding target container IP is obtained from the database according to the tenant ID in the container access request, and then the container access request can be forwarded to the corresponding target tenant container according to the target container IP. In this way, there is no need to configure a separate communication address and communication interface for each tenant container in the SAAS platform, and each tenant container uses its own communication address and communication interface to receive external access requests to itself. In this application, it is only necessary to use the communication address and communication interface of the container management node to uniformly receive the container access requests of each tenant container, and then use the tenant ID and container IP in the container access request to forward the container access request, thereby solving the communication network multiplexing problem in the SAAS platform, saving a large amount of communication resources consumed by the need to configure communication addresses and communication interfaces for each tenant container separately, reducing the workload in the SAAS application process, and further reducing costs, so it can take into account both cost and application product launch speed. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are merely embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without any creative work.
[0043] Figure 1 This is a flow chart of a SAAS application method disclosed in this application;
[0044] Figure 2 This is a flowchart of a container access request processing method disclosed in this application, which is accessed by a user through a browser;
[0045] Figure 3 A flowchart of a container access request process for a device access disclosed in this application;
[0046] Figure 4 This is a flow chart of a SAAS application method disclosed in this application;
[0047] Figure 5 This is an overall block diagram of a SAAS-based system disclosed in this application;
[0048] Figure 6 This is a schematic diagram of the SAAS system structure disclosed in this application;
[0049] Figure 7 This is a schematic diagram of the structure of an electronic device disclosed in this application. DETAILED DESCRIPTION
[0050] The following will be combined with the drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.
[0051] See also Figure 1 As shown, an embodiment of the present application discloses a SAAS application method, which is applied to a SAAS platform. The SAAS platform includes a container management node and a container host node. The method includes:
[0052] Step S11: The container management node obtains a container creation request, wherein the container creation request includes application product information.
[0053] In actual applications, the SAAS platform includes a container host node and a container management node. The container host node is used to load tenant containers, and the container management node is used to manage the container host and the tenant containers on the container host. The container management node can be a single node or a node collection. When the container management node is a node collection, multiple nodes respectively implement the functions of the container management node. In addition, this application does not exclude the possibility that the container management node and the container host node are located on the same node. In this case, the node simultaneously implements the functions of the container management node and the container host node.
[0054] The container management node needs to obtain a container creation request, where the container creation request is also a container creation request triggered by a user. The container creation request includes application product information. The application product information is the application product that the user needs to rent, including all-in-one type products and software products.
[0055] Step S12: The container management node sends a container creation instruction to the target container host node.
[0056] After the container management node obtains the container creation request, it is also necessary to send a container creation instruction to the target container management node on the SAAS platform, wherein sending the container creation instruction can be implemented by the container management node by calling a preset docker API. The target container management node is the container host node used to create the target tenant container corresponding to the container creation request.
[0057] In actual implementation, the SAAS platform may include multiple container host nodes, so the target container host node may be determined from the container host nodes first, and then the container creation instruction may be sent to the target container host node.
[0058] The step of determining the target container host node from the container host nodes may specifically include: determining the target container host node from the container host nodes on the SAAS platform based on a preset load balancing method.
[0059] In a first specific implementation, the target container host node is determined from the container host nodes on the SAAS platform based on a preset load balancing method, including: the container management node determines the current load index of each container host node based on the weight of each container host node and the user resource usage parameter, wherein the weight is determined based on at least one of the number of CPU cores, CPU main frequency and memory of each container host node, and the user resource usage parameter is determined based on at least one of the number of users, number of terminals and number of concurrent connections accessed by each tenant container of each container host node; the container management node uses the container host node with the smallest current load index as the target container host node.
[0060] Specifically, assuming that there are a total of container host nodes, and the weight of each node is (Weight >0). Assume that each host node has tenant containers, and the user resource usage parameters of each tenant container are , wherein the user resource usage parameter of the tenant container can be determined based on at least one of the number of users, the number of terminals, and the number of concurrent connections connected to each tenant container of each container host node. Then the current load index of each container host node is:
[0061]
[0062] Then, the container host node with the smallest current load index is used as the target container host node.
[0063] In actual implementation, the load information of each container host node on the SAAS platform needs to be persistently stored in MySQL (a relational database management system) on the container management node. This facilitates pre-warming the load indicators of each container host node when the service starts. That is, when the service starts, the load information of each container host node is obtained from MySQL to determine the current load indicator of each container host node.
[0064] In a second specific implementation, the determining the target container host node from the container host nodes on the SAAS platform based on a preset load balancing method includes: determining the target container host node from the container host nodes on the SAAS platform based on a tenant ID hash method.
[0065] In a third specific implementation, the determining of the target container host node from the container host nodes on the SAAS platform based on a preset load balancing method includes: determining the target container host node from the container host nodes on the SAAS platform based on a weighted round-robin method in load balancing.
[0066] In a fourth specific implementation, the determining of the target container host node from the container host nodes on the SAAS platform based on a preset load balancing method includes: determining the target container host node from the container host nodes on the SAAS platform based on a minimum number of connections method in load balancing.
[0067] Among them, the three load balancing methods of the second to fourth specific implementation methods are commonly used methods in the prior art, so they will not be described in detail here.
[0068] Step S13: When the target container host node obtains the container creation instruction, the application container engine on the target container host node creates a target tenant container using the product image corresponding to the application product information.
[0069] After the container management node sends the container creation instruction to the target container host node and the target container host receives the instruction, the application container engine on the target container host node can create and run the target tenant container using the product image corresponding to the application product information. The application container engine can be Docker, an open-source application container engine that allows developers to package applications and their dependencies into a portable image and then publish it to any popular Linux or Windows machine, also enabling virtualization.
[0070] Among them, the product image needs to meet certain conditions during the production process. For products similar to all-in-one machines, when making an image, you can use a pure device or virtual machine to package the system's root file system into a tar package to complete the image production. For software products, you can build on the basis of an existing image, such as creating an overlay layer of product software based on the centos7 distribution image. However, there are some differences between using application products as devices and using them as SAAS services, and the system needs to be modified and adapted for specific scenarios. Specifically, first of all, application products deployed in containers usually no longer require network configuration. The network of the application product is taken over by the container and SAAS platform, including network ports, network addresses, etc., or requires unified configuration, including routing, DNS (Domain Name System, Domain Name System) and other configurations. Users no longer need to perform custom configurations, so the network configuration function in the product image can be hidden.
[0071] Step S14: When the container management node obtains the container access request, the container management node obtains the target container IP corresponding to the tenant ID in the container access request from the database, and forwards the container access request to the target tenant container according to the target container IP, so as to access the target tenant container.
[0072] After the target tenant container begins normal operation, the user corresponding to the container creation request can access the target tenant container to utilize the services provided by the application product in the target tenant container. After the container management node obtains the container access request corresponding to the container creation request, the container management node must first obtain the target container IP (Internet Protocol Address) corresponding to the tenant ID in the container access request from the database and forward the container access request to the target tenant container based on the target container IP. After receiving the container access request, the target tenant container must first authenticate the container access request. After the access request is successfully authenticated, the target tenant container can be accessed. That is, after the access request is successfully authenticated, the target tenant container must respond to the container access request. The database can be the in-memory database Redis on the container management node. The container management node can not only manage container host nodes but also receive and forward container access requests.
[0073] Wherein, when the container management node obtains the container access request, the container management node obtains the target container IP corresponding to the tenant ID in the container access request from the database, and forwards the container access request to the target tenant container according to the target container IP, including: when the user access dynamic agent in the container management node obtains the container access request, the user access dynamic agent obtains the target container IP corresponding to the tenant ID in the container access request from the database through the user access dynamic agent, and forwards the container access request to the target tenant container according to the target container IP, wherein the user access dynamic agent is implemented based on Nginx plus Lua extension.
[0074] In other words, the container access request can be a user access request. User access is typically performed through a browser. Therefore, after user authentication is successful, the tenant ID can be set in a cookie in the browser. When a user accesses a tenant container, the cookie is automatically included. After the user access dynamic proxy receives the container access request, it parses the cookie to obtain the tenant ID. It then uses the tenant ID to query the database for the container IP address corresponding to the tenant ID, and then proxies the container access request to the corresponding tenant container.
[0075] Accordingly, in order to obtain the corresponding container IP from the database according to the tenant ID, the container management node needs to receive the container IP and tenant ID reported by each tenant container on each container host node, establish a correspondence between the container IP and tenant ID of each tenant container, and write the correspondence into the database.
[0076] This user access dynamic proxy can be implemented using Nginx with Lua extensions. Nginx proxies all HTTP (Hypertext Transfer Protocol) accesses from users to tenant containers, and Lua scripts implement request routing. This approach, combined with Nginx and Lua extensions, reduces development workload and offers flexible configuration and deployment.
[0077] See also Figure 2The figure below shows a flowchart for processing container access requests from users accessing through a browser. When the user access dynamic proxy on the container management node receives a container access request, it queries the container IP address based on the tenant ID in the browser cookie. Based on the container IP address, the container access request is forwarded to the tenant container corresponding to the queried container IP address among tenants 1 through M. The container IP address in the in-memory database Redis (i.e., the aforementioned database) is reported by each tenant container to the container monitoring module in the container management node, which then updates the IP address in the in-memory database Redis.
[0078] Among them, when the container management node obtains the container access request, the container management node obtains the target container IP corresponding to the tenant ID in the container access request from the database, and forwards the container access request to the target tenant container according to the target container IP, including: when the device access dynamic agent in the container management node obtains the container access request, obtains the target container IP corresponding to the tenant ID in the container access request from the database through the device access dynamic agent, and forwards the container access request to the target tenant container according to the target container IP.
[0079] That is, the container access request can be a request for the device to access the container, that is, the tenant container can be connected to the external device or system. For the HTTP request when the device is accessed, the user access dynamic proxy solution can be directly reused. However, for the TCP (Transmission Control Protocol) request when the device is accessed, it is generally a long connection of a private protocol, so a simple modification of the communication protocol of the device or system is required. For TCP requests for device-side access, it is necessary to add a plaintext tenant ID in the first packet of the connection. In this way, when the device access dynamic proxy receives the container access request for device access, it can parse the first packet, extract the tenant ID, and then forward the connection and subsequent communication data to the tenant container based on the container IP queried by the tenant ID.
[0080] Because tenant containers no longer have independent networks, devices and external systems require adaptation when connecting to tenant containers. This can be achieved by using a dynamic proxy for device access, for example, by reusing the communication network using the tenant ID. This approach requires modifications and adaptations to the device's SDK (Software Development Kit) or external system.
[0081] Accordingly, in order to obtain the corresponding container IP from the database according to the tenant ID, the container management node needs to receive the container IP and tenant ID reported by each tenant container on each container host, establish a correspondence between the container IP and tenant ID of each tenant container, and store the correspondence in the database.
[0082] See also Figure 3 The figure shows a flowchart for processing container access requests for device access. When the device access dynamic proxy on the container management node receives a container access request, it queries the container IP address based on the tenant ID of the link or request. Based on the container IP address, the container access request is forwarded to the tenant container corresponding to the queried container IP address among tenant containers 1 through M. The container IP address in the in-memory database Redis (the aforementioned database) is reported by each tenant container to the container monitoring module in the container management node, which then updates the IP address in the in-memory database Redis.
[0083] In actual applications, the container management node also needs to receive the heartbeat and running status regularly reported by each tenant container on each container host, and restart the abnormal tenant container when the heartbeat or the running status is abnormal.
[0084] In general, native container services can support container monitoring, and parameters can be used to configure the container to automatically restart when it exits abnormally. However, for containers with complex functions, a more reliable monitoring solution is required. Therefore, this application integrates an agent service inside the tenant container, and the agent regularly sends heartbeats and operating status to the container monitoring module on the container management node. When the container monitoring module finds that the tenant container heartbeat is abnormal, or that the tenant container operating status is abnormal, it actively restarts the abnormal tenant container to quickly restore the tenant business.
[0085] It can be seen that the present application is applied to a SAAS platform, and the SAAS platform includes a container management node and a container host node. First, the container management node obtains a container creation request, wherein the container creation request includes application product information. Then the container management node sends a container creation instruction to the target container host node; when the target container host node obtains the container creation instruction, the application container engine on the target container host node uses the product image corresponding to the application product information to create a target tenant container. When the container management node obtains a container access request, the container management node obtains the target container IP corresponding to the tenant ID in the container access request from the database, and forwards the container access request to the target tenant container according to the target container IP, so as to access the target tenant container. It can be seen that in this application, when the container management node obtains a container creation request, that is, when a container needs to be created, the container management node first sends a container creation instruction to the target container host node. After the target container host node obtains the container creation instruction, the application container engine uses the product image corresponding to the application product information in the container creation instruction to create a target tenant container. In this way, by creating a tenant container and running the application product in the tenant container, the application SAAS can be realized. Moreover, since creating a container and running the application product in the container is lighter than the virtualization solution, the application product can be quickly SAAS-ized. Moreover, since the creation cost is low and the workload is small, both the cost and the speed of application product launch can be taken into account. After obtaining the container access request through the container management node, the corresponding target container IP is obtained from the database according to the tenant ID in the container access request, and then the container access request can be forwarded to the corresponding target tenant container according to the target container IP. In this way, there is no need to configure a separate communication address and communication interface for each tenant container in the SAAS platform, and each tenant container uses its own communication address and communication interface to receive external access requests to itself. In this application, it is only necessary to use the communication address and communication interface of the container management node to uniformly receive the container access requests of each tenant container, and then use the tenant ID and container IP in the container access request to forward the container access request, thereby solving the communication network multiplexing problem in the SAAS platform, saving a large amount of communication resources consumed by the need to configure communication addresses and communication interfaces for each tenant container separately, reducing the workload in the SAAS application process, and further reducing costs, so it can take into account both cost and application product launch speed.
[0086] See also Figure 4 As shown, the embodiment of the present application discloses a specific SAAS application method, which is applied to a SAAS platform. The SAAS platform includes a container management node and a container host node. The method includes:
[0087] Step S21: The container management node obtains a container creation request, wherein the container creation request includes application product information.
[0088] Step S22: The container management node sends a container creation instruction to the target container host node.
[0089] Step S23: When the target container host node obtains the container creation instruction, the application container engine on the target container host node creates a target tenant container using the product image corresponding to the application product information.
[0090] In the specific implementation process, when the container management node on the SAAS platform obtains a container creation request, it can first determine the target container host node from the container host nodes on the SAAS platform based on a preset load balancing method, wherein the container creation request includes application product information, and the target container host node is used to deploy the target tenant container corresponding to the container creation request. After determining the target container host node, a container creation instruction can be sent to the target container host node, and the container creation instruction includes application product information. Accordingly, the target container host node needs to receive the container creation instruction sent by the container management node.
[0091] After the target container host node receives the container creation instruction, its application container engine must create and run the target tenant container using the product image corresponding to the application product information in the container creation instruction. In other words, the application product information in the container creation instruction is used to determine the specific product image to use for creating the target tenant container. The application container engine can then use the product image corresponding to the application product information in the container creation instruction to create and run the target tenant container.
[0092] Step S24: When the container management node obtains the container access request, the container management node obtains the target container IP corresponding to the tenant ID in the container access request from the database, and forwards the container access request to the target tenant container according to the target container IP, so as to access the target tenant container.
[0093] After creating and running the target tenant container, the container management node will also obtain a container access request in order to use the services provided by the application product in the target tenant container. After obtaining the container access request, the container management node needs to obtain the container IP corresponding to the tenant ID in the container access request from the database, and then forward the container access request to the target tenant container according to the container IP. Since the target tenant container shares the network resources on the target container host node with other tenant containers on the target container host node, the container access request needs to be forwarded to the target tenant container through the network of the target container host node. After receiving the container access request, the target tenant container will authenticate the container access request and respond to the container access request after successful authentication.
[0094] The container access request includes a container access request from a user via a browser, for example, i.e., a user accessing the tenant container via a browser. The container access request also includes a container access request from a device, i.e., the tenant container can be connected to an external device or system.
[0095] After obtaining the container access request, the container access request also needs to be authenticated. Specifically, the target tenant container and the SAAS platform perform single sign-on docking to complete the user authentication of the container access request. When the user authentication is successful, the tenant ID in the container access request is compared with the tenant ID associated with the target tenant container. If they are consistent, the container access request is deemed to have been authenticated successfully. In addition to general user authentication, the tenant ID in the container access request also needs to be compared with the tenant ID associated with the target tenant container. If they are consistent, the container access request is deemed to have been authenticated successfully, and then the container access request is responded to. This ensures isolation between tenants and prevents unauthorized access.
[0096] Step S25: When the application product in the target tenant container needs to be upgraded, the target container host node obtains a new product image produced based on the new version of the application product.
[0097] Step S26: The target container host node stops running and deletes the target tenant container.
[0098] Step S27: The target container host node creates and runs a new target tenant container based on the new product image.
[0099] In practice, since containers are typically single-use, software upgrades cannot be achieved by simply upgrading the container. Furthermore, upgrading every tenant's container consumes significant resources, is time-consuming, and difficult to maintain. Therefore, when creating the product image, it's necessary to disable the application's existing manual or automatic upgrade mechanisms.
[0100] Therefore, when the application product in the target tenant container needs to be upgraded, the target container host node must first obtain a new product image based on the new version of the application product; then stop and delete the target tenant container; and then create and run a new target tenant container based on the new product image. This upgrade process can be specifically performed by the application container engine on the target container host node.
[0101] In other words, for tenant containers, application product upgrades need to be achieved by upgrading the image. First, a new product image is created based on the new version of the software. Then, the current target tenant container needs to be stopped and deleted, and a new target tenant container needs to be created and run based on the new product image.
[0102] During the creation and operation of the new target tenant container, if the application product has been updated to a new version, but the user data is still in the old version, configuration conversion or data conversion of the user data is required. The configuration conversion can be automatically and smoothly processed within the new target tenant container, or a "configuration conversion temporary container" can be run before the new target tenant container is run to convert the configuration, and then the new target tenant container is run after the conversion.
[0103] In practice, offline applications typically include configuration backup and recovery features for fault recovery. For SaaS services, the platform has the responsibility and obligation to ensure the reliability of tenant container configurations and must consider disaster recovery. Therefore, when creating product images, the application's configuration backup and recovery features should be disabled.
[0104] However, the tenant's data requires automatic backup and disaster recovery by the SAAS platform. Therefore, the target container host node sends the backup data sent by the target tenant container to the backup node in the SAAS platform for backup storage, so that the backup node can synchronize the backup data to a device that is geographically different from the SAAS platform.
[0105] In other words, in addition to the underlying IAAS platform data reliability mechanism based on the container host node, each tenant container can implement a scheduled task to regularly (for example, daily) back up the tenant container's backup data to the SAAS platform's local backup node. The backup node then synchronizes the tenant container's backup data to a device geographically separate from the SAAS platform for disaster recovery, ensuring high reliability of the tenant data. The backup data can include the tenant container's configuration data.
[0106] See also Figure 5The figure shows the overall block diagram of the SAAS system. The SAAS platform includes container host nodes and container management nodes. The container management node is the management node for tenant containers, integrating container management, container monitoring, and container load modules. It provides an API (Application Programming Interface) to enable the creation, modification, restart, deletion, and query of tenant containers. It supports monitoring the health status of containers, sampling the operating status of containers, restarting abnormal containers, and sending operation and maintenance alerts for timely resolution. It also supports load balancing and dynamic migration of tenant containers across different container host nodes. Specifically, the container management module on the container management node provides an API to enable the creation, modification, deletion, and query of tenant containers. The container monitoring module monitors the health status of tenant containers, samples the operating status of tenant containers, restarts and recovers abnormal tenant containers, and sends operation and maintenance alerts for timely resolution. The container load module performs load balancing and dynamic migration of tenant containers across different container host nodes. The container host node provides the working node for the tenant container's operating environment and is managed by the container management node. The Docker on the container host node is an open source container service, which is responsible for the specific creation, modification, deletion and query functions of tenant containers. The user access dynamic agent is located on the container management node, and is responsible for proxying user management requests to the tenant container to achieve user management access. The device access dynamic agent is located on the container management node, and is responsible for proxying the communication of devices, terminals, and external systems to the tenant container to achieve communication between devices, terminals, external systems and tenant containers. In addition, the container host node can also include a persistent storage module and a product image. The persistent storage is used to persistently store some important data generated during the operation of the tenant container. The product image is a container image made based on the application product and is used to create a container. The in-memory database redis is a database on the container management node, which is used to store the tenant ID and the corresponding container IP, so that when a container access request (that is, a container access request) is obtained, the container access request is forwarded using the container IP in the in-memory database redis.
[0107] See also Figure 6 As shown, the embodiment of the present application discloses a SAAS application system, which is applied to a SAAS platform. The SAAS platform includes a container management node and a container host node, including:
[0108] The request acquisition module 11 on the container management node is used to obtain a container creation request, wherein the container creation request includes application product information;
[0109] The container management module 12 on the container management node is used to send a container creation instruction to the target container host node;
[0110] The application container engine 13 on the target container host node is configured to create a target tenant container using the product image corresponding to the application product information upon obtaining the container creation instruction;
[0111] The request forwarding module 14 on the container management node is used to obtain the target container IP corresponding to the tenant ID in the container access request from the database when obtaining the container access request, and forward the container access request to the target tenant container according to the target container IP, so as to access the target tenant container.
[0112] It can be seen that the present application is applied to a SAAS platform, and the SAAS platform includes a container management node and a container host node. First, the container management node obtains a container creation request, wherein the container creation request includes application product information. Then the container management node sends a container creation instruction to the target container host node; when the target container host node obtains the container creation instruction, the application container engine on the target container host node uses the product image corresponding to the application product information to create a target tenant container. When the container management node obtains a container access request, the container management node obtains the target container IP corresponding to the tenant ID in the container access request from the database, and forwards the container access request to the target tenant container according to the target container IP, so as to access the target tenant container. It can be seen that in this application, when the container management node obtains a container creation request, that is, when a container needs to be created, the container management node first sends a container creation instruction to the target container host node. After the target container host node obtains the container creation instruction, the application container engine uses the product image corresponding to the application product information in the container creation instruction to create a target tenant container. In this way, by creating a tenant container and running the application product in the tenant container, the application SAAS can be realized. Moreover, since creating a container and running the application product in the container is lighter than the virtualization solution, the application product can be quickly SAAS-ized. Moreover, since the creation cost is low and the workload is small, both the cost and the speed of application product launch can be taken into account. After obtaining the container access request through the container management node, the corresponding target container IP is obtained from the database according to the tenant ID in the container access request, and then the container access request can be forwarded to the corresponding target tenant container according to the target container IP. In this way, there is no need to configure a separate communication address and communication interface for each tenant container in the SAAS platform, and each tenant container uses its own communication address and communication interface to receive external access requests to itself. In this application, it is only necessary to use the communication address and communication interface of the container management node to uniformly receive the container access requests of each tenant container, and then use the tenant ID and container IP in the container access request to forward the container access request, thereby solving the communication network multiplexing problem in the SAAS platform, saving a large amount of communication resources consumed by the need to configure communication addresses and communication interfaces for each tenant container separately, reducing the workload in the SAAS application process, and further reducing costs, so it can take into account both cost and application product launch speed.
[0113] In some specific implementation processes, the SAAS application system further includes:
[0114] The container load module on the container management node is configured to determine a current load index of each container host node based on the weight of each container host node and a user resource usage parameter, wherein the weight is determined based on at least one of the number of CPU cores, CPU main frequency, and memory of each container host node, and the user resource usage parameter is determined based on at least one of the number of users, number of terminals, and number of concurrent connections connected to each tenant container of each container host node; and select the container host node with the smallest current load index as the target container host node.
[0115] In some specific implementation processes, the SAAS application system further includes:
[0116] The container monitoring module on the container management node is configured to receive the container IP and tenant ID reported by each tenant container on each container host node, establish a correspondence between the container IP and tenant ID of each tenant container, and write the correspondence into the database; receive the heartbeat and / or running status regularly reported by each tenant container on each container host node, and restart the abnormal tenant container when the heartbeat or the running status is abnormal.
[0117] In some specific implementations, the application container engine 13 is used to:
[0118] When the application product in the target tenant container needs to be upgraded, a new product image is created based on the new version of the application product;
[0119] Stop running and delete the target tenant container;
[0120] Create and run a new target tenant container based on the new product image.
[0121] In some specific implementations, the target container host node further includes:
[0122] The data backup module is used to send the data to be backed up sent by the target tenant container at regular intervals to the backup node in the SAAS platform for backup storage, so that the backup node can synchronize the data to be backed up to a device that is geographically different from the SAAS platform.
[0123] In some specific implementations, the request forwarding module 14 includes:
[0124] The user access dynamic proxy is used to obtain the target container IP corresponding to the tenant ID in the container access request from the database when receiving the container access request, and forward the container access request to the target tenant container according to the target container IP, wherein the user access dynamic proxy is implemented based on Nginx plus Lua extension.
[0125] In some specific implementations, the request forwarding module 14 includes:
[0126] The device access dynamic proxy is used to obtain the target container IP corresponding to the tenant ID in the container access request from the database when receiving the container access request, and forward the container access request to the target tenant container according to the target container IP.
[0127] In some specific implementations, the target tenant container is used to:
[0128] Perform single sign-on docking with the SAAS platform to complete user authentication of the container access request;
[0129] When the user authentication succeeds, the tenant ID in the container access request is compared with the tenant ID associated with the target tenant container. If they are consistent, it is determined that the container access request authentication succeeds.
[0130] The container load module is also the aforementioned Figure 5 The container load module on the container management node in the container management module 12 is also the aforementioned Figure 5 The container management module on the container management node in the container management module, the container monitoring module is also the aforementioned Figure 5 The container monitoring module on the container management node in .
[0131] See also Figure 7 As shown, it is a structural diagram of an electronic device 20 provided in an embodiment of the present application. The electronic device 20 can implement the aforementioned disclosed SAAS application method steps.
[0132] Generally, the electronic device 20 in this embodiment includes a processor 21 and a memory 22 .
[0133] The processor 21 may include one or more processing cores, such as a quad-core processor or an octa-core processor. The processor 21 may be implemented using at least one of the following hardware types: a DSP (digital signal processing), an FPGA (field-programmable gate array), and a PLA (programmable logic array). The processor 21 may also include a main processor and a coprocessor. The main processor is a processor for processing data in the awake state, also known as a CPU (central processing unit); the coprocessor is a low-power processor for processing data in the standby state. In some embodiments, the processor 21 may be integrated with a GPU (graphics processing unit), which is responsible for rendering and drawing images required to be displayed on the display screen. In some embodiments, the processor 21 may include an AI (artificial intelligence) processor, which is responsible for processing computing operations related to machine learning.
[0134] The memory 22 may include one or more computer-readable storage media, which may be non-transitory. The memory 22 may also include high-speed random access memory and non-volatile memory, such as one or more disk storage devices and flash memory storage devices. In this embodiment, the memory 22 is used to store at least the following computer program 221, wherein, after being loaded and executed by the processor 21, the computer program can implement the application SaaS method steps disclosed in any of the aforementioned embodiments.
[0135] In some embodiments, the electronic device 20 may further include a display screen 23 , an input / output interface 24 , a communication interface 25 , a sensor 26 , a power supply 27 , and a communication bus 28 .
[0136] Those skilled in the art will understand that Figure 7 The structure shown in the figure does not constitute a limitation on the electronic device 20, and may include more or fewer components than shown in the figure.
[0137] Furthermore, an embodiment of the present application also discloses a computer-readable storage medium for storing a computer program, wherein when the computer program is executed by a processor, the application SAAS method disclosed in any of the aforementioned embodiments is implemented.
[0138] Among them, regarding the specific process of applying the above-mentioned SAAS method, reference can be made to the corresponding content disclosed in the aforementioned embodiments, and no further details will be given here.
[0139] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from the other embodiments. Reference can be made to the descriptions of the identical or similar parts between the various embodiments. For the devices disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the descriptions are relatively simple, and the relevant parts can be referred to the descriptions of the methods.
[0140] The steps of the methods or algorithms described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in random access memory (RAM), internal memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
[0141] Finally, it should be noted that, in this article, relational terms such as first and second are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "comprises", "comprising" or any other variations thereof are intended to cover non-exclusive inclusion, so that a series of processes, methods, articles or devices that include other elements include not only those elements, but also other elements that are not explicitly listed, or elements that are inherent to such processes, methods, articles or devices. In the absence of further restrictions, an element defined by the sentence "comprising a ..." does not exclude the presence of other identical elements in the process, method, article or device that includes the element.
[0142] The above is a detailed introduction to the SAAS application method, system, SAAS platform, and medium provided by the present application. Specific examples are used herein to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea. At the same time, for those skilled in the art, according to the ideas of the present application, there may be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.
Claims
1. A SAAS application method, characterized in that: Applied to the SAAS platform, the SAAS platform includes a container management node and a container host node, including: The container management node obtains a container creation request, wherein the container creation request includes application product information; The container management node sends a container creation instruction to the target container host node; When the target container host node obtains the container creation instruction, the application container engine on the target container host node creates a target tenant container using the product image corresponding to the application product information; the product image is a container image produced based on the application product, and when producing the product image, the configuration backup and recovery function of the application product is disabled; When the container management node obtains a container access request, the container management node obtains the target container IP corresponding to the tenant ID in the container access request from the database, and forwards the container access request to the target tenant container according to the target container IP, so as to access the target tenant container; The SAAS application method further includes: The target container host node sends the data to be backed up sent by the target tenant container at regular intervals to the backup node in the SAAS platform for backup storage, so that the backup node synchronizes the data to be backed up to a device that is geographically different from the SAAS platform.
2. The SAAS application method according to claim 1, characterized in that: There are multiple container host nodes; before the container management node sends a container creation instruction to the target container host node, the method further includes: The container management node determines the current load index of each container host node based on the weight of each container host node and the user resource usage parameter, wherein the weight is determined based on at least one of the number of CPU cores, CPU main frequency, and memory of each container host node, and the user resource usage parameter is determined based on at least one of the number of users, number of terminals, and number of concurrent connections connected to each tenant container of each container host node; The container management node uses the container host node with the smallest current load index as the target container host node.
3. The SAAS application method according to claim 1, characterized in that: Also includes: The container management node receives the container IP and tenant ID reported by each tenant container on each container host node, establishes a correspondence between the container IP and tenant ID of each tenant container, and writes the correspondence into the database; The container management node receives the heartbeat and / or running status regularly reported by each tenant container on each container host node, and restarts the abnormal tenant container when the heartbeat or the running status is abnormal.
4. The SAAS application method according to claim 1, characterized in that: Also includes: When the application product in the target tenant container needs to be upgraded, the target container host node obtains a new product image based on the new version of the application product; The target container host node stops running and deletes the target tenant container; The target container host node creates and runs a new target tenant container based on the new product image.
5. The SAAS application method according to any one of claims 1 to 4, characterized in that: When the container management node obtains the container access request, the container management node obtains the target container IP corresponding to the tenant ID in the container access request from the database, and forwards the container access request to the target tenant container according to the target container IP, including: When the user access dynamic agent in the container management node obtains a container access request, the target container IP corresponding to the tenant ID in the container access request is obtained from the database through the user access dynamic agent, and the container access request is forwarded to the target tenant container according to the target container IP. The user access dynamic agent is implemented based on Nginx plus Lua extension.
6. The SAAS application method according to any one of claims 1 to 4, characterized in that: When the container management node obtains the container access request, the container management node obtains the target container IP corresponding to the tenant ID in the container access request from the database, and forwards the container access request to the target tenant container according to the target container IP, including: When the device access dynamic agent in the container management node obtains a container access request, the device access dynamic agent obtains the target container IP corresponding to the tenant ID in the container access request from the database, and forwards the container access request to the target tenant container according to the target container IP.
7. The SAAS application method according to any one of claims 1 to 4, characterized in that: After forwarding the container access request to the target tenant container according to the target container IP, the method further includes: The target tenant container performs single sign-on docking with the SAAS platform to complete user authentication of the container access request; When the user authentication succeeds, the tenant ID in the container access request is compared with the tenant ID associated with the target tenant container. If they are consistent, it is determined that the container access request authentication succeeds.
8. A SAAS platform, characterized in that: include: memory and processor; Wherein, the memory is used to store computer programs; The processor is used to execute the computer program to implement the application SAAS method according to any one of claims 1 to 7.
9. A computer-readable storage medium, characterized in that Used to store a computer program, wherein when the computer program is executed by a processor, the application SAAS method according to any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Application container based application management method and system
CN106020930A
Container login system and method, server and storage medium
CN111639314A
Container management method and device, equipment and storage medium
CN111796906A