Data processing method, device, electronic device and storage medium
By dividing multiple partitions in the cluster of the cloud platform and creating namespaces according to the tenant type, the problem of low resource utilization is solved, and efficient resource utilization and customized requirements are achieved.
Patent Information
- Application Number
- CN202110939382.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-08-16
- Publication Date
- 2024-11-15
- Estimated Expiration
- 2041-08-16
AI Technical Summary
The existing technology cannot reasonably allocate cloud platform resources according to the customized needs of different types of tenants, resulting in low resource utilization.
By dividing multiple partitions in the cluster and creating namespaces in the corresponding partitions according to the tenant type, the isolation and reasonable allocation of resources are achieved, and container orchestration technologies such as Kubernetes abstract computing resources are used to dynamically adjust the number of application instances to adapt to the access load.
It improves the utilization rate of cloud platform resources, meets the customized needs of different types of tenants, and realizes efficient utilization of resources and unified business management.
Smart Images

Figure CN115705236B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a data processing method, device, electronic equipment and storage medium. Background Art
[0002] The cloud platform can provide resources to multiple individuals or enterprises, allowing them to share the same set of services, which can reduce the operation and maintenance costs of individuals or enterprises. The cloud platform refers to such individuals or enterprises as tenants. In the related art, different types of tenants share the resources of the cloud platform. Due to the different customization requirements of different types of tenants, the related art cannot reasonably allocate cloud platform resources to different types of tenants according to their customization requirements, resulting in low utilization of cloud platform resources. Summary of the invention
[0003] In order to solve the above problems, an embodiment of the present invention provides a data processing method, device, electronic device and storage medium, so as to at least solve the problem that the relevant technology cannot reasonably allocate cluster resources to different types of tenants according to the customized needs of different types of tenants, and the cloud platform resource utilization rate is low.
[0004] The technical solution of the present invention is achieved in this way:
[0005] In a first aspect, an embodiment of the present invention provides a data processing method, the method comprising:
[0006] receiving a creation instruction for creating a first namespace; the creation instruction includes an identifier of the first namespace and a type of a first tenant; the first tenant represents a creator of the first namespace;
[0007] Determine a first partition corresponding to the type of the first tenant in the cluster; the cluster includes at least two partitions; each of the at least two partitions includes at least one node;
[0008] The first namespace is created in the first partition based on the creation instruction.
[0009] In the above solution, creating the first namespace in the first partition based on the creation instruction includes:
[0010] A domain name of the first namespace is generated based on the identifier of the first namespace.
[0011] In the above solution, creating the first namespace in the first partition based on the creation instruction includes:
[0012] In the case where the type of the first tenant is the first type, the first namespace is created in the first partition; all namespaces in the first partition correspond to the same database program, system middleware, database and application program;
[0013] In the case where the type of the first tenant is the second type, the first namespace is created in the first partition; the database and application corresponding to each namespace in the first partition are isolated from each other; the customization requirement degree of the first tenant of the second type is greater than the customization requirement degree of the first tenant of the first type;
[0014] In the case where the type of the first tenant is the third type, the first namespace is created in the first partition; the computing resources corresponding to each namespace in the first partition are isolated from each other, and each namespace in the first partition corresponds to at least one node in the first partition; the customization requirement degree of the first tenant of the third type is greater than the customization requirement degree of the first tenant of the second type.
[0015] In the above scheme, the method further comprises:
[0016] Determine an access load of a first namespace corresponding to the first tenant of the second type or the first tenant of the third type;
[0017] The number of application instances in the first namespace is adjusted based on the access load.
[0018] In the above scheme, the method further comprises:
[0019] Determine an identifier of a second namespace and a type of a second tenant corresponding to an access request used by the second tenant to access the second namespace in the cluster;
[0020] Determine a second partition corresponding to the type of the second tenant in the cluster;
[0021] Based on the load balancing controller of the cluster, the access request is forwarded to a second namespace corresponding to the identifier in the second partition.
[0022] In the above solution, determining the identifier of the second namespace corresponding to the access request and the type of the second tenant includes:
[0023] Pushing an access authentication page based on the access request;
[0024] Acquire authentication information obtained by accessing the authentication page; the authentication information represents the identifier of the second namespace and the type of the second tenant;
[0025] Performing access authentication based on the authentication information;
[0026] When the access authentication succeeds, the type of the second tenant and the identifier of the second namespace are determined based on the authentication information.
[0027] In the above scheme, the method further includes:
[0028] Dividing the cluster into the at least two partitions based on tenant type;
[0029] Nodes in each of the at least two partitions are labeled; the label represents a tenant type.
[0030] In a second aspect, an embodiment of the present invention provides a data processing device, the device comprising:
[0031] A receiving module, configured to receive a creation instruction for creating a first namespace; the creation instruction includes an identifier of the first namespace and a type of a first tenant; the first tenant represents a creator of the first namespace;
[0032] A determination module, configured to determine a first partition corresponding to the type of the first tenant in the cluster; the cluster includes at least two partitions; each of the at least two partitions includes at least one node;
[0033] A creation module is used to create the first namespace in the first partition based on the creation instruction.
[0034] In a third aspect, an embodiment of the present invention provides an electronic device, comprising a processor and a memory, wherein the processor and the memory are interconnected, wherein the memory is used to store a computer program, the computer program comprises program instructions, and the processor is configured to call the program instructions to execute the steps of the data processing method provided in the first aspect of the embodiment of the present invention.
[0035] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, including: the computer-readable storage medium stores a computer program. When the computer program is executed by a processor, the steps of the data processing method provided in the first aspect of the embodiment of the present invention are implemented.
[0036] The embodiment of the present invention receives a creation instruction for creating a first namespace, wherein the creation instruction includes an identifier of the first namespace and a type of the first tenant, wherein the first tenant represents a creator of the first namespace. A first partition corresponding to the type of the first tenant in the cluster is determined, and the first namespace is created in the first partition based on the creation instruction. The cluster includes at least two partitions, and each of the at least two partitions includes at least one node. The embodiment of the present invention creates corresponding namespaces in different partitions of the cluster according to different types of tenants, so that different types of tenants will not occupy each other's resources, thereby achieving reasonable allocation of cluster resources and improving cluster resource utilization. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] Figure 1 It is a schematic diagram of an implementation flow of a data processing method provided by an embodiment of the present invention;
[0038] Figure 2 It is a schematic diagram of an implementation flow of another data processing method provided by an embodiment of the present invention;
[0039] Figure 3 It is a schematic diagram of an implementation flow of another data processing method provided by an embodiment of the present invention;
[0040] Figure 4 It is a schematic diagram of an implementation flow of another data processing method provided by an embodiment of the present invention;
[0041] Figure 5 It is a schematic diagram of an implementation flow of another data processing method provided by an embodiment of the present invention;
[0042] Figure 6 It is a data flow diagram of a multi-tenant cluster provided by an application embodiment of the present invention;
[0043] Figure 7 is a schematic diagram of a data processing device provided by an embodiment of the present invention;
[0044] Figure 8 It is a schematic diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0045] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0046] In a cloud platform, a tenant refers to a user of a service. For example, if a service is developed for a certain enterprise, then the enterprise is a customer / tenant. If the service is Internet-oriented, then every Internet user who uses the service is a tenant.
[0047] Multi-tenancy, also known as multi-tenancy technology, is a software architecture technology that explores and implements how to share the same system or program components in a multi-user environment while still ensuring the isolation of data between users.
[0048] The mainstream multi-tenant solution on the market is to design a tenant configuration information library, obtain configuration information when the tenant logs in, and complete the dynamic diversification of menus, portals, styles, records, and forms. This design can only meet simple customization needs, but cannot meet the needs of tenants with complex customization processes. In addition, different tenants have different degrees of customization needs, and relatively flexible tenant isolation levels are required to achieve refined operations.
[0049] In multi-tenant scenarios, there is an 80 / 20 rule, where 80% of business needs are met by 20% of tenants. Therefore, special arrangements need to be made for designated large customers, while small and medium-sized customers use standardized solutions. The existing multi-tenant design cannot cope with the diversity of business scenarios. Related technologies cannot reasonably allocate resources for different types of tenants according to their customized needs, resulting in low resource utilization.
[0050] At present, some multi-tenant customization solutions adopt data isolation solutions, which configure business applications and configure each tenant's own usage characteristics and operating habits. The configuration libraries of each tenant are isolated from each other, but the applications are not isolated from each other, and the customization flexibility is not high. Although the data isolation multi-tenant solution ensures data security, business applications need to configure some business logic and save the configuration information in the configuration library. Business needs need to adapt to basic configuration capabilities, and it is difficult to meet needs beyond the capabilities. In addition, the configuration solution technology is closed and difficult to combine with the current mainstream technology, and the openness is poor.
[0051] Some multi-tenant customization solutions use virtual machine technology to divide computing servers into different virtual machines based on tenant information, and different tenants use different virtual machines. Although the virtual machine multi-tenant solution is flexible in customization, it is difficult to predict customer needs in the early stage, and it is difficult to reasonably set the virtual machine configuration. There is a problem of difficulty in later expansion, and resource utilization is low.
[0052] In view of the shortcomings of the above-mentioned related technologies, an embodiment of the present invention provides a data processing method, which can at least improve the resource utilization of the cloud platform. In order to illustrate the technical solution of the present invention, a specific embodiment is used for description below.
[0053] Figure 1 1 is a schematic diagram of an implementation flow of a data processing method provided by an embodiment of the present invention. The execution subject of the data processing method is a cloud platform, which can be a desktop computer, a laptop computer, a server, etc. Figure 1 , the data processing methods include:
[0054] S101, receiving a creation instruction for creating a first namespace; the creation instruction includes an identifier of the first namespace and a type of a first tenant; the first tenant represents a creator of the first namespace.
[0055] The embodiment of the present invention adopts container orchestration technology, such as kubernetes technology, to abstract the computing resources of the cloud platform and deploy clusters in the cloud platform. Tenants can create namespaces in the cluster. Namespaces are virtualized clusters in the K8S cluster. They are a resource organization mechanism provided by Kubernetes and are used to classify, filter and manage any object groups in the cluster. Namespaces are a "storage" mechanism for K8S cluster resources. Related resources can be "stored" in the same namespace to avoid unnecessary impacts between unrelated resources. The namespace itself is also a resource, and a new namespace can be created through the cluster API Server entry.
[0056] In actual applications, when creating a cluster, initialize the kubernets cluster through the RKE tool, install the localpath script to mount the local storage, set the DNS service to CoreDNS, set the image source to the local harbor service address, set Calico as the cluster network solution, and name all applications and middleware through the kubernets service.
[0057] The first tenant creates a first namespace in the cluster by inputting a creation instruction, and the creation instruction includes the identifier of the first namespace and the type of the first tenant. The identifier of the first namespace is used to distinguish it from other namespaces. The type of the first tenant can be divided according to the actual scenario, for example, according to the degree of customization demand of the tenant, it can be divided into: standardized tenants, customized tenants, and key tenants.
[0058] S102, determining a first partition corresponding to the type of the first tenant in a cluster; the cluster includes at least two partitions; each of the at least two partitions includes at least one node.
[0059] refer to Figure 2 In one embodiment, the method further comprises:
[0060] S201, dividing the cluster into the at least two partitions based on tenant type.
[0061] S202: Label the nodes in each of the at least two partitions; the label represents the tenant type.
[0062] A cluster consists of multiple nodes. Here, multiple nodes of the cluster are divided according to tenant types to obtain at least two partitions. Each partition includes at least one node, and the nodes in each partition are labeled accordingly. For example, the kubernetes cluster is divided into three partitions: commonPark, normalPark, and vipPark according to tenant type. When a namespace needs to be created, a namespace is created on the corresponding partition node according to the tenant type.
[0063] After receiving the creation instruction, a first partition corresponding to the type of the first tenant is determined.
[0064] S103: Create the first namespace in the first partition based on the creation instruction.
[0065] Create the first namespace of the first tenant in the first partition of the cluster. In this way, different types of tenants create their own namespaces in different partitions. Different types of tenants will not occupy each other's resources, and cluster resources can be reasonably allocated to improve resource utilization. When creating the first namespace, you can also create the first namespace based on information such as company name and customer market demand. Tenants can configure function permissions, menu display, interface background, logo and other information through tenant information.
[0066] For the first namespace created, the type of the first namespace can be set according to the tenant type, for example, a standardized tenant corresponds to a standardized namespace, a customized tenant corresponds to a customized namespace, and a key security tenant corresponds to a key security namespace.
[0067] In one embodiment, creating the first namespace in the first partition based on the creation instruction includes: generating a domain name of the first namespace based on an identifier of the first namespace.
[0068] A domain name address is dynamically generated according to the identifier of the first namespace. For example, the domain name of the first namespace is: identifier.park.com, and the domain name is mapped to the ingress resource of kubernetes. When a tenant accesses the first namespace, it can be accessed through the domain name carrying the identifier of the first namespace.
[0069] In one embodiment, creating the first namespace in the first partition based on the creation instruction includes:
[0070] In the case where the type of the first tenant is the first type, the first namespace is created in the first partition; all namespaces in the first partition correspond to the same database program, system middleware, database and application program;
[0071] In the case where the type of the first tenant is the second type, the first namespace is created in the first partition; the database and application corresponding to each namespace in the first partition are isolated from each other; the customization requirement degree of the first tenant of the second type is greater than the customization requirement degree of the first tenant of the first type;
[0072] In the case where the type of the first tenant is the third type, the first namespace is created in the first partition; the computing resources corresponding to each namespace in the first partition are isolated from each other, and each namespace in the first partition corresponds to at least one node in the first partition; the customization requirement degree of the first tenant of the third type is greater than the customization requirement degree of the first tenant of the second type.
[0073] Here, the first namespaces created by different types of tenants are different from each other. Assume that there are three types of first tenants, and the customization requirement degree of the third type of first tenant is greater than that of the second type of first tenant and greater than that of the first type of first tenant. For example, the first type of first tenant is a standard tenant, the second type of first tenant is a customized tenant, and the third type of first tenant is a key protection tenant.
[0074] The namespace corresponding to the commonPark partition is called onePark, which corresponds to all programs, middleware and data storage of standardized applications. The normalPark partition and vipPark partition will create namespaces corresponding to the identifiers. Each namespace also has independent programs and services.
[0075] For standardized tenants, there is only one namespace in the first partition, and applications use tenant IDs to store and query data. All standardized tenants correspond to the same database programs, system middleware, databases, and applications, that is, standardized tenants share all database programs, system middleware, database storage, and applications in the first partition.
[0076] For customized tenants, customized tenants share database programs and system middleware, and database storage and applications are isolated from each other. When creating the first namespace, the customized tenant will dynamically create the application's Deployment and the StatefulSet corresponding to the middleware in the normalPark partition. In the first namespace of the customized tenant, all applications and data are isolated, but all storage and hosts are centrally shared, and the application container will be dynamically scheduled to any node. PV is shared by all database services. The system can customize any application by adjusting the Deployment resources. Customized applications are uploaded to the habor warehouse. The image address in the Deploymentyaml can be modified to replace the application. This customization operation will not have any impact on other tenants.
[0077] For key tenants, when creating the first namespace, the Deployment of the application and the StatefulSet corresponding to the middleware will be dynamically created in the vipPark partition, and all computing resources of the key tenants will be isolated from each other. In the first partition, the first namespace of each key tenant corresponds to at least one node in the first partition, that is, each key tenant occupies several nodes separately, and other tenants cannot call the resources of these nodes. The first namespace of each key tenant has exclusive storage PV and physical server, and the specified node host will be marked with the label corresponding to the identifier of the first namespace. Services of other first namespaces will not be scheduled to this node host.
[0078] For different types of tenants, corresponding namespaces are created in different partitions of the cluster, and different isolation schemes are used for namespaces of different types of tenants. The customized needs of each type of tenant can be met, achieving efficient use of cluster resources and improving unified business management and horizontal business expansion.
[0079] refer to Figure 3 In one embodiment, the method further comprises:
[0080] S301: Determine an access load of a first namespace corresponding to the first tenant of the second type or the first tenant of the third type.
[0081] S302: Adjust the number of application instances in the first namespace based on the access load.
[0082] In the above embodiment, for customized tenants and key tenants, the access load of the corresponding first namespace is determined by counting data such as the CPU usage and HTTP traffic of each tenant, and the number of application instances in the first namespace is adjusted by the access load. Here, the application instance refers to the container group (pod) in the cluster node. In the Kubernetes cluster, Pod is the basis of all business types and the smallest unit level managed by K8S. It is a combination of one or more containers. These containers share storage, network and namespace, as well as specifications for how to run. In the Pod, all containers are arranged and scheduled in the same way and run in a shared context. For specific applications, Pod is their logical host, and Pod contains multiple business-related application containers.
[0083] Here, you can use the Kubernetes HPA (Pod Horizontal Autoscaling) controller to adjust the number of application instances in the first namespace. When the access load increases, increase the number of replica pods; when the access load decreases, reduce the number of replica pods, thereby ensuring efficient use of resources.
[0084] The embodiment of the present invention receives a creation instruction for creating a first namespace, wherein the creation instruction includes an identifier of the first namespace and a type of the first tenant, wherein the first tenant represents a creator of the first namespace. A first partition corresponding to the type of the first tenant in the cluster is determined, and the first namespace is created in the first partition based on the creation instruction. The cluster includes at least two partitions, and each of the at least two partitions includes at least one node. The embodiment of the present invention creates corresponding namespaces in different partitions of the cluster according to different types of tenants, so that different types of tenants will not occupy each other's resources, thereby achieving reasonable allocation of cluster resources and improving cluster resource utilization.
[0085] refer to Figure 4 In one embodiment, the method further comprises:
[0086] S401, determining an identifier of a second namespace and a type of a second tenant corresponding to an access request; the access request is used by the second tenant to access the second namespace in the cluster.
[0087] A tenant can access its own namespace in the cluster. A second tenant sends an access request to the cluster, and the cluster determines the identifier of the second namespace corresponding to the access request and the type of the second tenant.
[0088] S402: Determine a second partition corresponding to the type of the second tenant in the cluster.
[0089] The access request carries the identifier of the second namespace and the type of the second tenant. The cluster is divided according to the tenant type, and a second partition corresponding to the type of the second tenant is determined.
[0090] S403: Based on the load balancing controller of the cluster, forward the access request to a second namespace corresponding to the identifier in the second partition.
[0091] Here, in the Kubernetes cluster, the load balancing controller is the ingress controller, and the Ingress controller accesses the backend pod through the Ingress rule. Among them, the Ingress rule represents the correspondence between the domain name and the corresponding service.
[0092] When creating a namespace, the domain name of the namespace is mapped to the ingress resource of Kubernetes, and the corresponding Ingress rule is determined by the domain name, so that the access request is forwarded to the second namespace corresponding to the identifier in the second partition.
[0093] refer to Figure 5 In the above embodiment, determining the identifier of the second namespace corresponding to the access request and the type of the second tenant includes:
[0094] S501: Push an access authentication page based on the access request.
[0095] The cluster has an access authentication system. When a tenant accesses a namespace through a Kubernetes edge node, an access authentication page is pushed to the tenant.
[0096] S502: Acquire authentication information obtained by accessing the authentication page; the authentication information represents the identifier of the second namespace and the type of the second tenant.
[0097] The access authentication page includes authentication information that the tenant needs to fill in. The tenant fills in the authentication information on the access authentication page, such as the type of the second tenant, the identifier of the second namespace, the name, domain name, account number and password.
[0098] S503: Perform access authentication based on the authentication information.
[0099] Verify the authentication information filled in by the tenant to determine whether it is consistent with the data stored in the backend database. If it is consistent, the access authentication is successful.
[0100] S504: When the access authentication succeeds, determine the type of the second tenant and the identifier of the second namespace based on the authentication information.
[0101] If the access authentication is successful, the type of the second tenant and the identifier of the second namespace in the authentication information are correct, and the type of the second tenant and the identifier of the second namespace can be directly obtained from the authentication information.
[0102] Here, access authentication can be Basic_Auth authentication of ingress. BasicAuth is the authentication method of the open platform. To put it simply, the user's username and password are provided every time the API is requested.
[0103] Access authentication can prevent illegal tenants from accessing the namespace, and tenants can customize which tenants can access their own namespace.
[0104] refer to Figure 6 , Figure 6 It is a data flow diagram of a multi-tenant cluster provided by an application embodiment of the present invention. Among them, the park refers to the namespace. The tenant enters the park address (domain name) to access the namespace. The cluster receives the tenant's access request through the API gateway, determines the namespace accessed by the tenant through the Ingress Controller, and performs K8S unified authentication on the tenant information. The authentication includes tenant identity authentication and operation authority verification. After the authentication is passed, the park information accessed by the tenant is obtained. The park information is the information of the namespace accessed by the tenant. The node selector of the cluster determines the corresponding partition according to the park type, and the Ingress Controller forwards the access request to the park corresponding to the park identifier in the corresponding partition. Here, the tenant types are divided into ordinary tenants, customized tenants, and key tenants. Ordinary tenants share all database programs and system middleware, database storage and applications; customized tenants share database programs and system middleware, and database storage and applications are isolated from each other; all computing resources of key tenants are isolated from each other.
[0105] The application embodiment of the present invention divides the cluster into multiple partitions according to the tenant type, creates corresponding namespaces in different partitions of the cluster for different types of tenants, and adopts different isolation schemes for the namespaces of different types of tenants. The customized needs of each type of tenant can be met, achieving efficient utilization of cluster resources and improving unified business management and horizontal business expansion.
[0106] It should be understood that the order of execution of the steps in the above embodiment does not necessarily mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiment of the present invention.
[0107] It should be understood that when used in this specification and the appended claims, the terms "include" and "comprises" indicate the presence of described features, integers, steps, operations, elements and / or components, but do not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or combinations thereof.
[0108] It should be noted that the technical solutions described in the embodiments of the present invention can be arbitrarily combined without conflict.
[0109] In addition, in the embodiments of the present invention, "first", "second", etc. are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.
[0110] refer to Figure 7 , Figure 7 is a schematic diagram of a data processing device provided by an embodiment of the present invention, such as Figure 7 As shown, the device includes: a receiving module, a determining module and a creating module.
[0111] A receiving module, configured to receive a creation instruction for creating a first namespace; the creation instruction includes an identifier of the first namespace and a type of a first tenant; the first tenant represents a creator of the first namespace;
[0112] A determination module, configured to determine a first partition corresponding to the type of the first tenant in the cluster; the cluster includes at least two partitions; each of the at least two partitions includes at least one node;
[0113] A creation module is used to create the first namespace in the first partition based on the creation instruction.
[0114] In one embodiment, when the creation module creates the first namespace in the first partition based on the creation instruction, it is used to:
[0115] A domain name of the first namespace is generated based on the identifier of the first namespace.
[0116] In one embodiment, the creation module creates the first namespace in the first partition based on the creation instruction, for:
[0117] In the case where the type of the first tenant is the first type, the first namespace is created in the first partition; all namespaces in the first partition correspond to the same database program, system middleware, database and application program;
[0118] In the case where the type of the first tenant is the second type, the first namespace is created in the first partition; the database and application corresponding to each namespace in the first partition are isolated from each other; the customization requirement degree of the first tenant of the second type is greater than the customization requirement degree of the first tenant of the first type;
[0119] In the case where the type of the first tenant is the third type, the first namespace is created in the first partition; the computing resources corresponding to each namespace in the first partition are isolated from each other, and each namespace in the first partition corresponds to at least one node in the first partition; the customization requirement degree of the first tenant of the third type is greater than the customization requirement degree of the first tenant of the second type.
[0120] In one embodiment, the device further comprises:
[0121] A feature module is used to determine the access load of the first namespace corresponding to the first tenant of the second type or the first tenant of the third type; and adjust the number of application instances in the first namespace based on the access load.
[0122] In one embodiment, the device further comprises:
[0123] A forwarding module module, used to determine the identifier of the second namespace and the type of the second tenant corresponding to the access request; the access request is used by the second tenant to access the second namespace in the cluster; determine the second partition corresponding to the type of the second tenant in the cluster; based on the load balancing controller of the cluster, forward the access request to the second namespace corresponding to the identifier in the second partition.
[0124] In one embodiment, when determining the identifier of the second namespace and the type of the second tenant corresponding to the access request, the forwarding module is used to:
[0125] Pushing an access authentication page based on the access request; obtaining authentication information obtained from the access authentication page; the authentication information represents the identifier of the second namespace and the type of the second tenant; performing access authentication based on the authentication information; and in case the access authentication is successful, determining the type of the second tenant and the identifier of the second namespace based on the authentication information.
[0126] In one embodiment, the device further comprises:
[0127] A partitioning module, configured to partition the cluster into the at least two partitions based on tenant type;
[0128] The label module is used to label the nodes in each of the at least two partitions; the label represents the tenant type.
[0129] In actual application, the receiving module, determining module and creating module can be implemented by a processor in an electronic device, such as a central processing unit (CPU), a digital signal processor (DSP), a microcontroller unit (MCU) or a programmable gate array (FPGA).
[0130] It should be noted that: when the data processing device provided in the above embodiment performs data processing, only the division of the above modules is used as an example. In actual applications, the above processing can be assigned to different modules as needed, that is, the internal structure of the device is divided into different modules to complete all or part of the processing described above. In addition, the data processing device provided in the above embodiment and the data processing method embodiment belong to the same concept, and the specific implementation process is detailed in the method embodiment, which will not be repeated here.
[0131] Based on the hardware implementation of the above program modules and in order to implement the method of the embodiment of the present application, the embodiment of the present application also provides an electronic device. Figure 8 Schematic diagram of the hardware structure of the electronic device of the present application embodiment. Figure 8 As shown, the electronic equipment includes:
[0132] Communication interface, which can exchange information with other devices such as network equipment;
[0133] The processor is connected to the communication interface to realize information exchange with other devices, and is used to execute the method provided by one or more technical solutions of the electronic device side when running the computer program. The computer program is stored in the memory.
[0134] Of course, in actual applications, the various components in the electronic device are coupled together through the bus system. It is understandable that the bus system is used to achieve connection and communication between these components. In addition to the data bus, the bus system also includes a power bus, a control bus, and a status signal bus. However, for the sake of clarity, Figure 8 In the specification, various buses are labeled as bus systems.
[0135] The memory in the embodiment of the present application is used to store various types of data to support the operation of the electronic device. Examples of such data include: any computer program used to operate on the electronic device.
[0136] It can be understood that the memory can be a volatile memory or a non-volatile memory, and can also include both volatile and non-volatile memories. Among them, the non-volatile memory can be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), a magnetic random access memory (FRAM), a flash memory, a magnetic surface memory, an optical disc, or a compact disc read-only memory (CD-ROM); the magnetic surface memory can be a disk memory or a tape memory. The volatile memory can be a random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of RAM are available, such as static random access memory (SRAM), synchronous static random access memory (SSRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM, SyncLink Dynamic Random Access Memory), and direct RAM bus random access memory (DRRAM, Direct Rambus Random Access Memory).The memories described in the embodiments of the present application are intended to include, but are not limited to, these and any other suitable types of memories.
[0137] The method disclosed in the above embodiment of the present application can be applied to a processor or implemented by a processor. The processor may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by an integrated logic circuit of hardware in the processor or an instruction in the form of software. The above processor may be a general-purpose processor, a DSP, or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc. The processor can implement or execute the various methods, steps and logic block diagrams disclosed in the embodiments of the present application. The general-purpose processor may be a microprocessor or any conventional processor, etc. In combination with the steps of the method disclosed in the embodiment of the present application, it can be directly embodied as a hardware decoding processor to execute, or it can be executed by a combination of hardware and software modules in the decoding processor. The software module can be located in a storage medium, which is located in a memory, and the processor reads the program in the memory and completes the steps of the above method in combination with its hardware.
[0138] Optionally, when the processor executes the program, the corresponding processes implemented by the electronic device in each method of the embodiments of the present application are implemented, which will not be described in detail here for the sake of brevity.
[0139] In an exemplary embodiment, the present application also provides a storage medium, namely a computer storage medium, specifically a computer-readable storage medium, for example, including a first memory storing a computer program, and the computer program can be executed by a processor of an electronic device to complete the steps of the aforementioned method. The computer-readable storage medium can be a memory such as FRAM, ROM, PROM, EPROM, EEPROM, Flash Memory, magnetic surface storage, optical disk, or CD-ROM.
[0140] In the several embodiments provided in the present application, it should be understood that the disclosed devices, electronic devices and methods can be implemented in other ways. The device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as: multiple units or components can be combined, or can be integrated into another system, or some features can be ignored or not executed. In addition, the coupling, direct coupling, or communication connection between the components shown or discussed can be through some interfaces, and the indirect coupling or communication connection of the devices or units can be electrical, mechanical or other forms.
[0141] The units described above as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units; some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0142] In addition, all functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may be a separate unit, or two or more units may be integrated into one unit; the above-mentioned integrated units may be implemented in the form of hardware or in the form of hardware plus software functional units.
[0143] A person of ordinary skill in the art can understand that: all or part of the steps of implementing the above-mentioned method embodiment can be completed by hardware related to program instructions, and the aforementioned program can be stored in a computer-readable storage medium, which, when executed, executes the steps of the above-mentioned method embodiment; and the aforementioned storage medium includes: various media that can store program codes, such as mobile storage devices, ROM, RAM, disks or optical disks.
[0144] Alternatively, if the above-mentioned integrated unit of the present application is implemented in the form of a software function module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of the embodiment of the present application can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium, including several instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the methods described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as mobile storage devices, ROM, RAM, magnetic disks or optical disks.
[0145] It should be noted that the technical solutions described in the embodiments of the present application can be combined arbitrarily without conflict.
[0146] In addition, in the examples of the present application, "first", "second", etc. are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.
[0147] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A data processing method, characterized in that: The method comprises: receiving a creation instruction for creating a first namespace; the creation instruction includes an identifier of the first namespace and a type of a first tenant; the first tenant represents a creator of the first namespace; Determine a partition corresponding to the type of the first tenant in the cluster; the cluster includes at least two partitions; each of the at least two partitions includes at least one node; different types of tenants create their own namespaces in different partitions; Creating the first namespace in the partition corresponding to the type of the first tenant based on the creation instruction; The method further comprises: Dividing the cluster into the at least two partitions based on tenant type; Nodes in each of the at least two partitions are labeled; the label represents a tenant type.
2. The method according to claim 1, characterized in that The creating the first namespace in the partition corresponding to the type of the first tenant based on the creation instruction includes: A domain name of the first namespace is generated based on the identifier of the first namespace.
3. The method according to claim 1, characterized in that The creating the first namespace in the partition corresponding to the type of the first tenant based on the creation instruction includes: In the case where the type of the first tenant is the first type, the first namespace is created in the partition corresponding to the first type; all namespaces in the partition corresponding to the first type correspond to the same database program, system middleware, database and application program; In the case where the type of the first tenant is the second type, the first namespace is created in the partition corresponding to the second type; the database and application corresponding to each namespace in the partition corresponding to the second type are isolated from each other; the customization requirement degree of the first tenant of the second type is greater than the customization requirement degree of the first tenant of the first type; In the case where the type of the first tenant is the third type, the first namespace is created in the partition corresponding to the third type; the computing resources corresponding to each namespace in the partition corresponding to the third type are isolated from each other, and each namespace in the partition corresponding to the third type corresponds to at least one node in the partition corresponding to the third type; the degree of customization requirement of the first tenant of the third type is greater than the degree of customization requirement of the first tenant of the second type.
4. The method according to claim 3, characterized in that The method further comprises: Determine an access load of a first namespace corresponding to the first tenant of the second type or the first tenant of the third type; The number of application instances in the first namespace is adjusted based on the access load.
5. The method according to claim 1, characterized in that The method further comprises: Determine an identifier of a second namespace and a type of a second tenant corresponding to an access request used by the second tenant to access the second namespace in the cluster; Determine a partition corresponding to the type of the second tenant in the cluster; Based on the load balancing controller of the cluster, the access request is forwarded to a second namespace corresponding to the identifier in the partition corresponding to the type of the second tenant.
6. The method according to claim 5, characterized in that The determining the identifier of the second namespace corresponding to the access request and the type of the second tenant includes: Pushing an access authentication page based on the access request; Acquire authentication information obtained by accessing the authentication page; the authentication information represents the identifier of the second namespace and the type of the second tenant; Performing access authentication based on the authentication information; When the access authentication succeeds, the type of the second tenant and the identifier of the second namespace are determined based on the authentication information.
7. A data processing device, characterized in that: include: A receiving module, configured to receive a creation instruction for creating a first namespace; the creation instruction includes an identifier of the first namespace and a type of the first tenant; The first tenant represents a creator of the first namespace; A determination module, used to determine a partition corresponding to the type of the first tenant in the cluster; the cluster includes at least two partitions; each of the at least two partitions includes at least one node; different types of tenants create their own namespaces in different partitions; A creation module, configured to create the first namespace in a partition corresponding to the type of the first tenant based on the creation instruction; A partitioning module, configured to partition the cluster into the at least two partitions based on tenant type; A label module, used for labeling nodes in each of the at least two partitions; The tag represents the tenant type.
8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the data processing method according to any one of claims 1 to 6 is implemented.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein the computer program includes program instructions, and when the program instructions are executed by a processor, the processor executes the data processing method according to any one of claims 1 to 6.
Citation Information
Patent Citations
A method and apparatus for processing in-depth learning jobs in a distributed cluster
CN109034396A
A cluster resource management method and device
CN109189568A
Resource creation method and device and server
CN110750335A
Method and device for controlling permission of tenant to access container instance
CN111935110A
Fixed content storage within a partitioned content platform using namespaces
US20110106802A1
