CN111988405A - 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
CN111988405A
CN111988405A CN202010843539.9A CN202010843539A CN111988405A CN 111988405 A CN111988405 A CN 111988405A CN 202010843539 A CN202010843539 A CN 202010843539A CN 111988405 A CN111988405 A CN 111988405A
Authority
CN
China
Prior art keywords
message
rewriting
load balancing
configuration
target url
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.)
Granted
Application number
CN202010843539.9A
Other languages
Chinese (zh)
Other versions
CN111988405B (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

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/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

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Databases & Information Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The present disclosure relates to a message rewriting method for a load balancing apparatus, 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 rewriting 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 under the condition that the message is compressed and improve the rewriting efficiency.

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, to a message rewriting method for a load balancing device, the load balancing device, an electronic device, 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 the request and response messages of the HTTP are purposefully modified to meet a certain specific effect. This is the HTTP rewrite function. The current HTTP rewrite function is to search a certain fixed character string in an HTTP message as a matching condition, and replace the character string with a preset character string according to actual needs; or adding and deleting a header field in the HTTP message. Therefore, the HTTP interactive message can be modified, and the requirements of the client and the server are flexibly met.
However, in the scheme in the prior art, the HTTP compression originally improves the access experience of the client under the condition of sacrificing a certain performance. When the transmission data is small, the performance is sacrificed while the customer experience is not different; moreover, when the load balancing device is oriented to millions of clients, the clients need to rewrite the same message once per request. This wastes the opportunity for the load balancing apparatus to provide more functionality.
Therefore, a new message rewriting method for a load balancing apparatus, an electronic device, and a computer-readable medium are needed.
The above information disclosed in this background section is only for enhancement of understanding of the background of the disclosure and therefore it may contain information that does not constitute prior art that is already known to a person of ordinary skill in the art.
Disclosure of Invention
In view of the above, the present disclosure provides a message rewriting method for a load balancing apparatus, an electronic device, and a computer readable medium, which can flexibly implement message rewriting under the condition that a message is compressed, and improve rewriting efficiency.
Additional features and advantages of the disclosure will be set forth in the detailed description which follows, or in part will be obvious from the description, or may be learned by practice of the disclosure.
According to an aspect of the present disclosure, a method for rewriting a packet in a load balancing device is provided, where the method includes: acquiring a request message from a client; extracting a target URL address from the request message; when the rewriting configuration is not changed, matching in a cache according to the target URL address; when a valid result is matched, generating response information through the 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 the configuration authority of at least one server corresponding to the load balancing device; modifying the overriding configuration of the at least one server based on the configuration rights.
In an exemplary embodiment of the present disclosure, modifying the overriding 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 clear text.
In an exemplary embodiment of the present disclosure, the preset condition is satisfied, including: 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 packet rewriting on the response packet 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 corresponding response information in a cache of a 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 cache data corresponding to the target URL address in the cache and updating the re-configured matching item.
In an exemplary embodiment of the present disclosure, when the preset condition is not satisfied, the method further includes: when the rewriting configuration is not changed, matching in a cache according to the target URL address; when a valid result is matched, generating response information through the 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 rewrite configuration is not changed, matching in a cache according to the target URL address includes: judging whether the rewriting configuration is changed; when the rewriting configuration is not changed, retrieving in a cache according to the target URL address; and when the cache data corresponding to the target address exists, determining that a valid result is matched.
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 message module is provided for a load balancing apparatus, and 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 a server corresponding to the target URL address when a preset condition is met so that the server replies a response message through a plaintext; and the response module is used for rewriting 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 the overriding configuration of the at least one server based on the configuration rights.
According to an aspect of the present disclosure, an electronic device is provided, the electronic device including: one or more processors; storage means for storing one or more programs; when executed by one or more processors, cause the one or more processors to implement a method as above.
According to an aspect of the disclosure, a computer-readable medium is proposed, on which a computer program is stored, which program, when being executed by a processor, carries out the method as above.
According to the message rewriting method for the load balancing device, the electronic equipment and the computer readable medium, the request message from the 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 mode of generating the response information by rewriting the message to the response message can flexibly realize message rewriting under the condition that the message is compressed and improve the rewriting efficiency.
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 some embodiments of the present disclosure, and other drawings may be derived from those drawings by those of ordinary skill in the art without inventive effort.
Fig. 1 is a flowchart of a message rewriting method in the prior art.
Fig. 2 is a schematic diagram illustrating an application scenario of a packet rewriting method for a load balancing apparatus according to an exemplary embodiment.
Fig. 3 is a flowchart illustrating a message rewriting method for a load balancing apparatus according to an exemplary embodiment.
Fig. 4 is a flowchart illustrating a message rewriting method for a load balancing apparatus according to another exemplary embodiment.
Fig. 5 is a flowchart illustrating a message rewriting method for a load balancing apparatus according to another exemplary embodiment.
Fig. 6 is a block diagram illustrating a load balancing apparatus in accordance with an example embodiment.
FIG. 7 is a block diagram illustrating an electronic device in accordance with an example embodiment.
FIG. 8 is a block diagram illustrating a computer-readable medium in accordance with an example embodiment.
Detailed Description
Example embodiments will now be described more fully with reference to the accompanying drawings. Example embodiments may, however, be embodied in many different 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 example embodiments to those skilled in the art. The same reference numerals denote the same or similar parts in the drawings, 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 subject matter of the present disclosure can be practiced without one or more of the specific details, or with other methods, components, devices, steps, and so forth. In other instances, well-known methods, load-balancing devices, implementations, or operations have not been shown or described in detail to avoid obscuring aspects of the disclosure.
The block diagrams shown in the figures are functional entities only and do not necessarily correspond to physically separate entities. I.e. these functional entities may be implemented in the form of software, or in one or more hardware modules or integrated circuits, or in different networks and/or processor means and/or microcontroller means.
The flow charts shown in the drawings are merely illustrative and do not necessarily include all of the contents and operations/steps, nor do they necessarily have to 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 actual execution sequence may be changed according to the actual situation.
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. Thus, a first component discussed below may be termed a second component without departing from the teachings of the disclosed concept. As used herein, the term "and/or" includes any and all combinations of one or more of the associated listed items.
It is to be understood by those skilled in the art that the drawings are merely schematic representations of exemplary embodiments, and that the blocks or processes shown in the drawings are not necessarily required to practice the present disclosure and are, therefore, not intended to limit the scope of the present disclosure.
Fig. 1 is a flowchart of a message rewriting method in the prior art. As shown in fig. 1, in the current HTTP rewrite function, a certain fixed character string is generally retrieved from an HTTP message as a matching condition, and the fixed character string is replaced with a preset character string according to actual needs; or adding and deleting a header field in the HTTP message. Therefore, the HTTP interactive message can be modified, and the requirements of the client and the server are flexibly met.
The specific implementation scheme is as follows:
1. configuring a corresponding HTTP rewriting method according to actual requirements, such as: modifying a specified HTTP header field value, newly adding a field or deleting a HTTP header field, searching a certain character string in the message and replacing the character string with a new character string, and the like;
2. analyzing the HTTP message, acquiring basic information and each header field of the HTTP message, and recording information such as the position of a character string to be changed;
3. and modifying the message according to the position information of the character string, the HTTP header field information and the HTTP rewriting configuration required to complete rewriting.
In the process of HTTP transmission, the data volume transmitted by the network can be reduced by using HTTP compression, and the access speed of the client browser is improved. Under the situation of HTTP compression, the position information of the character strings which need to be modified and replaced in HTTP rewriting configuration cannot be directly acquired, and the position information can be acquired only after corresponding decompression according to the compression format specified by Accept-Encoding. The HTTP compression originally improves the access experience of the client under the condition of sacrificing certain performance. When the transmission data is small, the performance is sacrificed without the difference in the customer experience.
When the load balancing device faces millions of clients, the same message needs to be rewritten once every time the client requests one time. This wastes the opportunity for the load balancing apparatus to provide more functionality.
Aiming at the defects of the prior art, the message rewriting method for the load balancing device disclosed by the invention solves the problems of repeated rewriting for many times and inconvenience in rewriting under the situation of compression. The message rewriting method for the load balancing device can flexibly realize rewriting even under the condition of message compression, and improve the rewriting efficiency. The present disclosure is described in detail below with reference to specific examples.
Fig. 2 is a schematic diagram illustrating an application scenario of a packet rewriting method for a load balancing apparatus according to an exemplary embodiment.
As shown in fig. 2, the system architecture 20 may include terminal devices 201, 202, 203, a network 204 and load balancing means 205, servers 206, 207, 208. The network 204 is a medium to provide communication links between the terminal devices 201, 202, 203 and the load balancing apparatus 205; the network 204 also serves to provide a medium for communication links between the servers 206, 207, 208 and the load balancing apparatus 205. Network 204 may include various connection types, such as wired, wireless communication links, or fiber optic cables, to name a few.
The user may use the terminal device 201, 202, 203 to interact with the server 206, 207, 208, via the network 204, the load balancing means 205, to receive or send messages, etc. The terminal devices 201, 202, 203 may have various communication client applications installed thereon, such as shopping applications, web browser applications, search applications, instant messaging tools, mailbox clients, social platform software, and the like.
The terminal devices 201, 202, 203 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop portable computers, desktop computers, and the like.
The servers 206, 207, 208 may be servers providing various services, such as a background management server providing support for websites browsed by users using the terminal devices 201, 202, 203. The background management server can analyze and process the received request and feed back the processing result to the terminal equipment.
The load balancing apparatus 205 may, for example, obtain a request message from the client 101 (or the client 102, the client 103); the load balancing device 205 may extract the target URL address, for example, from the request message; the load balancing apparatus 205 may, for example, send the request message to the server 206 (or the server 207, the server 208) corresponding to the target URL address when a preset condition is met, so that the server replies a response message through plaintext; the load balancing apparatus 205 may, for example, rewrite the response packet to generate response information.
In one embodiment, the target URL address and the response information corresponding thereto may also be stored in a cache of a load balancing apparatus, for example.
The load balancing apparatus 205 may also, for example, perform matching in the cache according to the target URL address when the rewrite configuration is not changed; when a valid result is matched, generating response information through the data corresponding to the target URL address in the cache; and sending the response information to the client.
The load balancing apparatus 205 may also detect a change in the rewriting configuration at regular time, and when there is a change in the rewriting configuration, retrieve the target URL address from the cache; and deleting cache data corresponding to the target URL address in the cache and updating the re-configured matching item.
It should be noted that the message rewriting method for the load balancing apparatus provided in the embodiment of the present disclosure may be executed by the load balancing apparatus 205.
Fig. 3 is a flowchart illustrating a message rewriting method for a load balancing apparatus according to an exemplary embodiment. The message rewriting method 30 for a load balancing apparatus includes at least steps S302 to S308.
As shown in fig. 3, in S302, a request message from a client is obtained. The request message may be any required message, and may be, for example, a login request, an order processing request, a data access request, and the like, which is not limited in this disclosure.
Before obtaining the request message from the client, the method further comprises: acquiring the configuration authority of at least one server corresponding to the load balancing device; modifying the overriding configuration of the at least one server based on the configuration rights.
In one embodiment, modifying the overriding 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 clear text. Furthermore, an administrator can configure message rewriting items according to needs, and the method disclosed by the disclosure can be adopted in all scenes needing message rewriting. Preferably, in the context of message compression, the header-Encoding may be modified, so that the server responds to the message in a plaintext manner; after configuration, response messages of the server side are all in an HTTP plaintext state, and the position of the character string needing to be replaced is found according to rewriting configuration;
in S304, the target URL address is extracted from the request message.
In S306, when a preset condition is satisfied, 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 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 the modification header field Accept-Encoding is added, the server responds to the configuration switch replied by the message in a plaintext mode, and the subsequent HTTP response message of the configured server is started to be in a plaintext state, namely the position information of the replacement character string needing to be modified can be conveniently acquired.
In S308, the response message is rewritten to generate response information. The method comprises 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 message rewriting method may further include: modifying a specified certain HTTP header field value, adding a certain field or deleting a certain HTTP header field, searching a certain character string in the 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 mode of generating the response information by rewriting the message to the response message can flexibly realize message rewriting under the condition that the message is compressed and improve the rewriting efficiency.
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 flowchart illustrating a message rewriting method for a load balancing apparatus according to another exemplary embodiment. The flow 40 shown in fig. 4 is a supplementary description of the flow shown in fig. 2.
As shown in fig. 4, in S402, the target URL address and the response information corresponding to the target URL address are stored in a cache of the load balancing apparatus. And when 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, the rewritten message can be matched from the cache and directly replied to the client, namely, the same response message does not need to be rewritten every time.
In S404, when the rewrite configuration is not changed, matching is performed in the cache according to the target URL address. More specifically, the method can comprise the following steps: judging whether the rewriting configuration is changed; when the rewriting configuration is not changed, retrieving in a cache according to the target URL address; and when the cache data corresponding to the target address exists, determining that a valid result is matched.
In one embodiment, the rewriting configuration change condition can be detected at regular time, and when the rewriting configuration has change, the target URL address is searched in the cache; and deleting cache data corresponding to the target URL address in the cache and updating the re-configured matching item. When the rewriting effect of the response message changes, the cached message with the previous rewriting effect is judged and updated correspondingly. The rewriting effect required by the client is ensured to be the cached rewriting message, and the cached rewriting message is ensured to have real-time performance. When caching a rewrite packet, it is not possible to record only the requested target URL, and the rewritten configuration also needs to be recorded. When the request is received again, if only one matching condition of the target URL exists, when the rewriting configuration is changed, the replied cache response message does not contain the rewriting effect required by the client. Therefore, after the first rewrite succeeds, both the target URL and the rewrite configuration are recorded as matching conditions for the second access.
In S406, when a valid result is matched, response information is generated according to the data corresponding to the target URL address in the cache. 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.
When the load balancing device receives the same target URL request of the client again, whether the configured matching item is changed or not is checked, and if the configured matching item is not changed, the cached message contains the rewriting effect required by the client, and the cached message is directly replied to the client; and the rewriting configuration is changed, the message cached by the 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. Therefore, the target URL and the rewriting configuration are used as matching conditions of the cache message, and the latest cached rewriting message is ensured.
In S408, the response information is sent to the client.
Fig. 5 is a flowchart illustrating a message rewriting method for a load balancing apparatus according to another exemplary 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 rewriting content is configured.
In S504, the header field Accept-Encoding is modified, so that the server response packet is replied in a plaintext manner.
In S506, the received response message is retrieved. And the response messages of the server are all in an HTTP plaintext state, and the positions of the character strings needing to be replaced are found according to the rewriting configuration.
In S508, the rewrite 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 completing the rewriting, the rewritten packet is cached. 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 packet is matched according to the URL requested by the client.
In S514, the matched rewrite packet is replied to the request of the client. When the load balancing device receives the request of the client to the same URL again, the rewritten message is directly replied to the client after matching is successful according to the URL and the rewritten configuration as matching conditions.
According to the method disclosed by the disclosure, the HTTP response message can be flexibly rewritten in the context of message compression. And the rewritten message is cached, and when the load balancing device detects that a certain client requests the same URL, the cached rewritten message can be directly replied to the client.
Those skilled in the art will appreciate that all or part of the steps implementing the above embodiments are implemented as computer programs executed by a CPU. When executed by the CPU, performs the functions defined by the above-described methods provided by the present disclosure. The program may be stored in a computer readable storage medium, which may be a read-only memory, a magnetic or optical disk, or the like.
Furthermore, it should be noted that the above-mentioned figures are only schematic illustrations of the processes involved in the methods according to exemplary embodiments of the present disclosure, and are not intended to be limiting. It will be readily understood that the processes shown in the above figures are not intended to indicate or limit the chronological order of the processes. In addition, it is also readily understood that these processes may be performed synchronously or asynchronously, e.g., in multiple modules.
The following are embodiments of the disclosed apparatus that may be used to perform embodiments of the disclosed methods. For details not disclosed in the embodiments of the apparatus of the present disclosure, refer to the embodiments of the method of the present disclosure.
Fig. 6 is a block diagram illustrating a packet rewriting device for a load balancing device according to another exemplary embodiment. As shown in fig. 6, the packet rewriting apparatus 60 for a load balancing apparatus includes: a message module 602, an extraction module 604, a sending module 606, a response module 608, and a 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, and may be, for example, a login request, an order processing request, a request for accessing data, and the like.
The address module 604 is configured to extract a target URL address from the request message;
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 a plaintext; wherein, satisfy 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. The method comprises 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 right of at least one server corresponding to the load balancing apparatus; modifying the overriding configuration of the at least one server based on the configuration rights.
According to the message rewriting device for the load balancing device, the request message from the 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 mode of generating the response information by rewriting the message to the response message can flexibly realize message rewriting under the condition that the message is compressed and improve the rewriting efficiency.
FIG. 7 is a block diagram illustrating an electronic device in accordance with an example embodiment.
An electronic device 700 according to this embodiment of the disclosure is described below with reference to fig. 7. The electronic device 700 shown in fig. 7 is only an example and should not bring any limitation to the functions and the scope of use of the embodiments of the present disclosure.
As shown in fig. 7, electronic device 700 is embodied in the form of a general purpose computing device. The components of the 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 that connects the various 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 codes executable by the processing unit 710 to cause the processing unit 710 to perform the steps according to various exemplary embodiments of the present disclosure described in the above-mentioned electronic prescription flow processing method section of the present specification. For example, the processing unit 710 may perform the steps as shown in fig. 3, 4, 5.
The memory unit 720 may include readable media in the form of volatile memory units, such as a random access memory unit (RAM)7201 and/or a cache memory unit 7202, and may further include a read only memory unit (ROM) 7203.
The memory 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 of which, or some combination thereof, may comprise an implementation of a network environment.
Bus 730 may be any representation of 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.), with one or more devices that enable a user to interact with the electronic device 700, and/or with any devices (e.g., router, modem, etc.) that enable the electronic device 700 to communicate with one or more other computing devices. Such communication may occur via an input/output (I/O) interface 750. Also, the electronic device 700 may communicate with one or more networks (e.g., a Local Area Network (LAN), a Wide Area Network (WAN), and/or a public network such as the internet) via the network adapter 760. The network adapter 760 may communicate with other modules of the electronic device 700 via the bus 730. It should be appreciated that although not shown in the figures, other hardware and/or software modules may be used in conjunction with the electronic device 700, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, among others.
Through the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein may be implemented by software, or by software in combination with necessary hardware. Therefore, as shown in fig. 8, the technical solution according to the embodiment of the present disclosure may be embodied in the form of a software product, which may be stored in a non-volatile storage medium (which may be a CD-ROM, a usb disk, a removable hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which may be a personal computer, a server, or a network device, etc.) to execute the above method according to the embodiment 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. A readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the readable storage medium include: an electrical connection having one or more wires, a portable disk, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
The computer readable storage medium may include a propagated data signal with readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A readable storage medium may also be any readable medium that is not a readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a 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 for 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 and partly on a remote computing device, or entirely on the remote computing device or server. In the case of a remote computing device, 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., through the internet using an internet service provider).
The computer readable medium carries one or more programs which, when executed by a device, 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 rewriting the response message to generate response information.
Those skilled in the art will appreciate that the modules described above may be distributed in the apparatus according to the description of the embodiments, or may be modified accordingly in one or more apparatuses unique from the embodiments. The modules of the above embodiments may be combined into one module, or further split into multiple sub-modules.
Through the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein may be implemented by software, or by software in combination with necessary hardware. Therefore, 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 (which may be a CD-ROM, a usb disk, a removable hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which may be a personal computer, a server, a mobile terminal, or a network device, etc.) to execute 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 the present disclosure is not limited to the precise arrangements, instrumentalities, or instrumentalities 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 (11)

1. A message rewriting method for a load balancing device is characterized by comprising 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 rewriting the response message to generate response information.
2. The message rewriting method for a load balancing apparatus according to claim 1, before acquiring the request message from the client, further comprising:
acquiring the configuration authority of at least one server corresponding to the load balancing device;
modifying the overriding configuration of the at least one server based on the configuration rights.
3. The message rewriting method for a load balancing apparatus according to claim 2, wherein modifying the rewrite configuration of the at least one server based on the configuration authority 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 clear text.
4. The message rewriting method for a load balancing device according to claim 1, wherein satisfying the predetermined condition includes:
there is a change in the overwrite configuration or no match to a valid result in the cache.
5. The message rewriting method 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.
6. The message rewriting method for a load balancing apparatus according to claim 1, further comprising:
and storing the target URL address and the corresponding response information in a cache of a load balancing device.
7. The message rewriting method for 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 cache data corresponding to the target URL address in the cache and updating the re-configured matching item.
8. The message rewriting method for a load balancing apparatus according to claim 1, wherein when the preset condition is not satisfied, further comprising:
when the rewriting configuration is not changed, matching in a cache according to the target URL address;
when a valid result is matched, generating response information through the data corresponding to the target URL address in the cache;
and sending the response information to the client.
9. The message rewriting method for a load balancing apparatus according to claim 8, wherein when the rewrite configuration is not changed, performing 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, retrieving in a cache according to the target URL address;
and when the cache data corresponding to the target address exists, determining that a valid result is matched.
10. A load balancing apparatus, comprising:
the message module is used for acquiring 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 a server corresponding to the target URL address when a preset condition is met so that the server replies a response message through a plaintext;
and the response module is used for rewriting the response message to generate response information.
11. The load balancing apparatus of claim 1, further comprising:
the configuration module is used for acquiring the configuration authority of at least one server corresponding to the load balancing device; modifying the overriding configuration of the at least one server based on the 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 true CN111988405A (en) 2020-11-24
CN111988405B 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)

Cited By (1)

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

Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020099850A1 (en) * 1998-02-10 2002-07-25 Digital Island, Inc. Internet content delivery network
CN101610268A (en) * 2009-07-16 2009-12-23 杭州华三通信技术有限公司 A kind of implementation method of keyword filtration and equipment
US20130007109A1 (en) * 2010-01-06 2013-01-03 Fujitsu Limited Load balancing system and method thereof
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
US20160285992A1 (en) * 2015-03-26 2016-09-29 Fortinet, Inc. Rule based cache processing in application delivery controller for load balancing
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
US20190238504A1 (en) * 2018-01-26 2019-08-01 Citrix Systems, Inc. Split-tunneling for clientless ssl-vpn sessions with zero-configuration
CN111147583A (en) * 2019-12-27 2020-05-12 杭州迪普科技股份有限公司 HTTP redirection rewriting method and device

Patent Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020099850A1 (en) * 1998-02-10 2002-07-25 Digital Island, Inc. Internet content delivery network
CN101610268A (en) * 2009-07-16 2009-12-23 杭州华三通信技术有限公司 A kind of implementation method of keyword filtration and equipment
US20130007109A1 (en) * 2010-01-06 2013-01-03 Fujitsu Limited Load balancing system and method thereof
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
US20160285992A1 (en) * 2015-03-26 2016-09-29 Fortinet, Inc. Rule based cache processing in application delivery controller for load balancing
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
US20190238504A1 (en) * 2018-01-26 2019-08-01 Citrix Systems, Inc. Split-tunneling for clientless ssl-vpn sessions with zero-configuration
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在互联网国际出入口的部署应用", 电信技术, no. 07 *

Cited By (2)

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

Also Published As

Publication number Publication date
CN111988405B (en) 2023-09-26

Similar Documents

Publication Publication Date Title
US11017153B2 (en) Optimizing loading of web page based on aggregated user preferences for web page elements of web page
US7574486B1 (en) Web page content translator
WO2020199751A1 (en) Method and apparatus for loading page picture, and electronic device
US8856262B1 (en) Cloud-based image hosting
JP2021103506A (en) Method and device for generating information
CN107908662B (en) Method and device for realizing search system
CN110795649A (en) Target page display method, device and system and electronic equipment
CN107844488B (en) Data query method and device
CN110704771A (en) Page abnormity monitoring method, system, device, electronic equipment and readable medium
CN111756847B (en) Method and device for supporting https protocol by website
CN109213824B (en) Data capture system, method and device
CN113590974A (en) Recommendation page configuration method and device, electronic equipment and computer readable medium
US20190188623A1 (en) Cognitive and dynamic business process generation
WO2023092580A1 (en) Page display method and apparatus, storage medium, and electronic device
CN109902726B (en) Resume information processing method and device
CN108011936B (en) Method and device for pushing information
CN102375881A (en) Content signature notification
US20160156694A1 (en) Storing information to manipulate focus for a webpage
CN111988405B (en) Message rewriting method of load balancing device and load balancing device
CN112394907A (en) Container-based delivery system construction method, application delivery method and delivery system
CN112436943A (en) Request deduplication method, device, equipment and storage medium based on big data
US20170147543A1 (en) Enabling legacy web applications for mobile devices
CN110737861A (en) webpage data processing method, device, equipment and storage medium
CN107634942B (en) Method and device for identifying malicious request
CN115563134A (en) Interaction method, interaction device, electronic equipment and computer readable medium

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