CN109274731B - Method and device for deploying and calling web service based on multi-tenant technology - Google Patents

Method and device for deploying and calling web service based on multi-tenant technology Download PDF

Info

Publication number
CN109274731B
CN109274731B CN201811025208.3A CN201811025208A CN109274731B CN 109274731 B CN109274731 B CN 109274731B CN 201811025208 A CN201811025208 A CN 201811025208A CN 109274731 B CN109274731 B CN 109274731B
Authority
CN
China
Prior art keywords
tenant
private
request
file
web service
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.)
Active
Application number
CN201811025208.3A
Other languages
Chinese (zh)
Other versions
CN109274731A (en
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.)
JD Digital Technology Holdings Co Ltd
Jingdong Technology Holding Co Ltd
Original Assignee
JD Digital Technology Holdings 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 JD Digital Technology Holdings Co Ltd filed Critical JD Digital Technology Holdings Co Ltd
Priority to CN201811025208.3A priority Critical patent/CN109274731B/en
Publication of CN109274731A publication Critical patent/CN109274731A/en
Priority to PCT/CN2019/103532 priority patent/WO2020048391A1/en
Application granted granted Critical
Publication of CN109274731B publication Critical patent/CN109274731B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/02Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/10Network architectures or network communication protocols for network security for controlling access to devices or network resources
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/133Protocols for remote procedure calls [RPC]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/2866Architectures; Arrangements
    • H04L67/30Profiles
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/34Network arrangements or protocols for supporting network services or applications involving the movement of software or configuration parameters 
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/04Protocols for data compression, e.g. ROHC
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/22Parsing or analysis of headers

Abstract

The invention discloses a method and a device for deploying and calling a web service based on a multi-tenant technology, and relates to the technical field of computers. The deployment method deploys at least one business system to a web service platform in a tenant mode, and a specific implementation mode of the deployment method comprises the following steps: acquiring a tenant registration request of a service system, wherein the tenant registration request comprises a configuration file and an executable file of the service system; analyzing the configuration file, generating an authority verification rule for a private method in the configuration file, and loading an executable file; ports are allocated to the business system and published as web services. According to the implementation method, a plurality of business systems can be deployed on the same web service platform in a tenant mode to achieve business service isolation, so that cross-domain remote process calling can be converted into local calling, network communication, interaction and the like are saved, and response efficiency is improved.

Description

Method and device for deploying and calling web service based on multi-tenant technology
Technical Field
The invention relates to the technical field of computers, in particular to a method and a device for deploying and calling a web service based on a multi-tenant technology.
Background
Multi-tenant technology, or multi-tenancy technology, is a software architecture technology that explores how to implement sharing of the same business systems or program components in a multi-user environment and still ensures data isolation among users.
The existing multi-tenant technology simply means that a single service instance can serve multiple organizations or systems, the service instance is a system capable of supporting the multi-tenant technology, and the multiple organizations or systems form multiple tenants of the service instance and share a data center of the service instance. In order to ensure data isolation among multiple tenants, the service instance supporting the multi-tenant technology needs to perform virtual partitioning on data and configuration of the service instance in design, so that each tenant of the service instance can use a separate system instance, and each tenant can perform personalized configuration on a rented system instance according to own requirements.
The core of the existing multi-tenant technology is to virtually partition data and configuration of service instances supporting the multi-tenant technology. Taking Java as a programming language as an example, most of the existing multi-tenant technologies implement virtual partitions for implementing data and configuration of service instances based on Hibernate, and then deploy the service instances on a JVM (Java virtual machine) to implement a multi-tenant system. Because threads are the main mode of JVM work in Java language, a multi-tenant system deployed on the JVM generally performs service processing based on the threads, and by allocating a daemon thread to each tenant, the multi-tenant can access the same object, so that a program has concurrent processing capability, and the computing capability of the conventional multi-core processor is exerted to the maximum extent. The Hibernate is an object relational mapping framework and is mainly used for mapping a data layer entity object in a user business system with a database table. The implementation of Hibernate-based multi-tenant technology can establish an independent data source for each tenant, which is equivalent to isolating a plurality of sub-libraries in a database.
The existing invocation process of the multi-tenant system deployed on the JVM based on Hibernate implementation is as follows:
1. configuring a public/private architecture schema for a multi-tenant system (the architecture is used for defining a legal component group of a document or a constraint rule executed by the system), respectively corresponding to a shared area and a private area, and storing the configured architecture schema into different data sources;
2. intercepting a Web (World Wide Web, also called World Wide Web) request by a request interceptor, and forwarding the Web request to a tenant resolver;
3. the tenant resolver resolves a corresponding tenant identification ID (identification) from the web request and sends the tenant identification ID to the multi-tenant link manager;
4. the multi-tenant link manager acquires the schema corresponding to the tenant and binds the data source of the tenant to a data source manager;
5. the web controller takes the corresponding data source from the data source manager to process the service request and returns a corresponding result;
6. and (5) repeating the steps 2-5.
In the process of implementing the invention, the inventor finds that at least the following problems exist in the prior art:
1. when a cross-domain request (such as a Remote Procedure Call (RPC) request) occurs, the existing multi-tenant system has a network overhead problem when performing cross-domain access;
2. with the increase of the private type tenants, the data sources established for the private type tenants are also increased, so that the resource overhead of the database is rapidly increased;
3. in the prior art, service processing is performed based on threads, so the following problems can be caused: the request type is limited, and if a service request initiated by a tenant is not an atomic request and needs to be cooperatively processed by a plurality of sub-threads, the conventional multi-tenant system cannot efficiently process the atomic request; even without any business request, existing multi-tenant systems still need to maintain a certain amount of threads (per tenant daemon threads); the thread in the block can not process the new request, the callback cost of the thread is very large, and the thread can not receive the new task before the callback; the creation and maintenance cost of the thread is too high, and the problems of blocking, synchronization, deadlock and the like need to be considered.
Disclosure of Invention
In view of this, embodiments of the present invention provide a method and an apparatus for deploying and calling a web service based on a multi-tenant technology, which can deploy multiple service systems on the same web service platform in a tenant manner to implement service isolation, so that a cross-domain remote procedure call can be converted into a local call, thereby saving network communication, interaction, and the like, and improving response efficiency.
To achieve the above object, according to an aspect of the embodiments of the present invention, a method for deploying a web service based on a multi-tenant technology is provided.
A method for deploying web services based on multi-tenant technology, which deploys at least one business system to a web service platform in a tenant mode, comprises the following steps: acquiring a tenant registration request of a service system, wherein the tenant registration request comprises a configuration file and an executable file of the service system; analyzing the configuration file, generating an authority verification rule for a private method in the configuration file, and loading the executable file; and allocating ports for the business system and publishing the ports as web services.
Optionally, if the private method has a dependent method, adding the permission check rule to an annotation of the dependent method.
Optionally, after acquiring the tenant registration request of the service system, the method further includes: marking the declared executable class files of the service system which need to use a coroutine processing method, and updating the executable class files of the service system into marked class files.
Optionally, loading the executable class file includes: and analyzing the executable class file, and weaving an intervention code into the marked method to realize the pause and the awakening of the general thread.
Optionally, after acquiring the tenant registration request of the service system, the method further includes: and storing the executable class file into a database or a disk after serialization and compression processing.
Optionally, if the compression processing is saved in the database, the compression processing includes: performing byte processing on the serialized executable class file to convert the executable class file into byte codes; encoding the byte codes based on a Base64 encoding mode; cutting off the first two bits of the 8-bit binary code corresponding to each byte code, and splicing the binary codes of all the byte codes; and segmenting the binary code obtained after splicing into a section according to each 8 bits, and converting each segmented binary code into bytes after decimal transformation for compression processing.
Optionally, if the data is saved in the disk, the compressing includes: establishing a coordinate axis with a longitudinal axis of 54 and a transverse axis of 20, and representing a Chinese character symbol by the intersection point of each unit transverse axis and each unit longitudinal axis; performing byte processing on the serialized executable class file to convert the executable class file into byte codes, and encoding the byte codes based on a Base64 encoding mode; according to the corresponding relation between the preset code and the coordinate values on the coordinate axis, acquiring the horizontal coordinate value and the vertical coordinate value corresponding to the code, and taking the Chinese character symbol of the corresponding intersection point of the vertical axis and the horizontal axis as a compressed file.
According to another aspect of the embodiment of the invention, a device for deploying a web service based on a multi-tenant technology is provided.
A deployment device of web services based on multi-tenant technology, which deploys not less than one business system to a web service platform in a tenant form, the device comprising: the system comprises a request acquisition module, a service system and a service management module, wherein the request acquisition module is used for acquiring a tenant registration request of the service system, and the tenant registration request comprises a configuration file and an executable file of the service system; the analysis loading module is used for analyzing the configuration file, generating an authority verification rule for a private method in the configuration file and loading the executable file; and the service publishing module is used for distributing a port for the service system and publishing the port as the web service.
Optionally, if the private method has a dependent method, adding the permission check rule to an annotation of the dependent method.
Optionally, the system further comprises a marking module for: after acquiring a tenant registration request of a service system, marking the declared executable class files of the service system which need to be processed by using a coroutine processing method, and updating the executable class files of the service system into marked class files.
Optionally, the parsing loading module is further configured to: and analyzing the executable class file, and weaving an intervention code into the marked method to realize the pause and the awakening of the general thread.
Optionally, the system further comprises a file saving module, configured to: after acquiring a tenant registration request of a service system, storing the executable class file into a database or a disk after serialization and compression processing.
Optionally, if the compression processing is saved in the database, the compression processing includes: performing byte processing on the serialized executable class file to convert the executable class file into byte codes; encoding the byte codes based on a Base64 encoding mode; cutting off the first two bits of the 8-bit binary code corresponding to each byte code, and splicing the binary codes of all the byte codes; and segmenting the binary code obtained after splicing into a section according to each 8 bits, and converting each segmented binary code into bytes after decimal transformation for compression processing.
Optionally, if the data is saved in the disk, the compressing includes: establishing a coordinate axis with a longitudinal axis of 54 and a transverse axis of 20, and representing a Chinese character symbol by the intersection point of each unit transverse axis and each unit longitudinal axis; performing byte processing on the serialized executable class file to convert the executable class file into byte codes, and encoding the byte codes based on a Base64 encoding mode; according to the corresponding relation between the preset code and the coordinate values on the coordinate axis, acquiring the horizontal coordinate value and the vertical coordinate value corresponding to the code, and taking the Chinese character symbol of the corresponding intersection point of the vertical axis and the horizontal axis as a compressed file.
According to another aspect of the embodiment of the invention, a method for calling a web service based on a multi-tenant technology is provided.
A method for calling a web service based on a multi-tenant technology, wherein the web service is deployed according to a method for deploying the web service based on the multi-tenant technology provided by the embodiment of the invention, and the method for calling the web service comprises the following steps: acquiring a request type of a web service calling request initiated by a user; when the request type is a private request, performing authority verification on the user; and when the permission check is passed, responding to the web service calling request.
Optionally, the performing the authority check on the user includes: acquiring a private method corresponding to the private request; and carrying out authority verification on the user according to the authority verification rule of the private method.
Optionally, the performing the authority check on the user includes: acquiring a private method corresponding to the private request; if the private method has a dependent method, acquiring the authority verification rule from the annotation of the dependent method; and carrying out authority verification on the user according to the authority verification rule.
According to another aspect of the embodiment of the invention, a device for calling the web service based on the multi-tenant technology is provided.
An invoking device of a web service based on multi-tenant technology, the web service being deployed according to a deployment method of the web service based on multi-tenant technology provided by an embodiment of the present invention, the invoking device comprising: the type obtaining module is used for obtaining the request type of the web service calling request initiated by the user; the authority verification module is used for verifying the authority of the user when the request type is a private request; and the request response module is used for responding to the web service calling request when the permission verification passes.
Optionally, the permission verification module is further configured to: acquiring a private method corresponding to the private request; and carrying out authority verification on the user according to the authority verification rule of the private method.
Optionally, the permission verification module is further configured to: acquiring a private method corresponding to the private request; if the private method has a dependent method, acquiring the authority verification rule from the annotation of the dependent method; and carrying out authority verification on the user according to the authority verification rule.
According to yet another aspect of an embodiment of the present invention, an electronic device is provided.
An electronic device, comprising: one or more processors; the storage device is used for storing one or more programs, and when the one or more programs are executed by the one or more processors, the one or more processors implement the method for deploying and calling the web service based on the multi-tenant technology provided by the embodiment of the invention.
According to yet another aspect of embodiments of the present invention, a computer-readable medium is provided.
A computer readable medium, on which a computer program is stored, when being executed by a processor, implements a method for deploying and calling a web service based on multi-tenant technology, provided by an embodiment of the present invention.
One embodiment of the above invention has the following advantages or benefits: the method for deploying the web service based on the multi-tenant technology is realized by acquiring a tenant registration request of a service system, analyzing a configuration file of the service system to generate an authority check rule for a private method, loading an executable class file of the service system, allocating a port for the service system and issuing the web service, and deploying a plurality of service systems on the same web service platform in a tenant mode to realize service isolation based on the multi-tenant technology theory. In addition, the invention can also use the way of coordinating the journey to carry on the business processing, the coordinating journey is relative to thread, its switching mode is more flexible, and can save the establishment of the thread, maintain the expenses, improve the throughput under the distributed high concurrency; meanwhile, the executable class files of the business system can be stored in a database or a disk corresponding to the working space of the web service platform instead of being directly loaded into the JVM, the class files can be dynamically loaded and executed only when the business system is called, and resources are released after business processing is finished, so that the dynamic loading and unloading of the class are realized, and the effective utilization rate of the JVM is improved.
Further effects of the above-mentioned non-conventional alternatives will be described below in connection with the embodiments.
Drawings
The drawings are included to provide a better understanding of the invention and are not to be construed as unduly limiting the invention. Wherein:
fig. 1 is a schematic diagram of main steps of a method for deploying a web service based on a multi-tenant technology according to an embodiment of the present invention;
FIG. 2 is a system architecture diagram of an embodiment of the present invention;
FIG. 3 is a schematic diagram of a web service deployment flow according to an embodiment of the invention;
FIG. 4 is a schematic diagram of the main modules of a deployment apparatus for a web service based on multi-tenant technology according to an embodiment of the present invention;
FIG. 5 is a schematic diagram of a call flow of a web service according to an embodiment of the present invention;
FIG. 6 is an exemplary system architecture diagram in which embodiments of the present invention may be employed;
fig. 7 is a schematic block diagram of a computer system suitable for use in implementing a terminal device or server of an embodiment of the invention.
Detailed Description
Exemplary embodiments of the present invention are described below with reference to the accompanying drawings, in which various details of embodiments of the invention are included to assist understanding, and which are to be considered as merely exemplary. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the invention. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
Most of the existing multi-tenant systems implement data and configuration isolation by virtually partitioning data and configuration of service instances supporting multi-tenant technology, but service isolation cannot be achieved, so that the problem of network overhead exists when cross-domain access occurs. In order to solve the technical problem, the invention provides a deployment method of web services, and based on a multi-tenant technical theory, a plurality of business systems are deployed on the same web service platform in a tenant mode to realize business service isolation, so that cross-domain remote process call can be converted into local call, thereby saving the expenses of network communication, interaction and the like and improving the response efficiency.
The embedded web server is used as a web service platform, and the external business system instance is used as a tenant to be registered to the web service platform, so that the business service isolated multi-tenant system is realized. Specifically, after receiving a tenant registration request of a service system example, first allocating a tenant identifier to the tenant; then, configuration information corresponding to the service system can be obtained according to the tenant identity, so as to analyze a service alias (or a domain name of the tenant, and other tenants can access the tenant through the service alias), a private service interface (i.e., a method only allowed to be called by the tenant itself), a public service interface (a method shared by all tenants), a service alias (i.e., a service alias of another system which the current tenant needs to access), a service interface (which does not distinguish public and private), data source fragmentation information and the like, which are provided by the tenant to the outside; then, obtaining an executable class file of a service system according to a tenant identity and loading the executable class file into a JVM (Java virtual machine), wherein a class loading mechanism based on Java is needed in specific implementation, an executable resource package of the tenant is located at a place where a Java class loader cannot be loaded, so that the tenant needs to be loaded automatically, and a tenant resource file can be further incorporated (a section is connected to other application program types or objects and a notified object is created, such a behavior is called as incorporating) identity in the loading process, namely, a tenant identity tentrid which does not influence program operation is added into a compiled byte code file, so as to realize coding of the tenant; finally, the business system instance is published as a web service and distinguished from other web services by a port. When the configuration information of the business system is analyzed, a lock can be configured for the private service interface, so that the tenant holding the lock can access the private method of the business system instance.
The following describes a deployment method of a web service according to the present invention with reference to the accompanying drawings and specific embodiments.
Fig. 1 is a schematic diagram of main steps of a method for deploying a web service based on a multi-tenant technology according to an embodiment of the present invention. As shown in fig. 1, in order to implement that at least one business system is deployed to a web service platform in a tenant form, the method for deploying a web service based on a multi-tenant technology in the embodiment of the present invention mainly includes the following steps S101 to S103.
Step S101: acquiring a tenant registration request of a service system, wherein the tenant registration request comprises a configuration file and an executable file of the service system;
step S102: analyzing the configuration file, generating an authority verification rule for a private method in the configuration file, and loading an executable file;
step S103: ports are allocated to the business system and published as web services.
In step S102, data isolation may be performed on resource files such as an executable class file of the tenant, and in the loading process, intervention codes are dynamically injected to suspend and wake up the general thread. The method generates the authority verification rule for the private method so as to realize that only the specified user can access the private service interface of the service system, thereby realizing service isolation. After the authority verification rule is generated for the private method, the private method and the authority verification rule are stored in a tenant registration center of the web platform, so that authority verification can be performed when a subsequent user accesses the service system through the web service platform.
According to one embodiment of the invention, if the private method has a dependent method, the permission check rule is added to the annotation of the dependent method. Wherein, a dependent method refers to a method that the private method needs to depend on when executing. If the private method has a dependent method, when the private method is called to be executed, the dependent method needs to be executed, and at this time, the authority of the user can be checked according to the authority checking rule stored in the annotation of the dependent method. The authority verification rule may be flexibly set as required, and for example, the authority verification rule may be a token key pair generated and a token key pair used for authority verification, or a verification code generated and a verification code used for authority verification, and the like.
According to an embodiment of the present invention, after acquiring the tenant registration request of the service system, the method may further include:
marking the declared executable class files of the business system which need to use a coroutine processing method, and updating the executable class files of the business system into marked class files.
And, loading the executable class file includes:
and analyzing the executable class file, and weaving intervention codes into the marked method to realize the pause and the awakening of the general thread.
Through the technical scheme of the embodiment, business processing can be performed in a coroutine mode, and coroutine (coroutine) is also a program component as with a subroutine. Subroutines are portions of code of a main program that perform specific tasks and are relatively independent of other code in the main program, and are more general and flexible than subroutines, but are not as widely used in practice as subroutines. Compared with threads, the coroutines are relatively independent and have own contexts, but the switching is controlled by the system; the multiple coroutines are relatively independent and have own contexts, but the switching is controlled by the coroutines, and the current coroutine is switched to other coroutines and is controlled by the current coroutine. Therefore, the coroutine is more flexible in switching mode compared with the thread, the expense on creating and maintaining the thread can be saved, and the distributed high-concurrency throughput is improved.
The invention carries on the business processing based on the light-weight coroutine of JVM, while carrying on the systematic compilation to the class file according to built-in class loader and JVM agent of the invention, discern and record the class or method with coroutine label, and record the position of the class or method containing coroutine label into a self-defining file- "coroutine file", through cooperating with Java byte code file (. class) and coroutine file of the standard in order to realize the pause (yield method) and awaken (notify method) of the general thread while loading. The concurrent program yield method of the invention can not generate memory occupation on the JVM and suspend the thread, thereby saving the expense of creating and maintaining the thread.
In a distributed deployment environment, the coroutine processing mode of the invention controls the suspension and the continuous execution of the thread by the service system through yield action of coroutine, and the processing of distributed transactions in a concurrent environment can not cause the suspension and the blockage of the thread.
According to another embodiment of the present invention, after acquiring the tenant registration request of the service system, the method may further include:
and storing the executable class files into a database or a disk after serialization and compression processing.
According to the embodiment, after acquiring the tenant registration request of the business system, the configuration file and the executable class file of the business system, the web service platform can also store the executable class file of the business system into a database or a disk corresponding to a working space of the web service platform instead of directly loading the executable class file into the JVM, only when the business system is called, the class file is dynamically loaded and executed, and resources are released after business processing is completed, so that the dynamic loading and unloading of the class are realized, and the effective utilization rate of the JVM is improved.
According to another embodiment, the invention can store the executable class file containing the coroutine file to a disk or a database after serialization and compression processing, and only when the coroutine method is called, dynamic loading and intervention code weaving are carried out according to the coroutine file. If the coroutine method is not needed, the process does not produce redundant stack frames on the JVM. When the web service is called, the class loader reads the coroutine file from the compressed data, so as to obtain the method containing the coroutine identification and the method line needing yield (thread pause), as well as the parameter name and the request type. The class loader loads a target service class according to the parameter name and the request type and organizes an intervention code, when a program is executed to a yield method, the execution is terminated by throwing an exception, an execution result of the execution termination is stored to the stack top of the target service class as an intermediate value, and when the next call to the web service is initiated, the intermediate value is directly loaded from the last suspended position as a variable value and is pressed into an operation stack.
In a large-scale service integration environment, the invention writes the coroutine file into a disk by serializing and deserializing the executable class file, and the memory of the JVM is not consumed by the process.
By serializing and byte (byte) converting the runtime object and then performing the file conversion, the class file can be conveniently stored on storage media such as a disk and a database. The invention provides two dynamic compression modes according to different media to data size definitions. In a windows or linux system, English letters, numbers and English semihorn symbols occupy one byte, and in a relational database such as mysql, the varchar type Chinese and English occupancy are consistent.
In an embodiment of the present invention, if the compression is saved in the database, the compression process includes:
performing byte processing on the serialized executable class file to convert the executable class file into byte codes;
encoding the byte codes based on a Base64 encoding mode;
cutting off the first two bits of the 8-bit binary code corresponding to each byte code, and splicing the binary codes of all the byte codes;
and segmenting the binary code obtained after splicing into a section according to each 8 bits, and converting each segmented binary code into bytes after decimal transformation for compression processing.
Among them, Base64 is one of the most common encoding methods for transmitting 8Bit byte codes on a network, and Base64 is a method for representing binary data based on 64 printable characters.
In a disk medium of a server, a serialized file generated by arranging and combining 64 symbols of capital letters (A-Z), lowercase letters (a-Z), numbers (0-9) and English half-corner symbols (+/-) through Base64 coding processing of byte data is generated, the corresponding relation of 0-63 and 64 symbols is firstly established, then 0-63 is binarized, then the first two bits of the binary code of 8 bits are cut off and spliced with the binary code of the next processing, then each segment of 8 bits is segmented, the binary code after the segmentation processing is subjected to decimal processing, the byte value of the binary code is obtained and output to realize compression processing, and the decompression process is opposite.
In another embodiment of the present invention, if the data is saved to the disk, the compression process includes:
establishing a coordinate axis with a longitudinal axis of 54 and a transverse axis of 20, and representing a Chinese character symbol by the intersection point of each unit transverse axis and each unit longitudinal axis;
performing byte processing on the serialized executable class file to convert the executable class file into byte codes, and encoding the byte codes based on a Base64 encoding mode;
according to the corresponding relation between the preset codes and coordinate values on coordinate axes, acquiring horizontal and vertical coordinate values corresponding to the codes, and taking Chinese character symbols of the corresponding intersection points of the vertical axis and the horizontal axis as compressed files.
Wherein 54 refers to 54 symbols in total consisting of capital letters (A-Z), lowercase letters (a-Z) and English semi-character (+/-), and 20 refers to the number of possible repeated symbols. Specifically, for storage of class files in a relational database, a coordinate axis with a longitudinal axis of 54 and a longitudinal axis of 20 may be established, a position is replaced by a Chinese character symbol at an intersection point of the transverse axis and the longitudinal axis of each unit, Base64 processing is performed on byte codes after byte encoding, shorthand is performed on connected letters, for example, sssss is recorded as a form of an original value plus number s5, and then Chinese character symbols corresponding to s5 (where the first character s corresponds to a longitudinal axis coordinate and the second character 5 corresponds to a transverse axis coordinate) are searched on the coordinate axis and output to realize compression processing, and decompression processes are opposite.
Fig. 2 is a system architecture diagram of an embodiment of the present invention. As shown in fig. 2, the web service platform system of the present invention mainly includes a monitoring management platform, a web server and a database 3. The monitoring management platform is used for monitoring and managing the web service platform system, and a user submits a tenant registration request of the service system, executable resource files (such as: jar, zip, war, tar) of the service system, configuration information and the like through the monitoring management platform; the web server is a container for providing a running environment of each business system deployed on a web service platform, wherein a solid line represents access of public methods and data, and a dotted line represents usage of private methods and data; the database is used for storing application data of each business system.
FIG. 3 is a schematic diagram of a deployment flow of a web service according to an embodiment of the present invention. As shown in fig. 3, taking an example that a business system performs tenant registration through a web service platform, a deployment process of a web service mainly includes the following steps:
step S301: a user uploads an engineering compression package of a service system through a monitoring management platform, wherein the engineering compression package comprises a configuration file, an executable file and the like of the service system;
step S302: the central control dispatching device of the web service platform judges the current node state and distributes the current node state to different processors, wherein if ' f ' is 0 ', namely the business system uploads a project compression packet for the first time, the corresponding project compression packet is transmitted to a coder;
step S303: the code printer analyzes the configuration file in the engineering compression package to acquire information such as a service alias, a private service interface, a public service interface, a service alias and a service interface for calling an external system, a data source fragment id and the like which are externally provided by the service system; furthermore, renaming the declaration in the executable class file in the engineering compression package that needs to use the protocol processing method to realize adding the protocol identifier, where the renaming format is, for example: the original name _ coroutine _ protocol method name and the position of the method added with the protocol identification are recorded; finally, moving the processed file to a working space of a web service platform, and storing the processed file in a disk or a database corresponding to the working space;
step S304: after the coder finishes processing, the central control calling and dialing device of the web service platform judges the current node state again and allocates the current node state to different processors, wherein at the moment, "_ f = 1" indicates that the file is transferred to the working space of the web service platform, and then allocates the task of the current node to the initializer;
step S305: the initializer is used for deploying the service system uploaded to the working space of the web service platform into the JVM, specifically, calling a self-defined class loader through an agent of the JVM to load an executable class file, and analyzing the file containing the coroutine identification to generate a coroutine file; analyzing the configuration file, generating a token key pair for the private method, and pushing the private method and the key to a registration center; then searching whether the private method has a dependent method in the registry, if so, saving the secret key into an annotation file of the dependent method;
step S306: after the processing of the initializer is completed, the central control calling device of the web service platform judges the current node state again, wherein f is 2, which indicates that the file is loaded and analyzed, and returns to the monitoring management platform to upload successfully;
step S307: triggering execution by a user;
step S308: a central control transfer device of the web service platform distributes tasks to separators;
step S309: the splitter obtains an available port from a port pool of the registry and publishes the business system as a web service.
The process of other business systems for tenant registration through the web service platform is the same as the above process. Therefore, a plurality of business systems can be registered to the uniform web service platform in a tenant mode to realize service isolation.
Fig. 4 is a schematic diagram of main modules of a web service deployment apparatus based on multi-tenant technology according to an embodiment of the present invention. As shown in fig. 4, in order to implement that at least one business system is deployed to a web service platform in a tenant form, a deployment apparatus 400 of a web service based on a multi-tenant technology according to an embodiment of the present invention mainly includes a request acquisition module 401, an analysis loading module 402, and a service publishing module 403.
The request obtaining module 401 is configured to obtain a tenant registration request of a service system, where the tenant registration request includes a configuration file and an executable class file of the service system;
the analysis loading module 402 is configured to analyze the configuration file, generate an authority verification rule for a private method therein, and load the executable class file;
the service publishing module 403 is configured to allocate a port to the business system and publish the port as a web service.
According to one embodiment of the invention, if the private method has a dependent method, the permission check rule is added to the annotation of the dependent method.
According to another embodiment of the present invention, the apparatus 400 for deploying a web service based on a multi-tenant technology may further include a marking module (not shown in the figure) for:
after acquiring a tenant registration request of a service system, marking the declared executable class files of the service system which need to be processed by using a coroutine processing method, and updating the executable class files of the service system into marked class files.
According to an embodiment of the present invention, the parsing loading module 402 may be further configured to:
and analyzing the executable class file, and weaving an intervention code into the marked method to realize the pause and the awakening of the general thread.
According to another embodiment of the present invention, the apparatus 400 for deploying a web service based on a multi-tenant technology may further include a file saving module (not shown in the figure) for:
after acquiring a tenant registration request of a service system, storing the executable class file into a database or a disk after serialization and compression processing.
According to an embodiment of the present invention, if the compression is saved in the database, the compression process includes:
performing byte processing on the serialized executable class file to convert the executable class file into byte codes;
encoding the byte codes based on a Base64 encoding mode;
cutting off the first two bits of the 8-bit binary code corresponding to each byte code, and splicing the binary codes of all the byte codes;
and segmenting the binary code obtained after splicing into a section according to each 8 bits, and converting each segmented binary code into bytes after decimal transformation for compression processing.
According to another embodiment of the present invention, if the data is saved to the disk, the compression process includes:
establishing a coordinate axis with a longitudinal axis of 54 and a transverse axis of 20, and representing a Chinese character symbol by the intersection point of each unit transverse axis and each unit longitudinal axis;
performing byte processing on the serialized executable class file to convert the executable class file into byte codes, and encoding the byte codes based on a Base64 encoding mode;
according to the corresponding relation between the preset code and the coordinate values on the coordinate axis, acquiring the horizontal coordinate value and the vertical coordinate value corresponding to the code, and taking the Chinese character symbol of the corresponding intersection point of the vertical axis and the horizontal axis as a compressed file.
According to another aspect of the invention, a method and a device for calling the web service are also provided. Wherein the web service is deployed according to the method in the foregoing embodiment. The calling method of the web service mainly comprises the following steps:
acquiring a request type of a web service calling request initiated by a user;
when the request type is a private request, performing authority verification on the user;
and when the permission check is passed, responding to the web service calling request.
According to an embodiment of the present invention, the performing the authority check on the user includes:
acquiring a private method corresponding to the private request;
and carrying out authority verification on the user according to the authority verification rule of the private method.
According to another embodiment of the present invention, the performing the authority check on the user includes:
acquiring a private method corresponding to the private request;
if the private method has a dependent method, acquiring the authority verification rule from the annotation of the dependent method;
and carrying out authority verification on the user according to the authority verification rule.
FIG. 5 is a schematic diagram of a call flow of a web service according to an embodiment of the present invention. As shown in fig. 5, the call flow of the web service according to an embodiment of the present invention mainly includes the following steps:
step S501: a user initiates a call request of a web service to a web service platform, at this time, the call request does not need to distinguish web service devices, and only needs to add a port number port corresponding to the web service, where the call request is, for example: http:// xxxx: port/x/x;
step S502: after the request reaches the target web service, an IOC (Inversion of Control) controller of the web service platform performs authority verification before service processing, and because the web service has a public method and a private method, the authority verification needs to be performed on a user;
step S503: the IOC controller judges the request type, and when the request type is a private request, the encryption machine performs authority verification;
step S504: the encryption machine firstly obtains a secret key corresponding to a private method of the target web service or a secret key corresponding to a secret key of a dependent method of the private method from a registry; then, the encryption machine checks whether the key is legal (for example, whether the generation rule is satisfied, whether the key is issued by the web service platform, and the like) and whether the key is legal; if yes, the verification is passed, and the secret key or verification success information is sent to the IOC controller;
step S505: the IOC controller sends the secret key to the target web service;
step S506: the target web service requests a dependent service (a service corresponding to a dependent method) to perform business processing according to the secret key;
step S507: after receiving the request of the target web service, the dependent service performs permission verification again by the IOC control system through executing the steps S502-S504, and after the permission verification is passed, the IOC controller sends the secret key to the dependent service;
step S508: the dependence service returns a response result to the target web service;
step S509: the target web service returns a response result.
According to the embodiment of the invention, the calling device of the web service based on the multi-tenant technology mainly comprises:
the type obtaining module is used for obtaining the request type of the web service calling request initiated by the user;
the authority verification module is used for verifying the authority of the user when the request type is a private request;
and the request response module is used for responding to the web service calling request when the permission verification passes.
Wherein, the permission verification module can be further configured to:
acquiring a private method corresponding to the private request;
and carrying out authority verification on the user according to the authority verification rule of the private method.
In addition, the permission verification module may be further configured to:
acquiring a private method corresponding to the private request;
if the private method has a dependent method, acquiring the authority verification rule from the annotation of the dependent method;
and carrying out authority verification on the user according to the authority verification rule.
According to the technical scheme of the embodiment of the invention, the web service deployment method based on the multi-tenant technology is realized by acquiring the tenant registration request of the business system, analyzing the configuration file of the business system to generate the authority verification rule for the private method, and after the executable class file of the business system is loaded, allocating the port for the business system and issuing the web service, and based on the multi-tenant technology theory, deploying a plurality of business systems on the same web service platform in the form of tenants to realize business service isolation, so that cross-domain remote process call can be converted into local call, thereby saving the expenses of network communication, interaction and the like and improving the response efficiency. In addition, the invention can also use the way of coordinating the journey to carry on the business processing, the coordinating journey is relative to thread, its switching mode is more flexible, and can save the establishment of the thread, maintain the expenses, improve the throughput under the distributed high concurrency; meanwhile, the executable class files of the business system can be stored in a database or a disk corresponding to the working space of the web service platform instead of being directly loaded into the JVM, the class files can be dynamically loaded and executed only when the business system is called, and resources are released after business processing is finished, so that the dynamic loading and unloading of the class are realized, and the effective utilization rate of the JVM is improved.
Fig. 6 illustrates an exemplary system architecture 600 of a deployment, invocation method or device of a multi-tenant technology based web service to which embodiments of the present invention may be applied.
As shown in fig. 6, the system architecture 600 may include terminal devices 601, 602, 603, a network 604, and a server 605. The network 604 serves to provide a medium for communication links between the terminal devices 601, 602, 603 and the server 605. Network 604 may include various types of connections, such as wire, wireless communication links, or fiber optic cables, to name a few.
A user may use the terminal devices 601, 602, 603 to interact with the server 605 via the network 604 to receive or send messages or the like. The terminal devices 601, 602, 603 may have installed thereon various communication client applications, such as shopping applications, web browser applications, search applications, instant messaging tools, mailbox clients, social platform software, etc. (by way of example only).
The terminal devices 601, 602, 603 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop portable computers, desktop computers, and the like.
The server 605 may be a server providing various services, such as a background management server (for example only) providing support for shopping websites browsed by users using the terminal devices 601, 602, 603. The backend management server may analyze and perform other processing on the received data such as the product information query request, and feed back a processing result (for example, target push information, product information — just an example) to the terminal device.
It should be noted that the deployment and calling method of the web service based on the multi-tenant technology provided by the embodiment of the present invention is generally executed by the server 605, and accordingly, the deployment and calling device of the web service based on the multi-tenant technology is generally disposed in the server 605.
It should be understood that the number of terminal devices, networks, and servers in fig. 6 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
Referring now to FIG. 7, a block diagram of a computer system 700 suitable for use with a terminal device or server implementing an embodiment of the invention is shown. The terminal device or the server shown in fig. 7 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present invention.
As shown in fig. 7, the computer system 700 includes a Central Processing Unit (CPU)701, which can perform various appropriate actions and processes in accordance with a program stored in a Read Only Memory (ROM)702 or a program loaded from a storage section 708 into a Random Access Memory (RAM) 703. In the RAM 703, various programs and data necessary for the operation of the system 700 are also stored. The CPU 701, the ROM 702, and the RAM 703 are connected to each other via a bus 704. An input/output (I/O) interface 705 is also connected to bus 704.
To the I/O interface 705, AN input section 706 including a keyboard, a mouse, and the like, AN output section 707 including a keyboard such as a Cathode Ray Tube (CRT), a liquid crystal display (L CD), and the like, a speaker, and the like, a storage section 708 including a hard disk and the like, and a communication section 709 including a network interface card such as a L AN card, a modem, and the like, the communication section 709 performs communication processing via a network such as the internet, a drive 710 is also connected to the I/O interface 705 as necessary, a removable medium 711 such as a magnetic disk, AN optical disk, a magneto-optical disk, a semiconductor memory, and the like is mounted on the drive 710 as necessary, so that a computer program read out therefrom is mounted into the storage section 708 as necessary.
In particular, according to the embodiments of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In such an embodiment, the computer program can be downloaded and installed from a network through the communication section 709, and/or installed from the removable medium 711. The computer program performs the above-described functions defined in the system of the present invention when executed by the Central Processing Unit (CPU) 701.
It should be noted that the computer readable medium shown in the present invention can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present invention, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In the present invention, however, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units or modules described in the embodiments of the present invention may be implemented by software, or may be implemented by hardware. The described units or modules may also be provided in a processor, and may be described as: a processor comprises a request acquisition module, a parsing loading module and a service publishing module. The names of these units or modules do not in some cases constitute a limitation on the units or modules themselves, for example, the request acquisition module may also be described as a "module for acquiring a tenant registration request of a business system".
As another aspect, the present invention also provides a computer-readable medium that may be contained in the apparatus described in the above embodiments; or may be separate and not incorporated into the device. The computer readable medium carries one or more programs which, when executed by a device, cause the device to comprise: acquiring a tenant registration request of a service system, wherein the tenant registration request comprises a configuration file and an executable file of the service system; analyzing the configuration file, generating an authority verification rule for a private method in the configuration file, and loading the executable file; and allocating ports for the business system and publishing the ports as web services.
According to the technical scheme of the embodiment of the invention, the web service deployment method based on the multi-tenant technology is realized by acquiring the tenant registration request of the business system, analyzing the configuration file of the business system to generate the authority verification rule for the private method, and after the executable class file of the business system is loaded, allocating the port for the business system and issuing the web service, and based on the multi-tenant technology theory, deploying a plurality of business systems on the same web service platform in the form of tenants to realize business service isolation, so that cross-domain remote process call can be converted into local call, thereby saving the expenses of network communication, interaction and the like and improving the response efficiency. In addition, the invention can also use the way of coordinating the journey to carry on the business processing, the coordinating journey is relative to thread, its switching mode is more flexible, and can save the establishment of the thread, maintain the expenses, improve the throughput under the distributed high concurrency; meanwhile, the executable class files of the business system can be stored in a database or a disk corresponding to the working space of the web service platform instead of being directly loaded into the JVM, the class files can be dynamically loaded and executed only when the business system is called, and resources are released after business processing is finished, so that the dynamic loading and unloading of the class are realized, and the effective utilization rate of the JVM is improved.
The above-described embodiments should not be construed as limiting the scope of the invention. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions can occur, depending on design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (22)

1. A method for deploying web services based on multi-tenant technology is characterized in that not less than one business system is deployed to a web service platform in a tenant mode, and the method comprises the following steps:
acquiring a tenant registration request of a service system, wherein the tenant registration request comprises a configuration file and an executable file of the service system;
analyzing the configuration file, generating an authority verification rule for a private method in the configuration file, and loading the executable file;
and allocating ports for the business system and publishing the ports as web services.
2. The deployment method according to claim 1, wherein if the private method has a dependent method, the permission check rule is added to the annotation of the dependent method, wherein the dependent method refers to a method that the private method needs to depend on when executing.
3. The deployment method according to claim 1, wherein after acquiring the tenant registration request of the service system, the method further comprises:
marking the declared executable class files of the service system which need to use a coroutine processing method, and updating the executable class files of the service system into marked class files.
4. The deployment method of claim 3 wherein loading the executable class file comprises:
and analyzing the executable class file, and weaving an intervention code into the marked method to realize the pause and the awakening of the general thread.
5. The deployment method according to claim 1, wherein after acquiring the tenant registration request of the service system, the method further comprises:
and storing the executable class file into a database or a disk after serialization and compression processing.
6. The deployment method of claim 5, wherein if the compression process is saved in the database, the compression process comprises:
performing byte processing on the serialized executable class file to convert the executable class file into byte codes;
encoding the byte codes based on a Base64 encoding mode;
cutting off the first two bits of the 8-bit binary code corresponding to each byte code, and splicing the binary codes of all the byte codes;
and segmenting the binary code obtained after splicing into a section according to each 8 bits, and converting each segmented binary code into bytes after decimal transformation for compression processing.
7. The deployment method of claim 5, wherein if the data is saved to disk, the compressing comprises:
establishing a coordinate axis with a longitudinal axis of 54 and a transverse axis of 20, and representing a Chinese character symbol by the intersection point of each unit transverse axis and each unit longitudinal axis;
performing byte processing on the serialized executable class file to convert the executable class file into byte codes, and encoding the byte codes based on a Base64 encoding mode;
according to the corresponding relation between the preset code and the coordinate values on the coordinate axis, acquiring the horizontal coordinate value and the vertical coordinate value corresponding to the code, and taking the Chinese character symbol of the corresponding intersection point of the vertical axis and the horizontal axis as a compressed file.
8. A deployment device of web services based on multi-tenant technology is characterized in that not less than one business system is deployed to a web service platform in a tenant mode, and the device comprises:
the system comprises a request acquisition module, a service system and a service management module, wherein the request acquisition module is used for acquiring a tenant registration request of the service system, and the tenant registration request comprises a configuration file and an executable file of the service system;
the analysis loading module is used for analyzing the configuration file, generating an authority verification rule for a private method in the configuration file and loading the executable file;
and the service publishing module is used for distributing a port for the service system and publishing the port as the web service.
9. The deployment apparatus according to claim 8, wherein if the private method has a dependent method, the permission check rule is added to the annotation of the dependent method, wherein a dependent method refers to a method that the private method needs to depend on when executing.
10. The deployment device of claim 8 further comprising a marking module to:
after acquiring a tenant registration request of a service system, marking the declared executable class files of the service system which need to be processed by using a coroutine processing method, and updating the executable class files of the service system into marked class files.
11. The deployment device of claim 10 wherein the parse loading module is further configured to:
and analyzing the executable class file, and weaving an intervention code into the marked method to realize the pause and the awakening of the general thread.
12. The deployment device of claim 8 further comprising a file save module configured to:
after acquiring a tenant registration request of a service system, storing the executable class file into a database or a disk after serialization and compression processing.
13. The deployment device of claim 12 wherein the compression process, if saved to the database, comprises:
performing byte processing on the serialized executable class file to convert the executable class file into byte codes;
encoding the byte codes based on a Base64 encoding mode;
cutting off the first two bits of the 8-bit binary code corresponding to each byte code, and splicing the binary codes of all the byte codes;
and segmenting the binary code obtained after splicing into a section according to each 8 bits, and converting each segmented binary code into bytes after decimal transformation for compression processing.
14. The deployment device of claim 12, wherein if the data is saved to disk, the compression process comprises:
establishing a coordinate axis with a longitudinal axis of 54 and a transverse axis of 20, and representing a Chinese character symbol by the intersection point of each unit transverse axis and each unit longitudinal axis;
performing byte processing on the serialized executable class file to convert the executable class file into byte codes, and encoding the byte codes based on a Base64 encoding mode;
according to the corresponding relation between the preset code and the coordinate values on the coordinate axis, acquiring the horizontal coordinate value and the vertical coordinate value corresponding to the code, and taking the Chinese character symbol of the corresponding intersection point of the vertical axis and the horizontal axis as a compressed file.
15. A method for calling a web service based on multi-tenant technology, wherein the web service is deployed according to the method of any one of claims 1-7, and the method for calling comprises:
acquiring a request type of a web service calling request initiated by a user;
when the request type is a private request, performing authority verification on the user;
and when the permission check is passed, responding to the web service calling request.
16. The calling method of claim 15, wherein performing the permission check on the user comprises:
acquiring a private method corresponding to the private request;
and carrying out authority verification on the user according to the authority verification rule of the private method.
17. The calling method of claim 15, wherein performing the permission check on the user comprises:
acquiring a private method corresponding to the private request;
if the private method has a dependent method, acquiring the authority verification rule from the annotation of the dependent method, wherein the dependent method refers to a method which needs to be depended on when the private method is executed;
and carrying out authority verification on the user according to the authority verification rule.
18. A calling device of a web service based on multi-tenant technology, wherein the web service is deployed according to the method of any one of claims 1-7, the calling device comprising:
the type obtaining module is used for obtaining the request type of the web service calling request initiated by the user;
the authority verification module is used for verifying the authority of the user when the request type is a private request;
and the request response module is used for responding to the web service calling request when the permission verification passes.
19. The calling device of claim 18, wherein the permission check module is further configured to:
acquiring a private method corresponding to the private request;
and carrying out authority verification on the user according to the authority verification rule of the private method.
20. The calling device of claim 18, wherein the permission check module is further configured to:
acquiring a private method corresponding to the private request;
if the private method has a dependent method, acquiring the authority verification rule from the annotation of the dependent method, wherein the dependent method refers to a method which needs to be depended on when the private method is executed;
and carrying out authority verification on the user according to the authority verification rule.
21. An electronic device, comprising:
one or more processors;
a storage device for storing one or more programs,
when executed by the one or more processors, cause the one or more processors to implement a method as recited in any one of claims 1-7 and/or 15-17.
22. A computer-readable medium, on which a computer program is stored, which program, when being executed by a processor, is adapted to carry out the method of any one of claims 1-7 and/or 15-17.
CN201811025208.3A 2018-09-04 2018-09-04 Method and device for deploying and calling web service based on multi-tenant technology Active CN109274731B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201811025208.3A CN109274731B (en) 2018-09-04 2018-09-04 Method and device for deploying and calling web service based on multi-tenant technology
PCT/CN2019/103532 WO2020048391A1 (en) 2018-09-04 2019-08-30 Methods and apparatuses for deploying and invoking web services based on multi-tenancy technology

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811025208.3A CN109274731B (en) 2018-09-04 2018-09-04 Method and device for deploying and calling web service based on multi-tenant technology

Publications (2)

Publication Number Publication Date
CN109274731A CN109274731A (en) 2019-01-25
CN109274731B true CN109274731B (en) 2020-07-31

Family

ID=65188180

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811025208.3A Active CN109274731B (en) 2018-09-04 2018-09-04 Method and device for deploying and calling web service based on multi-tenant technology

Country Status (2)

Country Link
CN (1) CN109274731B (en)
WO (1) WO2020048391A1 (en)

Families Citing this family (20)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109274731B (en) * 2018-09-04 2020-07-31 京东数字科技控股有限公司 Method and device for deploying and calling web service based on multi-tenant technology
CN110708310B (en) * 2019-09-30 2022-02-08 杭州数梦工场科技有限公司 Tenant-level authority management method, device and equipment
CN111427684B (en) * 2020-03-20 2023-04-07 支付宝(杭州)信息技术有限公司 Service deployment method, system and device
CN113495895B (en) * 2020-04-02 2023-11-03 北京京东振世信息技术有限公司 Method and device for updating data
CN111581291B (en) * 2020-05-09 2023-04-28 抖音视界有限公司 Data processing method, device, electronic equipment and readable medium
CN111580820B (en) * 2020-05-25 2023-09-15 泰康保险集团股份有限公司 Applet generation method and device
CN111861140A (en) * 2020-06-28 2020-10-30 微民保险代理有限公司 Service processing method, device, storage medium and electronic device
CN111931103A (en) * 2020-07-09 2020-11-13 北京皮尔布莱尼软件有限公司 Website deployment method
CN113778499B (en) * 2020-08-21 2023-09-26 北京京东振世信息技术有限公司 Method, apparatus, device and computer readable medium for publishing services
CN112181470A (en) * 2020-09-22 2021-01-05 京东数字科技控股股份有限公司 Method and device for deploying patch
CN112463147B (en) * 2020-11-26 2023-07-04 杭州览众数据科技有限公司 Customized demand development method for generalized model
CN112800120B (en) * 2021-01-26 2023-06-06 政采云有限公司 Service processing method and device
CN115509727A (en) * 2021-06-07 2022-12-23 贵州白山云科技股份有限公司 Service code processing method, device, equipment and medium based on distributed network
CN113688152B (en) * 2021-08-30 2023-12-05 北京京东振世信息技术有限公司 System function self-checking method and device
CN113742774B (en) * 2021-09-03 2024-02-09 北京字跳网络技术有限公司 Data processing method and device, readable medium and electronic equipment
CN114595199B (en) * 2022-05-10 2022-09-02 太平金融科技服务(上海)有限公司 File analysis method and device, computer equipment and storage medium
CN115001776B (en) * 2022-05-26 2024-01-30 浙江网商银行股份有限公司 Data processing system and method
CN114693283B (en) * 2022-06-01 2022-09-27 四川高灯企服科技有限公司 Cross-system business process approval processing method and device and computer equipment
CN115268924B (en) * 2022-06-10 2023-05-02 知学云(北京)科技股份有限公司 Formula calculation engine service method and system based on aPaaS platform
CN116107547A (en) * 2023-01-04 2023-05-12 三峡高科信息技术有限责任公司 Unified service and multi-data source management method

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1509561A (en) * 2001-05-15 2004-06-30 ��˹��ŵ�� Contex sensitive web service
CN101192937A (en) * 2006-11-24 2008-06-04 华为技术有限公司 A hot deployable method and its system
US7506175B2 (en) * 2000-11-06 2009-03-17 International Business Machines Corporation File language verification
CN102323884A (en) * 2011-09-07 2012-01-18 山东中创软件工程股份有限公司 Web service container and method for issuing multiple Web services
CN102411506A (en) * 2011-07-07 2012-04-11 杭州典能科技有限公司 Java-system business-unit plug-in type managing system and dynamic business-function changing method
CN102663009A (en) * 2012-03-19 2012-09-12 华侨大学 Web-service integration method supporting data privatization of enterprise users
CN103078858A (en) * 2012-12-31 2013-05-01 上海同岩土木工程科技有限公司 Web service and signature certificate-based software trial authorization method
US8825815B2 (en) * 2008-01-08 2014-09-02 Amdocs Software Systems Limited System and method for client synchronization for a communication device
CN104539429A (en) * 2014-12-30 2015-04-22 飞天诚信科技股份有限公司 Cryptographic certificate positioning method, device and system
CN106453288A (en) * 2016-09-29 2017-02-22 上海和付信息技术有限公司 Asynchronous mode supporting distributed micro service framework system and implementation method thereof

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7415704B2 (en) * 2004-05-20 2008-08-19 Sap Ag Sharing objects in runtime systems
US8924542B1 (en) * 2011-05-31 2014-12-30 Amazon Technologies, Inc. Methods and apparatus for scalable private services
CN103036856A (en) * 2011-10-09 2013-04-10 镇江金软计算机科技有限责任公司 Multi-tenant system achievement based on software as a service (SAAS) application
CN109274731B (en) * 2018-09-04 2020-07-31 京东数字科技控股有限公司 Method and device for deploying and calling web service based on multi-tenant technology

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7506175B2 (en) * 2000-11-06 2009-03-17 International Business Machines Corporation File language verification
CN1509561A (en) * 2001-05-15 2004-06-30 ��˹��ŵ�� Contex sensitive web service
CN101192937A (en) * 2006-11-24 2008-06-04 华为技术有限公司 A hot deployable method and its system
US8825815B2 (en) * 2008-01-08 2014-09-02 Amdocs Software Systems Limited System and method for client synchronization for a communication device
CN102411506A (en) * 2011-07-07 2012-04-11 杭州典能科技有限公司 Java-system business-unit plug-in type managing system and dynamic business-function changing method
CN102323884A (en) * 2011-09-07 2012-01-18 山东中创软件工程股份有限公司 Web service container and method for issuing multiple Web services
CN102663009A (en) * 2012-03-19 2012-09-12 华侨大学 Web-service integration method supporting data privatization of enterprise users
CN103078858A (en) * 2012-12-31 2013-05-01 上海同岩土木工程科技有限公司 Web service and signature certificate-based software trial authorization method
CN104539429A (en) * 2014-12-30 2015-04-22 飞天诚信科技股份有限公司 Cryptographic certificate positioning method, device and system
CN106453288A (en) * 2016-09-29 2017-02-22 上海和付信息技术有限公司 Asynchronous mode supporting distributed micro service framework system and implementation method thereof

Also Published As

Publication number Publication date
CN109274731A (en) 2019-01-25
WO2020048391A1 (en) 2020-03-12

Similar Documents

Publication Publication Date Title
CN109274731B (en) Method and device for deploying and calling web service based on multi-tenant technology
CN113495921A (en) Routing method and device of database cluster
CN111491037B (en) Communication method with object storage server through SFTP data stream
CN110795315A (en) Method and device for monitoring service
US20170083387A1 (en) High-performance computing framework for cloud computing environments
US20160092206A1 (en) Managing executable files
CN112612467A (en) Method and device for processing micro front-end architecture based on qiankun
CN111124291B (en) Data storage processing method and device of distributed storage system and electronic equipment
CN111767126A (en) System and method for distributed batch processing
CN112398669A (en) Hadoop deployment method and device
CN109284177B (en) Data updating method and device
CN113779122B (en) Method and device for exporting data
CN110795741A (en) Method and device for carrying out security processing on data
CN113760861A (en) Data migration method and device
CN111191256B (en) Method and device for configuring user permission
US11861386B1 (en) Application gateways in an on-demand network code execution system
CN114070889A (en) Configuration method, traffic forwarding method, device, storage medium, and program product
CN112559001A (en) Method and device for updating application
CN111984616A (en) Method, device and system for updating shared file
CN112394907A (en) Container-based delivery system construction method, application delivery method and delivery system
CN112288396A (en) Multi-system user attribute information management method and device and electronic equipment
CN112214500A (en) Data comparison method and device, electronic equipment and storage medium
US11520781B2 (en) Efficient bulk loading multiple rows or partitions for a single target table
CN113760480A (en) Task scheduling method, device and system
CN113778323A (en) File processing 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
CB02 Change of applicant information
CB02 Change of applicant information

Address after: Branch of Beijing economic and Technological Development Zone of Beijing City eleven street 101111 No. 18 floor 2 block C room 221

Applicant after: JINGDONG DIGITAL TECHNOLOGY HOLDINGS Co.,Ltd.

Address before: Branch of Beijing economic and Technological Development Zone of Beijing City eleven street 101111 No. 18 floor 2 block C room 221

Applicant before: BEIJING JINGDONG FINANCIAL TECHNOLOGY HOLDING Co.,Ltd.

GR01 Patent grant
GR01 Patent grant
CP01 Change in the name or title of a patent holder
CP01 Change in the name or title of a patent holder

Address after: 101111 Room 221, 2nd Floor, Block C, 18 Kechuang 11th Street, Beijing Economic and Technological Development Zone

Patentee after: Jingdong Technology Holding Co.,Ltd.

Address before: 101111 Room 221, 2nd Floor, Block C, 18 Kechuang 11th Street, Beijing Economic and Technological Development Zone

Patentee before: Jingdong Digital Technology Holding Co.,Ltd.

Address after: 101111 Room 221, 2nd Floor, Block C, 18 Kechuang 11th Street, Beijing Economic and Technological Development Zone

Patentee after: Jingdong Digital Technology Holding Co.,Ltd.

Address before: 101111 Room 221, 2nd Floor, Block C, 18 Kechuang 11th Street, Beijing Economic and Technological Development Zone

Patentee before: JINGDONG DIGITAL TECHNOLOGY HOLDINGS Co.,Ltd.