WO2020147301A1 - 多租户业务接入实现方法、装置及电子设备 - Google Patents
多租户业务接入实现方法、装置及电子设备 Download PDFInfo
- Publication number
- WO2020147301A1 WO2020147301A1 PCT/CN2019/098765 CN2019098765W WO2020147301A1 WO 2020147301 A1 WO2020147301 A1 WO 2020147301A1 CN 2019098765 W CN2019098765 W CN 2019098765W WO 2020147301 A1 WO2020147301 A1 WO 2020147301A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- tenant
- service
- resources
- instance
- business
- Prior art date
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L41/00—Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
- H04L41/50—Network service management, e.g. ensuring proper service fulfilment according to agreements
- H04L41/5041—Network service management, e.g. ensuring proper service fulfilment according to agreements characterised by the time relationship between creation and deployment of a service
- H04L41/5054—Automatic deployment of services triggered by the service manager, e.g. service implementation by automatic configuration of network components
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L41/00—Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
- H04L41/50—Network service management, e.g. ensuring proper service fulfilment according to agreements
- H04L41/5041—Network service management, e.g. ensuring proper service fulfilment according to agreements characterised by the time relationship between creation and deployment of a service
- H04L41/5051—Service on demand, e.g. definition and deployment of services in real time
Definitions
- This application relates to the field of communication technology, and specifically to a method, device and electronic equipment for implementing multi-tenant service access.
- SaaS Software as a Service, software as a service
- software has become the best way for many small businesses to adopt advanced technologies. It reduces the cost of enterprises purchasing, building, and maintaining infrastructure and applications. cost.
- One of the most basic features of SaaS software is the ability to support multi-tenancy, that is, the same software system deployed in the cloud can be shared by multiple companies or users.
- the software code is a shared copy, the data between them is invisible to each other, and there are certain differences in functional appearance.
- a data routing module embedded in the service is often used to implement routing functions for different user services.
- the main function of the business processing environment is to perform business processing, which is generally developed as a separate module.
- the function of introducing routing into the service instance requires embedding other routing-related application codes.
- the business instance requires both business processing and routing function, which has high processing pressure and high complexity on the server side.
- the purpose of this application is to provide a method, device and electronic device for implementing multi-tenant service access to relieve the processing pressure on the server and reduce the complexity of the server.
- an embodiment of the present application provides a method for implementing multi-tenant service access, which is applied to an API gateway device.
- the API gateway device is in communication connection with a management server, and the management server is pre-configured and stored for processing service requests.
- Business instance resources the method includes:
- the service request carrying the obtained service instance resource is sent to the management server, so that the management server invokes the same service instance resource as the service instance resource in the service request to process the service request.
- the method further includes:
- the association relationship obtained after adjustment is sent to the management server.
- the step of adjusting the number of business instance resources associated with the tenant includes:
- the business instance resources are added to the tenant and will increase The business instance resources of is associated with the tenant.
- the step of adjusting the number of business instance resources associated with the tenant further includes:
- the business instance resources are reduced for the tenant and released The association between the reduced business instance resources and the tenant.
- the embodiments of the present application also provide a method for implementing multi-tenant service access, which is applied to a management server, the management server is in communication connection with an API gateway device, and the management server is pre-configured and stored for processing service requests Business instance resources of, the method includes:
- the method before the step of receiving the service request sent by the API gateway device, the method further includes:
- the method further includes:
- the stored association relationship between the tenant and the business instance resource is updated according to the received association relationship.
- the method further includes:
- an idle business instance resource is activated to replace the abnormal business instance resource
- the step of invoking the obtained service instance resource to process the service request includes:
- the service request is a data read request, find the data corresponding to the data read request from the obtained database resource, and return the found data to the tenant via the API gateway device;
- the service request is a data write request
- the data carried in the data write request is stored in the obtained database resource.
- this application also provides a device for implementing multi-tenant service access, which is applied to an API gateway device, the API gateway device is in communication connection with a management server, and the management server is pre-configured and stored with services for processing service requests
- An example resource the device includes:
- the first receiving module is configured to receive a service request sent by a user, wherein the service request carries tenant information to which the user belongs;
- the first resource obtaining module is configured to obtain the service instance resource associated with the tenant to which the user sending the service request belongs according to the pre-stored association relationship between the tenant and the service instance resource;
- the sending module is configured to send the service request carrying the obtained service instance resource to the management server, so that the management server calls the same service instance resource as the service instance resource in the service request to the service Request to be processed.
- this application also provides a device for implementing multi-tenant service access, which is applied to a management server, the management server is in communication connection with an API gateway device, and the management server is pre-configured and stored with services for processing service requests
- An example resource the device includes:
- the second receiving module is configured to receive a service request sent by the API gateway device.
- the service request is based on the pre-stored tenant and service instance resources when the API gateway device receives the service request sent by the user.
- the business request obtained by the association relationship contains the business instance resources associated with the tenant to which the user belongs;
- the second resource obtaining module is used to obtain tenant information carried in the service request and service instance resources associated with the tenant;
- the third resource obtaining module is configured to obtain, from the stored service instance resources, the service instance resources that are consistent with the service instance resources carried in the service request;
- the processing module is used to call the obtained service instance resources to process the service request.
- the present application also provides an electronic device, including a memory, a processor, and a computer program stored on the memory and capable of running on the processor.
- the processor implements the above-mentioned program when the program is executed. Method steps.
- the present application also provides a readable storage medium having a computer program stored on the readable storage medium, and the computer program executes the above method steps when run by a processor.
- the method, device, and electronic device for implementing multi-tenant service access when receiving a service request sent by a user through an API gateway device, obtain a data link according to the pre-stored association relationship between tenants and service instance resources. Send the business instance resources associated with the tenant to which the business request belongs. The service request carrying the obtained service instance resource is sent to the management server, so that the management server calls the same service instance resource as the service instance resource to process the service request.
- This application combines the use of API gateway equipment to route service requests, which avoids the intrusion of application code into service instances due to the need to embed routing modules inside the services of the server in the prior art, thereby reducing the service instance’s burden. Complexity makes the business instance only focus on business processing.
- FIG. 1 is a schematic diagram of an application scenario of a method for implementing multi-tenant service access provided by an embodiment of the application.
- Fig. 2 is a flowchart of a method for implementing multi-tenant service access applied to an API gateway device provided by an embodiment of the application.
- FIG. 3 is another flowchart of a method for implementing multi-tenant service access applied to an API gateway device according to an embodiment of the application.
- Fig. 4 is a flowchart of a method for implementing multi-tenant service access applied to a management server according to an embodiment of the application.
- Fig. 5 is another flowchart of a method for implementing multi-tenant service access applied to a management server according to an embodiment of the application.
- Fig. 6 is a block diagram of functional modules of an apparatus for implementing multi-tenant service access applied to an API gateway device according to an embodiment of the application.
- Fig. 7 is a block diagram of functional modules of a device for implementing multi-tenant service access applied to a management server according to an embodiment of the application.
- FIG. 8 is a structural block diagram of an electronic device provided by an embodiment of the application.
- FIG. 1 is a schematic diagram of an application scenario of a method for implementing multi-tenant service access provided by an embodiment of the application.
- This scenario includes a management server 200, an API gateway device 100, and multiple terminal devices 300 (only six are shown in the figure).
- the management server 200, the API gateway device 100, and each terminal device 300 can be connected via network communication.
- the terminal device 300 is the terminal device 300 corresponding to the user (in this embodiment, the user replaces the terminal device 300), and multiple users can form tenants (two are schematically drawn in the figure), for example, a company As a unit, the company is a tenant, and the employees in the company are users included in the tenant.
- the management server 200 can provide processing resources and database resources for user business requests, and the API gateway device 100 can provide data routing functions.
- FIG. 2 is a flowchart of a method for implementing multi-tenant service access applied to the API gateway device 100 shown in FIG. 1. The steps included in the method will be described in detail below.
- Step S110 Receive a service request sent by a user, where the service request carries tenant information to which the user belongs.
- Step S120 According to the pre-stored association relationship between the tenant and the service instance resource, obtain the service instance resource associated with the tenant to which the user sending the service request belongs.
- Step S130 Send the service request carrying the obtained service instance resource to the management server 200, so that the management server 200 calls the same service instance resource as the service instance resource in the service request to the service instance resource. Request to be processed.
- each tenant may initiate a tenant registration request to the management server 200 to perform account registration of the tenant.
- the tenant registration request carries the number of users included in the tenant, the expected request volume of the tenant, and business processing requirements.
- the configuration module therein can allocate matching service instance resources to the tenant according to the number of users, expected request volume, and service processing requirements included in the tenant registration request.
- the business instance resource is the processing resource used for the business request of the user included in the tenant.
- they may call the same service. For example, different companies can call the cloud check-in service system, but data isolation between different tenants needs to be ensured to ensure the invisibility of data. Therefore, different processing environments are needed to process the businesses of different companies, and in order to make the resources reasonable, this involves the issue of resource allocation.
- the number of users in different tenants may be different, the amount of business requests of the tenant may be different, and there are differences in business processing requirements, such as real-time business processing, business processing efficiency, and data isolation requirements. If some tenants contain more users, more business instance resources can be allocated to process related business requests of the tenant. While some tenants have very few business requests, in order to avoid waste of resources, fewer business instance resources can be allocated to the tenant.
- any of the following methods can be used for allocation: independent database; shared database, independent schema; shared database, shared schema, shared data table.
- the independent database method is to allocate a separate database for each tenant. This method has the highest user data isolation level and the best security, but the cost is higher. Allocating an independent database for each tenant helps simplify the expansion design of the data model to meet the unique needs of different tenants, and if a failure occurs, data recovery is easier. This approach can be aimed at tenants with high data isolation requirements, such as banks and hospitals.
- the way of sharing a database and an independent schema means that multiple tenants can share a database, but each tenant is assigned an independent schema.
- a database contains multiple schemas. This method can achieve a certain degree of logical data isolation, but not complete isolation. In this way, each database can support a larger number of tenants, but if a failure occurs, data recovery is more difficult because it will involve other tenants' data.
- the corresponding database resources can be allocated to the tenant according to the business processing requirements in the tenant registration request initiated by the tenant and the tenant's related information.
- the relationship between tenants, business instance resources, and database resources can be established, for example, the relationship between tenants and business instance resources, the relationship between tenants and databases, and business instance resources Relationship with database resources.
- the established association relationship is saved and sent to the API gateway device 100.
- the API gateway device 100 stores the association relationship after receiving the association relationship sent by the management server 200.
- the API gateway device 100 When the API gateway device 100 receives a service request sent by a certain user, it can obtain the tenant information to which the user belongs according to the service request. And according to the pre-stored association relationship between the tenant and the service instance resource, the service instance resource associated with the tenant to which the user sending the service request belongs is obtained.
- the API gateway device 100 may send a service request carrying the obtained service instance resource to the management server 200, and the calling module in the management server 200 can directly call the corresponding service instance resource to process the user's service request.
- the management server 200 when the management server 200 receives the service request sent by the API gateway device 100, it obtains the tenant information carried in the service request and the service instance resources associated with the tenant. Obtain the service instance resource consistent with the service instance resource carried in the service request from the pre-configured service instance resource, and call the service instance resource to process the service request.
- the routing function is realized by the API gateway device 100, and the business instances in the management server 200 only need to focus on business processing items, which relieves the processing pressure.
- the business instance resources allocated by the management server 200 to each tenant are configured according to the information in the tenant registration request, which is only a pre-allocation process.
- the tenant's request volume may deviate from the expected request volume during the previous registration. Therefore, referring to Fig. 3, in this embodiment, the method for implementing multi-tenant service access further includes the following steps:
- Step S210 Count the amount of service requests initiated by tenants within a preset time period.
- Step S220 It is detected whether the number of business instance resources associated with the tenant matches the number of processing resources required by the tenant's request amount, and if it does not match, the following step S230 is executed.
- step S230 the number of business instance resources associated with the tenant is adjusted to obtain an association relationship between the adjusted business instance resources and the tenant.
- Step S240 Send the adjusted association relationship to the management server 200.
- the API gateway device 100 may count the amount of service requests initiated by the tenant within the preset time interval at intervals. It is detected whether the number of business instance resources associated with the tenant matches the number of processing resources required by the tenant's request amount. If it does not match, the number of business instance resources associated with the tenant can be adjusted. If it matches, it will not be processed.
- the business instance resources when the number of processing resources required by the tenant's request amount exceeds the number of business instance resources associated with the tenant, and the exceeding value is greater than a first preset threshold, add business instances to the tenant Resources, and associate the increased business instance resources with the tenant.
- the business instance resources when the request volume of the tenant increases, the business instance resources can be added to the tenant to avoid the excessive load of the business instance resources associated with the tenant, which affects the processing of the tenant's business request.
- the number of processing resources required by the tenant's request amount is lower than the number of business instance resources associated with the tenant and the amount is greater than the second preset threshold, reducing business instance resources for the tenant, And disassociate the reduced business instance resources with the tenant. In this way, when the number of requests from tenants is reduced, the business instance resources allocated for tenants are reduced, and the problem of idle and waste of resources is avoided.
- the API gateway device 100 adjusts the association relationship between the tenant and the service instance resource, and then sends the adjusted association relationship to the management server 200. After the management server 200 receives the adjusted association relationship, the configuration service module in the management server 200 will update the stored association relationship between the tenant and the service instance resource according to the received association relationship.
- another embodiment of the present application also provides a method for implementing multi-tenant service access applied to the above-mentioned management server 200.
- the method includes the following steps:
- Step S410 Receive a service request sent by the API gateway device 100.
- the service request is determined by the API gateway device 100 according to the pre-stored association relationship between the tenant and service instance resources when the API gateway device 100 receives the service request sent by the user.
- the obtained business request contains the business instance resources associated with the tenant to which the user belongs.
- Step S420 Obtain the tenant information carried in the service request and the service instance resources associated with the tenant.
- Step S430 Obtain a service instance resource consistent with the service instance resource carried in the service request from the stored service instance resource.
- Step S440 Invoking the obtained service instance resource to process the service request.
- the method before the step of receiving the service request sent by the API gateway device 100 by the management server 200, the method further includes the following steps:
- a tenant registration request sent by a tenant is received, where the tenant registration request carries the number of users included in the tenant, the expected request volume, and service processing requirements.
- the tenant is allocated matching service instance resources, and the tenant is allocated database resources.
- the management server 200 may also receive the adjusted association relationship between the tenant and the service instance resource sent by the API gateway device 100, where the association relationship is that the API gateway device 100 is The request amount of the business request initiated by the tenant within the preset time period is adjusted and obtained. The stored association relationship between the tenant and the business instance resource is updated according to the received association relationship.
- the management server 200 calls the corresponding service instance resource to process the service request, it can be implemented through the following steps:
- the service request is a data read request
- the data corresponding to the data read request is found from the obtained database resource, and the found data is returned to the tenant through the API gateway device 100 .
- the service request is a data write request
- the data carried in the data write request is stored in the obtained database resource.
- the method for implementing multi-tenant service access further includes the following steps:
- Step S510 When it is detected that there is an abnormal service instance resource, an idle service instance resource is activated to replace the abnormal service instance resource.
- Step S520 Obtain tenant and database resources associated with the abnormal business instance resource according to the stored association relationship.
- Step S530 Associate the obtained tenant and database resources with the enabled idle service instance resources.
- the management server 200 includes a service awareness module, which can monitor in real time whether the service instance resource is abnormal, for example, whether it is offline. If the offline status occurs, it will affect the business processing of the corresponding tenant. Therefore, when the service awareness module detects that the service instance resource is abnormal, it activates an idle service instance resource to replace the abnormal service instance resource, that is, triggers the start of the failover process.
- the idle service instance resource is a service instance resource in the management server 200 that is not associated with any tenant.
- the related business of the abnormal business instance resource can be switched to the activated idle business instance resource.
- the tenant and database resources associated with the abnormal business instance resources are associated with the activated idle business instance resources. Remove the association relationship between abnormal business instance resources and corresponding tenants and database resources.
- the multi-tenant service implementation method provided in this embodiment can combine with the routing function of the API gateway device 100 to achieve the effect of processing the service instance resources invoked according to the corresponding service instance resources in the service request sent by the API gateway device 100.
- another embodiment of the present application further provides a multi-tenant service access implementing device 110 applied to the above-mentioned API gateway device 100, and the multi-tenant service access implementing device 110 includes:
- the first receiving module 111 is configured to receive a service request sent by a user, wherein the service request carries tenant information to which the user belongs. It can be understood that the first receiving module 111 may be used to execute the above step S110, and for the detailed implementation of the first receiving module 111, refer to the above-mentioned content related to the step S110.
- the first resource obtaining module 112 is configured to obtain the service instance resource associated with the tenant to which the user sending the service request belongs according to the pre-stored association relationship between the tenant and the service instance resource. It can be understood that the first resource obtaining module 112 may be used to execute the above step S120, and for the detailed implementation of the first resource obtaining module 112, reference may be made to the above-mentioned content related to step S120.
- the sending module 113 is configured to send the service request carrying the obtained service instance resource to the management server 200, so that the management server 200 calls the same service instance resource pair as the service instance resource in the service request The service request is processed. It can be understood that the sending module 113 may be used to execute the above step S130, and for the detailed implementation of the sending module 113, please refer to the content related to the above step S130.
- another embodiment of the present application also provides a multi-tenant service access implementing device 110 applied to the above-mentioned management server 200, and the multi-tenant service access implementing device 110 includes:
- the second receiving module 114 is configured to receive a service request sent by the API gateway device 100.
- the service request is based on the pre-stored tenant and service instance resources when the API gateway device 100 receives the service request sent by the user.
- the business request obtained by the association relationship contains the business instance resources associated with the tenant to which the user belongs. It can be understood that the second receiving module 114 may be used to execute the above step S410, and for the detailed implementation of the second receiving module 114, please refer to the content related to the above step S410.
- the second resource obtaining module 115 is configured to obtain tenant information carried in the service request and service instance resources associated with the tenant. It can be understood that the second resource obtaining module 115 may be used to perform the above step S420, and for the detailed implementation of the second resource obtaining module 115, reference may be made to the above-mentioned content related to step S420.
- the third resource obtaining module 116 is configured to obtain a service instance resource consistent with the service instance resource carried in the service request from the stored service instance resources. It can be understood that the third resource obtaining module 116 may be used to execute the above step S430, and for the detailed implementation of the third resource obtaining module 116, reference may be made to the above-mentioned content related to step S430.
- the processing module 117 is configured to call the obtained service instance resources to process the service request. It can be understood that the processing module 117 may be used to execute the above-mentioned step S440, and for the detailed implementation of the processing module 117, please refer to the above-mentioned content related to the step S440.
- an embodiment of the present application also provides an electronic device.
- the electronic device may be the aforementioned API gateway device 100 or the aforementioned management server 200.
- the electronic device 100 includes a multi-tenant service access implementation device. 110, a memory 120, a processor 130, and a communication unit 140.
- the tenant service access realization apparatus 110 may be the multi-tenant service access realization apparatus 110 in the API gateway device 100, or may be the multi-tenant service access realization apparatus 110 in the management server 200.
- the components of the memory 120, the processor 130, and the communication unit 140 are directly or indirectly electrically connected to each other to implement information transmission or interaction. For example, these components can be electrically connected to each other through one or more communication buses or signal lines.
- the memory 120 stores software function modules stored in the memory 120 in the form of software or firmware (Firmware), and the processor 130 runs the software programs and modules stored in the memory 120, as in the embodiment of the present invention.
- the device 110 for implementing multi-tenant service access is implemented to execute various functional applications and data processing, that is, to implement the method for implementing multi-tenant service access in the embodiment of the present invention.
- the memory 120 may be, but is not limited to, random access memory (Random Access Memory, RAM), read only memory (Read Only Memory, ROM), and programmable read-only memory (Programmable Read-Only Memory, PROM). , Erasable Programmable Read-Only Memory (EPROM), Electric Erasable Programmable Read-Only Memory (EEPROM), etc.
- RAM Random Access Memory
- ROM read only memory
- PROM programmable read-only memory
- PROM Programmable Read-Only Memory
- EPROM Erasable Programmable Read-Only Memory
- EEPROM Electric Erasable Programmable Read-Only Memory
- the processor 130 may be an integrated circuit chip with signal processing capability.
- the aforementioned processor 130 may be a general-purpose processor, such as a central processing unit (CPU).
- CPU central processing unit
- An embodiment of the present application also provides a readable storage medium that stores computer-executable instructions that can execute the method for implementing multi-tenant service access in any of the foregoing method embodiments.
- the embodiments of the present application provide a method, device, and electronic device for implementing multi-tenant service access.
- a service request sent by a user is received through the API gateway device 100, it is based on the relationship between pre-stored tenants and service instance resources.
- the association relationship obtains the service instance resource associated with the tenant to which the service request belongs.
- the service request carrying the obtained service instance resource is sent to the management server 200, so that the management server 200 invokes the same service instance resource as the service instance resource to process the service request.
- the API gateway device 100 is used in combination to route service requests, which avoids the intrusion of application code into service instances due to the need to embed routing modules inside the services on the server side in the prior art, thereby reducing the service instances on the server side.
- the complexity of the business case can only focus on business processing.
- each block in the flowchart or block diagram may represent a module, program segment, or part of code that contains one or more of the Executable instructions.
- the functions noted in the block may occur out of the order noted in the figures. For example, two consecutive blocks can actually be executed substantially in parallel, and sometimes they can also be executed in reverse order, depending on the functions involved.
- each block in the block diagrams and/or flowcharts, and combinations of blocks in the block diagrams and/or flowcharts can be implemented with dedicated hardware-based systems that perform specified functions or actions Or, it can be realized by a combination of dedicated hardware and computer instructions.
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
本申请实施例提供了一种多租户业务接入实现方法、装置及电子设备,通过API网关设备在接收到用户发送的业务请求时,根据预存的租户与业务实例资源之间的关联关系得到与发送该业务请求所属的租户相关联的业务实例资源。并将携带有所获得的业务实例资源的业务请求发送至管理服务器,以使管理服务器调用与该业务实例资源相同的业务实例资源对业务请求进行处理。本申请结合使用API网关设备对业务请求进行路由处理,避免了现有技术中的因需在服务端的服务内部嵌入路由模块而对业务实例带来的应用代码侵入,从而降低了服务端的业务实例的复杂性,使业务实例只关注于业务处理即可。
Description
本申请涉及通信技术领域,具体而言,涉及一种多租户业务接入实现方法、装置及电子设备。
随着云计算技术的发展,SaaS(Software as a Service,软件即服务)化的软件已经成为许多小型企业采用先进技术的最好途径,它降低了企业购买、构建和维护基础设施和应用程序的成本。SaaS软件最基本的一个特征是能够支持多租户,即,在云端部署的同一套软件系统可以被多个企业或者用户共享。虽然软件代码是共享的同一份,但彼此之间的数据相互不可见,在功能外观上也存在一定的差异。为了能够实现这种多租户的特性,现有技术中常采用在服务内部嵌入数据路由的模块,以实现不同用户业务的路由功能。而业务处理环境其主要功能是进行业务处理,一般作为单独模块进行开发。而现有技术中在业务实例中引入路由的功能,则需要嵌入其他的路由相关的应用代码。业务实例既需要进行业务处理,又要进行路由功能,处理压力较大,服务端的复杂性较高。
发明内容
有鉴于此,本申请的目的在于,提供一种多租户业务接入实现方法、装置及电子设备以缓解服务端的处理压力、降低服务端的复杂性。
为了实现上述目的,本申请实施例采用的技术方案如下:
第一方面,本申请实施例提供一种多租户业务接入实现方法,应用于API网关设备,所述API网关设备与管理服务器通信连接,所述管理服务器预先配置并存储有用于处理业务请求的业务实例资源,所述方法包括:
接收用户发送的业务请求,其中,所述业务请求中携带有所述用户所 属的租户信息;
根据预存的租户与业务实例资源之间的关联关系,获得与发送所述业务请求的用户所属的租户相关联的业务实例资源;
将携带获得的所述业务实例资源的业务请求发送至所述管理服务器,以使所述管理服务器调用与所述业务请求中的业务实例资源相同的业务实例资源对所述业务请求进行处理。
可选地,所述方法还包括:
统计预设时长内租户发起的业务请求的请求量;
检测与该租户相关联的业务实例资源的数量是否与该租户的请求量所需的处理资源的数量相匹配,若不匹配,则对与该租户相关联的业务实例资源的数量进行调整,得到调整后的业务实例资源与所述租户之间的关联关系;
将调整后所得到的关联关系发送至所述管理服务器。
可选地,所述对与该租户相关联的业务实例资源的数量进行调整的步骤,包括:
在所述租户的请求量所需的处理资源的数量超过与所述租户相关联的业务实例资源的数量且超过值大于第一预设阈值时,为所述租户增加业务实例资源,并将增加的业务实例资源与该租户进行关联。
可选地,所述对与该租户相关联的业务实例资源的数量进行调整的步骤,还包括:
在所述租户的请求量所需的处理资源的数量低于与所述租户相关联的业务实例资源的数量且低于值大于第二预设阈值时,为该租户减少业务实例资源,并解除减少的业务实例资源与该租户之间的关联。
第二方面,本申请实施例还提供一种多租户业务接入实现方法,应用于管理服务器,所述管理服务器与API网关设备通信连接,所述管理服务器中预先配置并存储有用于处理业务请求的业务实例资源,所述方法包括:
接收所述API网关设备发送的业务请求,所述业务请求为所述API网关设备在接收到用户发送的业务请求时,根据预存的租户及业务实例资源之间的关联关系所获得的包含与该用户所属的租户相关联的业务实例资源的业务请求;
获得所述业务请求中携带的租户信息及与该租户相关联的业务实例资源;
从存储的业务实例资源中获得与所述业务请求所携带的业务实例资源一致的业务实例资源;
调用获得的所述业务实例资源对所述业务请求进行处理。
可选地,所述接收所述API网关设备发送的业务请求的步骤之前,所述方法还包括:
接收租户发送的租户注册请求,其中,所述租户注册请求中携带有所述租户包含的用户数量、预期请求量及业务处理要求;
根据所述租户包含的用户数量、预期请求量及业务处理要求为所述租户分配匹配的业务实例资源,并为该租户分配数据库资源;
建立所述租户、所述业务实例资源以及所述数据库资源之间的关联关系,将所述关联关系存储,并将所述关联关系发送至所述API网关设备。
可选地,所述方法还包括:
接收所述API网关设备发送的调整后的租户与业务实例资源的关联关系,其中,所述关联关系为所述API网关设备根据所述租户在预设时长内发起的业务请求的请求量所调整获得;
根据接收到的所述关联关系对存储的该租户与业务实例资源之间的关联关系进行更新。
可选地,所述方法还包括:
在监测到存在业务实例资源异常时,启用一空闲业务实例资源以替换存在异常的业务实例资源;
根据存储的关联关系获得与异常的业务实例资源相关联的租户及数据库资源;
将获得的租户和数据库资源与所启用的所述空闲业务实例资源进行关联。
可选地,所述调用获得的所述业务实例资源以对所述业务请求进行处理的步骤,包括:
查询存储的所述关联关系得到与所述租户和获得的所述业务实例资源相关联的数据库资源;
若所述业务请求为数据读请求,则从获得的所述数据库资源中查找到与所述数据读请求对应的数据,将查找到的所述数据通过所述API网关设备返回给所述租户;
若所述业务请求为数据写请求,则将所述数据写请求中携带的数据存入获得的所述数据库资源中。
第三方面,本申请还提供一种多租户业务接入实现装置,应用于API网关设备,所述API网关设备与管理服务器通信连接,所述管理服务器预先配置并存储有用于处理业务请求的业务实例资源,所述装置包括:
第一接收模块,用于接收用户发送的业务请求,其中,所述业务请求中携带有所述用户所属的租户信息;
第一资源获得模块,用于根据预存的租户与业务实例资源之间的关联关系获得与发送所述业务请求的用户所属的租户相关联的业务实例资源;
发送模块,用于将携带获得的所述业务实例资源的业务请求发送至所述管理服务器,以使所述管理服务器调用与所述业务请求中的业务实例资源相同的业务实例资源对所述业务请求进行处理。
第四方面,本申请还提供一种多租户业务接入实现装置,应用于管理服务器,所述管理服务器与API网关设备通信连接,所述管理服务器中预先配置并存储有用于处理业务请求的业务实例资源,所述装置包括:
第二接收模块,用于接收所述API网关设备发送的业务请求,所述业务请求为所述API网关设备在接收到用户所发送的业务请求时,根据预存的租户及业务实例资源之间的关联关系所获得的包含与该用户所属的租户相关联的业务实例资源的业务请求;
第二资源获得模块,用于获得所述业务请求中携带的租户信息及与该租户相关联的业务实例资源;
第三资源获得模块,用于从存储的业务实例资源中获得与所述业务请求所携带的业务实例资源一致的业务实例资源;
处理模块,用于调用获得的所述业务实例资源对所述业务请求进行处理。
第五方面,本申请还提供一种电子设备,包括存储器、处理器及存储在所述存储器上并可在所述处理器上运行的计算机程序,所述处理器执行所述程序时实现上述的方法步骤。
第六方面,本申请还提供一种可读存储介质,该可读存储介质上存储有计算机程序,该计算机程序被处理器运行时执行上述的方法步骤。
本申请实施例提供的一种多租户业务接入实现方法、装置及电子设备,通过API网关设备在接收到用户发送的业务请求时,根据预存的租户与业务实例资源之间的关联关系得到与发送该业务请求所属的租户相关联的业务实例资源。并将携带有所获得的业务实例资源的业务请求发送至管理服务器,以使管理服务器调用与该业务实例资源相同的业务实例资源对业务请求进行处理。本申请结合使用API网关设备对业务请求进行路由处理,避免了现有技术中的因需在服务端的服务内部嵌入路由模块而对业务实例带来的应用代码侵入,从而降低了服务端的业务实例的复杂性,使业务实例只关注于业务处理即可。
为使本申请的上述目的、特征和优点能更明显易懂,下文特举较佳实施例,并配合所附附图,作详细说明如下。
为了更清楚地说明本申请实施例的技术方案,下面将对实施例中所需要使用的附图作简单地介绍,应当理解,以下附图仅示出了本申请的某些实施例,因此不应被看作是对范围的限定,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他相关的附图。
图1为本申请实施例提供的多租户业务接入实现方法的应用场景示意图。
图2为本申请实施例提供的应用于API网关设备的多租户业务接入实现方法的流程图。
图3为本申请实施例提供的应用于API网关设备的多租户业务接入实现方法的另一流程图。
图4为本申请实施例提供的应用于管理服务器的多租户业务接入实现方法的流程图。
图5为本申请实施例提供的应用于管理服务器的多租户业务接入实现方法的另一流程图。
图6为本申请实施例提供的应用于API网关设备的多租户业务接入实现装置的功能模块框图。
图7为本申请实施例提供的应用于管理服务器的多租户业务接入实现装置的功能模块框图。
图8为本申请实施例提供的电子设备的结构框图。
下面将结合本申请实施例中附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本申请一部分实施例,而不是全部的实施例。通常在此处附图中描述和示出的本申请实施例的组件可以以各种不同的配置来布置和设计。因此,以下对在附图中提供的本 申请的实施例的详细描述并非旨在限制要求保护的本申请的范围,而是仅仅表示本申请的选定实施例。基于本申请的实施例,本领域技术人员在没有做出创造性劳动的前提下所获得的所有其他实施例,都属于本申请保护的范围。
应注意到:相似的标号和字母在下面的附图中表示类似项,因此,一旦某一项在一个附图中被定义,则在随后的附图中不需要对其进行进一步定义和解释。同时,在本申请的描述中,除非另有明确的规定和限定,术语“安装”、“设置”、“连接”应做广义理解,例如,可以是固定连接,也可以是可拆卸连接,或一体地连接;可以是机械连接,也可以是电连接;可以是直接相连,也可以通过中间媒介间接相连,可以是两个元件内部的连通。对于本领域的普通技术人员而言,可以具体情况理解上述术语在本申请中的具体含义。
请参阅图1,图1为本申请实施例提供的多租户业务接入实现方法的应用场景示意图。该场景中包括管理服务器200、API网关设备100及多个终端设备300(图中只画出了六个)。管理服务器200、API网关设备100及各终端设备300可通过网络通信连接。其中,所述终端设备300为对应于用户的终端设备300(本实施例中以用户代替终端设备300),而多个用户可构成租户(图中示意性的画出两个),例如以公司为单位,该公司为一个租户,而该公司内部的员工为该租户所包括的用户。而管理服务器200可为用户的业务请求提供处理资源及数据库资源,API网关设备100可提供数据路由功能。
请参照图2,图2为应用于图1所示的API网关设备100的一种多租户业务接入实现方法的流程图,以下将对所述方法包括的各个步骤进行详细阐述。
步骤S110,接收用户发送的业务请求,其中,所述业务请求中携带有所述用户所属的租户信息。
步骤S120,根据预存的租户与业务实例资源之间的关联关系,获得与发送所述业务请求的用户所属的租户相关联的业务实例资源。
步骤S130,将携带获得的所述业务实例资源的业务请求发送至所述管理服务器200,以使所述管理服务器200调用与所述业务请求中的业务实例资源相同的业务实例资源对所述业务请求进行处理。
本实施例中,在执行步骤S110之前,各个租户可向管理服务器200发起租户注册请求以进行租户的账户注册。其中,该租户注册请求中携带有所述租户所包含的用户数量、该租户的预期请求量及对业务处理要求等。管理服务器200在接收到该租户注册请求中,其中的配置模块可根据租户注册请求中所包含的上述用户数量、预期请求量及业务处理要求等为该租户分配匹配的业务实例资源,其中,该业务实例资源即为用于该租户所包含的用户的业务请求的处理资源。对于不同的租户,其可能调用相同的服务,例如不同的公司均可以调用云端的打卡服务系统,但是需确保不同租户之间的数据的隔离性,以保障数据的彼此不可见性。因此,需要有不同的处理环境对不同公司的业务进行处理,而为了使资源得到合理利用,这就涉及到资源的分配问题。
不同的租户内用户的数量可能不同、该租户的业务请求量可能不同并且对于业务处理要求,例如业务处理的实时性、业务处理的效率、数据的隔离要求等,均存在差异。有的租户中包含的用户较多,则可以分配较多的业务实例资源用于处理该租户的相关的业务请求。而有的租户的业务请求量很少,则为了避免资源的浪费,可为该租户分配较少的业务实例资源。
而对于数据库资源的分配,可采用以下的任意一种方式进行分配:独立数据库;共享数据库、独立schema;共享数据库、共享schema、共享数据表。其中,独立数据库的方式即为每一个租户分配一个单独的数据库,这种方式的用户数据隔离级别最高、安全性最好,但成本较高。为每一个租户分配独立的数据库有助于简化数据模型的扩展设计,满足不同租户的 独特需求,并且若出现故障,数据恢复较为容易。这种方式可针对对于数据隔离要求较高的租户,例如银行、医院等。
其中,共享数据库、独立schema的方式即多个租户可共享一个数据库,但是为每一个租户分配一个独立的schema,其中,一个数据库中包含多个schema。这种方式可以实现一定程度的逻辑数据隔离,但并不是完全隔离。这种方式下每个数据库可支持较多的租户数量,但是若出现故障,数据恢复上比较困难,因为会牵涉到其他租户的数据。
而对于共享数据库、共享schema、共享数据表这种方式,即不同租户间共享一个数据库、同一个schema、同一个数据表。在每插入一个数据时,需要有一个用户的标识,这样才能在同一张数据表中区分出不同的用户的数据。这种方式共享程度最高、数据隔离级别最低,维护和购置成本最低,每个数据库支持的租户数量最大。
基于上述研究,可根据租户发起的租户注册请求中的业务处理要求及租户的相关信息来为租户分配对应的数据库资源。
在分配完成业务实例资源及数据库资源后,可建立租户、业务实例资源及数据库资源之间的关联关系,例如,租户与业务实例资源之间的关系、租户与数据库之间的关系、业务实例资源与数据库资源之间的关系。将建立的关联关系进行保存,并且发送至API网关设备100。API网关设备100在接收到管理服务器200发送的关联关系后进行存储。
API网关设备100在接收到某个用户发送的业务请求时,可根据该业务请求获得该用户所属的租户信息。并根据预存的租户与业务实例资源之间的关联关系,获得与发送所述业务请求的用户所属的租户相关联的业务实例资源。
API网关设备100可将携带有所获得的业务实例资源的业务请求发送至管理服务器200,管理服务器200中的调用模块直接调用对应的业务实例资源对所述用户的业务请求进行处理即可。
本实施例中,管理服务器200在接收到API网关设备100发送的业务请求时,获得该业务请求中携带的租户信息及与该租户相关联的业务实例资源。从预先配置的业务实例资源中获得与该业务请求中所携带的业务实例资源一致的业务实例资源,调用该业务实例资源对所述业务请求进行处理。
如此,通过API网关设备100来实现路由的功能,管理服务器200中的业务实例只需关注于业务处理事项即可,缓解了处理压力。并且,业务实例模块中无需嵌入数据路由模块,也避免了外部的路由相关的应用代码的侵入,独立性更高。
由上述可知,管理服务器200为各租户所分配的业务实例资源为根据租户注册请求中的信息所配置,只是一个预配过程。在实际执行过程中,租户的请求量可能相对于其先前进行注册时的预期请求量有偏差。因此,请参阅图3,本实施例中,所述多租户业务接入实现方法还包括以下步骤:
步骤S210,统计预设时长内租户发起的业务请求的请求量。
步骤S220,检测与该租户相关联的业务实例资源的数量是否与该租户的请求量所需的处理资源的数量相匹配,若不匹配,在执行以下步骤S230。
步骤S230,对与该租户相关联的业务实例资源的数量进行调整,得到调整后的业务实例资源与所述租户之间的关联关系。
步骤S240,将调整后所得到的关联关系发送至所述管理服务器200。
本实施例中,API网关设备100可间隔预设时长统计该预设时长内租户发起的业务请求的请求量。检测该租户所关联的业务实例资源的数量是否与该租户的请求量所需的处理资源的数量相匹配。若不匹配,则可对与该租户相关联的业务实例资源的数量进行调整。若匹配,则不作处理。
可选地,在所述租户的请求量所需的处理资源的数量超过与所述租户相关联的业务实例资源的数量,并且超过值大于第一预设阈值时,为所述租户增加业务实例资源,并将增加的业务实例资源与该租户进行关联。如 此,可在租户的请求量增大的情况下,为租户增配业务实例资源,避免了该租户关联的业务实例资源的负载过大,而影响到对租户的业务请求的处理。
此外,在所述租户的请求量所需的处理资源的数量低于与所述租户相关联的业务实例资源的数量且低于量大于第二预设阈值时,为该租户减少业务实例资源,并解除减少的业务实例资源与该租户之间的关联。如此,在租户的请求量减少的情况下,为租户减少配置的业务实例资源,避免资源闲置、浪费的问题。
本实施例中,API网关设备100在对租户与业务实例资源之间的关联关系进行调整后,将调整后的关联关系发送至管理服务器200。管理服务器200在接收到调整后的关联关系后,管理服务器200中的配置服务模块将根据接收到的所述关联关系对存储的该租户与业务实例资源之间的关联关系进行更新。
请参阅图4,本申请另一实施例还提供一种应用于上述管理服务器200的多租户业务接入实现方法,该方法包括以下步骤:
步骤S410,接收所述API网关设备100发送的业务请求,所述业务请求为所述API网关设备100在接收到用户发送的业务请求时,根据预存的租户及业务实例资源之间的关联关系所获得的包含与该用户所属的租户相关联的业务实例资源的业务请求。
步骤S420,获得所述业务请求中携带的租户信息及与该租户相关联的业务实例资源。
步骤S430,从存储的业务实例资源中获得与所述业务请求所携带的业务实例资源一致的业务实例资源。
步骤S440,调用获得的所述业务实例资源对所述业务请求进行处理。
在本实施例中,管理服务器200在接收API网关设备100发送的业务请求的步骤之前,所述方法还包括以下步骤:
接收租户发送的租户注册请求,其中,所述租户注册请求中携带有所述租户包含的用户数量、预期请求量及业务处理要求。
根据所述租户包含的用户数量、预期请求量及业务处理要求为所述租户分配匹配的业务实例资源,并为该租户分配数据库资源。
建立所述租户、所述业务实例资源以及所述数据库资源之间的关联关系,将所述关联关系存储,并将所述关联关系发送至所述API网关设备100。
进一步地,在本实施例中,管理服务器200还可接收所述API网关设备100发送的调整后的租户与业务实例资源的关联关系,其中,所述关联关系为所述API网关设备100根据所述租户在预设时长内发起的业务请求的请求量所调整获得。根据接收到的所述关联关系对存储的该租户与业务实例资源之间的关联关系进行更新。
其中,关于上述步骤的详细过程可参见上一实施例中的多租户业务接入实现方法中的相关描述,在此不再赘述。
本实施例中,管理服务器200在调用对应的业务实例资源对业务请求进行处理时,可通过以下步骤实现:
查询存储的所述关联关系得到与所述租户和获得的所述业务实例资源相关联的数据库资源。
若所述业务请求为数据读请求,则从获得的所述数据库资源中查找到与所述数据读请求对应的数据,将查找到的所述数据通过所述API网关设备100返回给所述租户。
若所述业务请求为数据写请求,则将所述数据写请求中携带的数据存入获得的所述数据库资源中。
此外,请参阅图5,在本实施例中,所述多租户业务接入实现方法还包括以下步骤:
步骤S510,在监测到存在业务实例资源异常时,启用一空闲业务实例资源以替换存在异常的业务实例资源。
步骤S520,根据存储的关联关系获得与异常的业务实例资源相关联的租户及数据库资源。
步骤S530,将获得的租户和数据库资源与所启用的所述空闲业务实例资源进行关联。
本实施例中,管理服务器200中包含服务感知模块,服务感知模块可实时监测业务实例资源是否出现异常,例如是否离线,若出现离线状况的话,会影响到相应租户的业务处理。因此,在服务感知模块监测到存在业务实例资源异常时,则启用一空闲业务实例资源以替换该存在异常的业务实例资源,即触发启动故障切换流程。其中,该空闲业务实例资源为管理服务器200中未与任一租户相关联的业务实例资源。
并且,可将存在异常的业务实例资源的相关业务切换到该启用的空闲业务实例资源。并且,将与所述异常的业务实例资源关联的租户及数据库资源与启用的空闲业务实例资源建立关联。解除异常的业务实例资源与对应的租户及数据库资源的关联关系。
本实施例所提供的多租户业务实现方法,可结合API网关设备100的路由功能,实现根据API网关设备100所发送的业务请求中的相应的业务实例资源调用的业务实例资源进行处理的效果。无需自身进行路由功能,处理压力小,且不必嵌入其他的路由相关的应用程序,独立性更高。
请参阅图6,本申请另一实施例还提供一种应用于上述API网关设备100的多租户业务接入实现装置110,所述多租户业务接入实现装置110包括:
第一接收模块111,用于接收用户发送的业务请求,其中,所述业务请求中携带有所述用户所属的租户信息。可以理解,该第一接收模块111可以用于执行上述步骤S110,关于该第一接收模块111的详细实现方式可以参照上述对步骤S110有关的内容。
第一资源获得模块112,用于根据预存的租户与业务实例资源之间的关 联关系获得与发送所述业务请求的用户所属的租户相关联的业务实例资源。可以理解,该第一资源获得模块112可以用于执行上述步骤S120,关于该第一资源获得模块112的详细实现方式可以参照上述对步骤S120有关的内容。
发送模块113,用于将携带获得的所述业务实例资源的业务请求发送至所述管理服务器200,以使所述管理服务器200调用与所述业务请求中的业务实例资源相同的业务实例资源对所述业务请求进行处理。可以理解,该发送模块113可以用于执行上述步骤S130,关于该发送模块113的详细实现方式可以参照上述对步骤S130有关的内容。
请参阅图7,本申请另一实施例还提供一种应用于上述管理服务器200的多租户业务接入实现装置110,所述多租户业务接入实现装置110包括:
第二接收模块114,用于接收所述API网关设备100发送的业务请求,所述业务请求为所述API网关设备100在接收到用户所发送的业务请求时,根据预存的租户及业务实例资源之间的关联关系所获得的包含与该用户所属的租户相关联的业务实例资源的业务请求。可以理解,该第二接收模块114可以用于执行上述步骤S410,关于该第二接收模块114的详细实现方式可以参照上述对步骤S410有关的内容。
第二资源获得模块115,用于获得所述业务请求中携带的租户信息及与该租户相关联的业务实例资源。可以理解,该第二资源获得模块115可以用于执行上述步骤S420,关于该第二资源获得模块115的详细实现方式可以参照上述对步骤S420有关的内容。
第三资源获得模块116,用于从存储的业务实例资源中获得与所述业务请求所携带的业务实例资源一致的业务实例资源。可以理解,该第三资源获得模块116可以用于执行上述步骤S430,关于该第三资源获得模块116的详细实现方式可以参照上述对步骤S430有关的内容。
处理模块117,用于调用获得的所述业务实例资源对所述业务请求进行 处理。可以理解,该处理模块117可以用于执行上述步骤S440,关于该处理模块117的详细实现方式可以参照上述对步骤S440有关的内容。
如图8所示,本申请实施例还提供一种电子设备,所述电子设备可为上述的API网关设备100或者是上述的管理服务器200,所述电子设备100包括多租户业务接入实现装置110、存储器120、处理器130以及通信单元140。其中,该租户业务接入实现装置110可以是API网关设备100中的多租户业务接入实现装置110,也可以是管理服务器200中的多租户业务接入实现装置110。
所述存储器120、处理器130以及通信单元140各元件相互之间直接或间接地电性连接,以实现信息的传输或交互。例如,这些元件相互之间可通过一条或多条通讯总线或信号线实现电性连接。存储器120中存储有以软件或固件(Firmware)的形式存储于所述存储器120中的软件功能模块,所述处理器130通过运行存储在存储器120内的软件程序以及模块,如本发明实施例中的多租户业务接入实现装置110,从而执行各种功能应用以及数据处理,即实现本发明实施例中的多租户业务接入实现方法。
其中,所述存储器120可以是,但不限于,随机存取存储器(Random Access Memory,RAM),只读存储器(Read Only Memory,ROM),可编程只读存储器(Programmable Read-Only Memory,PROM),可擦除只读存储器(Erasable Programmable Read-Only Memory,EPROM),电可擦除只读存储器(Electric Erasable Programmable Read-Only Memory,EEPROM)等。其中,存储器120用于存储程序,所述处理器130在接收到执行指令后,执行所述程序。所述通信单元140用于建立网络节点之间的通信。
所述处理器130可能是一种集成电路芯片,具有信号的处理能力。上述的处理器130可以是通用处理器,例如中央处理器(Central Processing Unit,CPU)。
本申请实施例还提供了一种可读存储介质,所述可读存储介质存储有 计算机可执行指令,该计算机可执行指令可执行上述任意方法实施例中的多租户业务接入实现方法。
综上所述,本申请实施例提供一种多租户业务接入实现方法、装置及电子设备,通过API网关设备100在接收到用户发送的业务请求时,根据预存的租户与业务实例资源之间的关联关系得到与发送该业务请求所属的租户相关联的业务实例资源。并将携带有所获得的业务实例资源的业务请求发送至管理服务器200,以使管理服务器200调用与该业务实例资源相同的业务实例资源对业务请求进行处理。本申请结合使用API网关设备100对业务请求进行路由处理,避免了现有技术中的因需在服务端的服务内部嵌入路由模块而对业务实例带来的应用代码侵入,从而降低了服务端的业务实例的复杂性,使业务实例只关注于业务处理即可。
在本申请所提供的实施例中,应该理解到,所揭露的装置和方法,也可以通过其它的方式实现。以上所描述的装置实施例仅仅是示意性的,例如,附图中的流程图和框图显示了根据本申请的实施例的装置、方法和计算机程序产品的可能实现的体系架构、功能和操作。在这点上,流程图或框图中的每个方框可以代表一个模块、程序段或代码的一部分,所述模块、程序段或代码的一部分包含一个或多个用于实现规定的逻辑功能的可执行指令。也应当注意,在有些作为替换的实现方式中,方框中所标注的功能也可以以不同于附图中所标注的顺序发生。例如,两个连续的方框实际上可以基本并行地执行,它们有时也可以按相反的顺序执行,这依所涉及的功能而定。也要注意的是,框图和/或流程图中的每个方框、以及框图和/或流程图中的方框的组合,可以用执行规定的功能或动作的专用的基于硬件的系统来实现,或者可以用专用硬件与计算机指令的组合来实现。
需要说明的是,在本文中,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是 还包括为这种过程、方法、物品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、物品或者设备中还存在另外的相同要素。
以上所述仅为本申请的优选实施例而已,并不用于限制本申请,对于本领域的技术人员来说,本申请可以有各种更改和变化。凡在本申请的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本申请的保护范围之内。应注意到:相似的标号和字母在下面的附图中表示类似项,因此,一旦某一项在一个附图中被定义,则在随后的附图中不需要对其进行进一步定义和解释。
Claims (13)
- 一种多租户业务接入实现方法,其特征在于,应用于API网关设备,所述API网关设备与管理服务器通信连接,所述管理服务器预先配置并存储有用于处理业务请求的业务实例资源,所述方法包括:接收用户发送的业务请求,其中,所述业务请求中携带有所述用户所属的租户信息;根据预存的租户与业务实例资源之间的关联关系,获得与发送所述业务请求的用户所属的租户相关联的业务实例资源;将携带获得的所述业务实例资源的业务请求发送至所述管理服务器,以使所述管理服务器调用与所述业务请求中的业务实例资源相同的业务实例资源对所述业务请求进行处理。
- 根据权利要求1所述的多租户业务接入实现方法,其特征在于,所述方法还包括:统计预设时长内租户发起的业务请求的请求量;检测与该租户相关联的业务实例资源的数量是否与该租户的请求量所需的处理资源的数量相匹配,若不匹配,则对与该租户相关联的业务实例资源的数量进行调整,得到调整后的业务实例资源与所述租户之间的关联关系;将调整后所得到的关联关系发送至所述管理服务器。
- 根据权利要求2所述的多租户业务接入实现方法,其特征在于,所述对与该租户相关联的业务实例资源的数量进行调整的步骤,包括:在所述租户的请求量所需的处理资源的数量超过与所述租户相关联的业务实例资源的数量且超过值大于第一预设阈值时,为所述租户增加业务实例资源,并将增加的业务实例资源与该租户进行关联。
- 根据权利要求3所述的多租户业务接入实现方法,其特征在于,所述 对与该租户相关联的业务实例资源的数量进行调整的步骤,还包括:在所述租户的请求量所需的处理资源的数量低于与所述租户相关联的业务实例资源的数量且低于值大于第二预设阈值时,为该租户减少业务实例资源,并解除减少的业务实例资源与该租户之间的关联。
- 一种多租户业务接入实现方法,其特征在于,应用于管理服务器,所述管理服务器与API网关设备通信连接,所述管理服务器中预先配置并存储有用于处理业务请求的业务实例资源,所述方法包括:接收所述API网关设备发送的业务请求,所述业务请求为所述API网关设备在接收到用户发送的业务请求时,根据预存的租户及业务实例资源之间的关联关系所获得的包含与该用户所属的租户相关联的业务实例资源的业务请求;获得所述业务请求中携带的租户信息及与该租户相关联的业务实例资源;从存储的业务实例资源中获得与所述业务请求所携带的业务实例资源一致的业务实例资源;调用获得的所述业务实例资源对所述业务请求进行处理。
- 根据权利要求5所述的多租户业务接入实现方法,其特征在于,所述接收所述API网关设备发送的业务请求的步骤之前,所述方法还包括:接收租户发送的租户注册请求,其中,所述租户注册请求中携带有所述租户包含的用户数量、预期请求量及业务处理要求;根据所述租户包含的用户数量、预期请求量及业务处理要求为所述租户分配匹配的业务实例资源,并为该租户分配数据库资源;建立所述租户、所述业务实例资源以及所述数据库资源之间的关联关系,将所述关联关系存储,并将所述关联关系发送至所述API网关设备。
- 根据权利要求6所述的多租户业务接入实现方法,其特征在于,所述方法还包括:接收所述API网关设备发送的调整后的租户与业务实例资源的关联关系,其中,所述关联关系为所述API网关设备根据所述租户在预设时长内发起的业务请求的请求量所调整获得;根据接收到的所述关联关系对存储的该租户与业务实例资源之间的关联关系进行更新。
- 根据权利要求6所述的多租户业务接入实现方法,其特征在于,所述方法还包括:在监测到存在业务实例资源异常时,启用一空闲业务实例资源以替换存在异常的业务实例资源;根据存储的关联关系获得与异常的业务实例资源相关联的租户及数据库资源;将获得的租户和数据库资源与所启用的所述空闲业务实例资源进行关联。
- 根据权利要求6所述的多租户业务接入实现方法,其特征在于,所述调用获得的所述业务实例资源以对所述业务请求进行处理的步骤,包括:查询存储的所述关联关系得到与所述租户和获得的所述业务实例资源相关联的数据库资源;若所述业务请求为数据读请求,则从获得的所述数据库资源中查找到与所述数据读请求对应的数据,将查找到的所述数据通过所述API网关设备返回给所述租户;若所述业务请求为数据写请求,则将所述数据写请求中携带的数据存入获得的所述数据库资源中。
- 一种多租户业务接入实现装置,其特征在于,应用于API网关设备,所述API网关设备与管理服务器通信连接,所述管理服务器预先配置并存储有用于处理业务请求的业务实例资源,所述装置包括:第一接收模块,用于接收用户发送的业务请求,其中,所述业务请求 中携带有所述用户所属的租户信息;第一资源获得模块,用于根据预存的租户与业务实例资源之间的关联关系获得与发送所述业务请求的用户所属的租户相关联的业务实例资源;发送模块,用于将携带获得的所述业务实例资源的业务请求发送至所述管理服务器,以使所述管理服务器调用与所述业务请求中的业务实例资源相同的业务实例资源对所述业务请求进行处理。
- 一种多租户业务接入实现装置,其特征在于,应用于管理服务器,所述管理服务器与API网关设备通信连接,所述管理服务器中预先配置并存储有用于处理业务请求的业务实例资源,所述装置包括:第二接收模块,用于接收所述API网关设备发送的业务请求,所述业务请求为所述API网关设备在接收到用户所发送的业务请求时,根据预存的租户及业务实例资源之间的关联关系所获得的包含与该用户所属的租户相关联的业务实例资源的业务请求;第二资源获得模块,用于获得所述业务请求中携带的租户信息及与该租户相关联的业务实例资源;第三资源获得模块,用于从存储的业务实例资源中获得与所述业务请求所携带的业务实例资源一致的业务实例资源;处理模块,用于调用获得的所述业务实例资源对所述业务请求进行处理。
- 一种电子设备,包括存储器、处理器及存储在所述存储器上并可在所述处理器上运行的计算机程序,其特征在于,所述处理器执行所述程序时实现权利要求1-4或权利要求5-9中任意一项所述的方法步骤。
- 一种可读存储介质,其特征在于,该可读存储介质上存储有计算机程序,该计算机程序被处理器运行时执行如权利要求1-4或权利要求5-9中任意一项所述的方法步骤。
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910037908.2 | 2019-01-16 | ||
CN201910037908.2A CN109412878A (zh) | 2019-01-16 | 2019-01-16 | 多租户业务接入实现方法、装置及电子设备 |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2020147301A1 true WO2020147301A1 (zh) | 2020-07-23 |
Family
ID=65462377
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2019/098765 WO2020147301A1 (zh) | 2019-01-16 | 2019-08-01 | 多租户业务接入实现方法、装置及电子设备 |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN109412878A (zh) |
WO (1) | WO2020147301A1 (zh) |
Families Citing this family (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109412878A (zh) * | 2019-01-16 | 2019-03-01 | 紫光云数科技有限公司 | 多租户业务接入实现方法、装置及电子设备 |
CN110784551A (zh) * | 2019-11-05 | 2020-02-11 | 中国建设银行股份有限公司 | 基于多租户的数据处理方法、装置、设备和介质 |
CN113132146B (zh) * | 2019-12-31 | 2022-12-27 | 北京华为数字技术有限公司 | 一种业务处理方法及相关装置 |
CN111506411A (zh) * | 2020-04-21 | 2020-08-07 | 北京思特奇信息技术股份有限公司 | 一种多租户服务管理方法和系统 |
CN112118565B (zh) * | 2020-08-14 | 2023-07-25 | 金蝶医疗软件科技有限公司 | 多租户服务灰度发布方法、装置、计算机设备和存储介质 |
CN112069210A (zh) * | 2020-08-21 | 2020-12-11 | 北京首汽智行科技有限公司 | 一种saas平台多租户数据隔离方法 |
CN112308377B (zh) * | 2020-09-30 | 2023-09-26 | 北京沃东天骏信息技术有限公司 | 基于多租户的资源调配方法和装置 |
CN114153488A (zh) * | 2021-11-10 | 2022-03-08 | 建信金融科技有限责任公司 | 一种应用请求处理方法、装置、系统和介质 |
CN114390110B (zh) * | 2021-12-31 | 2023-08-22 | 华南理工大学 | 一种带约束的可扩展资源供给的多租户系统、方法和设备 |
Citations (11)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102170457A (zh) * | 2010-02-26 | 2011-08-31 | 国际商业机器公司 | 向应用的多租户提供服务的方法和装置 |
US20130145006A1 (en) * | 2011-12-06 | 2013-06-06 | Sap Portals Israel Ltd | Multi-tenant infrastructure |
US20140101299A1 (en) * | 2012-10-06 | 2014-04-10 | International Business Machines Corporation | Techniques for implementing information services with tentant specific service level agreements |
CN104142864A (zh) * | 2014-08-07 | 2014-11-12 | 浪潮电子信息产业股份有限公司 | 一种基于虚拟化技术的多租户性能隔离框架 |
CN104881749A (zh) * | 2015-06-01 | 2015-09-02 | 北京圆通慧达管理软件开发有限公司 | 面向多租户的数据管理方法和数据存储系统 |
US20160087960A1 (en) * | 2014-09-19 | 2016-03-24 | Oracle International Corporation | Shared identity management (idm) integration in a multi-tenant computing environment |
CN107493314A (zh) * | 2016-06-10 | 2017-12-19 | 三星Sds株式会社 | 基于多租户的服务提供系统及方法 |
CN108170520A (zh) * | 2018-01-29 | 2018-06-15 | 北京搜狐新媒体信息技术有限公司 | 一种云计算资源管理方法及装置 |
CN108737325A (zh) * | 2017-04-13 | 2018-11-02 | 华为技术有限公司 | 一种多租户数据隔离方法、装置及系统 |
CN109040276A (zh) * | 2018-08-20 | 2018-12-18 | 郑州云海信息技术有限公司 | 一种构建云平台的方法、装置、计算机存储介质及终端 |
CN109412878A (zh) * | 2019-01-16 | 2019-03-01 | 紫光云数科技有限公司 | 多租户业务接入实现方法、装置及电子设备 |
Family Cites Families (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US10706025B2 (en) * | 2013-02-28 | 2020-07-07 | Amazon Technologies, Inc. | Database system providing single-tenant and multi-tenant environments |
US9660905B2 (en) * | 2013-04-12 | 2017-05-23 | Futurewei Technologies, Inc. | Service chain policy for distributed gateways in virtual overlay networks |
CN103957246B (zh) * | 2014-04-22 | 2017-03-01 | 广州杰赛科技股份有限公司 | 基于租户感知的动态负载均衡方法及系统 |
CN106712998A (zh) * | 2015-11-18 | 2017-05-24 | 中兴通讯股份有限公司 | 一种云平台资源管理方法、装置及系统 |
CN105450668A (zh) * | 2015-12-30 | 2016-03-30 | 中电长城网际系统应用有限公司 | 云安全服务实现系统和云安全服务实现方法 |
US10120734B1 (en) * | 2016-08-29 | 2018-11-06 | Equinix, Inc. | Application programming interface and services engine with application-level multi-tenancy |
-
2019
- 2019-01-16 CN CN201910037908.2A patent/CN109412878A/zh active Pending
- 2019-08-01 WO PCT/CN2019/098765 patent/WO2020147301A1/zh active Application Filing
Patent Citations (11)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102170457A (zh) * | 2010-02-26 | 2011-08-31 | 国际商业机器公司 | 向应用的多租户提供服务的方法和装置 |
US20130145006A1 (en) * | 2011-12-06 | 2013-06-06 | Sap Portals Israel Ltd | Multi-tenant infrastructure |
US20140101299A1 (en) * | 2012-10-06 | 2014-04-10 | International Business Machines Corporation | Techniques for implementing information services with tentant specific service level agreements |
CN104142864A (zh) * | 2014-08-07 | 2014-11-12 | 浪潮电子信息产业股份有限公司 | 一种基于虚拟化技术的多租户性能隔离框架 |
US20160087960A1 (en) * | 2014-09-19 | 2016-03-24 | Oracle International Corporation | Shared identity management (idm) integration in a multi-tenant computing environment |
CN104881749A (zh) * | 2015-06-01 | 2015-09-02 | 北京圆通慧达管理软件开发有限公司 | 面向多租户的数据管理方法和数据存储系统 |
CN107493314A (zh) * | 2016-06-10 | 2017-12-19 | 三星Sds株式会社 | 基于多租户的服务提供系统及方法 |
CN108737325A (zh) * | 2017-04-13 | 2018-11-02 | 华为技术有限公司 | 一种多租户数据隔离方法、装置及系统 |
CN108170520A (zh) * | 2018-01-29 | 2018-06-15 | 北京搜狐新媒体信息技术有限公司 | 一种云计算资源管理方法及装置 |
CN109040276A (zh) * | 2018-08-20 | 2018-12-18 | 郑州云海信息技术有限公司 | 一种构建云平台的方法、装置、计算机存储介质及终端 |
CN109412878A (zh) * | 2019-01-16 | 2019-03-01 | 紫光云数科技有限公司 | 多租户业务接入实现方法、装置及电子设备 |
Also Published As
Publication number | Publication date |
---|---|
CN109412878A (zh) | 2019-03-01 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2020147301A1 (zh) | 多租户业务接入实现方法、装置及电子设备 | |
WO2020177533A1 (zh) | 电子票据标识分配方法、电子票据生成方法、装置及系统 | |
US11343103B2 (en) | Sending cross-chain authenticatable messages | |
CN106817408B (zh) | 一种分布式服务器集群调度方法及装置 | |
CN110661662B (zh) | 一种轻量级的微服务配置方法 | |
WO2019061720A1 (zh) | 一种数据同步的方法和系统 | |
WO2019237594A1 (zh) | 会话保持方法、装置、计算机设备及存储介质 | |
CN105404542A (zh) | 云计算系统及在其上运行高性能计算的方法 | |
CN114189525B (zh) | 服务请求方法、装置和电子设备 | |
CN110597918A (zh) | 一种账户管理方法、装置及计算机可读存储介质 | |
CN106302640A (zh) | 数据请求处理方法及装置 | |
RU2008138577A (ru) | Сетевая система | |
WO2019223099A1 (zh) | 应用程序的调用方法及系统 | |
CN108667660B (zh) | 路由管理和业务路由的方法和装置及路由系统 | |
WO2017157111A1 (zh) | 防止内存数据丢失的的方法、装置和系统 | |
CN105376347A (zh) | 一种ip地址分配方法及系统 | |
CN111694845A (zh) | 一种基于Redis的标识生成方法和装置 | |
US10701027B2 (en) | Self-organizing distributed computation grid | |
CN108259605B (zh) | 一种基于多数据中心的数据调用系统及方法 | |
CN115277707B (zh) | 业务处理方法、装置、电子设备和存储介质 | |
CN115550424B (zh) | 一种数据缓存方法、装置、设备及存储介质 | |
CN117354312A (zh) | 访问请求处理方法、装置、系统、计算机设备和存储介质 | |
CN110378494B (zh) | 远程面签方法、装置、存储介质及计算机设备 | |
CN114860782B (zh) | 数据查询方法、装置、设备及介质 | |
CN106657360A (zh) | 一种Linux系统下NIS服务器的同步方法和系统 |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 19910660 Country of ref document: EP Kind code of ref document: A1 |
|
NENP | Non-entry into the national phase |
Ref country code: DE |
|
122 | Ep: pct application non-entry in european phase |
Ref document number: 19910660 Country of ref document: EP Kind code of ref document: A1 |