Request processing method and device
A technology for processing requests and processors, applied in the computer field, it can solve the problems of multi-tenant influence and high development and maintenance costs of single-tenancy, and achieve the effect of overcoming high development and maintenance costs, eliminating the problem of service interaction, and meeting individual needs.
Pending Publication Date: 2020-05-26
CCB FINTECH CO LTD
0 Cites 0 Cited by
AI-Extracted Technical Summary
Problems solved by technology
[0007] In view of this, the embodiment of the present invention provides a method and device for processing requests to solve the tec...
Method used
1. Adopt the mode of front-end and back-end separation, the front-end is responsible for the rendering of the page server, and the back-end provides the interface services required by the website; the multi-tenant scene can realize the multiplexing of back-end services, and the front-end services can be managed while meeting the requirements of height The pages can be customized and multi-tenant with low maintenance cost; the front-end service supports static website, realizes the fault isolation mechanism of back-end service, and eliminates the problem of service interaction caused by multi-tenant service.
According to the various embodiments described above, it can be seen that the present invention distributes the request to the rendering service of the website server or the static service of the website according to the health status information of the service corresponding to the tenant, thereby returning dynamic data or static The technical means of data solves the technical problems in the prior art that multi-tenant services will be affected by each other and single-tenant development and maintenance costs are high. The embodiment of the present invention adopts the mode of front-end and back-end separation, the front-end is responsible for page server rendering, and the back-end provides interface services required by the website, so that multi-tenant scenarios can realize back-end service reuse, thereby ensuring lower development and maintenance costs Under the premise, it can not only fully meet the individual needs of multi-tenants, but also shield the mutual influence of services between multi-tenants by means of fault isolation. Moreover, the front-end service of the website can make the site static, realize fault isolation from the back-end service, and eliminate the problem of service interaction caused by multi-tenant services.
[0045] The embodiment of the present invention adopts the method of separating the front and back ends, independently deploys the server rendering service in units of tenants, centrally deploys the background public services of the website and the management functions of multi-tenants, and introduces the health status check service, The health status of server-side rendering service and website background service can be identified in real time, so that under the premise of ensuring low development and maintenance costs, it can not only fully meet the individual needs of multi-tenants, but also shield multi-tenants through fault isolation. interaction between services.
[0054] Optionally, the website server rendering service adopts a multi-instance architecture deployment, and the website background service adopts a single-instance architecture deployment, so that under the premise of ensuring lower development and maintenance costs, the multi-tenant requirements can be fully satisfied. Personalized requirements can also be shielded from the interaction of services between multiple tenants through fault isolation.
[0...
Abstract
The invention discloses a request processing method and device, and relates to the technical field of computers. A specific embodiment of the method comprises the steps of receiving a request sent bya tenant; distributing the request to a website server rendering service or a website static service according to the health state information of the service corresponding to the tenant; and returningthe dynamic data or the static data corresponding to the request. According to the embodiment, the technical problems that services of multiple tenants are mutually influenced and the development andmaintenance cost of a single tenant is high can be solved.
Application Domain
Website content managementSpecial data processing applications
Technology Topic
EngineeringServer +4
Image
Examples
- Experimental program(1)
Example Embodiment
[0044] The following describes exemplary embodiments of the present invention with reference to the accompanying drawings, which include various details of the embodiments of the present invention to facilitate understanding, and should be regarded as merely exemplary. Therefore, those of ordinary skill in the art should realize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of the present invention. Likewise, for clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.
[0045] The embodiment of the present invention adopts the method of separating the front and back ends. The server rendering service is independently deployed on a tenant basis, the background public service of the website and the multi-tenant management function are centrally deployed, and the health status check service is introduced to enable the server The health status of rendering services and website backend services can be identified in real time, so that under the premise of ensuring low development and maintenance costs, it can not only fully meet the individual needs of multi-tenants, but also shield the services between multi-tenants through fault isolation. interdependent.
[0046] figure 1 It is a schematic diagram of the main flow of the method for processing a request according to an embodiment of the present invention. As an embodiment of the present invention, such as figure 1 As shown, the method for processing the request may include:
[0047] Step 101: Receive a request sent by a tenant.
[0048] Receive the request sent from the tenant website, and parse the request.
[0049] Step 102, according to the health status information of the service corresponding to the tenant, distribute the request to a website server rendering service or a website static service.
[0050] Before distributing the request, periodically receive the health status information of the service corresponding to each tenant, and distribute the request sent by the tenant to the website server rendering service or the website static service according to the health status information of the service corresponding to each tenant.
[0051] Optionally, according to the health status information of the service corresponding to the tenant, distributing the request to a website server rendering service or a website static service, including: if the health status information of the service corresponding to the tenant is normal, then Distribute the request to the website server rendering service to obtain dynamic data; if the health status information of the service corresponding to the tenant is abnormal, then distribute the request to the website static service to obtain static data.
[0052] In the embodiment of the present invention, the website staticization service is a simple static website service, which stores static data of high-frequency access routes of various tenant websites. Therefore, the corresponding static page file is returned according to the requested page route. The website server-side rendering service is the main service independently deployed by multiple tenants. This service provides the server-side rendering capability of the tenant website. During the server-side rendering process, it will request the website back-end service deployed by the multi-tenant uniformly to obtain website-related dynamics. data.
[0053] Optionally, the service corresponding to the tenant includes a website server-side rendering service and a website background service. Therefore, it is necessary to periodically obtain the health status information of the website server rendering service and the website background service corresponding to each tenant.
[0054] Optionally, the server-side rendering service of the website is deployed in a multi-instance architecture, and the back-end service of the website is deployed in a single-instance architecture, so that the individual needs of multi-tenants can be fully met while ensuring low development and maintenance costs. , And can shield the mutual influence of services between multi-tenants by means of fault isolation.
[0055] Single-tenant SaaS architecture: also known as multi-instance architecture, which refers to the creation of separate software applications and supporting environments for each customer. Single-tenant SaaS is widely cited in applications where customers need to support customization. Each client has a separate database and operating system on a separate server, or in a virtual network environment isolated with strong security measures.
[0056] Multi-tenant SaaS architecture: Applications are all running on the same server or group of servers, which is called a "single instance" architecture. Multi-tenancy is more suitable for customers with general needs, that is, customers who do not need to adjust or reconfigure mainline functions. The data of multiple tenants is stored in the same location, and partitions are usually used to ensure data isolation between tenants.
[0057] Step 103: Return dynamic data or static data corresponding to the request.
[0058] After obtaining the dynamic data or static data corresponding to the request, the dynamic data or static data is returned to the tenant.
[0059] Optionally, the method further includes: synchronizing rendering results corresponding to requests whose request frequency is greater than a preset frequency threshold to the corresponding website staticization service in the form of static data at specified time intervals. In the embodiment of the present invention, the rendering result of the high-frequency routing request can also be synchronized to the corresponding website static service in the form of a page static file according to a certain time frequency. Then, when the health status information of the website server-side rendering service or the website background service is abnormal, it can be requested to be distributed to the website static service to obtain static data.
[0060] According to the various embodiments described above, it can be seen that the present invention distributes the request to the website server rendering service or website static service according to the health status information of the service corresponding to the tenant, thereby returning dynamic data or static data. The method solves the technical problems in the prior art that the services of multi-tenants are mutually affected and the development and maintenance costs of single-tenants are high. The embodiment of the present invention adopts a front-end and back-end separation mode, the front-end is responsible for page server-side rendering, and the back-end provides interface services required by the website, so that multi-tenant scenarios can realize back-end service reuse, thereby ensuring low development and maintenance costs Under the premise, it can not only fully meet the individual needs of multi-tenants, but also shield the mutual influence of services between multi-tenants by means of fault isolation. In addition, the front-end service of the website can make the site static, realize fault isolation from the back-end service, and eliminate the mutual influence of services caused by multi-tenant services.
[0061] figure 2 It is a schematic diagram of the main flow of a request processing method according to an embodiment of the present invention. As an embodiment of the present invention, such as figure 2 As shown, the method for processing the request may include:
[0062] Step 201: Receive the health status information of the service corresponding to each tenant in real time.
[0063] Optionally, the service corresponding to the tenant includes a website server rendering service and a website background service.
[0064] Step 202: Receive and parse the request sent by the tenant.
[0065] Step 203, query whether the health status information of the service corresponding to the tenant is normal; if so, perform step 204; if not, perform step 205.
[0066] Step 204: Distribute the request to the rendering service of the website server to obtain dynamic data.
[0067] In the embodiment of the present invention, the website server rendering service is the main service independently deployed by multiple tenants. The service provides the server rendering capability of the tenant website. During the server rendering process, the website backend deployed by the multitenant uniformly will be requested on demand. Services to obtain dynamic data related to the website.
[0068] Step 205: Distribute the request to the website staticization service to obtain static data.
[0069] In the embodiment of the present invention, the website staticization service is a simple static website service that stores static data of the high-frequency access routes of each tenant website. Therefore, the corresponding static page file is returned according to the requested page route.
[0070] Optionally, the server-side rendering service of the website is deployed in a multi-instance architecture, and the back-end service of the website is deployed in a single-instance architecture, so that the individual needs of multi-tenants can be fully met while ensuring low development and maintenance costs. , And can shield the mutual influence of services between multi-tenants by means of fault isolation.
[0071] Step 206: Return dynamic data or static data corresponding to the request.
[0072] Step 207: Synchronize rendering results corresponding to requests whose request frequency is greater than the preset frequency threshold to the corresponding website static service in the form of static data at designated time intervals.
[0073] The rendering results of high-frequency routing requests are synchronized to the corresponding website static service in the form of page static files according to a certain time frequency. Then, when the health status information of the website server-side rendering service or the website background service is abnormal, it can be requested to be distributed to the website static service to obtain static data.
[0074] In addition, in the present invention, one can refer to the specific implementation content of the request processing method in the embodiment, which has been described in detail in the above-mentioned request processing method, so the repeated content will not be described here.
[0075] image 3 It is an architecture diagram of a server-side rendering website system that implements a method for processing a request according to an embodiment of the present invention. Such as image 3 As shown, the server-side rendering website system includes a network pre-distribution module 100, a website staticization service 201, a website server-side rendering service 202, a health check service 203, a website background service 300, and a multi-tenant management background 400. among them:
[0076] The network pre-distribution module 100 receives the request from the tenant website domain name and parses it. At the same time, the network front-end distribution module 100 regularly collects the health status information of the service corresponding to each tenant reported by the health status check service 203. The network pre-distribution module 100 queries the health status information of the service corresponding to the tenant, and distributes the request to the website server rendering service 202 or the website static service 201 according to the query result. Specifically, if the health status information of the service corresponding to the tenant is normal, the request is distributed to the website server rendering service 202 to obtain dynamic data; if the health status information of the service corresponding to the tenant is abnormal, Then, the request is distributed to the website staticization service 201 to obtain static data.
[0077] The website staticization service 201 is a simple static website service that stores static page files of high-frequency access routes of various tenant websites. Therefore, the corresponding static page file is returned according to the requested page route.
[0078] The website server rendering service 202 is the main service independently deployed by multiple tenants. This service provides the server rendering capabilities of the tenant website. During the server rendering process, it will request the website background services deployed uniformly by the multiple tenants to obtain website-related information. dynamic data. In addition, the website server rendering service 202 synchronizes the rendering results of the high-frequency routing request to the corresponding website staticization service 201 in the form of page static files according to a certain time frequency. In the embodiment of the present invention, the website server rendering service 202 is deployed in a multi-instance architecture.
[0079] The health status check service 203 regularly collects the health status information of the tenant website server rendering service 202 and the website background service 300, and feeds back the health status information to the network pre-distribution module 100 and the multi-tenant management background 400 in real time.
[0080] The website background service 300 mainly provides a unified data interface service for tenants. In the embodiment of the present invention, the website background service 300 is deployed in a single instance architecture.
[0081] The multi-tenant management backend 400 is responsible for the operation of the entire server-side rendering website system, and controls the health status of the services corresponding to each tenant in real time. It can issue instructions to the server-side rendering service 202 independently deployed by multi-tenants to control the start and stop of services and restrict access And so on.
[0082] It can be seen that the server-side rendering website system has the following beneficial effects:
[0083] 1. The front-end and back-end separation mode is adopted. The front-end is responsible for page server-side rendering, and the back-end provides interface services required by the website; enabling multi-tenant scenarios to achieve back-end service reuse, front-end services can be managed, and high page availability Customization and multi-tenant lower maintenance costs; the front-end service supports static website, realizes the back-end service fault isolation mechanism, and eliminates the mutual influence of services caused by multi-tenant services.
[0084] 2. The website routing, interface layout, and interface call are highly configurable, and special pages can be customized and developed.
[0085] 3. The front-end service of the website can make the site static and realize fault isolation from the back-end service.
[0086] 4. The website front-end service has a health check process, real-time checking the back-end service status and reporting the front-end service status to the multi-tenant management service.
[0087] Figure 4 Is a schematic diagram of the main modules of the apparatus for processing requests according to an embodiment of the present invention, such as Figure 4 As shown, the device for processing the request includes a receiving module 401, a distributing module 402, and a returning module 403. The receiving module 401 is used to receive the request sent by the tenant; the distribution module 402 is used to distribute the request to the website server rendering service or the website static service according to the health status information of the service corresponding to the tenant; the return module 403 is used to return dynamic data or static data corresponding to the request.
[0088] Optionally, the distribution module 402 is further configured to:
[0089] If the health status information of the service corresponding to the tenant is normal, the request is distributed to the website server rendering service to obtain dynamic data;
[0090] If the health status information of the service corresponding to the tenant is abnormal, the request is distributed to the website static service to obtain static data.
[0091] Optionally, the service corresponding to the tenant includes a website server rendering service and a website background service.
[0092] Optionally, the website server-side rendering service adopts a multi-instance architecture deployment, and the website background service adopts a single-instance architecture deployment.
[0093] Optionally, it also includes:
[0094] The update module is used for synchronizing rendering results corresponding to requests with a request frequency greater than a preset frequency threshold to the corresponding website static service in the form of static data at specified time intervals.
[0095] According to the various embodiments described above, it can be seen that the present invention distributes requests to the website server rendering service or website static service according to the health status information of the service corresponding to the tenant, thereby returning dynamic data or static data. The method solves the technical problems in the prior art that the services of multi-tenants are mutually affected and the development and maintenance costs of single-tenants are high. The embodiment of the present invention adopts the front-end and back-end separation mode, the front-end is responsible for page server-side rendering, and the back-end provides interface services required by the website, so that multi-tenant scenarios can realize back-end service reuse, thereby ensuring lower development and maintenance costs Under the premise, it can not only fully meet the individual needs of multi-tenants, but also shield the mutual influence of services between multi-tenants by means of fault isolation. Moreover, the front-end service of the website can make the site static, realize fault isolation from the back-end service, and eliminate the problem of mutual influence caused by multi-tenant services.
[0096] It should be noted that the specific implementation content of the device for processing requests of the present invention has been described in detail in the method for processing requests described above, so the repeated content will not be described here.
[0097] Figure 5 An exemplary system architecture 500 in which the method for processing a request or the apparatus for processing a request according to an embodiment of the present invention can be applied is shown.
[0098] Such as Figure 5 As shown, the system architecture 500 may include terminal devices 501, 502, 503, a network 504, and a server 505. The network 504 is used to provide a medium for communication links between the terminal devices 501, 502, 503 and the server 505. The network 504 may include various connection types, such as wired, wireless communication links, or fiber optic cables, and so on.
[0099] The user can use the terminal devices 501, 502, and 503 to interact with the server 505 via the network 504 to receive or send messages and so on. Various communication client applications, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social platform software, etc., may be installed on the terminal devices 501, 502, and 503 (only examples).
[0100] The terminal devices 501, 502, and 503 may be various electronic devices that have a display screen and support web browsing, including but not limited to smart phones, tablet computers, laptop computers, desktop computers, and so on.
[0101] The server 505 may be a server that provides various services, for example, a back-end management server (just an example) that provides support for shopping websites that users browse through the terminal devices 501, 502, and 503. The background management server can analyze and process the received item information query request and other data, and feed back the processing result (for example, target push information, item information-only examples) to the terminal device.
[0102] It should be noted that the method for processing a request provided in the embodiment of the present invention is generally executed by the server 505, and accordingly, the device for processing the request is generally set in the server 505.
[0103] Should understand, Figure 5 The number of terminal devices, networks, and servers in the are only illustrative. According to implementation needs, there can be any number of terminal devices, networks and servers.
[0104] Reference below Image 6 , Which shows a schematic structural diagram of a computer system 600 suitable for implementing the terminal device of the embodiment of the present invention. Image 6 The terminal device shown is only an example, and should not bring any limitation to the function and scope of use of the embodiments of the present invention.
[0105] Such as Image 6 As shown, the computer system 600 includes a central processing unit (CPU) 601, which can execute various programs according to a program stored in a read-only memory (ROM) 602 or a program loaded from a storage part 608 to a random access memory (RAM) 603. Kind of appropriate actions and processing. In the RAM 603, various programs and data required for the operation of the system 600 are also stored. The CPU 601, ROM 602, and RAM 603 are connected to each other through a bus 604. An input/output (I/O) interface 605 is also connected to the bus 604.
[0106] The following components are connected to the I/O interface 605: an input part 606 including a keyboard, a mouse, etc.; an output part 607 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc. and speakers, etc.; a storage part 608 including a hard disk, etc. ; And a communication section 609 including a network interface card such as a LAN card, a modem, etc. The communication section 609 performs communication processing via a network such as the Internet. The driver 610 is also connected to the I/O interface 605 as needed. A removable medium 611, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 610 as required, so that the computer program read from it is installed in the storage part 608 as required.
[0107] In particular, according to the disclosed embodiments of the present invention, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present invention include a computer program, which includes a computer program carried on a computer-readable medium, and the computer program contains program code for executing the method shown in the flowchart. In such an embodiment, the computer program may be downloaded and installed from the network through the communication part 609, and/or installed from the removable medium 611. When the computer program is executed by the central processing unit (CPU) 601, the above-mentioned functions defined in the system of the present invention are executed.
[0108] It should be noted that the computer-readable medium shown in the present invention may be a computer-readable signal medium or a computer-readable storage medium, or any combination of the two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: electrical connections with one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable Programmable read only memory (EPROM or flash memory), optical fiber, portable compact disk read only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination of the above. In the present invention, the computer-readable storage medium may be any tangible medium that contains or stores a program, and the program may be used by or in combination with an instruction execution system, apparatus, or device. In the present invention, a computer-readable signal medium may include a data signal propagated in a baseband or as a part of a carrier wave, and a computer-readable program code is carried therein. This propagated data signal can take many forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the foregoing. The computer-readable signal medium may also be any computer-readable medium other than the computer-readable storage medium. The computer-readable medium may send, propagate, or transmit the program for use by or in combination with the instruction execution system, apparatus, or device . The program code contained on the computer-readable medium can be transmitted by any suitable medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.
[0109] The flowcharts and block diagrams in the accompanying drawings illustrate the possible implementation architecture, functions, and operations of the system, method, and computer program according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagram may represent a module, program segment, or part of code, and the above-mentioned module, program segment, or part of code contains one or more for realizing the specified logic function Executable instructions. It should also be noted that, in some alternative implementations, the functions marked in the block may also occur in a different order from the order marked in the drawings. For example, two blocks shown in succession can actually be executed substantially in parallel, and they can sometimes be executed in the reverse order, depending on the functions involved. It should also be noted that each block in the block diagram or flowchart, and the combination of blocks in the block diagram or flowchart, can be implemented by a dedicated hardware-based system that performs the specified function or operation, or can be It is realized by a combination of dedicated hardware and computer instructions.
[0110] The modules involved in the embodiments described in the present invention can be implemented in software or hardware. The described modules can also be set in the processor, for example, it can be described as: a processor includes a receiving module, a distribution module, and a return module, where the names of these modules do not constitute the module itself under certain circumstances. The limit.
[0111] As another aspect, the present invention also provides a computer-readable medium. The computer-readable medium may be included in the device described in the foregoing embodiment; or it may exist alone without being assembled into the device. The aforementioned computer-readable medium carries one or more programs. When the aforementioned one or more programs are executed by a device, the device includes: receiving a request sent by a tenant; and according to the health status information of the service corresponding to the tenant , Distribute the request to a website server rendering service or a website static service; return dynamic data or static data corresponding to the request.
[0112] According to the technical solution of the embodiment of the present invention, because the request is distributed to the website server rendering service or the website static service according to the health status information of the service corresponding to the tenant, the technical means of returning dynamic data or static data is overcome, In the prior art, the multi-tenant services will be affected by each other and the single-tenant development and maintenance cost is high. The embodiment of the present invention adopts the front-end and back-end separation mode, the front-end is responsible for page server-side rendering, and the back-end provides interface services required by the website, so that multi-tenant scenarios can realize back-end service reuse, thereby ensuring lower development and maintenance costs Under the premise, it can not only fully meet the individual needs of multi-tenants, but also shield the mutual influence of services between multi-tenants by means of fault isolation. Moreover, the front-end service of the website can make the site static, realize fault isolation from the back-end service, and eliminate the problem of mutual influence caused by multi-tenant services.
[0113] The foregoing specific implementations do not constitute a limitation on the protection scope of the present invention. Those skilled in the art should understand that, depending on design requirements and other factors, various modifications, combinations, sub-combinations, and substitutions can occur. Any modifications, equivalent substitutions and improvements made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
PUM


Description & Claims & Application Information
We can also present the details of the Description, Claims and Application information to help users get a comprehensive understanding of the technical details of the patent, such as background art, summary of invention, brief description of drawings, description of embodiments, and other original content. On the other hand, users can also determine the specific scope of protection of the technology through the list of claims; as well as understand the changes in the life cycle of the technology with the presentation of the patent timeline. Login to view more.
Similar technology patents
Short message verification method and device, equipment and storage medium
PendingCN114390457AUnified quick dockingReduce development and maintenance costs
Owner:BIGO TECH PTE LTD
Processing method and device and computer equipment
ActiveCN111158771AGuaranteed reliable operationReduce development and maintenance costs
Owner:LENOVO (BEIJING) CO LTD
Log recording method and device
Owner:QINGDAO HISENSE TRANS TECH
React Native-based hot update method and system
PendingCN114115969AEasy operationReduce development and maintenance costs
Owner:上海汇付支付有限公司
Classification and recommendation of technical efficacy words
- Reduce development and maintenance costs
Method and device for synchronizing redundant array of independent disks (RAID)
ActiveCN102789370AReduce development and maintenance costsImprove sync speed and performance
Owner:ZHEJIANG UNIVIEW TECH
Transparent transmitting method and system for regulatory data of car machine
ActiveCN104539592AReduce development and maintenance costs
Owner:北京中交兴路车联网科技有限公司
Multi-level role permission control method and device based on cryptography
ActiveCN112422287AReduce development and maintenance costsStrong stability and security
Owner:杭州城市大数据运营有限公司 +2
Non-card account payment method, device and system and storage medium
PendingCN113657887AReduce development and maintenance costs
Owner:CHINA UNIONPAY
Multi-data source chart display method based on mobile terminal equipment
PendingCN114463098Aspeed up developmentReduce development and maintenance costs
Owner:华泰万象科技(大连)有限公司