CN113179317B - Test system and method for content rewriting device - Google Patents

Test system and method for content rewriting device Download PDF

Info

Publication number
CN113179317B
CN113179317B CN202110458411.5A CN202110458411A CN113179317B CN 113179317 B CN113179317 B CN 113179317B CN 202110458411 A CN202110458411 A CN 202110458411A CN 113179317 B CN113179317 B CN 113179317B
Authority
CN
China
Prior art keywords
http
request data
http request
content
rewriting
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
CN202110458411.5A
Other languages
Chinese (zh)
Other versions
CN113179317A (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 CN202110458411.5A priority Critical patent/CN113179317B/en
Publication of CN113179317A publication Critical patent/CN113179317A/en
Application granted granted Critical
Publication of CN113179317B publication Critical patent/CN113179317B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/02Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/18Protocol analysers
    • 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

Abstract

The present disclosure relates to a test system, method, electronic device, and computer-readable medium for a content rewriting device. The method comprises the following steps: acquiring a plurality of HTTP request data and a first request message number by content rewriting equipment to be tested; identifying headers of the HTTP request data to generate a plurality of identification results; forwarding the HTTP request data to a target HTTP server according to the identification results; acquiring a second request message number of the HTTP request data received in the target HTTP server; and determining the test result of the content rewriting device according to the comparison result of the first request message number and the second request message number. The content rewriting device testing method, the content rewriting system, the electronic device and the computer readable medium can obviously improve the rewriting effect judgment efficiency and result accuracy of the content rewriting device, reduce the analysis time of testers on the content of the data message, and improve the working efficiency.

Description

Test system and method for content rewriting device
Technical Field
The present disclosure relates to the field of computer information processing, and in particular, to a method and system for testing a content rewriting device, an electronic device, and a computer-readable medium
Background
With the development of the internet, more and more clients are faced by service providers, a single server cannot meet the access requirements of so many clients, and a single server also has a single point of failure problem, so that a load balancing device appears, which is used for receiving a request from a client and distributing the request to a specific server in the background according to a certain condition, and the background has a plurality of servers providing the same service. When processing partial data, the load balancing device needs to identify and rewrite a header field in a message in order to achieve the purpose of accurately controlling the flow, and HTTP content rewriting becomes one of important functions of the load balancing device.
The existing test method for content rewriting of the HTTP of the load balancing device is to receive a message at an HTTP server after the HTTP request message passes through the content rewriting device, and determine whether an HTTP content rewriting function of the content rewriting device conforms to an expected content rewriting setting by analyzing the received message. The existing HTTP content rewriting test method can only analyze and judge whether the content rewriting equipment carries out correct rewriting actions through manually capturing data messages, human errors exist, and when a large amount of data messages carry out content rewriting, a large amount of high-performance content rewriting test work cannot be followed by manual work.
Therefore, there is a need for a new method, system, electronic device, and computer readable medium for testing a content rewriting device.
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 this, the present disclosure provides a method and a system for testing a content rewriting device, an electronic device, and a computer readable medium, which can significantly improve the rewriting effect determination efficiency and result accuracy of the content rewriting device, reduce the analysis time of a tester on the content of a data packet, and improve the work 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, there is provided a method of testing a content rewriting device, the method including: acquiring a plurality of HTTP request data and a first request message number by content rewriting equipment to be tested; identifying headers of the HTTP request data to generate a plurality of identification results; forwarding the plurality of HTTP request data to a target HTTP server according to the plurality of identification results; acquiring a second request message number of the HTTP request data received in the target HTTP server; and determining a test result of the content rewriting device according to a comparison result of the first request message number and the second request message number.
In an exemplary embodiment of the present disclosure, further comprising: the content rewriting apparatus acquires a plurality of initial HTTP request data by an HTTP client; rewriting headers of the plurality of initial HTTP request data to generate the plurality of HTTP request data.
In an exemplary embodiment of the present disclosure, rewriting headers of the plurality of HTTP request data to generate the plurality of HTTP request data includes: rewriting URIs in headers of the plurality of HTTP request data to generate the plurality of HTTP request data; and/or rewriting a METHOD in headers of the plurality of HTTP request data to generate the plurality of HTTP request data; and/or rewriting HOST in headers of the plurality of HTTP request data to generate the plurality of HTTP request data.
In an exemplary embodiment of the present disclosure, further comprising: the HTTP server processes the plurality of HTTP request data to generate a plurality of response messages; and sending the plurality of response messages back to the HTTP client.
In an exemplary embodiment of the present disclosure, forwarding the plurality of HTTP request data to an HTTP server according to the plurality of recognition results includes: matching the identification result with a content scheduling policy, and determining a target HTTP server from at least one HTTP server when the matching is successful; and forwarding the HTTP request data corresponding to the identification result to the target HTTP server.
In an exemplary embodiment of the present disclosure, further comprising: and when the matching is unsuccessful, forwarding the HTTP request data corresponding to the identification result to a preset HTTP server or discarding the HTTP request data.
In an exemplary embodiment of the present disclosure, determining a test result of the content rewriting device according to a comparison result of the first request message number and the second request message number includes: and when the number of the first request messages is the same as that of the second request messages, determining that the content rewriting device is normal in function.
According to an aspect of the present disclosure, there is provided a test system of a content rewriting device, the system including: a content rewriting device for generating a plurality of HTTP request data; the content scheduling device is used for acquiring a plurality of HTTP request data and a first request message number from the content rewriting device to be tested; identifying headers of the HTTP request data to generate a plurality of identification results; forwarding the HTTP request data to a target HTTP server according to the identification results; the target HTTP server is used for calculating the second request message number of the HTTP request data; and the calculating device is used for determining the test result of the content rewriting equipment according to the comparison result of the first request message number and the second request message number.
In an exemplary embodiment of the present disclosure, further comprising: and the HTTP client is used for generating a plurality of initial HTTP request data.
In an exemplary embodiment of the present disclosure, the content rewriting device is further configured to rewrite headers of the plurality of initial HTTP request data to generate the plurality of HTTP request data.
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 testing method, the system, the electronic device and the computer readable medium of the content rewriting device, a plurality of HTTP request data and a first request message number are obtained from the content rewriting device to be tested; identifying headers of the HTTP request data to generate a plurality of identification results; forwarding the plurality of HTTP request data to a target HTTP server according to the plurality of identification results; acquiring a second request message number of the received HTTP request data in the target HTTP server; the mode of determining the test result of the content rewriting device according to the comparison result of the first request message number and the second request message number can obviously improve the rewriting effect judgment efficiency and result accuracy of the content rewriting device, reduce the analysis time of a tester on the content of the data message, and improve the working 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 schematic diagram illustrating a test system of a content rewriting device according to an exemplary embodiment.
Fig. 2 is a flowchart illustrating a method of testing a content rewriting device according to an exemplary embodiment.
Fig. 3 is a flowchart illustrating a method of testing a content rewriting device according to another exemplary embodiment.
Fig. 4 is a flowchart illustrating a method of testing a content rewriting device according to another exemplary embodiment.
FIG. 5 is a system diagram illustrating a testing system of a content rewriting device in accordance with an exemplary embodiment.
Fig. 6 is a block diagram illustrating a test system of a content rewriting device according to another exemplary 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 in the drawings denote the same or similar parts, and 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, systems, implementations, or operations have not been shown or described in detail to avoid obscuring aspects of the present 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.
The technical abbreviations are explained as follows:
HTTP (HyperText Transfer Protocol) is a simple request-response Protocol, running on top of the TCP Protocol. It specifies in what format the client might send the message and what server response to get. The request and response messages are divided into a header, a header value, and a message body.
HTTP header field: the HTTP message marks protocol Content in a mode of a header field plus a header field value, wherein the header field comprises a Method, a URI, a Version, a Host, a Cookie, a User-Agent, a Connection, an Accept-Encoding, a Content-Length and the like, and the header value is determined according to specific conditions.
And (3) HTTP content rewriting, wherein when the HTTP request message passes through the content rewriting device, the device identifies the header field and the header value in the message and judges whether the header field and the header value are matched with a preset value, if the header field and the header value are matched with the preset value, the device executes rewriting actions, and the rewriting actions comprise operations of adding other headers and corresponding values, deleting the headers and the corresponding values, modifying the header values, replacing the headers with other headers and the like.
And (3) HTTP content scheduling, namely when the HTTP request message passes through the content scheduling equipment, the equipment identifies a header field and a header value in the message and judges whether the header field and the header value are matched with a preset value, if the header field and the header value are matched with the preset value, scheduling actions are executed, and the scheduling actions comprise closing the connection and distributing the connection to a specific certain server or a specific server group.
Load balancing: the load balancing equipment provides load balancing capacity, the load balancing equipment exists between a client and a server, the original condition that one client corresponds to one server is changed into the condition that one client corresponds to one load balancing equipment, the load balancing equipment corresponds to a plurality of servers providing the same service, the client directly initiates access to the servers from the original condition and modifies the access to the virtual service on the load balancing equipment, and then a large number of access requests of the client are distributed to different background servers through intermediate scheduling of the load balancing equipment, so that the load sharing of data among the servers is realized, the pressure of a single server is reduced, the access quality of a user is improved, and the use experience of the user is improved.
As described in the background description, after a large amount of HTTP request data is subjected to HTTP content rewriting operation by the load balancing device, it cannot be determined whether all messages arriving at the HTTP server have completed the HTTP content rewriting operation correctly, so the present disclosure provides a testing method for determining whether a result obtained after the content rewriting operation is performed on the large amount of HTTP request data meets a preset value. More specifically, the method in this document tests, for the rewrite function of the HTTP content rewrite apparatus, whether the result of content rewrite is correct, that is, completely satisfies the content rewrite policy that is expected to be set, after a large number of HTTP request messages pass through the HTTP content rewrite apparatus.
The present disclosure is described in detail below with the aid of specific examples.
Fig. 1 is a schematic diagram illustrating a test system of a content rewriting device according to an exemplary embodiment.
As shown in fig. 1, the system architecture 10 may include an HTTP client 101, a content rewriting device 102, a content scheduling device 103, and an HTTP server 104. The network serves as a medium for providing communication links between the terminal devices 101, 102, 103 and the HTTP server 104. The network may include various connection types, such as wired, wireless communication links, or fiber optic cables, to name a few.
The HTTP client 101 may be a variety of electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablets, laptop portable computers, desktop computers, and the like.
The HTTP server 104 may be a server that provides various services, and for example, the HTTP server 104 may analyze the received request data and feed back the processing result to the HTTP client 101.
The HTTP client 101 and the HTTP server 104 are provided with a content rewriting device 102 and a content scheduling device 103.
The content rewriting device 102 acquires HTTP request data from the HTTP client 101, rewrites a header (URI, METHOD, HOST, etc.) in the HTTP request data according to a preset policy by the content rewriting device 102, and transmits the HTTP request data after writing to the content scheduling device 103.
The content scheduling apparatus 103 identifies the header (URI, METHOD, HOST, etc.) and the header value in the HTTP request data, and forwards or discards the HTTP request data to the HTTP server 104 or another server based on the identified header (URI, METHOD, HOST, etc.) and the header value in the HTTP request data.
The system architecture 10 further includes a computing device (not shown), and the computing device may be disposed in the HTTP client 101, the content scheduling apparatus 103, or the HTTP server 104, which is not limited in this disclosure. The computing means determines the test result of the content rewriting device 102 based on the comparison result of the first number of request messages sent out at the HTTP client 101 and the second number of request messages received at the HTTP server 104.
Based on the above system architecture, the specific testing process of the present disclosure may be as follows:
the HTTP client 101 initiates an HTTP request message, and after the request message reaches the content rewriting device 102, the content rewriting device 102 implements content rewriting of the HTTP request message, and modifies the original content message1 in the request message into a target content message2;
the request message reaches the content scheduling device 103, if the message2 after the content is rewritten is identified, the request is sent to the HTTP Server, otherwise, the request message is discarded;
furthermore, when a request message sent by the HTTP client 101 reaches the content scheduling device 103 after being subjected to content rewriting by the content rewriting device 102, the content scheduling device 103 determines whether a header field and a header value after being rewritten in the HTTP request message conform to an expected set value, if the header field and the header value conform to the expected set value, it is verified that the content rewriting function of the content rewriting device 102 is normal and the message is normally forwarded to the HTTP server 104, otherwise, the content rewriting device 102 is abnormal in content rewriting function and discards the message, and the HTTP server 104 cannot receive the message.
After receiving the request message, the HTTP server 104 replies a response message, and returns to the HTTP client 101 after passing through the content scheduling device 103 and the content rewriting device 102 in sequence, and the entire data flow is normally ended;
the computing device can count the number S1 of request messages sent by the HTTP client 101 and the number S2 of messages received by the HTTP server 104;
the HTTP content rewriting function of the intermediate content rewriting device 102 is normal if S1= S2, otherwise the content rewriting function of the content rewriting device 102 is not normal.
Fig. 2 is a flowchart illustrating a method of testing a content rewriting device according to an exemplary embodiment. The test method 20 of the content rewriting device includes at least steps S202 to S210.
As shown in fig. 2, in S202, a plurality of HTTP request data and a first request message number are acquired by a content rewriting device to be tested. Wherein the content rewriting apparatus has realized rewriting of a header (URI, METHOD, HOST, etc.) in the initial HTTP request data.
In S204, headers of the plurality of HTTP request data are recognized, and a plurality of recognition results are generated. More specifically, headers (URI, METHOD, HOST, etc.) in the HTTP request data are identified.
In S206, the HTTP request data is forwarded to the target HTTP server according to the plurality of recognition results. The identification result may be a server address to which the HTTP request data is to be forwarded.
In S208, a second request message number of the HTTP request data received in the target HTTP server is acquired. The target HTTP server may be one server in the server cluster, and when counting the number of the second request messages, the number of the messages in all the server clusters may be counted. For example, the HTTP server processes the plurality of HTTP request data to generate a plurality of response messages; and sending the plurality of response messages back to the HTTP client.
In S210, a test result of the content rewriting device is determined according to a comparison result of the first request message number and the second request message number. For example, when the first number of request messages is the same as the second number of request messages, it may be determined that the content rewriting device functions normally.
According to the testing method of the content rewriting device, a plurality of HTTP request data and a first request message number are obtained from the content rewriting device to be tested; identifying headers of the HTTP request data to generate a plurality of identification results; forwarding the HTTP request data to a target HTTP server according to the identification results; acquiring a second request message number of the received HTTP request data in the target HTTP server; the mode of determining the test result of the content rewriting device according to the comparison result of the first request message number and the second request message number can obviously improve the rewriting effect judgment efficiency and result accuracy of the content rewriting device, reduce the analysis time of a tester on the content of the data message, and improve the working 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. 3 is a flowchart illustrating a method of testing a content rewriting device according to another exemplary embodiment. The process 30 shown in fig. 3 is a supplementary description of fig. 2.
As shown in fig. 3, in S302, the content rewriting apparatus acquires a plurality of initial HTTP request data by the HTTP client.
In S304, the URIs in the headers of the plurality of HTTP request data are rewritten to generate the plurality of HTTP request data. URL rewriting is the process of first obtaining an incoming URL request and then rewriting it into another URL that the website can handle.
In S306, the METHOD in the headers of the plurality of HTTP request data is rewritten to generate the plurality of HTTP request data. Some browsers can only send GET and POS requests, and the PUT request sent by the client cannot be understood by the server. In addition to the constraints of the client and server on the HTTP method employed by the request, intermediate components such as proxies, gateways, etc. have limitations for the HTTP method. To solve the above problem, the problem can be solved by the METHOD rewrite.
In S308, HOST in the headers of the plurality of HTTP request data is rewritten to generate the plurality of HTTP request data. The HOST user client specifies the domain name/IP address and port number of the HTTP server that the user wants to access.
Fig. 4 is a flowchart illustrating a method of testing a content rewriting device according to another exemplary embodiment. The flow 40 shown in fig. 4 is a detailed description of S206 "forwarding the HTTP request data to the HTTP server according to the identification results" in the flow shown in fig. 2.
As shown in fig. 4, in S402, the recognition result is matched with the content scheduling policy. Different recognition results can be matched with different scheduling strategies according to the content in the scheduling strategies.
In S404, when the matching is successful, a target HTTP server is determined from the at least one HTTP server. And determining a target HTTP server to be forwarded according to the scheduling strategy.
In S406, the HTTP request data corresponding to the identification result is forwarded to the target HTTP server.
In S408, when the matching is unsuccessful, forwarding the HTTP request data corresponding to the identification result to a preset HTTP server or discarding the HTTP request data. A preset HTTP server address can be set for bearing the message with the rewriting error, the message with the rewriting error can be counted, and a user can identify the fault.
Fig. 5 is a test scheme in a specific application scenario, where in the application scenario illustrated in fig. 5, networking configuration information is as follows:
Figure BDA0003041430570000091
configuration 1: addresses of 1.1.1.4 and 1.1.1.5 are both on the a device, 2.2.2.4, 3.3.3.5 on the B device;
configuration 2: the device A and the device B are directly connected and are connected through a 3.3.3.0/24 network segment, the address on the device A is 3.3.3.2, and the address on the device B is 3.3.3.3;
configuration 3: configuring a route ip route 2.2.2.0/24.3.3.3.3 to reach a server network segment on the device A;
configuration 4: the device B is provided with a route reaching the PC network segment, i.e. ip route 1.1.1.0/24.3.3.2;
configuration 5: the virtual service address of the device A is 1.1.1.5, and the background server corresponding to the virtual service is 3.3.3.5;
configuration 6: the A device content rewriting policy is to modify the Host value to 1.1.1.10 and then forward the request data to 3.3.3.5 when the destination address of the request is a virtual service of 1.1.1.5 and the Host header value of the HTTP request is 1.1.1.1;
configuration 7: the virtual service address of the B device is 3.3.3.5, and the background servers are a server 1, a server 2 and a server 3;
configuration 8: the B device content scheduling policy is to assign HTTP request data to server 2 and server 3 in sequence according to a polling algorithm when the destination address of the request is a virtual service of 3.3.3.5 and the Host header value of the HTTP request is 1.1.1.10, the HTTP request is assigned to server 1, and the Host value is otherwise.
In the application scenario shown in fig. 5, the detailed testing process is as follows:
PC1 initiates HTTP request with destination address 1.1.1.5 to reach device A;
the IP address of the PC1 is 1.1.1, the HTTP request is matched with the content rewriting strategy of the device A, the Host field in the request message is modified to be 1.1.1.10, and then the request message is forwarded to the 3.3.3.5 virtual service of the device B;
after receiving the request data with the Host of 1.1.1.10, the device B matches the content scheduling policy and forwards the request message to the server 1;
PC2 initiates HTTP request with destination address 1.1.1.5 to reach device A;
the Host field in the HTTP request message of the PC2 is not matched with the content rewriting strategy of the device A, and the request message is directly forwarded to 3.3.3.5;
after receiving the request data with the Host of 1.1.1.2, the device B does not match the content scheduling policy, and forwards the request message to the server 2;
the PC3 initiates an HTTP request with a destination address of 1.1.1.5 to the device A;
the Host field in the HTTP request message of the PC3 is not matched with the content rewriting strategy of the device A, and the request message is directly forwarded to 3.3.3.5;
after receiving the request data with the Host of 1.1.1.3, the device B does not match with the content scheduling strategy and forwards the request message to the server 3 according to a polling scheduling algorithm;
when the PC1, the PC2 and the PC3 initiate a large number of HTTP requests to carry out content rewriting tests through the device A, counting the number S1 of HTTP request data messages sent by the PC1 and the number S2 of data messages received by the server 1;
after testing, the results were judged as follows: when S1= S2, it may be determined that the content rewriting function of the a device is normal, otherwise, the content rewriting function of the a device is not normal.
The method in the disclosure remarkably reduces the analysis of the content of the data message by the tester, obviously improves the judgment efficiency and the result accuracy of the content rewriting, and has obvious application effect in the following test conditions:
1. when a large amount of HTTP content overwrite data needs to be tested.
2. When the content rewriting function of the load balancing equipment needs to be subjected to performance test.
3. When the rewriting types (adding a header, deleting a header, rewriting a header and the like) of the content rewriting equipment are too many, the analysis of the test result can be completed only by correspondingly adding a scheduling strategy of the content scheduling equipment, configuring and scheduling the scheduling strategy to a corresponding background server and counting the message receiving quantity of the background server.
And the data result after the content is rewritten is identified by the content scheduling equipment, so that the working efficiency is improved.
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 disclosure, and are not intended to be limiting. It will be readily appreciated that the processes illustrated in the above figures are not intended to indicate or limit the temporal 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 test apparatus of a content rewriting device according to an exemplary embodiment. As shown in fig. 6, the test apparatus 60 of the content rewriting device includes: a content rewriting device 602, a content scheduling device 604, a target HTTP server 606, a computing device 608, and an HTTP client 610.
The content rewriting device 602 is configured to generate a plurality of HTTP request data; the content rewriting device 602 is further configured to rewrite headers of the plurality of initial HTTP request data to generate the plurality of HTTP request data.
The content scheduling device 604 is configured to obtain, by the content rewriting device to be tested, a plurality of HTTP request data and a first request message number; identifying headers of the HTTP request data to generate a plurality of identification results; forwarding the plurality of HTTP request data to a target HTTP server according to the plurality of identification results;
the target HTTP server 606 is configured to calculate a second request message number of the HTTP request data;
the calculating means 608 is configured to determine a test result of the content rewriting device according to a comparison result of the first request message number and the second request message number.
The HTTP client 610 is used to generate a plurality of initial HTTP request data.
According to the testing device of the content rewriting device, a plurality of HTTP request data and a first request message number are obtained from the content rewriting device to be tested; identifying headers of the HTTP request data to generate a plurality of identification results; forwarding the HTTP request data to a target HTTP server according to the identification results; acquiring a second request message number of the HTTP request data received in the target HTTP server; the mode of determining the test result of the content rewriting device according to the comparison result of the first request message number and the second request message number can obviously improve the rewriting effect judgment efficiency and result accuracy of the content rewriting device, reduce the analysis time of a tester on the content of the data message, and improve the working 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 function and the scope of use of the embodiments of the present disclosure.
As shown in fig. 7, electronic device 700 is 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 couples 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 code that can be executed 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 this specification. For example, the processing unit 710 may perform the steps as shown in fig. 2, 3, 4.
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 can also communicate with one or more external devices 700' (e.g., keyboard, pointing device, bluetooth device, etc.) such that a user can communicate with the devices with which the electronic device 700 interacts, and/or any device (e.g., router, modem, etc.) with which the electronic device 700 can 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. The 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 diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
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 plurality of HTTP request data and a first request message number by content rewriting equipment to be tested; identifying the headers of the plurality of HTTP request data to generate a plurality of identification results; forwarding the HTTP request data to a target HTTP server according to the identification results; acquiring a second request message number of the received HTTP request data in the target HTTP server; and determining the test result of the content rewriting device according to the comparison result of the first request message number and the second request message number.
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 (10)

1. A method of testing a content rewriting device, comprising:
acquiring a plurality of HTTP request data and a first request message number by content rewriting equipment to be tested;
identifying the headers of the plurality of HTTP request data to generate a plurality of identification results;
forwarding the HTTP request data to a target HTTP server according to the identification results;
acquiring a second request message number of the received HTTP request data in the target HTTP server;
and determining a test result of the content rewriting device according to a comparison result of the first request message number and the second request message number.
2. The testing method of claim 1, further comprising:
the content rewriting apparatus acquires a plurality of initial HTTP request data by an HTTP client;
rewriting headers of the plurality of initial HTTP request data to generate the plurality of HTTP request data.
3. The testing method of claim 2, wherein rewriting headers of the plurality of HTTP request data to generate the plurality of HTTP request data comprises:
rewriting URIs in headers of the plurality of HTTP request data to generate the plurality of HTTP request data; and/or
Rewriting a METHOD in headers of the plurality of HTTP request data to generate the plurality of HTTP request data; and/or
Rewriting HOST in headers of the plurality of HTTP request data to generate the plurality of HTTP request data.
4. The test method of claim 1, further comprising:
the HTTP server processes the HTTP request data to generate a plurality of response messages;
and sending the plurality of response messages back to the HTTP client.
5. The testing method of claim 1, wherein forwarding the plurality of HTTP request data to an HTTP server based on the plurality of recognition results comprises:
matching the recognition result with the content scheduling policy, and determining a target HTTP server from at least one HTTP server when the matching is successful;
and forwarding the HTTP request data corresponding to the identification result to the target HTTP server.
6. The test method of claim 5, further comprising:
and when the matching is unsuccessful, forwarding the HTTP request data corresponding to the identification result to a preset HTTP server or discarding the HTTP request data.
7. The method for testing of claim 1, wherein determining the test result of the content rewriting device based on the comparison result of the first number of request messages and the second number of request messages includes:
and when the number of the first request messages is the same as that of the second request messages, determining that the content rewriting device is normal in function.
8. A content rewriting apparatus test system, comprising:
a content rewriting device for generating a plurality of HTTP request data;
the content scheduling device is used for acquiring a plurality of HTTP request data and a first request message number from the content rewriting device to be tested; identifying the headers of the plurality of HTTP request data to generate a plurality of identification results; forwarding the HTTP request data to a target HTTP server according to the identification results;
the target HTTP server is used for calculating the second request message number of the HTTP request data;
and the calculating device is used for determining the test result of the content rewriting equipment according to the comparison result of the first request message number and the second request message number.
9. The test system of claim 8, further comprising:
the HTTP client is used for generating a plurality of initial HTTP request data.
10. The test system of claim 9, wherein the content rewriting device is further configured to
Rewriting headers of the plurality of initial HTTP request data to generate the plurality of HTTP request data.
CN202110458411.5A 2021-04-27 2021-04-27 Test system and method for content rewriting device Active CN113179317B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110458411.5A CN113179317B (en) 2021-04-27 2021-04-27 Test system and method for content rewriting device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110458411.5A CN113179317B (en) 2021-04-27 2021-04-27 Test system and method for content rewriting device

Publications (2)

Publication Number Publication Date
CN113179317A CN113179317A (en) 2021-07-27
CN113179317B true CN113179317B (en) 2023-02-07

Family

ID=76926434

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110458411.5A Active CN113179317B (en) 2021-04-27 2021-04-27 Test system and method for content rewriting device

Country Status (1)

Country Link
CN (1) CN113179317B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113722007B (en) * 2021-08-24 2023-11-03 杭州迪普科技股份有限公司 Configuration method, device and system of VPN branch equipment

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6684257B1 (en) * 1999-10-15 2004-01-27 International Business Machines Corporation Systems, methods and computer program products for validating web content tailored for display within pervasive computing devices
CN111914194A (en) * 2020-07-02 2020-11-10 网联清算有限公司 Business system changing method and device, electronic equipment and storage medium
CN111988405A (en) * 2020-08-20 2020-11-24 杭州迪普科技股份有限公司 Message rewriting method of load balancing device and load balancing device

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8117325B1 (en) * 2008-04-29 2012-02-14 Juniper Networks, Inc. Policy-based cross-domain access control for SSL VPN
CN104579822B (en) * 2014-12-10 2018-06-19 华南理工大学 Mobile application automated performance testing system and method based on Http agreements
CN104580216B (en) * 2015-01-09 2017-10-03 北京京东尚科信息技术有限公司 A kind of system and method limited access request
CN106878311B (en) * 2017-02-22 2019-12-06 杭州迪普科技股份有限公司 HTTP message rewriting method and device
CN110032511A (en) * 2019-03-19 2019-07-19 深圳市买买提信息科技有限公司 A kind of interface test method and interface testing equipment
CN111147598B (en) * 2019-12-30 2023-04-25 杭州迪普科技股份有限公司 HTTP message processing method and device

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6684257B1 (en) * 1999-10-15 2004-01-27 International Business Machines Corporation Systems, methods and computer program products for validating web content tailored for display within pervasive computing devices
CN111914194A (en) * 2020-07-02 2020-11-10 网联清算有限公司 Business system changing method and device, electronic equipment and storage medium
CN111988405A (en) * 2020-08-20 2020-11-24 杭州迪普科技股份有限公司 Message rewriting method of load balancing device and load balancing device

Also Published As

Publication number Publication date
CN113179317A (en) 2021-07-27

Similar Documents

Publication Publication Date Title
US9459987B2 (en) Method and system for comparing different versions of a cloud based application in a production environment using segregated backend systems
US9455873B2 (en) End-to-end analysis of transactions in networks with traffic-altering devices
CN108173938B (en) Server load distribution method and device
CN112148674B (en) Log data processing method, device, computer equipment and storage medium
US7171464B1 (en) Method of tracing data traffic on a network
CN108718347B (en) Domain name resolution method, system, device and storage medium
US20150278523A1 (en) Method and system for testing cloud based applications and services in a production environment using segregated backend systems
CN112243002B (en) Data forwarding method, device, electronic equipment and computer readable medium
CN110198248B (en) Method and device for detecting IP address
CN111917900B (en) Domain name agent request processing method and device
CN110719215B (en) Flow information acquisition method and device of virtual network
CN111954240A (en) Network fault processing method and device and electronic equipment
CN104298675A (en) Method and device for cache management
US9917747B2 (en) Problem detection in a distributed digital network through distributed packet analysis
US8572245B1 (en) Using the TCP window size for identifying packets and debugging
CN113179317B (en) Test system and method for content rewriting device
CN112363938A (en) Data processing method and device, electronic equipment and storage medium
CN113055420B (en) HTTPS service identification method and device and computing equipment
CN115374207A (en) Service processing method and device, electronic equipment and computer readable storage medium
CN114143079A (en) Verification device and method for packet filtering strategy
CN112260903B (en) Link monitoring method and device
CN114650271B (en) Global load DNS neighbor site learning method and device
CN115277506B (en) Load balancing equipment testing method and system
US20230308392A1 (en) Linked Packet Tracing for Software Load Balancers
CN112436951A (en) Method and device for predicting flow path

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