CN109412878A - Multi-tenant service access implementation method, device and electronic equipment - Google Patents

Multi-tenant service access implementation method, device and electronic equipment Download PDF

Info

Publication number
CN109412878A
CN109412878A CN201910037908.2A CN201910037908A CN109412878A CN 109412878 A CN109412878 A CN 109412878A CN 201910037908 A CN201910037908 A CN 201910037908A CN 109412878 A CN109412878 A CN 109412878A
Authority
CN
China
Prior art keywords
tenant
resource
srvice instance
service request
instance resource
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201910037908.2A
Other languages
Chinese (zh)
Inventor
马宾
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ziguang Cloud Digital Technology Co Ltd
Original Assignee
Ziguang Cloud Digital Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Ziguang Cloud Digital Technology Co Ltd filed Critical Ziguang Cloud Digital Technology Co Ltd
Priority to CN201910037908.2A priority Critical patent/CN109412878A/en
Publication of CN109412878A publication Critical patent/CN109412878A/en
Priority to PCT/CN2019/098765 priority patent/WO2020147301A1/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/50Network service management, e.g. ensuring proper service fulfilment according to agreements
    • H04L41/5041Network service management, e.g. ensuring proper service fulfilment according to agreements characterised by the time relationship between creation and deployment of a service
    • H04L41/5054Automatic deployment of services triggered by the service manager, e.g. service implementation by automatic configuration of network components
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/50Network service management, e.g. ensuring proper service fulfilment according to agreements
    • H04L41/5041Network service management, e.g. ensuring proper service fulfilment according to agreements characterised by the time relationship between creation and deployment of a service
    • H04L41/5051Service on demand, e.g. definition and deployment of services in real time

Abstract

The embodiment of the present application provides a kind of multi-tenant service access implementation method, device and electronic equipment, through API gateway equipment when receiving the service request of user's transmission, srvice instance resource associated with tenant belonging to the service request is sent is obtained according to the incidence relation between the tenant prestored and srvice instance resource.And the service request for carrying srvice instance resource obtained is sent to management server, so that management server calls srvice instance resource identical with the srvice instance resource to handle service request.The application is used in combination API gateway equipment and carries out route processing to service request, it avoids in the prior art because that need to invade due to the service of server-side is internally embedded routing module srvice instance bring application code, to reduce the complexity of the srvice instance of server-side, only focus on srvice instance in business processing.

Description

Multi-tenant service access implementation method, device and electronic equipment
Technical field
This application involves field of communication technology, in particular to a kind of multi-tenant service access implementation method, device and Electronic equipment.
Background technique
With the development of cloud computing technology, the software that SaaS (Software as a Service, software are to service) changes is Through becoming the preferred approach of many small business's sophistications, it reduces enterprise's purchase, building and maintenance infrastructure With the cost of application program.A most basic feature of SaaS software is can to support multi-tenant, that is, that disposes beyond the clouds is same Covering software systems can be by multiple enterprises or user sharing.Although software code is shared same portion, each other Data are mutually invisible, and in function, there is also certain differences in appearance.It is existing in order to realize the characteristic of this multi-tenant Frequently with the module for being internally embedded data routing in service in technology, to realize the routing function of different user business.And business Its major function of processing environment is to carry out business processing, is developed generally as separate modular.And in the prior art in business The function of routing is introduced in example, then needs to be embedded in the relevant application code of other routings.Srvice instance both needs to carry out industry Business processing, carries out routing function, processing pressure is larger, and the complexity of server-side is higher again.
Summary of the invention
In view of this, the purpose of the application is, a kind of multi-tenant service access implementation method, device and electronics are provided and set For to alleviate the processing pressure of server-side, reduce the complexity of server-side.
To achieve the goals above, the embodiment of the present application the technical solution adopted is as follows:
In a first aspect, the embodiment of the present application provides a kind of multi-tenant service access implementation method, it is applied to API gateway equipment, institute It states API gateway equipment to connect with management server communication, the management server is pre-configured with and is stored with for processing business The srvice instance resource of request, which comprises
Receive the service request that user sends, wherein tenant's information belonging to the user is carried in the service request;
According to the incidence relation between the tenant prestored and srvice instance resource, the user institute with the transmission service request is obtained The associated srvice instance resource of the tenant of category;
The service request for carrying the srvice instance resource obtained is sent to the management server, so that the management takes Be engaged in device call identical with the srvice instance resource in service request srvice instance resource to the service request at Reason.
Optionally, the method also includes:
Count the request amount for the service request that tenant initiates in preset duration;
Detect associated with tenant srvice instance resource quantity whether process resource needed for the request amount with the tenant Quantity match, if mismatch, the quantity of srvice instance resource associated with the tenant is adjusted, is adjusted Incidence relation between rear srvice instance resource and the tenant;
Incidence relation obtained after adjustment is sent to the management server.
Optionally, the step of quantity to srvice instance resource associated with the tenant is adjusted, comprising:
The quantity of the process resource needed for the request amount of the tenant is more than srvice instance resource associated with the tenant Quantity and exceedance when being greater than the first preset threshold, increase srvice instance resource for the tenant, and increased business is real Example resource is associated with the tenant.
Optionally, the step of quantity to srvice instance resource associated with the tenant is adjusted, further includes:
The quantity of the process resource needed for the request amount of the tenant is lower than srvice instance resource associated with the tenant Quantity and when being greater than the second preset threshold lower than value, reduce srvice instance resource for the tenant, and it is real to release reduced business Being associated between example resource and the tenant.
Second aspect, the embodiment of the present application also provide a kind of multi-tenant service access implementation method, are applied to management service Device, the management server and API gateway equipment communicate to connect, and are pre-configured with and are stored with for locating in the management server Manage the srvice instance resource of service request, which comprises
The service request that the API gateway equipment is sent is received, the service request is that the API gateway equipment is receiving use It is obtained according to the incidence relation between the tenant and srvice instance resource prestored to include and this when the service request that family is sent The service request of the associated srvice instance resource of tenant belonging to user;
Obtain the tenant's information carried in the service request and srvice instance resource associated with the tenant;
It is obtained from the srvice instance resource of storage and the business of srvice instance resource consistence entrained by service request reality Example resource;
The srvice instance resource obtained is called to handle the service request.
Optionally, before described the step of receiving the service request that the API gateway equipment is sent, the method is also wrapped It includes:
Receive tenant's registration request that tenant sends, wherein the use that the tenant includes is carried in tenant's registration request Amount amount, expected request amount and business processing requirement;
Number of users, expected request amount and the business processing for including according to the tenant require to be that the tenant distributes matched industry Business example resource, and be tenant's allocation database resource;
The incidence relation between the tenant, the srvice instance resource and the database resource is established, by the association Relationship storage, and the incidence relation is sent to the API gateway equipment.
Optionally, the method also includes:
Receive the incidence relation of tenant adjusted and srvice instance resource that the API gateway equipment is sent, wherein the pass The request amount for the service request that connection relationship is initiated in preset duration by the API gateway equipment according to the tenant, which adjusts, to be obtained ?;
The incidence relation between the tenant and srvice instance resource of storage is carried out more according to the incidence relation received Newly.
Optionally, the method also includes:
Monitoring that there are when srvice instance resource exception, enable an idle traffic example resource to replace in the presence of abnormal business Example resource;
Tenant associated with abnormal srvice instance resource and database resource are obtained according to the incidence relation of storage;
The tenant of acquisition and database resource are associated with the idle traffic example resource enabled.
It is optionally, described to call the step of srvice instance resource obtained is to handle the service request, Include:
The incidence relation of inquiry storage obtains data associated with the srvice instance resource of the tenant and acquisition Base resource;
If the service request is data read request, finds from the database resource obtained and asked with data reading Corresponding data are sought, the data found are returned into the tenant by the API gateway equipment;
If the service request is data write request, the number that the data carried in the data write request deposit is obtained According in base resource.
The third aspect, the application also provide a kind of multi-tenant service access realization device, are applied to API gateway equipment, institute It states API gateway equipment to connect with management server communication, the management server is pre-configured with and is stored with for processing business The srvice instance resource of request, described device include:
First receiving module, for receiving the service request of user's transmission, wherein carry the user in the service request Affiliated tenant's information;
First resource obtains module, for being obtained and being sent according to the incidence relation between the tenant prestored and srvice instance resource The associated srvice instance resource of tenant belonging to the user of the service request;
Sending module, for the service request for carrying the srvice instance resource obtained to be sent to the management server, So that the management server calls srvice instance resource identical with the srvice instance resource in the service request to described Service request is handled.
Fourth aspect, the application also provide a kind of multi-tenant service access realization device, are applied to management server, described Management server and API gateway equipment communicate to connect, and are pre-configured with and are stored with for processing business in the management server The srvice instance resource of request, described device include:
Second receiving module, the service request sent for receiving the API gateway equipment, the service request are the API Gateway is when receiving service request transmitted by user, according to the association between the tenant and srvice instance resource prestored The relationship service request obtained comprising srvice instance resource associated with tenant belonging to the user;
Secondary resource obtains module, for obtaining the tenant's information carried in the service request and industry associated with the tenant Business example resource;
Information resources obtain module, for obtaining from the srvice instance resource of storage and business entrained by the service request The consistent srvice instance resource of example resource;
Processing module, for calling the srvice instance resource obtained to handle the service request.
5th aspect, the application also provide a kind of electronic equipment, including memory, processor and are stored in the memory Computer program that is upper and can running on the processor, the processor realize above-mentioned method step when executing described program Suddenly.
6th aspect, the application also provide a kind of readable storage medium storing program for executing, computer journey are stored on the readable storage medium storing program for executing Sequence, the computer program execute above-mentioned method and step when being run by processor.
A kind of multi-tenant service access implementation method, device and electronic equipment provided by the embodiments of the present application, pass through API net Equipment is closed when receiving the service request of user's transmission, according to the incidence relation between the tenant prestored and srvice instance resource Obtain srvice instance resource associated with tenant belonging to the service request is sent.And srvice instance obtained will be carried The service request of resource is sent to management server, so that management server calls business identical with the srvice instance resource real Example resource handles service request.The application is used in combination API gateway equipment and carries out route processing to service request, avoids It is in the prior art because that need to invade due to the service of server-side is internally embedded routing module srvice instance bring application code Enter, to reduce the complexity of the srvice instance of server-side, only focuses on srvice instance in business processing.
To enable the above objects, features, and advantages of the application to be clearer and more comprehensible, preferred embodiment is cited below particularly, and cooperate Appended attached drawing, is described in detail below.
Detailed description of the invention
Technical solution in ord to more clearly illustrate embodiments of the present application, below will be to needed in the embodiment attached Figure is briefly described, it should be understood that the following drawings illustrates only some embodiments of the application, therefore is not construed as pair The restriction of range for those of ordinary skill in the art without creative efforts, can also be according to this A little attached drawings obtain other relevant attached drawings.
Fig. 1 is the application scenarios schematic diagram of multi-tenant service access implementation method provided by the embodiments of the present application.
Fig. 2 is the stream of the multi-tenant service access implementation method provided by the embodiments of the present application applied to API gateway equipment Cheng Tu.
Fig. 3 is the another of the multi-tenant service access implementation method provided by the embodiments of the present application applied to API gateway equipment One flow chart.
Fig. 4 is the process of the multi-tenant service access implementation method provided by the embodiments of the present application applied to management server Figure.
Fig. 5 is the another of the multi-tenant service access implementation method provided by the embodiments of the present application applied to management server Flow chart.
Fig. 6 is the function of the multi-tenant service access realization device provided by the embodiments of the present application applied to API gateway equipment It can module frame chart.
Fig. 7 is the function of the multi-tenant service access realization device provided by the embodiments of the present application applied to management server Module frame chart.
Fig. 8 is the structural block diagram of electronic equipment provided by the embodiments of the present application.
Specific embodiment
Below in conjunction with attached drawing in the embodiment of the present application, technical solutions in the embodiments of the present application carries out clear, complete Ground description, it is clear that described embodiments are only a part of embodiments of the present application, instead of all the embodiments.Usually exist The component of the embodiment of the present application described and illustrated in attached drawing can be arranged and be designed with a variety of different configurations herein.Cause This, is not intended to limit claimed the application's to the detailed description of the embodiments herein provided in the accompanying drawings below Range, but it is merely representative of the selected embodiment of the application.Based on embodiments herein, those skilled in the art are not being done Every other embodiment obtained under the premise of creative work out, shall fall in the protection scope of this application.
It should also be noted that similar label and letter indicate similar terms in following attached drawing, therefore, once a certain Xiang Yi It is defined in a attached drawing, does not then need that it is further defined and explained in subsequent attached drawing.Meanwhile the application's In description unless specifically defined or limited otherwise, term " installation ", " setting ", " connection " shall be understood in a broad sense, for example, can To be to be fixedly connected, may be a detachable connection, or be integrally connected;It can be mechanical connection, be also possible to be electrically connected;It can To be to be connected directly, the connection inside two elements can also be can be indirectly connected through an intermediary.For this field For those of ordinary skill, the concrete meaning of above-mentioned term in this application can be understood with concrete condition.
Referring to Fig. 1, the application scenarios that Fig. 1 is multi-tenant service access implementation method provided by the embodiments of the present application are illustrated Figure.It include only depicting six in management server 200, API gateway equipment 100 and multiple terminal devices 300(figure in the scene It is a).Management server 200, API gateway equipment 100 and each terminal device 300 can be connected by network communication.Wherein, the end End equipment 300 is to replace terminal device 300 corresponding in terminal device 300(the present embodiment of user with user), and multiple use Family may make up tenant (two are schematically drawn in figure), such as unit of company, and the said firm is a tenant, and the said firm Internal employee is user included by the tenant.And management server 200 can provide process resource for the service request of user And database resource, API gateway equipment 100 can provide data routing function.
Referring to figure 2., Fig. 2 is a kind of multi-tenant service access realization applied to API gateway equipment 100 shown in FIG. 1 The flow chart of method, below by the method includes each step be described in detail.
Step S110 receives the service request that user sends, wherein carried belonging to the user in the service request Tenant's information.
Step S120 is obtained according to the incidence relation between the tenant prestored and srvice instance resource and is sent the industry The associated srvice instance resource of tenant belonging to the user of business request.
The service request for carrying the srvice instance resource obtained is sent to the management server by step S130 200, so that the management server 200 calls srvice instance resource identical with the srvice instance resource in the service request The service request is handled.
In the present embodiment, before executing step S110, each tenant can initiate tenant's registration to management server 200 to be asked It asks to carry out the Account Registration of tenant.Wherein, number of users that the tenant included is carried in tenant's registration request, should The expection request amount of tenant and to business processing require etc..Management server 200 in receiving tenant's registration request, wherein Configuration module above-mentioned number of users according to included in tenant's registration request, expected request amount and business processing require etc. Matched srvice instance resource is distributed for the tenant, wherein the srvice instance resource is to be used for the user that the tenant is included Service request process resource.For different tenants, it can be capable of calling identical service, such as different companies can be with The card punching service system in cloud is called, but need to ensure the isolation of the data between different tenants, to ensure data each other Invisibility.It is therefore desirable to have different processing environments handles the business of different company, and in order to close resource Reason utilizes, this relates to the assignment problem of resource.
Possible different, the tenant the service request amounts of the quantity of user may be different and for business in different tenants Processing requirement, such as real-time, the efficiency of business processing, the insulation request of data of business processing etc., have differences.Have The user for including in tenant is more, then can distribute more srvice instance resource and ask for handling the relevant business of the tenant It asks.And the service request amount of some tenants is seldom, then in order to avoid the waste of resource, it is real less business can be distributed for the tenant Example resource.
And the distribution for database resource, any one mode below can be used and be allocated: self contained data base;Altogether Enjoy database, independent schema;Shared data bank, shared schema, shared data table.Wherein, the mode of self contained data base is An individual database is distributed for each tenant, the user data isolation level highest of this mode, safety are best, but Higher cost.The extension design that independent database facilitates simplified data model is distributed for each tenant, meets different rents The unique need at family, and if break down, data recovery is relatively easy to.This mode can for for data isolation require compared with High tenant, such as bank, hospital etc..
Wherein, shared data bank, independent schema mode, that is, multiple tenants can share a database, but be each A tenant distributes an independent schema, wherein includes multiple schema in a database.This mode may be implemented one Determine the logical data isolation of degree, but is not entirely isolated.Each database can support more tenant's number under this mode Amount, if but break down, data restore upper relatively difficult, because the data of other tenants can be involved.
And for shared data bank, shared schema, this mode of shared data table, i.e., a number is shared between different tenants According to library, the same schema, the same tables of data.In one data of every insertion, the mark of a user is needed, so The data of different users can be distinguished in same tables of data.This mode degree of share highest, data isolation rank are most Low, maintenance and acquisition cost are minimum, and tenant's quantity that each database is supported is maximum.
It, can be according to the correlation of business processing requirement and tenant in tenant's registration request that tenant initiates based on the studies above Information is distributed corresponding database resource for tenant.
After being assigned srvice instance resource and database resource, tenant, srvice instance resource and database can be established Incidence relation between resource, for example, relationship, tenant between tenant and srvice instance resource and the relationship between database, Relationship between srvice instance resource and database resource.The incidence relation of foundation is saved, and is sent to API gateway Equipment 100.API gateway equipment 100 is stored after the incidence relation for receiving the transmission of management server 200.
API gateway equipment 100 can be somebody's turn to do when receiving the service request of some user transmission according to the service request Tenant's information belonging to user.And according to the incidence relation between the tenant prestored and srvice instance resource, obtains and send institute State the associated srvice instance resource of tenant belonging to the user of service request.
The service request for carrying srvice instance resource obtained can be sent to management service by API gateway equipment 100 Device 200, the calling module in management server 200 call directly corresponding srvice instance resource to the service request of the user It is handled.
In the present embodiment, management server 200 is somebody's turn to do when receiving the service request of the transmission of API gateway equipment 100 The tenant's information and srvice instance resource associated with the tenant carried in service request.It is provided from preconfigured srvice instance The srvice instance resource with srvice instance resource consistence entrained in the service request is obtained in source, and the srvice instance is called to provide Source handles the service request.
In this way, realizing the function of routing by API gateway equipment 100, the srvice instance in management server 200 is only needed Business processing item is focused on, processing pressure is alleviated.Also, mould is routed without embedding data in srvice instance module Block, also avoids the intrusion of the external relevant application code of routing, and independence is higher.
It can be seen from the above, the srvice instance resource that management server 200 is distributed by each tenant is to be asked according to tenant's registration Information in asking is configured, only a provisioning process.In practical implementation, the request amount of tenant may be relative to its elder generation Preceding expection request amount when being registered has deviation.Therefore, referring to Fig. 3, in the present embodiment, the multi-tenant service access is real Existing method is further comprising the steps of:
Step S210 counts the request amount for the service request that tenant initiates in preset duration.
Step S220, detect associated with tenant srvice instance resource quantity whether the request amount institute with the tenant The quantity of the process resource needed matches, if mismatching, is executing following steps S230.
Step S230 is adjusted the quantity of srvice instance resource associated with the tenant, the industry after being adjusted The incidence relation being engaged between example resource and the tenant.
Incidence relation obtained after adjustment is sent to the management server 200 by step S240.
In the present embodiment, API gateway equipment 100 can be spaced preset duration and count the business that tenant initiates in the preset duration The request amount of request.Detect srvice instance resource associated by the tenant quantity whether place needed for the request amount with the tenant The quantity of reason resource matches.If mismatching, the quantity of srvice instance resource associated with the tenant can be adjusted. If matching, does not deal with.
Optionally, the quantity of the process resource needed for the request amount of the tenant is more than industry associated with the tenant Be engaged in example resource quantity, and exceedance be greater than the first preset threshold when, for the tenant increase srvice instance resource, and will Increased srvice instance resource is associated with the tenant.In this way, can increase in the case where the request amount of tenant increases for tenant With srvice instance resource, the load excessive of the associated srvice instance resource of the tenant is avoided, and influences the business to tenant The processing of request.
In addition, the quantity of the process resource needed for the request amount of the tenant is lower than business associated with the tenant The quantity of example resource and when being greater than the second preset threshold lower than amount, reduces srvice instance resource for the tenant, and releases reduction Srvice instance resource and the tenant between be associated with.In this way, reducing and matching for tenant in the case where the request amount of tenant is reduced The srvice instance resource set avoids the problem that resources idle, waste.
In the present embodiment, API gateway equipment 100 is adjusted to the incidence relation between tenant and srvice instance resource Afterwards, incidence relation adjusted is sent to management server 200.Management server 200 is receiving association pass adjusted After system, configuration service module in management server 200 by according to the incidence relation received to the tenant of storage with Incidence relation between srvice instance resource is updated.
Referring to Fig. 4, another embodiment of the application also provides a kind of multi-tenant industry applied to above-mentioned management server 200 Business access implementing method, method includes the following steps:
Step S410, receives the service request that the API gateway equipment 100 is sent, and the service request is that the API gateway is set Standby 100 when receiving the service request of user's transmission, according to the incidence relation between the tenant and srvice instance resource prestored Service request obtained comprising srvice instance resource associated with tenant belonging to the user.
Step S420 obtains the tenant's information carried in the service request and srvice instance associated with tenant money Source.
Step S430 is obtained and srvice instance resource entrained by the service request from the srvice instance resource of storage Consistent srvice instance resource.
Step S440 calls the srvice instance resource of acquisition to handle the service request.
In the present embodiment, management server 200 receive API gateway equipment 100 send service request the step of it Before, the method also includes following steps:
Receive tenant's registration request that tenant sends, wherein the use that the tenant includes is carried in tenant's registration request Amount amount, expected request amount and business processing requirement.
Number of users, expected request amount and the business processing for including according to the tenant require to be that the tenant distributes matching Srvice instance resource, and be tenant's allocation database resource.
The incidence relation between the tenant, the srvice instance resource and the database resource is established, it will be described Incidence relation storage, and the incidence relation is sent to the API gateway equipment 100.
Further, in the present embodiment, management server 200 also can receive the tune that the API gateway equipment 100 is sent The incidence relation of tenant and srvice instance resource after whole, wherein the incidence relation is 100 basis of API gateway equipment The request amount for the service request that the tenant initiates in preset duration adjusts acquisition.According to the incidence relation received Incidence relation between the tenant and srvice instance resource of storage is updated.
Wherein, it can be found in the multi-tenant service access implementation method in a upper embodiment about the detailed process of above-mentioned steps In associated description, details are not described herein.
In the present embodiment, management server 200 when calling corresponding srvice instance resource to handle service request, It can be realized by following steps:
The incidence relation of inquiry storage obtains data associated with the srvice instance resource of the tenant and acquisition Base resource.
If the service request is data read request, found from the database resource obtained and the data The data found are returned to the tenant by the API gateway equipment 100 by the corresponding data of read request.
If the service request is data write request, the institute that the data carried in the data write request deposit is obtained It states in database resource.
In addition, referring to Fig. 5, in the present embodiment, the multi-tenant service access implementation method is further comprising the steps of:
Step S510 is monitoring that there are when srvice instance resource exception, enable an idle traffic example resource to replace presence Abnormal srvice instance resource.
Step S520 obtains tenant associated with abnormal srvice instance resource and data according to the incidence relation of storage Base resource.
Step S530 closes the tenant of acquisition and database resource with the idle traffic example resource enabled Connection.
It include service-aware module in management server 200, service-aware module can real-time monitoring business in the present embodiment Whether example resource there is exception, for example whether offline, if if there is offline situation, at the business that influences whether corresponding tenant Reason.Therefore, service-aware module monitors to there are when srvice instance resource exception, then enable an idle traffic example resource with The srvice instance resource of presence exception is replaced, i.e. triggering startup separator switching flow.Wherein, which is Srvice instance resource not associated with any tenant in management server 200.
Also, the related service that abnormal srvice instance resource can will be present is switched to the idle traffic example money of the enabling Source.Also, by the idle traffic example of tenant and database resource and enabling with the abnormal srvice instance resource associations Resource establishes association.Release abnormal srvice instance resource and the incidence relation of corresponding tenant and database resource.
Multi-tenant service implementation method provided by the present embodiment, it is real in combination with the routing function of API gateway equipment 100 The now srvice instance resource of the corresponding srvice instance resource transfer in the service request according to transmitted by API gateway equipment 100 The effect handled.Routing function is carried out without itself, processing pressure is small, and need not be embedded in the relevant application of other routings Program, independence are higher.
Referring to Fig. 6, another embodiment of the application also provides a kind of multi-tenant applied to above-mentioned API gateway equipment 100 Service access realization device 110, the multi-tenant service access realization device 110 include:
First receiving module 111, for receiving the service request of user's transmission, wherein carried in the service request described Tenant's information belonging to user.It is appreciated that first receiving module 111 can be used for executing above-mentioned steps S110, about this The detailed implementation of first receiving module 111 is referred to above-mentioned to the related content of step S110.
First resource obtains module 112, for being obtained according to the incidence relation between the tenant prestored and srvice instance resource Obtain srvice instance resource associated with tenant belonging to the user for sending the service request.It is appreciated that the first resource Obtaining module 112 can be used for executing above-mentioned steps S120, and the detailed implementation for obtaining module 112 about the first resource can With referring to above-mentioned to the related content of step S120.
Sending module 113, for the service request for carrying the srvice instance resource obtained to be sent to the management Server 200, so that the management server 200 calls business identical with the srvice instance resource in the service request real Example resource handles the service request.It is appreciated that the sending module 113 can be used for executing above-mentioned steps S130, Detailed implementation about the sending module 113 is referred to above-mentioned to the related content of step S130.
Referring to Fig. 7, another embodiment of the application also provides a kind of multi-tenant industry applied to above-mentioned management server 200 Business access realization device 110, the multi-tenant service access realization device 110 include:
Second receiving module 114, the service request sent for receiving the API gateway equipment 100, the service request is institute API gateway equipment 100 is stated when receiving service request transmitted by user, according to the tenant and srvice instance resource prestored it Between the incidence relation service request obtained comprising srvice instance resource associated with tenant belonging to the user.It can be with Understand, which can be used for executing above-mentioned steps S410, the detailed reality about second receiving module 114 Existing mode is referred to above-mentioned to the related content of step S410.
Secondary resource obtain module 115, for obtain the tenant's information carried in the service request and with tenant's phase Associated srvice instance resource.It is appreciated that the Secondary resource, which obtains module 115, can be used for executing above-mentioned steps S420, close It is referred in the detailed implementation that the Secondary resource obtains module 115 above-mentioned to the related content of step S420.
Information resources obtain module 116, are taken for obtaining from the srvice instance resource of storage with the service request The srvice instance resource of the srvice instance resource consistence of band.It can be used for executing it is appreciated that the information resources obtain module 116 Above-mentioned steps S430, the detailed implementation for obtaining module 116 about the information resources are referred to above-mentioned have step S430 The content of pass.
Processing module 117, for calling the srvice instance resource obtained to handle the service request.It can be with Understand, which can be used for executing above-mentioned steps S440, and the detailed implementation about the processing module 117 can With referring to above-mentioned to the related content of step S440.
As shown in figure 8, the embodiment of the present application also provides a kind of electronic equipment, the electronic equipment can be above-mentioned API net The either above-mentioned management server 200 of equipment 100 is closed, the electronic equipment 100 includes multi-tenant service access realization device 110, memory 120, processor 130 and communication unit 140.Wherein, which can be Multi-tenant service access realization device 110 in API gateway equipment 100, the multi-tenant industry being also possible in management server 200 Business access realization device 110.
The memory 120, processor 130 and each element of communication unit 140 are directly or indirectly electrical between each other Connection, to realize the transmission or interaction of information.For example, these elements can pass through one or more communication bus or letter between each other Number line, which is realized, to be electrically connected.It is stored in memory 120 and is stored in the storage in the form of software or firmware (Firmware) Software function module in device 120, the software program and mould that the processor 130 is stored in memory 120 by operation Block, such as the multi-tenant service access realization device 110 in the embodiment of the present invention, at various function application and data Reason, i.e. multi-tenant service access implementation method in the realization embodiment of the present invention.
Wherein, the memory 120 may be, but not limited to, random access memory (Random Access Memory, RAM), read-only memory (Read Only Memory, ROM), programmable read only memory (Programmable Read-Only Memory, PROM), erasable read-only memory (Erasable Programmable Read-Only Memory, EPROM), electricallyerasable ROM (EEROM) (Electric Erasable Programmable Read-Only Memory, EEPROM) etc..Wherein, memory 120 is for storing program, the processor 130 after receiving and executing instruction, Execute described program.The communication unit 140 is used for the communication established between network node.
The processor 130 may be a kind of IC chip, the processing capacity with signal.Above-mentioned processor 130 can be general processor, such as central processing unit (Central Processing Unit, CPU).
The embodiment of the present application also provides a kind of readable storage medium storing program for executing, the readable storage medium storing program for executing is stored with computer and can hold The multi-tenant service access implementation method in above-mentioned any means embodiment can be performed in row instruction, the computer executable instructions.
In conclusion the embodiment of the present application provides a kind of multi-tenant service access implementation method, device and electronic equipment, lead to API gateway equipment 100 is crossed when receiving the service request of user's transmission, according between the tenant prestored and srvice instance resource Incidence relation obtain and send the associated srvice instance resource of tenant belonging to the service request.And carrying is obtained The service request of srvice instance resource be sent to management server 200 so that management server 200 is called and the srvice instance The identical srvice instance resource of resource handles service request.The application is used in combination API gateway equipment 100 and asks to business Seek carry out route processing, avoid it is in the prior art because need to due to the service of server-side is internally embedded routing module to business reality Example bring application code intrusion, to reduce the complexity of the srvice instance of server-side, only focuses on srvice instance in industry Business processing.
In embodiment provided herein, it should be understood that disclosed device and method, it can also be by other Mode realize.The apparatus embodiments described above are merely exemplary, for example, the flow chart and block diagram in attached drawing are shown Architectural framework in the cards, function and the behaviour of device according to an embodiment of the present application, method and computer program product Make.In this regard, each box in flowchart or block diagram can represent a part of a module, section or code, institute The a part for stating module, section or code includes one or more executable instructions for implementing the specified logical function. It should also be noted that function marked in the box can also be to be different from attached drawing in some implementations as replacement The sequence marked occurs.For example, two continuous boxes can actually be basically executed in parallel, they sometimes can also be by Opposite sequence executes, and this depends on the function involved.It is also noted that each box in block diagram and or flow chart, And the combination of the box in block diagram and or flow chart, hardware can be based on the defined function of execution or the dedicated of movement System realize, or can realize using a combination of dedicated hardware and computer instructions.
It should be noted that, in this document, the terms "include", "comprise" or its any other variant are intended to non-row His property includes, so that the process, method, article or equipment for including a series of elements not only includes those elements, and And further include other elements that are not explicitly listed, or further include for this process, method, article or equipment institute it is intrinsic Element.In the absence of more restrictions, the element limited by sentence "including a ...", it is not excluded that including institute State in the process, method, article or equipment of element that there is also other identical elements.
The foregoing is merely preferred embodiment of the present application, are not intended to limit this application, for the skill of this field For art personnel, various changes and changes are possible in this application.Within the spirit and principles of this application, made any to repair Change, equivalent replacement, improvement etc., should be included within the scope of protection of this application.It should also be noted that similar label and letter exist Similar terms are indicated in following attached drawing, therefore, once being defined in a certain Xiang Yi attached drawing, are then not required in subsequent attached drawing It is further defined and explained.

Claims (13)

1. a kind of multi-tenant service access implementation method, which is characterized in that be applied to API gateway equipment, the API gateway equipment It is connect with management server communication, the management server is pre-configured with and is stored with the srvice instance for processing business request Resource, which comprises
Receive the service request that user sends, wherein tenant's information belonging to the user is carried in the service request;
According to the incidence relation between the tenant prestored and srvice instance resource, the user institute with the transmission service request is obtained The associated srvice instance resource of the tenant of category;
The service request for carrying the srvice instance resource obtained is sent to the management server, so that the management takes Be engaged in device call identical with the srvice instance resource in service request srvice instance resource to the service request at Reason.
2. multi-tenant service access implementation method according to claim 1, which is characterized in that the method also includes:
Count the request amount for the service request that tenant initiates in preset duration;
Detect associated with tenant srvice instance resource quantity whether process resource needed for the request amount with the tenant Quantity match, if mismatch, the quantity of srvice instance resource associated with the tenant is adjusted, is adjusted Incidence relation between rear srvice instance resource and the tenant;
Incidence relation obtained after adjustment is sent to the management server.
3. multi-tenant service access implementation method according to claim 2, which is characterized in that described to related to the tenant The step of quantity of the srvice instance resource of connection is adjusted, comprising:
The quantity of the process resource needed for the request amount of the tenant is more than srvice instance resource associated with the tenant Quantity and exceedance when being greater than the first preset threshold, increase srvice instance resource for the tenant, and increased business is real Example resource is associated with the tenant.
4. multi-tenant service access implementation method according to claim 3, which is characterized in that described to related to the tenant The step of quantity of the srvice instance resource of connection is adjusted, further includes:
The quantity of the process resource needed for the request amount of the tenant is lower than srvice instance resource associated with the tenant Quantity and when being greater than the second preset threshold lower than value, reduce srvice instance resource for the tenant, and it is real to release reduced business Being associated between example resource and the tenant.
5. a kind of multi-tenant service access implementation method, which is characterized in that be applied to management server, the management server with API gateway equipment communicates to connect, and is pre-configured with and is stored with real for the business of processing business request in the management server Example resource, which comprises
The service request that the API gateway equipment is sent is received, the service request is that the API gateway equipment is receiving use It is obtained according to the incidence relation between the tenant and srvice instance resource prestored to include and this when the service request that family is sent The service request of the associated srvice instance resource of tenant belonging to user;
Obtain the tenant's information carried in the service request and srvice instance resource associated with the tenant;
It is obtained from the srvice instance resource of storage and the business of srvice instance resource consistence entrained by service request reality Example resource;
The srvice instance resource obtained is called to handle the service request.
6. multi-tenant service access implementation method according to claim 5, which is characterized in that described to receive the API net Before the step of closing the service request that equipment is sent, the method also includes:
Receive tenant's registration request that tenant sends, wherein the use that the tenant includes is carried in tenant's registration request Amount amount, expected request amount and business processing requirement;
Number of users, expected request amount and the business processing for including according to the tenant require to be that the tenant distributes matched industry Business example resource, and be tenant's allocation database resource;
The incidence relation between the tenant, the srvice instance resource and the database resource is established, by the association Relationship storage, and the incidence relation is sent to the API gateway equipment.
7. multi-tenant service access implementation method according to claim 6, which is characterized in that the method also includes:
Receive the incidence relation of tenant adjusted and srvice instance resource that the API gateway equipment is sent, wherein the pass The request amount for the service request that connection relationship is initiated in preset duration by the API gateway equipment according to the tenant, which adjusts, to be obtained ?;
The incidence relation between the tenant and srvice instance resource of storage is carried out more according to the incidence relation received Newly.
8. multi-tenant service access implementation method according to claim 6, which is characterized in that the method also includes:
Monitoring that there are when srvice instance resource exception, enable an idle traffic example resource to replace in the presence of abnormal business Example resource;
Tenant associated with abnormal srvice instance resource and database resource are obtained according to the incidence relation of storage;
The tenant of acquisition and database resource are associated with the idle traffic example resource enabled.
9. multi-tenant service access implementation method according to claim 6, which is characterized in that described to call the described of acquisition The step of srvice instance resource is to handle the service request, comprising:
The incidence relation of inquiry storage obtains data associated with the srvice instance resource of the tenant and acquisition Base resource;
If the service request is data read request, finds from the database resource obtained and asked with data reading Corresponding data are sought, the data found are returned into the tenant by the API gateway equipment;
If the service request is data write request, the number that the data carried in the data write request deposit is obtained According in base resource.
10. a kind of multi-tenant service access realization device, which is characterized in that be applied to API gateway equipment, the API gateway is set Standby to connect with management server communication, the management server is pre-configured with and is stored with real for the business of processing business request Example resource, described device include:
First receiving module, for receiving the service request of user's transmission, wherein carry the user in the service request Affiliated tenant's information;
First resource obtains module, for being obtained and being sent according to the incidence relation between the tenant prestored and srvice instance resource The associated srvice instance resource of tenant belonging to the user of the service request;
Sending module, for the service request for carrying the srvice instance resource obtained to be sent to the management server, So that the management server calls srvice instance resource identical with the srvice instance resource in the service request to described Service request is handled.
11. a kind of multi-tenant service access realization device, which is characterized in that be applied to management server, the management server It is communicated to connect with API gateway equipment, be pre-configured in the management server and be stored with the business for processing business request Example resource, described device include:
Second receiving module, the service request sent for receiving the API gateway equipment, the service request are the API Gateway is when receiving service request transmitted by user, according to the association between the tenant and srvice instance resource prestored The relationship service request obtained comprising srvice instance resource associated with tenant belonging to the user;
Secondary resource obtains module, for obtaining the tenant's information carried in the service request and industry associated with the tenant Business example resource;
Information resources obtain module, for obtaining from the srvice instance resource of storage and business entrained by the service request The consistent srvice instance resource of example resource;
Processing module, for calling the srvice instance resource obtained to handle the service request.
12. a kind of electronic equipment, including memory, processor and it is stored on the memory and can transports on the processor Capable computer program, which is characterized in that the processor realizes claim 1-4 or claim 5- when executing described program Method and step described in any one of 9.
13. a kind of readable storage medium storing program for executing, which is characterized in that be stored with computer program on the readable storage medium storing program for executing, the computer The method and step as described in any one of claim 1-4 or claim 5-9 is executed when program is run by processor.
CN201910037908.2A 2019-01-16 2019-01-16 Multi-tenant service access implementation method, device and electronic equipment Pending CN109412878A (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201910037908.2A CN109412878A (en) 2019-01-16 2019-01-16 Multi-tenant service access implementation method, device and electronic equipment
PCT/CN2019/098765 WO2020147301A1 (en) 2019-01-16 2019-08-01 Method and apparatus for implementing multi-tenant service access, and electronic device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910037908.2A CN109412878A (en) 2019-01-16 2019-01-16 Multi-tenant service access implementation method, device and electronic equipment

Publications (1)

Publication Number Publication Date
CN109412878A true CN109412878A (en) 2019-03-01

Family

ID=65462377

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910037908.2A Pending CN109412878A (en) 2019-01-16 2019-01-16 Multi-tenant service access implementation method, device and electronic equipment

Country Status (2)

Country Link
CN (1) CN109412878A (en)
WO (1) WO2020147301A1 (en)

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110784551A (en) * 2019-11-05 2020-02-11 中国建设银行股份有限公司 Data processing method, device, equipment and medium based on multiple tenants
WO2020147301A1 (en) * 2019-01-16 2020-07-23 紫光云数科技有限公司 Method and apparatus for implementing multi-tenant service access, and electronic device
CN111506411A (en) * 2020-04-21 2020-08-07 北京思特奇信息技术股份有限公司 Multi-tenant service management method and system
CN112069210A (en) * 2020-08-21 2020-12-11 北京首汽智行科技有限公司 Saas platform multi-tenant data isolation method
CN112118565A (en) * 2020-08-14 2020-12-22 金蝶医疗软件科技有限公司 Multi-tenant service gray level publishing method and device, computer equipment and storage medium
CN112308377A (en) * 2020-09-30 2021-02-02 北京沃东天骏信息技术有限公司 Resource allocation method and device based on multiple tenants
CN113132146A (en) * 2019-12-31 2021-07-16 北京华为数字技术有限公司 Service processing method and related device
CN114390110A (en) * 2021-12-31 2022-04-22 华南理工大学 Multi-tenant system, method and equipment with constrained extensible resource supply

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103957246A (en) * 2014-04-22 2014-07-30 广州杰赛科技股份有限公司 Dynamic load balancing method and system based on tenant sensing
US20140307744A1 (en) * 2013-04-12 2014-10-16 Futurewei Technologies, Inc. Service Chain Policy for Distributed Gateways in Virtual Overlay Networks
CN105074702A (en) * 2013-02-28 2015-11-18 亚马逊科技公司 Database system providing single-tenant and multi-tenant environments
CN105450668A (en) * 2015-12-30 2016-03-30 中电长城网际系统应用有限公司 Cloud security service implementing system and cloud security service implementing method
CN106712998A (en) * 2015-11-18 2017-05-24 中兴通讯股份有限公司 Cloud platform resource management method, device and system
CN107493314A (en) * 2016-06-10 2017-12-19 三星Sds株式会社 Service provider system and method based on multi-tenant
US10120734B1 (en) * 2016-08-29 2018-11-06 Equinix, Inc. Application programming interface and services engine with application-level multi-tenancy

Family Cites Families (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102170457A (en) * 2010-02-26 2011-08-31 国际商业机器公司 Method and device for providing service for tenants of application
US8819210B2 (en) * 2011-12-06 2014-08-26 Sap Portals Israel Ltd Multi-tenant infrastructure
US9342353B2 (en) * 2012-10-06 2016-05-17 International Business Machines Corporation Techniques for implementing information services with tenant specific service level agreements
CN104142864A (en) * 2014-08-07 2014-11-12 浪潮电子信息产业股份有限公司 Multi-tenant performance isolation framework based on virtualization technology
US9721117B2 (en) * 2014-09-19 2017-08-01 Oracle International Corporation Shared identity management (IDM) integration in a multi-tenant computing environment
CN104881749A (en) * 2015-06-01 2015-09-02 北京圆通慧达管理软件开发有限公司 Data management method and data storage system for multiple tenants
CN108737325B (en) * 2017-04-13 2021-01-08 华为技术有限公司 Multi-tenant data isolation method, device and system
CN108170520A (en) * 2018-01-29 2018-06-15 北京搜狐新媒体信息技术有限公司 A kind of cloud computing resources management method and device
CN109040276B (en) * 2018-08-20 2022-03-22 郑州云海信息技术有限公司 Method and device for constructing cloud platform, computer storage medium and terminal
CN109412878A (en) * 2019-01-16 2019-03-01 紫光云数科技有限公司 Multi-tenant service access implementation method, device and electronic equipment

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105074702A (en) * 2013-02-28 2015-11-18 亚马逊科技公司 Database system providing single-tenant and multi-tenant environments
US20140307744A1 (en) * 2013-04-12 2014-10-16 Futurewei Technologies, Inc. Service Chain Policy for Distributed Gateways in Virtual Overlay Networks
CN103957246A (en) * 2014-04-22 2014-07-30 广州杰赛科技股份有限公司 Dynamic load balancing method and system based on tenant sensing
CN106712998A (en) * 2015-11-18 2017-05-24 中兴通讯股份有限公司 Cloud platform resource management method, device and system
CN105450668A (en) * 2015-12-30 2016-03-30 中电长城网际系统应用有限公司 Cloud security service implementing system and cloud security service implementing method
CN107493314A (en) * 2016-06-10 2017-12-19 三星Sds株式会社 Service provider system and method based on multi-tenant
US10120734B1 (en) * 2016-08-29 2018-11-06 Equinix, Inc. Application programming interface and services engine with application-level multi-tenancy

Cited By (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2020147301A1 (en) * 2019-01-16 2020-07-23 紫光云数科技有限公司 Method and apparatus for implementing multi-tenant service access, and electronic device
CN110784551A (en) * 2019-11-05 2020-02-11 中国建设银行股份有限公司 Data processing method, device, equipment and medium based on multiple tenants
CN113132146A (en) * 2019-12-31 2021-07-16 北京华为数字技术有限公司 Service processing method and related device
CN113132146B (en) * 2019-12-31 2022-12-27 北京华为数字技术有限公司 Service processing method and related device
CN111506411A (en) * 2020-04-21 2020-08-07 北京思特奇信息技术股份有限公司 Multi-tenant service management method and system
CN112118565A (en) * 2020-08-14 2020-12-22 金蝶医疗软件科技有限公司 Multi-tenant service gray level publishing method and device, computer equipment and storage medium
CN112118565B (en) * 2020-08-14 2023-07-25 金蝶医疗软件科技有限公司 Multi-tenant service gray level publishing method, device, computer equipment and storage medium
CN112069210A (en) * 2020-08-21 2020-12-11 北京首汽智行科技有限公司 Saas platform multi-tenant data isolation method
CN112308377A (en) * 2020-09-30 2021-02-02 北京沃东天骏信息技术有限公司 Resource allocation method and device based on multiple tenants
CN112308377B (en) * 2020-09-30 2023-09-26 北京沃东天骏信息技术有限公司 Multi-tenant-based resource allocation method and device
CN114390110A (en) * 2021-12-31 2022-04-22 华南理工大学 Multi-tenant system, method and equipment with constrained extensible resource supply
CN114390110B (en) * 2021-12-31 2023-08-22 华南理工大学 Multi-tenant system, method and equipment for constrained extensible resource supply

Also Published As

Publication number Publication date
WO2020147301A1 (en) 2020-07-23

Similar Documents

Publication Publication Date Title
CN109412878A (en) Multi-tenant service access implementation method, device and electronic equipment
CN110535831B (en) Kubernetes and network domain-based cluster security management method and device and storage medium
US10700947B2 (en) Life cycle management method and device for network service
WO2021017301A1 (en) Management method and apparatus based on kubernetes cluster, and computer-readable storage medium
CN110119292B (en) System operation parameter query method, matching method, device and node equipment
CN109150572B (en) Method, device and computer readable storage medium for realizing alarm association
CN106301829A (en) A kind of method and apparatus of Network dilatation
CN105913847A (en) Voice control system, user end device, server and central control unit
CN105991694B (en) A kind of method and apparatus realizing Distributed Services and calling
EP3447965A1 (en) Network function instance management method and relevant device
CN106470184A (en) Safety certifying method, apparatus and system
CN107707622A (en) A kind of method, apparatus and desktop cloud controller for accessing desktop cloud virtual machine
CN105471700B (en) A kind of methods, devices and systems of Message Processing
CN103581040A (en) Server distributing device and server distributing method
CN112199353A (en) Data processing method and electric power customer service platform
CN114911598A (en) Task scheduling method, device, equipment and storage medium
US11106763B2 (en) Systems and methods for transaction-based licensing
CN103067486A (en) Big-data processing method based on platform-as-a-service (PaaS) platform
CN110737425B (en) Method and device for establishing application program of charging platform system
CN110519354A (en) A kind of distributed objects storage system and its method for processing business and storage medium
CN111045928A (en) Interface data testing method, device, terminal and storage medium
CN115622976A (en) Domain name management system, domain name registration and resolution method, device, equipment and medium
CN116032614A (en) Container network micro-isolation method, device, equipment and medium
CN109194738A (en) Remote reboot method, routing development board and hardware bottom plate
CN114070847B (en) Method, device, equipment and storage medium for limiting current of server

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20190301