CN111988405B - Message rewriting method of load balancing device and load balancing device - Google Patents

Message rewriting method of load balancing device and load balancing device Download PDF

Info

Publication number
CN111988405B
CN111988405B CN202010843539.9A CN202010843539A CN111988405B CN 111988405 B CN111988405 B CN 111988405B CN 202010843539 A CN202010843539 A CN 202010843539A CN 111988405 B CN111988405 B CN 111988405B
Authority
CN
China
Prior art keywords
message
rewriting
configuration
load balancing
cache
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
CN202010843539.9A
Other languages
Chinese (zh)
Other versions
CN111988405A (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.)
Hangzhou DPTech Technologies Co Ltd
Original Assignee
Hangzhou DPTech Technologies 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 Hangzhou DPTech Technologies Co Ltd filed Critical Hangzhou DPTech Technologies Co Ltd
Priority to CN202010843539.9A priority Critical patent/CN111988405B/en
Publication of CN111988405A publication Critical patent/CN111988405A/en
Application granted granted Critical
Publication of CN111988405B publication Critical patent/CN111988405B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

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/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1001Protocols in which an application is distributed across nodes in the network for accessing one among a plurality of replicated servers
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/955Retrieval from the web using information identifiers, e.g. uniform resource locators [URL]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/56Provisioning of proxy services
    • H04L67/568Storing data temporarily at an intermediate stage, e.g. caching
    • 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 disclosure relates to a message rewriting method for a load balancing device, an electronic device and a computer readable medium. The method comprises the following steps: acquiring a request message from a client; extracting a target URL address from the request message; when a preset condition is met, the request message is sent to a server corresponding to the target URL address, so that the server replies a response message through a plaintext; and carrying out message rewriting on the response message to generate response information. The message rewriting method for the load balancing device, the electronic equipment and the computer readable medium can flexibly realize message rewriting and improve the rewriting efficiency under the condition that the message is compressed.

Description

Message rewriting method of load balancing device and load balancing device
Technical Field
The disclosure relates to the field of computer information processing, and in particular relates to a message rewriting method for a load balancing device, the load balancing device, electronic equipment and a computer readable medium.
Background
In the actual network data transmission process, the load balancing device is used as a middle ring between the server side and the client side, and purposefully modifies the request and response messages of HTTP to meet a certain specific effect. This is the HTTP overwrite function. At present, a certain fixed character string is generally searched in an HTTP message as a matching condition, and the fixed character string is replaced by a preset character string according to actual needs; or a header field is added and deleted in the HTTP message. Therefore, HTTP interactive messages can be modified, and the requirements of a client side and a server side can be flexibly met.
However, in the scheme in the prior art, HTTP compression originally improves the access experience of the client under the condition of sacrificing a certain performance. When the transmission data is smaller, the performance is sacrificed in the case that the customer experience is not different; moreover, when the load balancing device is oriented to millions of clients, the same message needs to be rewritten once for every request of the clients. This wastes the opportunity for the load balancing device to provide more functionality.
Therefore, there is a need for a new message rewriting method for a load balancing apparatus, an electronic device, and a computer readable medium.
The above information disclosed in the background section is only for enhancement of understanding of the background of the disclosure and therefore it may include information that does not form the prior art that is already known to a person of ordinary skill in the art.
Disclosure of Invention
In view of this, the disclosure provides a method for rewriting a message for a load balancing device, an electronic device, and a computer readable medium, which can flexibly implement the rewriting of the message and improve the rewriting efficiency when the message is compressed.
Other features and advantages of the present disclosure will be apparent from the following detailed description, or may be learned in part by the practice of the disclosure.
According to an aspect of the present disclosure, a method for rewriting a message for a load balancing apparatus is provided, the method including: acquiring a request message from a client; extracting a target URL address from the request message; when the rewriting configuration is not changed, matching is carried out in a cache according to the target URL address; when the effective result is matched, generating response information through data corresponding to the target URL address in the cache; and sending the response information to the client.
In an exemplary embodiment of the present disclosure, further comprising: before obtaining the request message from the client, the method further comprises: acquiring configuration permission of at least one server corresponding to the load balancing device; modifying a overwrite configuration of said at least one server based on said configuration rights.
In an exemplary embodiment of the present disclosure, modifying the overwrite configuration of the at least one server based on the configuration rights includes: and modifying the header field of the at least one server based on the configuration authority so that the response message of the at least one server is in a plaintext.
In one exemplary embodiment of the present disclosure, the satisfaction of the preset condition includes: there is a change in the overwrite configuration or no match to a valid result in the cache.
In an exemplary embodiment of the present disclosure, performing a message rewrite on the response message to generate response information includes: the load balancing device receives and analyzes the response message; extracting a character string to be rewritten from the response message; and replacing the character string to be rewritten according to preset information to generate the response information.
In an exemplary embodiment of the present disclosure, further comprising: and storing the target URL address and the response information corresponding to the target URL address in a cache of the load balancing device.
In an exemplary embodiment of the present disclosure, further comprising: detecting the change condition of the rewriting configuration at fixed time, and searching in a cache according to the target URL address when the rewriting configuration is changed; and deleting the corresponding cache data of the target URL address in the cache and updating the match item of the rewriting configuration.
In an exemplary embodiment of the present disclosure, when the preset condition is not satisfied, further comprising: when the rewriting configuration is not changed, matching is carried out in a cache according to the target URL address; when the effective result is matched, generating response information through data corresponding to the target URL address in the cache; and sending the response information to the client.
In an exemplary embodiment of the present disclosure, when the overwrite configuration is unchanged, matching in the cache according to the target URL address includes: judging whether the rewriting configuration is changed; when the rewriting configuration is not changed, searching in a cache according to the target URL address; and when the cache data corresponding to the target address exists, determining that the cache data is matched with a valid result.
In an exemplary embodiment of the present disclosure, further comprising: and when the effective result is not matched, sending the request message to a server corresponding to the target URL address to acquire response information.
According to an aspect of the present disclosure, a load balancing device and a message module are provided, where the message module is configured to obtain a request message from a client; the address module is used for extracting a target URL address from the request message; the sending module is used for sending the request message to the server corresponding to the target URL address when the preset condition is met, so that the server replies a response message through a plaintext; and the response module is used for carrying out message rewriting on the response message to generate response information.
In an exemplary embodiment of the present disclosure, further comprising: the configuration module is used for acquiring the configuration authority of at least one server corresponding to the load balancing device; modifying a overwrite configuration of said at least one server based on said configuration rights.
According to an aspect of the present disclosure, there is provided an electronic device including: one or more processors; a storage means for storing one or more programs; when the one or more programs are executed by the one or more processors, the one or more processors are caused to implement the methods as described above.
According to an aspect of the present disclosure, a computer-readable medium is presented, on which a computer program is stored, which program, when being executed by a processor, implements a method as described above.
According to the message rewriting method for the load balancing device, the electronic equipment and the computer readable medium, a request message from a client is obtained; extracting a target URL address from the request message; when a preset condition is met, the request message is sent to a server corresponding to the target URL address, so that the server replies a response message through a plaintext; the method for generating the response information by rewriting the response message can flexibly realize the message rewriting and improve the rewriting efficiency under the condition that the message is compressed.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The above and other objects, features and advantages of the present disclosure will become more apparent by describing in detail exemplary embodiments thereof with reference to the attached drawings. The drawings described below are merely examples of the present disclosure and other drawings may be obtained from these drawings without inventive effort for a person of ordinary skill in the art.
Fig. 1 is a flow chart of a method of rewriting a message in the prior art.
Fig. 2 is a schematic diagram of an application scenario of a message rewriting method for a load balancing apparatus according to an exemplary embodiment.
Fig. 3 is a flow chart illustrating a method of message rewriting for a load balancing apparatus according to an example embodiment.
Fig. 4 is a flow chart illustrating a method of message rewriting for a load balancing apparatus according to another example embodiment.
Fig. 5 is a flow chart illustrating a method of message rewriting for a load balancing apparatus according to another example embodiment.
Fig. 6 is a block diagram illustrating a load balancing apparatus according to an example embodiment.
Fig. 7 is a block diagram of an electronic device, according to an example embodiment.
Fig. 8 is a block diagram of a computer-readable medium shown according to an example embodiment.
Detailed Description
Example embodiments will now be described more fully with reference to the accompanying drawings. However, the exemplary embodiments can be embodied in many forms and should not be construed as limited to the embodiments set forth herein; rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the concept of the example embodiments to those skilled in the art. The same reference numerals in the drawings denote the same or similar parts, and thus a repetitive description thereof will be omitted.
Furthermore, the described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments. In the following description, numerous specific details are provided to give a thorough understanding of embodiments of the disclosure. One skilled in the relevant art will recognize, however, that the disclosed aspects may be practiced without one or more of the specific details, or with other methods, components, devices, steps, etc. In other instances, well-known methods, load balancing apparatus, implementations, or operations have not been shown or described in detail to avoid obscuring aspects of the disclosure.
The block diagrams depicted in the figures are merely functional entities and do not necessarily correspond to physically separate entities. That is, the functional entities may be implemented in software, or in one or more hardware modules or integrated circuits, or in different networks and/or processor devices and/or microcontroller devices.
The flow diagrams depicted in the figures are exemplary only, and do not necessarily include all of the elements and operations/steps, nor must they be performed in the order described. For example, some operations/steps may be decomposed, and some operations/steps may be combined or partially combined, so that the order of actual execution may be changed according to actual situations.
It will be understood that, although the terms first, second, third, etc. may be used herein to describe various components, these components should not be limited by these terms. These terms are used to distinguish one element from another element. Accordingly, a first component discussed below could be termed a second component without departing from the teachings of the concepts of the present disclosure. As used herein, the term "and/or" includes any one of the associated listed items and all combinations of one or more.
Those skilled in the art will appreciate that the drawings are schematic representations of example embodiments and that the modules or flows in the drawings are not necessarily required to practice the present disclosure, and therefore, should not be taken to limit the scope of the present disclosure.
Fig. 1 is a flow chart of a method of rewriting a message in the prior art. As shown in fig. 1, in the current HTTP overwrite function, a fixed character string is generally searched in an HTTP message as a matching condition, and the fixed character string is replaced by a preset character string according to actual needs; or a header field is added and deleted in the HTTP message. Therefore, HTTP interactive messages can be modified, and the requirements of a client side and a server side can be flexibly met.
The specific implementation scheme is as follows:
1. according to the actual requirement, configuring a corresponding HTTP rewriting method, for example: modifying a specified field value of a certain HTTP header, adding a certain field or deleting a certain HTTP header field, retrieving a certain character string in a message, replacing the character string with a new character string, and the like;
2. analyzing the HTTP message, obtaining basic information and each header field of the HTTP message, and recording information such as character string positions needing to be changed;
3. and modifying the message according to the position information, HTTP header field information and HTTP rewriting configuration of the character string to finish rewriting.
In the HTTP transmission process, HTTP compression is used to reduce the data volume of network transmission and improve the access speed of the client browser. In the context of HTTP compression, the position information of the character string to be modified and replaced in the HTTP overwrite configuration cannot be directly obtained, and the position information can be obtained only after the corresponding decompression is performed according to the compression format specified by Accept-Encoding. HTTP compression is inherently to enhance the access experience of a client at the expense of certain performance. When the transmitted data is small, the customer experience is indiscriminate, sacrificing performance.
The message replied by the server reaches the client after HTTP rewriting by the load balancing device, and when the load balancing device faces millions of clients, the same message needs to be rewritten once when the client requests once. This wastes the opportunity for the load balancing device to provide more functionality.
Aiming at the defects of the current technical scheme, the message rewriting method for the load balancing device solves the problems of repeated rewriting for a plurality of times and inconvenient rewriting under the compression scene. The message rewriting method for the load balancing device can flexibly realize rewriting and improve the rewriting efficiency even under the condition of message compression. The present disclosure is described in detail below with reference to specific examples.
Fig. 2 is a schematic diagram of an application scenario of a message rewriting method for a load balancing apparatus according to an exemplary embodiment.
As shown in fig. 2, the system architecture 20 may comprise terminal devices 201, 202, 203, a network 204 and load balancing means 205, servers 206, 207, 208. The network 204 is a medium for providing a communication link between the terminal devices 201, 202, 203 and the load balancing means 205; the network 204 also serves as a medium to provide communication links between the servers 206, 207, 208 and the load balancing device 205. The network 204 may include various connection types, such as wired, wireless communication links, or fiber optic cables, among others.
The user may interact with the server 206, 207, 208 via the network 204, the load balancing means 205, using the terminal devices 201, 202, 203 to receive or send messages etc. Various communication client applications, such as shopping class applications, web browser applications, search class applications, instant messaging tools, mailbox clients, social platform software, etc., may be installed on the terminal devices 201, 202, 203.
The terminal devices 201, 202, 203 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smartphones, tablets, laptop and desktop computers, and the like.
The servers 206, 207, 208 may be servers providing various services, such as a background management server providing support for websites browsed by the user using the terminal devices 201, 202, 203. The background management server can analyze the received request and feed back the processing result to the terminal equipment.
The load balancing device 205 may, for example, obtain a request message from the client 101 (or client 102, client 103); the load balancing device 205 may extract the target URL address, for example, from the request message; the load balancing device 205 may send the request message to the server 206 (or the server 207, the server 208) corresponding to the target URL address, for example, when a preset condition is met, so that the server replies a response message through plaintext; the load balancing device 205 may generate the response information, for example, by performing a message rewrite on the response message.
In one embodiment, the target URL address and the response information corresponding thereto may also be stored in a cache of a load balancing device, for example.
The load balancing device 205 may also, for example, match in the cache according to the target URL address when the overwrite configuration is unchanged; when the effective result is matched, generating response information through data corresponding to the target URL address in the cache; and sending the response information to the client.
The load balancing device 205 may also detect, for example, a change situation of the overwrite configuration at regular time, and when there is a change of the overwrite configuration, retrieve the change in the cache according to the target URL address; and deleting the corresponding cache data of the target URL address in the cache and updating the match item of the rewriting configuration.
It should be noted that, the method for rewriting a message for a load balancing apparatus provided in the embodiments of the present disclosure may be performed by the load balancing apparatus 205.
Fig. 3 is a flow chart illustrating a method of message rewriting for a load balancing apparatus according to an example embodiment. The message rewriting method 30 for the load balancing apparatus at least includes steps S302 to S308.
As shown in fig. 3, in S302, a request message from a client is acquired. The request message may be any desired message, such as a login request, an order processing request, an access data request, etc., which is not limited in this disclosure.
Before obtaining the request message from the client, the method further comprises the following steps: acquiring configuration permission of at least one server corresponding to the load balancing device; modifying a overwrite configuration of said at least one server based on said configuration rights.
In one embodiment, modifying the overwrite configuration of the at least one server based on the configuration rights comprises: and modifying the header field of the at least one server based on the configuration authority so that the response message of the at least one server is in a plaintext. More specifically, an administrator can configure a message rewriting item according to requirements, and the method in the disclosure can be adopted in all scenes needing message rewriting. Preferably, in the scene of message compression, the header field Accept-Encoding can be modified to enable the server to respond to the message in a plaintext manner; after configuration, the response messages of the server are in HTTP plaintext state, and the position of the character string to be replaced is found according to the rewriting configuration;
in S304, a target URL address is extracted from the request message.
In S306, when a preset condition is met, the request message is sent to the server corresponding to the target URL address, so that the server replies a response message through plaintext. Wherein, satisfy the preset condition, include: there is a change in the overwrite configuration or no match to a valid result in the cache. In the rewriting configuration, after adding the modification header field Accept-Encoding, the server responds to the configuration switch that the message replies in a plaintext manner, and the subsequent HTTP response message of the server after the configuration is started is in a plaintext state, so that the position information of the character string needing to be modified can be conveniently obtained.
In S308, the response message is rewritten to generate response information. Comprising the following steps: the load balancing device receives and analyzes the response message; extracting a character string to be rewritten from the response message; and replacing the character string to be rewritten according to preset information to generate the response information.
In one embodiment, the method for rewriting the message may further include: modifying a specified certain HTTP header field value, adding a certain field or deleting a certain HTTP header field, retrieving a certain character string in a message and replacing the character string with a new character string, and the like.
According to the message rewriting method for the load balancing device, a request message from a client is obtained; extracting a target URL address from the request message; when a preset condition is met, the request message is sent to a server corresponding to the target URL address, so that the server replies a response message through a plaintext; the method for generating the response information by rewriting the response message can flexibly realize the message rewriting and improve the rewriting efficiency under the condition that the message is compressed.
It should be clearly understood that this disclosure describes how to make and use particular examples, but the principles of this disclosure are not limited to any details of these examples. Rather, these principles can be applied to many other embodiments based on the teachings of the present disclosure.
Fig. 4 is a flow chart illustrating a method of message rewriting for a load balancing apparatus according to another example embodiment. The flow 40 shown in fig. 4 is a complementary description of the flow shown in fig. 2.
As shown in fig. 4, in S402, the target URL address and the response information corresponding thereto are stored in a cache of the load balancing apparatus. And after the response message is rewritten, recording the rewritten message. And marking the rewritten message according to the target URL of the request of the client. When a client initiates a request, and requests the target UR of the same request, a rewritten message can be matched from the cache, and the client is directly replied to, namely, the same response message does not need to be rewritten every time.
In S404, when the overwrite configuration is not changed, matching is performed in the cache according to the target URL address. More specifically, it may include: judging whether the rewriting configuration is changed; when the rewriting configuration is not changed, searching in a cache according to the target URL address; and when the cache data corresponding to the target address exists, determining that the cache data is matched with a valid result.
In one embodiment, the change condition of the rewriting configuration can be detected regularly, and when the rewriting configuration is changed, the rewriting configuration is searched in a cache according to the target URL address; and deleting the corresponding cache data of the target URL address in the cache and updating the match item of the rewriting configuration. When the rewriting effect of the response message changes, the cached message with the previous rewriting effect is correspondingly judged and updated. The method ensures that the cached rewriting message is necessarily the rewriting effect required by the client, and ensures that the cached rewriting message has real-time property. When a rewrite message is cached, only the target URL of the request cannot be recorded, and the configuration of the rewrite also needs to be recorded. When the request is received again, if only the target URL is matched, when the rewriting configuration is changed, the replied buffer response message does not contain the rewriting effect required by the client. Therefore, after the first rewrite is successful, both the target URL and the rewrite configuration are recorded as the matching condition at the time of revisit.
In S406, when the valid result is matched, response information is generated by the data corresponding to the target URL address in the cache. Further comprises: and when the effective result is not matched, sending the request message to a server corresponding to the target URL address to acquire response information.
When the load balancing device receives the request of the same target URL of the client, checking whether the match item of the rewriting configuration is changed, and when the match item of the rewriting configuration is not changed, the cached message contains the rewriting effect required by the client and is directly returned to the client; the rewriting configuration is changed, the message cached by the previous target URL is deleted, the response message is rewritten according to the new rewriting configuration, the rewriting message is cached, and the matching item of the rewriting configuration is updated. Thus, the target URL and the rewriting configuration are used as matching conditions of the cache message, and the cached rewriting message is ensured to be up to date.
In S408, the response information is sent to the client.
Fig. 5 is a flow chart illustrating a method of message rewriting for a load balancing apparatus according to another example embodiment. The flow 50 shown in fig. 5 is a detailed description of the overall process of the present disclosure.
As shown in fig. 5, in S502, HTTP overwrite contents are configured.
In S504, the header field Accept-Encoding is modified to allow the server response message to reply in plain text.
In S506, the received response message is retrieved. The response messages of the server are in HTTP plaintext state, and the positions of the character strings to be replaced are found according to the rewriting configuration.
In S508, the rewritten character string position is extracted. And modifying the message by using the new character string according to the position information and the rewriting configuration obtained by retrieving the message.
In S510, after the overwriting is completed, the overwritten message is buffered. After the rewriting is completed, the rewriting message is cached, and the cached content comprises a request URL and rewriting configuration.
In S512, the cached rewrite message is matched according to the URL requested by the client.
In S514, the matched rewrite message is replied to the request of the client. When the load balancing device receives the request of the client for the same URL again, the load balancing device directly replies the rewritten message to the client after successful matching according to the URL and the rewriting configuration as matching conditions.
According to the method in the disclosure, the HTTP response message can be flexibly rewritten under the condition of message compression. And the rewritten message is cached, when the load balancing device detects that a certain client requests the same URL, the cached rewritten message can be directly returned to the client.
Those skilled in the art will appreciate that all or part of the steps implementing the above described embodiments are implemented as a computer program executed by a CPU. The above-described functions defined by the above-described methods provided by the present disclosure are performed when the computer program is executed by a CPU. The program may be stored in a computer readable storage medium, which may be a read-only memory, a magnetic disk or an optical disk, etc.
Furthermore, it should be noted that the above-described figures are merely illustrative of the processes involved in the method according to the exemplary embodiments of the present disclosure, and are not intended to be limiting. It will be readily appreciated that the processes shown in the above figures do not indicate or limit the temporal order of these processes. In addition, it is also readily understood that these processes may be performed synchronously or asynchronously, for example, among a plurality of modules.
The following are device embodiments of the present disclosure that may be used to perform method embodiments of the present disclosure. For details not disclosed in the embodiments of the apparatus of the present disclosure, please refer to the embodiments of the method of the present disclosure.
Fig. 6 is a block diagram illustrating a message rewriting apparatus for a load balancing apparatus according to another example embodiment. As shown in fig. 6, the message rewriting device 60 for the load balancing device includes: message module 602, extraction module 604, send module 606, response module 608, configuration module 610.
The message module 602 is configured to obtain a request message from a client; the request message may be any desired message, such as a login request, an order processing request, an access data request, and so on.
The address module 604 is configured to extract a target URL address from the request packet;
the sending module 606 is configured to send the request message to a server corresponding to the target URL address when a preset condition is met, so that the server replies a response message through plaintext; wherein, satisfy the preset condition, include: there is a change in the overwrite configuration or no match to a valid result in the cache.
The response module 608 is configured to perform message rewriting on the response message to generate response information. Comprising the following steps: the load balancing device receives and analyzes the response message; extracting a character string to be rewritten from the response message; and replacing the character string to be rewritten according to preset information to generate the response information.
The configuration module 610 is configured to obtain a configuration permission of at least one server corresponding to the load balancing device; modifying a overwrite configuration of said at least one server based on said configuration rights.
According to the message rewriting device for the load balancing device, a request message from a client is obtained; extracting a target URL address from the request message; when a preset condition is met, the request message is sent to a server corresponding to the target URL address, so that the server replies a response message through a plaintext; the method for generating the response information by rewriting the response message can flexibly realize the message rewriting and improve the rewriting efficiency under the condition that the message is compressed.
Fig. 7 is a block diagram of an electronic device, according to an example embodiment.
An electronic device 700 according to such an embodiment of the present disclosure is described below with reference to fig. 7. The electronic device 700 shown in fig. 7 is merely an example and should not be construed to limit the functionality and scope of use of embodiments of the present disclosure in any way.
As shown in fig. 7, the electronic device 700 is embodied in the form of a general purpose computing device. Components of electronic device 700 may include, but are not limited to: at least one processing unit 710, at least one memory unit 720, a bus 730 connecting the different system components (including the memory unit 720 and the processing unit 710), a display unit 740, and the like.
Wherein the storage unit stores program code executable by the processing unit 710 such that the processing unit 710 performs steps according to various exemplary embodiments of the present disclosure described in the above-described electronic prescription flow processing methods section of the present specification. For example, the processing unit 710 may perform the steps as shown in fig. 3, 4, and 5.
The memory unit 720 may include readable media in the form of volatile memory units, such as Random Access Memory (RAM) 7201 and/or cache memory 7202, and may further include Read Only Memory (ROM) 7203.
The storage unit 720 may also include a program/utility 7204 having a set (at least one) of program modules 7205, such program modules 7205 including, but not limited to: an operating system, one or more application programs, other program modules, and program data, each or some combination of which may include an implementation of a network environment.
Bus 730 may be a bus representing one or more of several types of bus structures including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.
The electronic device 700 may also communicate with one or more external devices 700' (e.g., keyboard, pointing device, bluetooth device, etc.), one or more devices that enable a user to interact with the electronic device 700, and/or any device (e.g., router, modem, etc.) that enables the electronic device 700 to communicate with one or more other computing devices. Such communication may occur through an input/output (I/O) interface 750. Also, electronic device 700 may communicate with one or more networks such as a Local Area Network (LAN), a Wide Area Network (WAN) and/or a public network, such as the Internet, through network adapter 760. Network adapter 760 may communicate with other modules of electronic device 700 via bus 730. It should be appreciated that although not shown, other hardware and/or software modules may be used in connection with electronic device 700, including, but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, data backup storage systems, and the like.
From the above description of embodiments, those skilled in the art will readily appreciate that the example embodiments described herein may be implemented in software, or may be implemented in software in combination with the necessary hardware. Thus, as shown in fig. 8, the technical solution according to the embodiments of the present disclosure may be embodied in the form of a software product, which may be stored in a non-volatile storage medium (may be a CD-ROM, a U-disk, a mobile hard disk, etc.) or on a network, and includes several instructions to cause a computing device (may be a personal computer, a server, or a network device, etc.) to perform the above-described method according to the embodiments of the present disclosure.
The software product may employ any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium can be, for example, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples (a non-exhaustive list) of the readable storage medium would include the following: an electrical connection having one or more wires, a portable disk, a hard disk, 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), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
The computer readable storage medium may include a data signal propagated in baseband or as part of a carrier wave, with readable program code embodied therein. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. A readable storage medium may also be any readable medium 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 readable storage medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Program code for carrying out operations of the present disclosure may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, C++ or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computing device, partly on the user's device, as a stand-alone software package, partly on the user's computing device, partly on a remote computing device, or entirely on the remote computing device or server. In the case of remote computing devices, the remote computing device may be connected to the user computing device through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computing device (e.g., connected via the Internet using an Internet service provider).
The computer-readable medium carries one or more programs, which when executed by one of the devices, cause the computer-readable medium to perform the functions of: acquiring a request message from a client; extracting a target URL address from the request message; when a preset condition is met, the request message is sent to a server corresponding to the target URL address, so that the server replies a response message through a plaintext; and carrying out message rewriting on the response message to generate response information.
Those skilled in the art will appreciate that the modules may be distributed throughout several devices as described in the embodiments, and that corresponding variations may be implemented in one or more devices that are unique to the embodiments. The modules of the above embodiments may be combined into one module, or may be further split into a plurality of sub-modules.
From the above description of embodiments, those skilled in the art will readily appreciate that the example embodiments described herein may be implemented in software, or in combination with the necessary hardware. Thus, the technical solutions according to the embodiments of the present disclosure may be embodied in the form of a software product, which may be stored in a non-volatile storage medium (may be a CD-ROM, a U-disk, a mobile hard disk, etc.) or on a network, and include several instructions to cause a computing device (may be a personal computer, a server, a mobile terminal, or a network device, etc.) to perform the method according to the embodiments of the present disclosure.
Exemplary embodiments of the present disclosure are specifically illustrated and described above. It is to be understood that this disclosure is not limited to the particular arrangements, instrumentalities and methods of implementation described herein; on the contrary, the disclosure is intended to cover various modifications and equivalent arrangements included within the spirit and scope of the appended claims.

Claims (8)

1. A method for message rewriting for a load balancing device, comprising:
acquiring a request message from a client;
extracting a target URL address from the request message;
when a preset condition is met, adding a modification header field Accept-Encoding in the rewriting configuration, and sending the request message to a server corresponding to the target URL address to enable the server to start a configuration switch replied in a plaintext manner, so that a response message is replied through the plaintext to conveniently obtain the position information of a character string needing to be modified, wherein the preset condition comprises that the rewriting configuration is changed or a valid result is not matched in a cache; performing message rewriting on the response message to generate response information; and
and under the condition that the preset condition is not met, judging whether the rewriting configuration is changed, and searching in a cache according to the target URL address when the rewriting configuration is not changed, so that when the cache data corresponding to the target address exists and a valid result is confirmed to be matched in the cache, response information is generated through the data corresponding to the target URL address in the cache, and the response information is sent to the client.
2. The method for message rewriting in a load balancing apparatus according to claim 1, further comprising, before acquiring the request message from the client:
acquiring configuration permission of at least one server corresponding to the load balancing device;
modifying a overwrite configuration of said at least one server based on said configuration rights.
3. The method for message rewriting of a load balancing apparatus according to claim 2, wherein modifying the rewriting configuration of the at least one server based on the configuration authority includes:
and modifying the header field of the at least one server based on the configuration authority so that the response message of the at least one server is in a plaintext.
4. The method for message rewriting for a load balancing apparatus according to claim 1, wherein performing message rewriting on the response message to generate response information includes:
the load balancing device receives and analyzes the response message;
extracting a character string to be rewritten from the response message;
and replacing the character string to be rewritten according to preset information to generate the response information.
5. The method for message rewriting in a load balancing apparatus according to claim 1, further comprising:
and storing the target URL address and the response information corresponding to the target URL address in a cache of the load balancing device.
6. The method for message rewriting in a load balancing apparatus according to claim 1, further comprising:
detecting the change condition of the rewriting configuration at fixed time, and searching in a cache according to the target URL address when the rewriting configuration is changed;
and deleting the corresponding cache data of the target URL address in the cache and updating the match item of the rewriting configuration.
7. A load balancing apparatus, comprising:
the message module is used for acquiring a request message from the client;
the address module is used for extracting a target URL address from the request message;
the sending module is used for adding a modification header field Accept-Encoding in the rewriting configuration when a preset condition is met, sending the request message to a server corresponding to the target URL address so that the server starts a configuration switch replied in a plaintext mode, so that the response message is replied through the plaintext, the position information of a character string needing to be modified is conveniently obtained, the preset condition comprises that whether the rewriting configuration is changed or not matched with a valid result in a cache is judged, and if the preset condition is not met, whether the rewriting configuration is changed or not is judged, and when the rewriting configuration is not changed, the request message is searched in the cache according to the target URL address, so that when the cache data corresponding to the target URL address exist and the valid result is confirmed to be matched in the cache, response information is generated through the data corresponding to the target URL address in the cache, and the response information is sent to the client;
and the response module is used for carrying out message rewriting on the response message to generate response information.
8. The load balancing apparatus of claim 7, further comprising:
the configuration module is used for acquiring the configuration authority of at least one server corresponding to the load balancing device; modifying a overwrite configuration of said at least one server based on said configuration rights.
CN202010843539.9A 2020-08-20 2020-08-20 Message rewriting method of load balancing device and load balancing device Active CN111988405B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010843539.9A CN111988405B (en) 2020-08-20 2020-08-20 Message rewriting method of load balancing device and load balancing device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010843539.9A CN111988405B (en) 2020-08-20 2020-08-20 Message rewriting method of load balancing device and load balancing device

Publications (2)

Publication Number Publication Date
CN111988405A CN111988405A (en) 2020-11-24
CN111988405B true CN111988405B (en) 2023-09-26

Family

ID=73443444

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010843539.9A Active CN111988405B (en) 2020-08-20 2020-08-20 Message rewriting method of load balancing device and load balancing device

Country Status (1)

Country Link
CN (1) CN111988405B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113179317B (en) * 2021-04-27 2023-02-07 杭州迪普科技股份有限公司 Test system and method for content rewriting device

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101610268A (en) * 2009-07-16 2009-12-23 杭州华三通信技术有限公司 A kind of implementation method of keyword filtration and equipment
CN103036967A (en) * 2012-12-10 2013-04-10 北京奇虎科技有限公司 Data download system and device and method for download management
CN103780654A (en) * 2012-10-24 2014-05-07 华为技术有限公司 Business request processing method, user terminal, business router and network system
CN106101239A (en) * 2016-06-21 2016-11-09 杭州迪普科技有限公司 The rewrite method of HTTP redirection message and device
WO2017097092A1 (en) * 2015-12-08 2017-06-15 中兴通讯股份有限公司 Method and system for processing cache cluster service
CN107070983A (en) * 2017-01-23 2017-08-18 天地融科技股份有限公司 A kind of load-balancing method, equipment and system forwarded based on address
WO2018099384A1 (en) * 2016-11-29 2018-06-07 中兴通讯股份有限公司 Packet load balancing method, apparatus and system
CN111147583A (en) * 2019-12-27 2020-05-12 杭州迪普科技股份有限公司 HTTP redirection rewriting method and device

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7054935B2 (en) * 1998-02-10 2006-05-30 Savvis Communications Corporation Internet content delivery network
WO2011083567A1 (en) * 2010-01-06 2011-07-14 富士通株式会社 Load distribution system and method for same
US10560543B2 (en) * 2015-03-26 2020-02-11 Fortinet, Inc. Rule based cache processing in application delivery controller for load balancing
US10812448B2 (en) * 2018-01-26 2020-10-20 Citrix Systems, Inc. Split-tunneling for clientless SSL-VPN sessions with zero-configuration

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101610268A (en) * 2009-07-16 2009-12-23 杭州华三通信技术有限公司 A kind of implementation method of keyword filtration and equipment
CN103780654A (en) * 2012-10-24 2014-05-07 华为技术有限公司 Business request processing method, user terminal, business router and network system
CN103036967A (en) * 2012-12-10 2013-04-10 北京奇虎科技有限公司 Data download system and device and method for download management
WO2017097092A1 (en) * 2015-12-08 2017-06-15 中兴通讯股份有限公司 Method and system for processing cache cluster service
CN106101239A (en) * 2016-06-21 2016-11-09 杭州迪普科技有限公司 The rewrite method of HTTP redirection message and device
WO2018099384A1 (en) * 2016-11-29 2018-06-07 中兴通讯股份有限公司 Packet load balancing method, apparatus and system
CN107070983A (en) * 2017-01-23 2017-08-18 天地融科技股份有限公司 A kind of load-balancing method, equipment and system forwarded based on address
CN111147583A (en) * 2019-12-27 2020-05-12 杭州迪普科技股份有限公司 HTTP redirection rewriting method and device

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
Web Cache在互联网国际出入口的部署应用;马兆铭;;电信技术(07);全文 *

Also Published As

Publication number Publication date
CN111988405A (en) 2020-11-24

Similar Documents

Publication Publication Date Title
CN107622135B (en) Method and apparatus for displaying information
US11017153B2 (en) Optimizing loading of web page based on aggregated user preferences for web page elements of web page
WO2020199751A1 (en) Method and apparatus for loading page picture, and electronic device
EP2629208A2 (en) Cloud system and file compression and transmission method in a cloud system
CN111756847B (en) Method and device for supporting https protocol by website
CN110795649A (en) Target page display method, device and system and electronic equipment
CN110929128A (en) Data crawling method, device, equipment and medium
CN112612546A (en) Page loading method and device, electronic equipment and storage medium
CN109213824B (en) Data capture system, method and device
CN112183045A (en) Online document processing method and device and electronic equipment
CN109902726B (en) Resume information processing method and device
CN111988405B (en) Message rewriting method of load balancing device and load balancing device
CN107862035B (en) Network reading method and device for conference record, intelligent tablet and storage medium
US9680910B2 (en) Storing information to manipulate focus for a webpage
CN109284428A (en) Data processing method, device and storage medium
CN110704771A (en) Page abnormity monitoring method, system, device, electronic equipment and readable medium
US20170147543A1 (en) Enabling legacy web applications for mobile devices
CN114449523B (en) Flow filtering method, device, equipment and medium for satellite measurement and control system
CN107465604B (en) E-mail display method and device and medium computing device
CN115563134A (en) Interaction method, interaction device, electronic equipment and computer readable medium
CN115470432A (en) Page rendering method and device, electronic equipment and computer readable medium
US10585992B2 (en) Changing a language for a user session replay
CN111950663A (en) Display picture generation method and device and electronic equipment
CN111597059A (en) Interface calling request processing method and device and electronic equipment
US10547986B2 (en) Cognitive root uniform resource locator

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
GR01 Patent grant
GR01 Patent grant