CN113821215A - Code deployment method and device and multi-tenant distributed system - Google Patents
Code deployment method and device and multi-tenant distributed system Download PDFInfo
- Publication number
- CN113821215A CN113821215A CN202111107667.8A CN202111107667A CN113821215A CN 113821215 A CN113821215 A CN 113821215A CN 202111107667 A CN202111107667 A CN 202111107667A CN 113821215 A CN113821215 A CN 113821215A
- Authority
- CN
- China
- Prior art keywords
- deployed
- tenant
- code
- service module
- file server
- 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
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/60—Software deployment
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/54—Interprogram communication
- G06F9/546—Message passing systems or structures, e.g. queues
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F2209/00—Indexing scheme relating to G06F9/00
- G06F2209/54—Indexing scheme relating to G06F9/54
- G06F2209/548—Queue
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Stored Programmes (AREA)
Abstract
The application provides a code deployment method, a code deployment device, a multi-tenant distributed system, an electronic device and a computer storage medium, wherein the method is applied to a plurality of service modules with the same function in the multi-tenant distributed system and comprises the following steps: each service module acquires and stores an extended code ID to be deployed and a tenant ID sent by a message queue; the tenant ID is used for representing the identity of the tenant, and the extension code ID to be deployed is generated by the file server after the extension code to be deployed is uploaded to the file server by the tenant corresponding to the tenant ID; when one of the service modules receives a service request of a tenant corresponding to the tenant ID, acquiring an extended code to be deployed from a file server according to the extended code ID to be deployed; and deploying the extended code to be deployed. Compared with an interface provided by a remote calling service module, the interface is directly deployed into the service module by the to-be-deployed extension code, so that the to-be-deployed extension code can call all resources in the service module.
Description
Technical Field
The present application relates to the field of distributed system development technologies, and in particular, to a code deployment method and apparatus, a multi-tenant distributed system, an electronic device, and a computer storage medium.
Background
Software-as-a-Service (SaaS) is a Software running mode for providing Software services based on the internet, and SaaS operators deploy SaaS applications on servers and can provide Software services for multiple tenants simultaneously in a lease mode.
In the running process of the SaaS system, some interfaces are usually provided to the outside, so that some tenants with certain development capability perform secondary development on the software service in a manner of remotely calling the interfaces in the process of using the software service. However, since the SaaS system has a limited capability of providing an external interface, a tenant cannot call all resources of the SaaS system when performing secondary development.
Disclosure of Invention
An object of the embodiments of the present application is to provide a code deployment method and apparatus, a multi-tenant distributed system, an electronic device, and a computer storage medium, so as to solve a problem that, in an existing SaaS system, tenants cannot call all resources of the SaaS system when performing secondary development.
In a first aspect, an embodiment of the present application provides a code deployment method, which is applied to a plurality of service modules with the same function in a multi-tenant distributed system, and the method includes: acquiring and storing an ID (identity) of an expansion code to be deployed and a tenant ID sent by a message queue; the tenant ID is used for representing the identity of a tenant, and the extended code ID to be deployed is generated by a file server after the extended code to be deployed is uploaded to the file server by the tenant corresponding to the tenant ID; when one of the service modules receives a service request of a tenant corresponding to the tenant ID, acquiring an extended code to be deployed from a file server according to the extended code ID to be deployed; and deploying the to-be-deployed spreading codes.
In the embodiment of the application, the service module acquires the ID of the to-be-deployed extension code and the tenant ID through the message queue, acquires the corresponding to-be-deployed extension code from the file server according to the ID of the to-be-deployed extension code, and deploys the corresponding to-be-deployed extension code, so that deployment of the to-be-deployed extension code on the service module is realized. Compared with an interface provided by a remote calling service module, the interface is directly deployed into the service module by the to-be-deployed extension code, so that the to-be-deployed extension code can call all resources in the service module. In addition, each service module requests the file server for the extension code to be deployed only when the tenant uses the software service on the corresponding service module, and then deploys the extension code to be deployed, so that resource consumption of the multi-tenant distributed system can be reduced, and deployment and updating among the service modules are not affected mutually.
In an optional embodiment, the deploying the to-be-deployed extension code includes: and hot-loading the extension code to be deployed by adopting a custom class loader.
In the embodiment of the application, in the multi-tenant distributed system, a plurality of tenants access the same service module at the same time. Under the condition, when a certain tenant needs to deploy the extension code of secondary development, the extension code to be deployed is hot-loaded by the user-defined class loader without restarting the service module, so that the service module is not interrupted, and the normal use of other tenants is not influenced.
In an optional embodiment, after the service modules acquire and store the to-be-deployed extension code ID and the tenant ID sent by the message queue, the method further includes: judging whether deployed extension codes of the tenants corresponding to the tenant IDs exist or not; and if so, deleting the deployed extension code.
In the embodiment of the present application, if the tenant has performed secondary development on the software service in the service module before, the service module is deployed with the extension code of the previous version. The problem of operation error caused by the existence of a plurality of versions of the extension codes in the service module can be avoided by deleting the extension codes of the previous versions.
In an alternative embodiment, the message queue is one of a RabbitMQ, Kafka, or Redis.
In a second aspect, an embodiment of the present application provides a code deployment method, which is applied to a file server in a multi-tenant distributed system, and the method includes: receiving an ID of an extension code to be deployed sent by a service module; determining the expansion code to be deployed according to the ID of the expansion code to be deployed; and sending the to-be-deployed spreading codes to the service module so that the service module deploys the to-be-deployed spreading codes.
In the embodiment of the application, the file server determines the corresponding to-be-deployed extension code from the file server according to the ID of the to-be-deployed extension code, and then sends the to-be-deployed extension code to the service module, so that the service module deploys the to-be-deployed extension code. Compared with an interface provided by the remote calling service module, the extension code to be deployed is directly deployed in the service module, so that the extension code to be deployed can call all resources in the service module.
In an alternative embodiment, the method further comprises: acquiring and storing an extended code to be deployed, which is sent by a tenant; and generating an ID of the expansion code to be deployed corresponding to the expansion code to be deployed.
In a third aspect, an embodiment of the present application provides a code deployment apparatus, which is applied to a plurality of service modules with the same function in a multi-tenant distributed system, and the apparatus includes: the acquisition module is used for acquiring and storing the ID of the expansion code to be deployed and the tenant ID sent by the message queue by each service module; the tenant ID is used for representing the identity of a tenant, and the extended code ID to be deployed is generated by a file server after the extended code to be deployed is uploaded to the file server by the tenant corresponding to the tenant ID; the obtaining module is further configured to obtain the to-be-deployed extension code from the file server according to the ID of the to-be-deployed extension code when one of the service modules receives a service request of a tenant corresponding to the tenant ID; and the deployment module is used for deploying the to-be-deployed extension codes.
In an optional embodiment, the deployment module is specifically configured to hot-load the to-be-deployed extension code by using a custom class loader.
In an alternative embodiment, the apparatus comprises: the judging module is used for judging whether the extension code of the tenant corresponding to the tenant ID exists or not; and the deleting module is used for deleting the extension codes when the extension codes exist.
In an alternative embodiment, the message queue is one of a RabbitMQ, Kafka, or Redis.
In a fourth aspect, an embodiment of the present application provides a code deployment apparatus, which is applied to a file server in a multi-tenant distributed system, where the apparatus includes: the receiving module is used for receiving the ID of the extension code to be deployed sent by the service module; the determining module is used for determining the spreading codes to be deployed based on the ID of the spreading codes to be deployed; and the sending module is used for sending the to-be-deployed spreading codes to the service module so as to enable the service module to deploy the to-be-deployed spreading codes.
In an alternative embodiment, the apparatus further comprises: the acquisition module is used for acquiring and storing the extension code to be deployed, which is sent by the tenant; and the generating module is used for generating the ID of the to-be-deployed extension code corresponding to the to-be-deployed extension code.
In a fifth aspect, an embodiment of the present application provides a multi-tenant distributed system, including: a message queue; a file server for performing the method according to the second aspect; a plurality of service modules providing the same function, wherein each service module provides services for a plurality of tenants, and the plurality of service modules are connected with the message queue and the file server for executing the method according to the first aspect.
In a sixth aspect, an embodiment of the present application provides an electronic device, including: a processor, a memory, and a bus; the processor and the memory are communicated with each other through the bus; the memory stores program instructions executable by the processor, the processor being capable of executing the method of the first aspect or the method of the second aspect when invoked by the processor.
In a seventh aspect, an embodiment of the present application provides a computer storage medium, on which computer program instructions are stored, and when the computer program instructions are read and executed by a computer, the computer program instructions perform the method according to the foregoing first aspect or the method according to the foregoing second aspect.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are required to be used in the embodiments of the present application will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present application and therefore should not be considered as limiting the scope, and that those skilled in the art can also obtain other related drawings based on the drawings without inventive efforts.
Fig. 1 is a block diagram illustrating a structure of a multi-tenant distributed system according to an embodiment of the present disclosure;
fig. 2 is a flowchart of a code deployment method provided in an embodiment of the present application;
fig. 3 is a block diagram illustrating a code deployment apparatus applied to a service module of a multi-tenant distributed system according to an embodiment of the present disclosure;
fig. 4 is a block diagram illustrating a code deployment apparatus applied to a file server of a multi-tenant distributed system according to an embodiment of the present disclosure;
fig. 5 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Icon: 100-multi-tenant distributed system; 101-a message queue; 102-a file server; 103-a service module; 300-a code deployment apparatus; 301-an obtaining module; 302-a deployment module; 400-a code deployment apparatus; 401-a receiving module; 402-a determination module; 403-a sending module; 500-an electronic device; 501, a processor; 502-a communication interface; 503-a memory; 504-bus.
Detailed Description
The technical solutions in the embodiments of the present application will be described below with reference to the drawings in the embodiments of the present application.
Referring to fig. 1, fig. 1 is a block diagram of a multi-tenant distributed system according to an embodiment of the present application, where the multi-tenant distributed system 100 includes: a message queue 101, a file server 102, and a plurality of service modules 103. In the embodiment of the present application, a plurality of service modules 103 may provide the same function.
Specifically, the multi-tenant distributed system 100 may be a SaaS system that provides three service modules 103.
Each service module 103 is connected to the message queue 101 and the file server 102. For convenience of illustration, the three service modules 103 are a service module a, a service module B, and a service module C from left to right in sequence. The service module a, the service module B, and the service module C may be three instances with identical functions, that is, the three service modules may provide the same software service for tenant 1, tenant 2, and tenant 3 at the same time.
The file server 102 provides file upload and download services. The file server 102 can be understood as a server, and tenant 1, tenant 2, and tenant 3 can access the file server 102 to upload files. The file server 102 generates a file ID after receiving a file uploaded by a tenant. The service module 103 may download the corresponding file from the file server 102 according to the file ID.
Specifically, the file server 102 may be an http (hyper Text Transfer protocol) server.
The message queue 101 is used to enable communication between the tenant and the service module 103. The tenant sends a message with the service module 103 through the message queue 101.
Specifically, the message queue 101 may be: one of RabbitMQ, Kafka, or Redis, which is not specifically limited in this application.
Based on the multi-tenant distributed system 100, the embodiment of the present application further provides a code deployment method, in which a tenant accesses the multi-tenant distributed system 100 through a device. It should be noted that the device may be a notebook computer, a mobile phone, an intelligent wearable device, and the like, which is not specifically limited in this application. The tenant uploads the to-be-deployed extension codes of the secondary development to the file server 102, receives the to-be-deployed extension code ID returned by the file server 102, then sends the to-be-deployed extension code ID to the service module 103 through the message queue 101, and the service module 103 deploys the corresponding to-be-deployed extension codes according to the to-be-deployed extension code ID, so that deployment of the to-be-deployed extension codes on the service module 103 is achieved.
The code deployment method provided by the embodiment of the present application is described in detail below by taking the multi-tenant distributed system 100 shown in fig. 1 as an example.
The file server 102 may perform the following steps:
firstly, acquiring and storing an extended code to be deployed, which is sent by a tenant;
and secondly, generating an expansion code ID to be deployed corresponding to the expansion code to be deployed.
Specifically, after the tenant performs secondary development on the software function used by the tenant, the tenant uploads the extension code to be deployed to the file server 102. After obtaining the to-be-deployed extension code, the file server 102 saves the to-be-deployed extension code, and generates an ID of the to-be-deployed extension code corresponding to the to-be-deployed extension code.
It should be noted that the ID of the to-be-deployed extension code may be a download link for downloading the to-be-deployed extension code. The tenant and service module 103 may download the to-be-deployed extension code uploaded to the file server 102 by the tenant according to the to-be-deployed extension code ID.
After generating the to-be-deployed extension code ID corresponding to the to-be-deployed extension code, the file server 102 sends the to-be-deployed extension code ID to the tenant.
Referring to fig. 2, after the file server 102 stores the to-be-deployed extension code that is developed by the tenant for the second time and the tenant obtains the ID of the to-be-deployed extension code, fig. 2 is a flowchart of a code deployment method provided in an embodiment of the present application, where the code deployment method may include the following steps:
step 201: and each service module acquires and stores the ID of the extension code to be deployed and the ID of the tenant sent by the message queue.
Step 202: when one of the service modules receives a service request of a tenant corresponding to the tenant ID, the service module requests the extension code to be deployed from the file server according to the extension code ID to be deployed.
Step 203: and the file server receives the ID of the extension code to be deployed sent by the service module.
Step 204: and the file server determines the extension codes to be deployed according to the ID of the extension codes to be deployed.
Step 205: and the file server sends the extension code to be deployed to the service module.
Step 206: and the service module receives the extension code to be deployed sent by the file server.
Step 207: and the service module deploys the extension codes to be deployed.
It should be noted that, the above step 202-207 is directed to the interaction between one service module 103 and the file server 102 in the multi-tenant distributed system 100. It can be understood that the interaction process between each service module 103 and the file server 102 in each multi-tenant distributed system 100 is the same, and for brevity of the description, no further description is given here.
The above method is described in detail below.
Step 201: and each service module acquires and stores the ID of the extension code to be deployed and the ID of the tenant sent by the message queue.
In the embodiment of the present application, the extension code ID to be deployed and the tenant ID are sent to the service module 103 by the tenant through the message queue 101. The tenant sends the deployment extension code ID and its own corresponding tenant ID in each service module 103 to each service module 103 in the multi-tenant distributed system 100.
It should be noted that, since one service module 103 provides software services to multiple tenants simultaneously, in order to distinguish different tenants, the tenants need to send tenant IDs to characterize the identities of the tenants.
After receiving the ID of the to-be-deployed extension code and the tenant ID, the service module 103 saves the ID of the to-be-deployed extension code and the tenant ID.
In the embodiment of the present application, the service module 103 correspondingly stores the ID of the to-be-deployed extension code and the tenant ID, so that the to-be-deployed extension codes of multiple tenants do not affect each other.
As an optional implementation manner, after step 201, the code deployment method provided in the embodiment of the present application further includes the following steps:
the first step, judging whether a deployed extension code of a tenant corresponding to a tenant ID exists;
and secondly, deleting the deployed extension code when the deployed extension code of the tenant corresponding to the tenant ID exists.
Specifically, if the tenant has performed secondary development on the software service in the service module 103 before, a previous version of extension code is deployed in the service module 103. The problem of operation error caused by the existence of a plurality of versions of the extension codes in the service module can be avoided by deleting the extension codes of the previous versions.
Step 202: when one of the service modules receives a service request of a tenant corresponding to the tenant ID, the service module requests the extension code to be deployed from the file server according to the extension code ID to be deployed.
In the embodiment of the application, the service module 103 deploys the extended code to be deployed by using a lazy loading mechanism, that is, only when the service module 103 receives a service request of a tenant corresponding to a tenant ID, the extended code to be deployed is requested from the file server 102 according to the extended code ID to be deployed; the service module 103 that does not receive the service request of the tenant corresponding to the tenant ID does not request the file server 102 for the extended code to be deployed, and thus does not deploy the extended code to be deployed.
Through the above manner, only when the tenant uses the software service on the corresponding service module 103, the extension code to be deployed is requested from the file server 102, and then the extension code to be deployed is deployed, so that the resource consumption of the multi-tenant distributed system can be reduced.
Step 203 and step 205 are also described below.
Step 203: and the file server receives the ID of the extension code to be deployed sent by the service module.
Step 204: and the file server determines the extension codes to be deployed according to the ID of the extension codes to be deployed.
Step 205: and the file server sends the extension code to be deployed to the service module.
In the embodiment of the present application, after the service module 103 requests the file server 102 for the extension code to be deployed according to the extension code ID to be deployed, the file server 102 receives the extension code ID to be deployed sent by the service module 103. And then determining the extension code to be deployed, which is stored in the file server 102 by the tenant, according to the ID of the extension code to be deployed, and further sending the extension code to be deployed to the service module, so that the service module can deploy the extension code to be deployed.
Step 206: and the service module receives the extension code to be deployed sent by the file server.
In the embodiment of the present application, the service module 103 receives an extension code to be deployed, which is sent by the file server 102. For example, when the file server 102 is an FTP server, step 201, step 202 and step 206 may be understood as that the service module 103 downloads the corresponding to-be-deployed extension code from the file server 102 according to the FTP protocol.
Step 207: and the service module deploys the extension codes to be deployed.
In the embodiment of the present application, the service module 103 deploys the acquired to-be-deployed extension code. It should be noted that, compared to an interface provided by the remote call service module 103, the to-be-deployed extension code is directly deployed in the service module 103, so that the to-be-deployed extension code can call all resources, such as various storage resources, computing resources, and the like, in the service module 103.
As an alternative embodiment, the service module 103 uses a custom class loader to hot load the extension code to be deployed. In a multi-tenant distributed system, there is a case where a plurality of tenants simultaneously access the same service module. Under the condition, when a certain tenant needs to deploy the extension code of the secondary development, the extension code to be deployed is hot-loaded by adopting the custom-type loader without restarting the service module 103, so that the service module 103 is not interrupted, the normal use of other tenants is not influenced, and the service modules are respectively deployed and updated as required without mutual influence.
Based on the same inventive concept, the embodiment of the application provides a code deployment device. Referring to fig. 3, fig. 3 is a block diagram illustrating a code deployment apparatus for a plurality of service modules with the same function applied to a multi-tenant distributed system according to an embodiment of the present disclosure, where the code deployment apparatus 300 is applied to a service module in a multi-tenant distributed system, and the code deployment apparatus 300 may include:
an obtaining module 301, configured to obtain and store, by each service module, an ID of an extension code to be deployed and a tenant ID sent by a message queue; the tenant ID is used for representing the identity of a tenant, and the extended code ID to be deployed is generated by a file server after the extended code to be deployed is uploaded to the file server by the tenant corresponding to the tenant ID;
the obtaining module 301 is further configured to, when one of the service modules receives a service request of a tenant corresponding to the tenant ID, obtain an extended code to be deployed from a file server according to the extended code ID to be deployed;
a deployment module 302, configured to deploy the to-be-deployed extension code.
In an optional embodiment, the deployment module 302 is specifically configured to hot-load the extension code to be deployed by using a custom class loader.
In an alternative embodiment, the apparatus comprises: the judging module is used for judging whether the deployed extension codes of the tenants corresponding to the tenant IDs exist or not; a deleting module, configured to delete the deployed extension code when the deployed extension code exists.
In an alternative embodiment, the message queue is one of a RabbitMQ, Kafka, or Redis.
In addition, the embodiment of the application also provides a code deployment device. Referring to fig. 4, fig. 4 is a block diagram illustrating a code deploying apparatus applied to a file server of a multi-tenant distributed system according to an embodiment of the present disclosure, where the code deploying apparatus 400 is applied to a file server of a multi-tenant distributed system, and the code deploying apparatus 400 may include:
a receiving module 401, configured to receive an ID of an extension code to be deployed, sent by a service module;
a determining module 402, configured to determine an extension code to be deployed based on the ID of the extension code to be deployed;
a sending module 403, configured to send the to-be-deployed extension code to the service module, so that the service module deploys the to-be-deployed extension code.
In an alternative embodiment, the apparatus further comprises: the acquisition module is used for acquiring and storing the extension code to be deployed, which is sent by the tenant; and the generating module is used for generating the ID of the to-be-deployed extension code corresponding to the to-be-deployed extension code.
Referring to fig. 5, fig. 5 is a schematic structural diagram of an electronic device 500 according to an embodiment of the present application, where the electronic device 500 includes: at least one processor 501, at least one communication interface 502, at least one memory 503, and at least one bus 504. Wherein the bus 504 is used for realizing direct connection communication of the components, the communication interface 502 is used for communicating signaling or data with other node devices, and the memory 503 stores machine readable instructions executable by the processor 501. When the electronic device 500 is in operation, the processor 501 communicates with the memory 503 via the bus 504, and the machine-readable instructions, when called by the processor 501, perform the code deployment methods described above.
The processor 501 may be an integrated circuit chip having signal processing capabilities. The Processor 501 may be a general-purpose Processor, including a Central Processing Unit (CPU), a Network Processor (NP), and the like; but also Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field-Programmable Gate arrays (FPGAs) or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components. Which may implement or perform the various methods, steps, and logic blocks disclosed in the embodiments of the present application. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The Memory 503 may include, but is not limited to, Random Access Memory (RAM), Read Only Memory (ROM), Programmable Read Only Memory (PROM), Erasable Read Only Memory (EPROM), electrically Erasable Read Only Memory (EEPROM), and the like.
It will be appreciated that the configuration shown in FIG. 5 is merely illustrative and that electronic device 500 may include more or fewer components than shown in FIG. 5 or have a different configuration than shown in FIG. 5. The components shown in fig. 5 may be implemented in hardware, software, or a combination thereof. In this embodiment, the electronic device 500 may be, but is not limited to, an entity device such as a desktop, a laptop, a smart phone, an intelligent wearable device, and a vehicle-mounted device, and may also be a virtual device such as a virtual machine. In addition, the electronic device 500 is not necessarily a single device, but may also be a combination of multiple devices, such as a server cluster, and the like.
In addition, an embodiment of the present application further provides a computer storage medium, where a computer program is stored on the computer storage medium, and when the computer program is executed by a computer, the steps of the code deployment method in the foregoing embodiments are performed.
To sum up, according to the code deployment method and apparatus, the multi-tenant distributed system, the electronic device, and the computer storage medium provided in the embodiments of the present application, the service module obtains the ID of the to-be-deployed extension code and the tenant ID through the message queue, obtains the corresponding to-be-deployed extension code from the file server according to the ID of the to-be-deployed extension code, and deploys the corresponding to-be-deployed extension code, thereby implementing deployment of the to-be-deployed extension code on the service module. Compared with an interface provided by the remote calling service module, the extension code to be deployed is directly deployed in the service module, so that the extension code to be deployed can call all resources in the service module. In addition, each service module requests the file server for the extension code to be deployed only when the tenant uses the software service on the corresponding service module, and then deploys the extension code to be deployed, so that the resource consumption of the multi-tenant distributed system can be reduced.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. The above-described embodiments of the apparatus are merely illustrative, and for example, the division of the units is only one logical division, and there may be other divisions when actually implemented, and for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection of devices or units through some communication interfaces, and may be in an electrical, mechanical or other form.
In addition, units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
Furthermore, the functional modules in the embodiments of the present application may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.
It should be noted that the functions, if implemented in the form of software functional modules and sold or used as independent products, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application or portions thereof that substantially contribute to the prior art may be embodied in the form of a software product stored in a storage medium and including instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
In this document, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions.
The above description is only an example of the present application and is not intended to limit the scope of the present application, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, improvement and the like made within the spirit and principle of the present application shall be included in the protection scope of the present application.
Claims (10)
1. A code deployment method is applied to a plurality of service modules with the same function in a multi-tenant distributed system, and comprises the following steps:
each service module acquires and stores an extended code ID to be deployed and a tenant ID sent by a message queue; the tenant ID is used for representing the identity of a tenant, and the extended code ID to be deployed is generated by a file server after the extended code to be deployed is uploaded to the file server by the tenant corresponding to the tenant ID;
when one of the service modules receives a service request of a tenant corresponding to the tenant ID, acquiring an extended code to be deployed from a file server according to the extended code ID to be deployed;
and deploying the to-be-deployed spreading codes.
2. The method of claim 1, wherein the deploying the to-be-deployed spreading code comprises:
and hot-loading the extension code to be deployed by adopting a custom class loader.
3. The method according to claim 1, wherein after each service module acquires and saves the to-be-deployed extension code ID and the tenant ID sent by the message queue, the method further comprises:
judging whether deployed extension codes of the tenants corresponding to the tenant IDs exist or not;
and if so, deleting the deployed extension code.
4. The method of claim 1, wherein the message queue is one of RabbitMQ, Kafka, or Redis.
5. A code deployment method is applied to a file server in a multi-tenant distributed system, and comprises the following steps:
receiving an ID of an extension code to be deployed sent by a service module;
determining the expansion code to be deployed according to the ID of the expansion code to be deployed;
and sending the to-be-deployed spreading codes to the service module so that the service module deploys the to-be-deployed spreading codes.
6. The method of claim 5, further comprising:
acquiring and storing an extended code to be deployed, which is sent by a tenant;
and generating an ID of the expansion code to be deployed corresponding to the expansion code to be deployed.
7. A code deployment apparatus, applied to a plurality of service module modules of the same function in a multi-tenant distributed system, the apparatus comprising:
the acquisition module is used for acquiring and storing the ID of the expansion code to be deployed and the tenant ID sent by the message queue by each service module; the tenant ID is used for representing the identity of a tenant, and the extended code ID to be deployed is generated by a file server after the extended code to be deployed is uploaded to the file server by the tenant corresponding to the tenant ID;
the obtaining module is further configured to obtain the to-be-deployed extension code from the file server according to the ID of the to-be-deployed extension code when one of the service modules receives a service request of a tenant corresponding to the tenant ID;
and the deployment module is used for deploying the to-be-deployed extension codes.
8. A code deployment apparatus, applied to a file server in a multi-tenant distributed system, the apparatus comprising:
the receiving module is used for receiving the ID of the extension code to be deployed sent by the service module;
the determining module is used for determining the spreading codes to be deployed based on the ID of the spreading codes to be deployed;
and the sending module is used for sending the to-be-deployed spreading code to the service module.
9. A multi-tenant distributed system, comprising:
a message queue;
a file server for performing the method of any one of claims 5-6;
a plurality of service modules providing the same function, wherein each service module provides services for a plurality of tenants, and the plurality of service modules are connected with the message queue and the file server for executing the method according to any one of claims 1 to 4.
10. A computer storage medium having computer program instructions stored thereon which, when read and executed by a computer, perform the method of any of claims 1-4 or the method of any of claims 5-6.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111107667.8A CN113821215A (en) | 2021-09-22 | 2021-09-22 | Code deployment method and device and multi-tenant distributed system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111107667.8A CN113821215A (en) | 2021-09-22 | 2021-09-22 | Code deployment method and device and multi-tenant distributed system |
Publications (1)
Publication Number | Publication Date |
---|---|
CN113821215A true CN113821215A (en) | 2021-12-21 |
Family
ID=78920786
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202111107667.8A Pending CN113821215A (en) | 2021-09-22 | 2021-09-22 | Code deployment method and device and multi-tenant distributed system |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113821215A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115437648A (en) * | 2022-08-23 | 2022-12-06 | 中国电子科技集团公司第十研究所 | Large-scale blueprint parallel deployment method, device and medium |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20100005443A1 (en) * | 2008-07-07 | 2010-01-07 | Kwok Thomas Y | System and Methods to Create a Multi-Tenancy Software as a Service Application |
US20170168783A1 (en) * | 2015-12-10 | 2017-06-15 | Sap Se | Generating logic with scripting language in software as a service enterprise resource planning |
CN109408067A (en) * | 2018-10-22 | 2019-03-01 | 浙江明度智控科技有限公司 | A kind of data managing method and server based on monomer applications |
CN110300025A (en) * | 2019-06-28 | 2019-10-01 | 湖南御家科技有限公司 | Platform service extension method and system in a kind of business |
CN110389829A (en) * | 2018-04-18 | 2019-10-29 | Sap欧洲公司 | Classification and distribution of extension objects in a multi-tenant environment |
CN112100262A (en) * | 2020-09-16 | 2020-12-18 | 南京智数云信息科技有限公司 | Method and system for quickly building and dynamically expanding multi-tenant software as a service (SaaS) platform |
-
2021
- 2021-09-22 CN CN202111107667.8A patent/CN113821215A/en active Pending
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20100005443A1 (en) * | 2008-07-07 | 2010-01-07 | Kwok Thomas Y | System and Methods to Create a Multi-Tenancy Software as a Service Application |
US20170168783A1 (en) * | 2015-12-10 | 2017-06-15 | Sap Se | Generating logic with scripting language in software as a service enterprise resource planning |
CN110389829A (en) * | 2018-04-18 | 2019-10-29 | Sap欧洲公司 | Classification and distribution of extension objects in a multi-tenant environment |
CN109408067A (en) * | 2018-10-22 | 2019-03-01 | 浙江明度智控科技有限公司 | A kind of data managing method and server based on monomer applications |
CN110300025A (en) * | 2019-06-28 | 2019-10-01 | 湖南御家科技有限公司 | Platform service extension method and system in a kind of business |
CN112100262A (en) * | 2020-09-16 | 2020-12-18 | 南京智数云信息科技有限公司 | Method and system for quickly building and dynamically expanding multi-tenant software as a service (SaaS) platform |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115437648A (en) * | 2022-08-23 | 2022-12-06 | 中国电子科技集团公司第十研究所 | Large-scale blueprint parallel deployment method, device and medium |
CN115437648B (en) * | 2022-08-23 | 2025-04-25 | 中国电子科技集团公司第十研究所 | Large-scale blueprint parallel deployment method, device and medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP7678065B2 (en) | Implementing compliance settings on mobile devices to adhere to configuration scenarios | |
CN110838071B (en) | Policy data processing method, device and server | |
CN107832100B (en) | APK plug-in loading method and terminal thereof | |
CN112748962A (en) | Application loading method and device, electronic equipment and computer readable medium | |
CN111163130B (en) | Network service system and data transmission method thereof | |
CN112653618A (en) | Gateway registration method and device of micro-service application API endpoint | |
CN114465998A (en) | Multi-device file transmission method and device, terminal device and readable storage medium | |
CN111427596A (en) | Software upgrading method and device and terminal equipment | |
CN107644075B (en) | Method and device for collecting page information | |
CN110580305A (en) | Method, apparatus, system, and medium for generating identifier | |
CN112818336A (en) | Data access method, data access device and computer readable storage medium | |
CN112468585B (en) | Data transmission method and device, electronic equipment and storage medium | |
CN111273939B (en) | Information processing method, information processing device and terminal equipment | |
CN113821215A (en) | Code deployment method and device and multi-tenant distributed system | |
CN114138888B (en) | Processing method, system, medium and equipment for distributed data routing | |
CN115314376A (en) | Method and device for deploying network plug-ins in cluster, electronic equipment and storage medium | |
CN113779122B (en) | Method and device for exporting data | |
CN114270309B (en) | Resource acquisition method, device and electronic device | |
CN111142972B (en) | Method, apparatus, system, and medium for extending functions of application program | |
CN107045452B (en) | Virtual machine scheduling method and device | |
CN111771191B (en) | Cross-domain inline event handlers | |
CN111722994A (en) | A method and device for responding to a task request | |
CN115827778A (en) | A data acquisition method, device, electronic equipment and storage medium | |
CN115358331A (en) | Device type identification method and device, computer readable storage medium, terminal | |
CN116126674A (en) | Interface testing method and device |
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 |