CN111628911B - CDN back source abnormity testing method and device and terminal equipment - Google Patents

CDN back source abnormity testing method and device and terminal equipment Download PDF

Info

Publication number
CN111628911B
CN111628911B CN202010464721.3A CN202010464721A CN111628911B CN 111628911 B CN111628911 B CN 111628911B CN 202010464721 A CN202010464721 A CN 202010464721A CN 111628911 B CN111628911 B CN 111628911B
Authority
CN
China
Prior art keywords
source
test request
response
simulation
instruction
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
CN202010464721.3A
Other languages
Chinese (zh)
Other versions
CN111628911A (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.)
Beijing Kingsoft Cloud Network Technology Co Ltd
Original Assignee
Beijing Kingsoft Cloud Network Technology 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 Beijing Kingsoft Cloud Network Technology Co Ltd filed Critical Beijing Kingsoft Cloud Network Technology Co Ltd
Priority to CN202010464721.3A priority Critical patent/CN111628911B/en
Publication of CN111628911A publication Critical patent/CN111628911A/en
Application granted granted Critical
Publication of CN111628911B publication Critical patent/CN111628911B/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
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/08Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
    • H04L43/0823Errors, e.g. transmission errors
    • 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/08Protocols for interworking; Protocol conversion
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/22Parsing or analysis of headers

Abstract

The invention provides a method, a device and a terminal device for testing a CDN back source abnormity, wherein a test terminal receives a back source test request for a target CDN network, which is triggered by a user; the back source test request comprises a designated back source response instruction; the source return response instruction is used for indicating a response mode of the simulation source station for responding to the source return test request; and sending the back-source test request to the simulation source station through the target CDN, so that the simulation source station responds to the back-source test request based on the back-source response instruction. According to the mode, the response mode that the simulation source station responds to the back source test request is controlled through the back source response instruction in the back source test request, so that the disconnection time of the CDN and the simulation source station is finely controlled, various conditions of CDN back source abnormity can be comprehensively tested, meanwhile, the mode only disconnects the current back source test request and the simulation source station, the influence on other tests of the CDN performed in parallel is avoided, and the overall test efficiency is improved.

Description

CDN back source abnormity testing method and device and terminal equipment
Technical Field
The invention relates to the technical field of network testing, in particular to a method and a device for testing CDN network back source abnormity and terminal equipment.
Background
When a node device in a CDN (Content Delivery Network) Network receives a data access request from a user, if the node device in the CDN Network does not store data corresponding to the data access request, data needs to be obtained from a source station, and a process of obtaining the data from the source station is also referred to as CDN back-to-source.
In order to ensure that the CDN back source is normal, an anomaly test needs to be performed on the CDN back source process, and the anomaly is repaired in real time based on the test result. In the related art, the connection between the CDN network and the source station may be interrupted to simulate the abnormal CDN back-to-source condition, for example, limiting a data packet between the CDN network and the source station by an iptables tool to simulate the abnormal CDN back-to-source condition; alternatively, a nginx server or other web server may be used as the simulation source, and the connection between the simulation source and the CDN network is forcibly stopped when the test is performed. However, the above methods are difficult to finely control the disconnection time of the CDN network and the source station, which makes it difficult to comprehensively test various situations of CDN back-source abnormality, and meanwhile, when the CDN back-source abnormality test is performed in the above methods, other tests of the CDN network performed in parallel may be affected, which results in lower overall test efficiency.
Disclosure of Invention
The invention aims to provide a method, a device and a terminal device for testing CDN back source abnormity, so as to comprehensively test various conditions of CDN back source abnormity and improve the overall testing efficiency of CDN back source abnormity.
In a first aspect, an embodiment of the present invention provides a method for testing a CDN network back source anomaly, where the method is applied to a terminal device, where the terminal device is connected to a preset simulated source station through a target CDN network; the method comprises the following steps: receiving a source returning test request for a target CDN network, which is triggered by a user; wherein, the back source test request comprises a designated back source response instruction; the source return response instruction is used for indicating a response mode of the simulation source station for responding to the source return test request; and sending the back-source test request to a simulation source station through a target CDN network so that the simulation source station responds to the back-source test request based on a back-source response instruction.
In an alternative embodiment, the response mode includes: and the simulation source station returns the data volume of the response data corresponding to the back source test request.
In an optional embodiment, the back source response instruction includes: presetting an instruction name and an instruction value; wherein the instruction value is to indicate: and the simulation source station returns the data volume of the response data corresponding to the back source test request.
In an optional embodiment, the data amount of the response data corresponding to the back source test request includes any one of the following: returning complete response data corresponding to the source test request; returning header information of response data corresponding to the source test request and partial response data of the specified data volume; the header information is used for indicating the back source state of the back source test request; returning the head information of response data corresponding to the source test request; and zero data volume.
In an optional embodiment, before the step of sending the back-source test request to the simulated source station through the target CDN network, the method further includes: converting the format of the back source test request into a format matched with a preset network transmission protocol; in the converted back-to-source test request, the back-to-source response instruction is set in a request header or a Uniform Resource Locator (URL) of the back-to-source test request.
In a second aspect, an embodiment of the present invention provides a method for testing a CDN network back source anomaly, where the method is applied to a server running a simulated source station, where the simulated source station is connected to a terminal device through a target CDN network; the method comprises the following steps: receiving a back source test request sent by a target CDN; wherein, the back source test request comprises a designated back source response instruction; the source return response instruction is used for indicating a response mode of the simulation source station responding to the source return test request; extracting a back source response instruction from the back source test request; and responding to the back source test request based on the back source response instruction.
In an alternative embodiment, the response mode includes: and the simulation source station returns the data volume of the response data corresponding to the back source test request.
In an optional embodiment, the back source response instruction includes: presetting an instruction name and an instruction value; wherein the instruction value is to indicate: and the simulation source station returns the data volume of the response data corresponding to the back source test request.
In an optional embodiment, the step of responding to the back source test request based on the back source response instruction includes one or more of the following steps: if the data volume of the response data is complete response data, returning the complete response data corresponding to the source test request to the terminal equipment; if the data volume of the response data is the header information and the partial response data of the specified data volume, returning the header information of the response data corresponding to the source test request and the partial response data of the specified data volume to the terminal equipment; the header information is used for indicating the back source state of the back source test request; if the data volume of the response data is the head information of the response data, returning the head information of the response data corresponding to the source test request to the terminal equipment; and if the data volume of the response data is zero data volume, not returning any response data corresponding to the source test request to the terminal equipment.
In a third aspect, an embodiment of the present invention provides a device for testing a CDN network back source anomaly, where the device is disposed in a terminal device, and the terminal device is connected to a preset simulated source station through a target CDN network; the device includes: the request receiving module is used for receiving a source returning test request for the target CDN network, which is triggered by a user; wherein, the back source test request comprises a designated back source response instruction; the source return response instruction is used for indicating a response mode of the simulation source station responding to the source return test request; and the request sending module is used for sending the back-source test request to the simulation source station through the target CDN, so that the simulation source station responds to the back-source test request based on the back-source response instruction.
In a fourth aspect, an embodiment of the present invention provides a device for testing a CDN network back source anomaly, where the device is disposed in a server running a simulation source station, and the simulation source station is connected to a terminal device through a target CDN network; the device includes: the instruction receiving module is used for receiving a back source test request sent by a target CDN; wherein, the back source test request comprises a designated back source response instruction; the returned source response instruction is used for indicating a response mode of the simulation source station responding to the returned source test request; the instruction extracting module is used for extracting a back source response instruction from the back source test request; and the response module is used for responding to the back source test request based on the back source response instruction.
In a fifth aspect, an embodiment of the present invention provides a terminal device, where the terminal device includes a processor and a memory, where the memory stores machine executable instructions that can be executed by the processor, and the processor executes the machine executable instructions to implement the method for testing a CDN network back source exception according to the first aspect.
In a sixth aspect, an embodiment of the present invention provides a server, where the server includes a processor and a memory, where the memory stores machine executable instructions that can be executed by the processor, and the processor executes the machine executable instructions to implement the method for testing the CDN network back source exception according to the second aspect.
In a seventh aspect, an embodiment of the present invention provides a machine-readable storage medium, where the machine-readable storage medium stores machine-executable instructions, and when the machine-executable instructions are called and executed by a processor, the machine-executable instructions cause the processor to implement the method for testing the CDN network back-source exception.
The embodiment of the invention has the following beneficial effects:
the invention provides a method, a device and a terminal device for testing CDN back source abnormity, wherein the method comprises the steps that firstly, the terminal device receives a back source test request for a target CDN network, which is triggered by a user; wherein, the back source test request comprises a designated back source response instruction; the source return response instruction is used for indicating a response mode of the simulation source station for responding to the source return test request; and then sending the back-source test request to the simulation source station through the target CDN, so that the simulation source station responds to the back-source test request based on the back-source response instruction. According to the mode, the response mode that the simulation source station responds to the back source test request is controlled through the back source response instruction in the back source test request, so that the disconnection time of the CDN and the simulation source station is finely controlled, various conditions of CDN back source abnormity can be comprehensively tested, meanwhile, the mode only disconnects the current back source test request and the simulation source station, the influence on other tests of the CDN performed in parallel is avoided, and the overall test efficiency is improved.
Additional features and advantages of the invention will be set forth in the description which follows, and in part will be obvious from the description, or may be learned by the practice of the invention as set forth above.
In order to make the aforementioned and other objects, features and advantages of the present invention comprehensible, preferred embodiments accompanied with figures are described in detail below.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and other drawings can be obtained by those skilled in the art without creative efforts.
Fig. 1 is a flowchart of a method for testing a CDN network back source exception according to an embodiment of the present invention;
fig. 2 is a flowchart of another testing method for CDN network back source exception according to the embodiment of the present invention;
fig. 3 is a flowchart of another testing method for CDN network back source exception according to the embodiment of the present invention;
fig. 4 is a flowchart of another testing method for CDN network back source exception according to the embodiment of the present invention;
fig. 5 is a schematic structural diagram of a testing apparatus for CDN network back source exception according to an embodiment of the present invention;
fig. 6 is a schematic structural diagram of another testing apparatus for CDN network back source exception according to an embodiment of the present invention;
fig. 7 is a schematic structural diagram of a terminal device according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. The components of embodiments of the present invention generally described and illustrated in the figures herein may be arranged and designed in a wide variety of different configurations.
Thus, the following detailed description of the embodiments of the present invention, presented in the figures, is not intended to limit the scope of the invention, as claimed, but is merely representative of selected embodiments of the invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
In view of the above, in the current testing method for the CDN back-source abnormality, it is difficult to finely control the time for disconnecting the CDN network from the source station, so that it is difficult to comprehensively test various situations of the CDN back-source abnormality.
Based on this, the embodiment of the invention provides a method and a device for testing a CDN back source abnormity and a terminal device, and the technology can be applied to a testing scene of the CDN back source, especially a testing scene of the back source abnormity. In order to facilitate understanding of the embodiment, a detailed description is first given of a method for testing a CDN network back source anomaly disclosed in the embodiment of the present invention, where the method is applied to a terminal device, and the terminal device is connected to a preset simulated source station through a target CDN network; the terminal device may be a computer, or may be a mobile terminal (e.g., a mobile phone, a tablet computer, etc.); as shown in fig. 1, the method comprises the steps of:
step S102, receiving a source returning test request for a target CDN network triggered by a user; wherein, the back source test request comprises a designated back source response instruction; the source return response instruction is used for indicating the response mode of the simulation source station responding to the source return test request.
A user may generally trigger a back source test request at a terminal device, where the back source test request may be an http (Hypertext Transfer Protocol) request, an https (Hypertext Transfer Protocol Secure) request, or a request corresponding to another transmission Protocol. In the process of the CDN back-source abnormity test, a specified back-source response instruction can be added in the back-source test request, the back-source response instruction is used for indicating a response mode of the simulation source station responding to the back-source test request, the response mode can be a mode of interrupting the response after the simulation source station responds to how much data, or a mode of directly closing the connection between the CDN network and the simulation source station in the request without responding to the data, and the response mode can be set according to the requirements of testers, so that the disconnection time of the CDN network and the simulation source station can be finely controlled based on the response mode.
And step S104, sending the back source test request to a simulation source station through a target CDN network so that the simulation source station responds to the back source test request based on a back source response instruction.
The back source test request has a certain corresponding relationship with the CDN network, that is, which CDN network needs to be used when the back source test request uses the domain name to access data is preset. Therefore, when the terminal device sends the back source test request, the CDN network corresponding to the back source test request may be determined according to a domain name resolution method, and the CDN network is determined as a target CDN network, so that the back source test request carrying the back source response instruction is sent to the simulated source station corresponding to the target CDN network through the target CDN network. After receiving the back-source test request, the simulation source station may respond to the back-source test request based on a response mode in the back-source response instruction, and return response data to the terminal device.
The invention provides a method for testing CDN back source abnormity, which comprises the following steps that firstly, terminal equipment receives a back source test request for a target CDN network, wherein the back source test request is triggered by a user; wherein, the back source test request comprises a designated back source response instruction; the source return response instruction is used for indicating a response mode of the simulation source station for responding to the source return test request; and then sending the back-source test request to the simulation source station through the target CDN, so that the simulation source station responds to the back-source test request based on the back-source response instruction. According to the mode, the response mode that the simulation source station responds to the back source test request is controlled through the back source response instruction in the back source test request, so that the disconnection time of the CDN and the simulation source station is finely controlled, various conditions of CDN back source abnormity can be comprehensively tested, meanwhile, the mode only disconnects the current back source test request and the simulation source station, the influence on other tests of the CDN performed in parallel is avoided, and the overall test efficiency is improved.
The embodiment of the invention also provides another testing method for the CDN back source abnormity, which is realized on the basis of the method in the embodiment; the method mainly describes a response mode corresponding to a back source response, namely a testing process of CDN network back source abnormity and a specific process of data format conversion before request transmission (realized by the following step S204) when simulating the data volume of response data corresponding to a back source test request returned by a source station; as shown in fig. 2, the method comprises the steps of:
step S202, receiving a source returning test request for a target CDN network triggered by a user; the back source test request comprises a designated back source response instruction; the source return response instruction is used for indicating a response mode of the simulation source station for responding to the source return test request; the response mode comprises the following steps: and the simulation source station returns the data volume of the response data corresponding to the back source test request.
The response mode is used for indicating the data volume of response data corresponding to the source returning test request returned to the terminal equipment by the analog source station, and the data volume can be identified by numbers or character strings. During specific implementation, the time for disconnecting the CDN network from the analog source station in the current back-to-source test request, that is, after the analog source station returns response data of the data amount set in the response mode for the terminal device, the connection between the CDN network and the analog source station in the current back-to-source test request is disconnected (it may also be understood that the analog source station does not send response data to the terminal device any more).
In a specific implementation, the back source response instruction includes: presetting an instruction name and an instruction value; wherein the instruction value is to indicate: and the simulation source station returns the data volume of the response data corresponding to the source test request.
The instruction value may be set to a specific value, where the value is used to instruct the simulation source station to return the data volume of the response data corresponding to the source test request, and when the instruction value is specifically set, different values may be defined as different data volumes according to the requirements of the tester. For example, a negative number, zero, or positive number, etc., may be set. In a specific implementation, the back source test instruction may be represented as "instruction name: the format of the instruction value "may be other formats.
In some embodiments, the instruction name may be an expect-abort, which is typically a request message header, and the value of the expect-abort is typically a desired condition, indicating that the request can only be properly processed if the desired condition is satisfied; the expected condition may be set to the data amount of the response data corresponding to the source test request returned by the simulation source station indicated by the instruction value.
In some embodiments, the data amount of the response data corresponding to the back source test request may be any one of the following data amounts:
1. and returning the complete response data corresponding to the source test request. In specific implementation, the complete response data usually includes header information and actual data, where the actual data may be data that needs to be accessed by the backlog request, such as images, videos, audios, apks (android packages), and compressed packages; the header information is used for indicating the back source state of the back source test request, and the back source state can be back source normal or back source abnormal; the header information may also contain some descriptive information.
2. Header information of response data corresponding to the back source test request, and partial response data specifying the data amount.
The specified data amount is the data amount indicated in the response mode, and the partial response data of the specified data amount is the data of the specified data amount in the actual data.
3. And returning the header information of the response data corresponding to the source test request.
4. Zero data volume; i.e. the simulation source station does not return any data to the terminal device.
Step S204, converting the format of the back source test request into a format matched with a preset network transmission protocol; in the converted back-to-source test request, the back-to-source response instruction is set in a request header or a URL of the back-to-source test request.
The network transmission protocol can be an http protocol or an https protocol. Specifically, the above-mentioned back-source response instruction may be added to a request header or a URL (Uniform Resource Location) in the back-source test request, where the URL is usually a character string used to describe the information Resource; the request header may typically be used to set date, data type, browser type, etc. For example, the format of the back source test request is converted into a format matched with the http protocol, and the back source response instruction is set in an expect-abort request header, so the back source test request may be www.test.com/video/mp 4/test. mp4, and the request header is expect-abort: 1048576; the back source response instruction is set in the URL parameter of the back source test request, which can be represented as http:// www.test.com/video/mp 4/test. mp4expect _ abort 1048576.
In specific implementation, the back source response instruction is put into the request head, extra operation is not needed, and an abnormal response scene can be simulated, so that the test efficiency is improved.
Step S206, sending the back-source test request to the simulation source station through the target CDN network, so that the simulation source station responds to the back-source test request based on the data size of the response data corresponding to the back-source response instruction.
In specific implementation, based on the transparent transmission characteristic of the CDN network, the CDN network may send a back source test request sent by the terminal device to a simulated source station corresponding to the target CDN network, where the simulated source station may analyze a back source response instruction in the back source test request after receiving the back source test request, and respond to the back source test request according to a data amount in the back source response instruction.
In order to facilitate understanding of the above embodiments, the following description takes an example of adding a request header expect-abort to a back-source test request, where when the value of expect-abort is not a number, it indicates that the simulation source station returns complete response data corresponding to the back-source test request; when the value of expect-abort is negative, the simulation source station does not return any data; when the value of expect-abort is zero, the simulation source station returns the head information of the response data corresponding to the source test request; when the value of expect-abort is zero, the simulation source station returns the header information of the response data corresponding to the source test request and the partial response data of the specified data volume.
For example, the simulation source station parses out expect-abort:1, after receiving a back source test request, the simulation source station directly closes the connection with the back source test request, and does not respond to any data of the CDN network, that is, does not respond to any data of the terminal device; if the expect-abort is 0, the simulation source station receives the back source test request, and closes the connection with the back source test request after responding the head information of the back source test request, namely only responding the head information of the terminal equipment; if expect-abort:1048576, the simulation source station receives the back-source test request, after responding to the header information of the back-source test request and 1048576 bytes (equivalent to 1 mbyte) of response data, closes the connection with the back-source test request, that is, only responds to the header information of the terminal device and 1 mbyte of response data (also called actual data), and does not respond to the complete response data.
According to the method for testing the CDN network back-source abnormity, the back-source response instruction is added in the back-source test request, so that the simulation source station returns the data volume of the response data of the back-source test request according to the back-source response instruction, the data volume of the response data in the abnormal response of the simulation source station can be accurately controlled, other tests which are performed aiming at the target CDN network cannot be influenced, other people using the simulation source station to perform tests cannot be influenced, the test efficiency and coverage are improved, the quality and stability of CDN service are improved, the parallel execution of the tests is realized, and CDN equipment resources and human resources can be saved.
Corresponding to the above embodiment, another testing method for CDN network back source anomaly is also provided in the embodiments of the present invention, where the method is applied to a server running a simulated source station, where the simulated source station is connected to a terminal device through a target CDN network; as shown in fig. 3, the method comprises the steps of:
step S302, receiving a back source test request sent by a target CDN; wherein, the back source test request comprises a designated back source response instruction; the source return response instruction is used for indicating the response mode of the simulation source station responding to the source return test request.
Step S304, extracting a source return response command from the source return test request.
In particular implementation, the back source response instruction can be extracted and parsed according to the instruction name of the back source response instruction.
In some embodiments, the response mode includes: and the simulation source station returns the data volume of the response data corresponding to the source test request. Specifically, the back source response instruction includes: presetting an instruction name and an instruction value; wherein the instruction value is to indicate: and the simulation source station returns the data volume of the response data corresponding to the source test request.
The instruction value may be set to a specific value, where the value is used to instruct the simulation source station to return the data volume of the response data corresponding to the source test request, and when the instruction value is specifically set, different values may be defined as different data volumes according to the requirements of the tester. For example, a negative number, zero, or positive number, etc., may be set. In a specific implementation, the back source test instruction may be represented as "instruction name: the format of the instruction value ". Preferably, the above-mentioned back source response instruction may be added to a request header or URL of the back source test instruction.
And step S306, responding to the back source test request based on the back source response instruction.
In a specific implementation, the simulation source station may respond to the back-source test request according to the data volume of the response data corresponding to the back-source test request returned by the simulation source station included in the response mode, and return the corresponding result to the terminal device. Specifically, the step S306 may include one or more of the following steps:
1. and if the data volume of the response data corresponding to the source returning test request is complete response data, returning the complete response data corresponding to the source returning test request to the terminal equipment.
2. If the data volume of the response data corresponding to the source returning test request is the header information and the partial response data of the designated data volume, returning the header information of the response data corresponding to the source returning test request and the partial response data of the designated data volume to the terminal equipment; the header information is used to indicate the back source status of the back source test request.
3. And if the data volume of the response data corresponding to the back source test request is the header information of the response data, returning the header information of the response data corresponding to the back source test request to the terminal equipment.
4. And if the data volume of the response data corresponding to the back source test request is zero data volume, not returning any response data corresponding to the back source test request to the terminal equipment.
In the method for testing the back-source abnormity of the CDN, when a server corresponding to a simulation source station receives a back-source test request sent by a target CDN, a back-source response instruction is extracted from the back-source test request; the source return response instruction is used for indicating a response mode of the simulation source station for responding to the source return test request; and then responds to the back source test request based on the back source response instruction. According to the method, the response mode of the simulated source station responding to the back source test request is controlled through the back source response instruction in the back source test request, so that the simulated source station can perform data response according to the response mode, the disconnection time of the CDN network and the simulated source station can be finely controlled, various conditions of CDN back source abnormity can be comprehensively tested, meanwhile, the mode only disconnects the current back source test request and the simulated source station, the influence on other tests of the CDN network performed in parallel is avoided, and the overall test efficiency is improved.
The embodiment of the invention also provides another testing method for the CDN back source abnormity, which is realized on the basis of the method in the embodiment; the method comprises the steps that a terminal description feedback source response instruction is arranged on an expect-abort request header of a feedback source request, and a specific process that a source station carries out feedback source request response is simulated according to an instruction value on the request header; the method is applied to a server corresponding to a simulation source station, and as shown in fig. 4, the method includes the following steps:
step S402, receiving a back-source test request for the target CDN network from the terminal device.
In this embodiment, the function may be implemented on the simulation source station, so that the simulation source station may implement different abnormal response behaviors according to a value of a request header carried in a return source test request sent by the terminal device.
Step S404, judging whether the back source test request contains an expect-abort request header; if yes, go to step S406, otherwise go to step S412.
Specifically, by using the transparent name transmission characteristic of the CDN network, the analog source station receives the returnable source test request and parses an expect-abort request header added during testing.
Step S406, judging whether the expect-abort request header contains a number; if the digital code is included, step S408 is executed, otherwise, step S412 is executed.
If the echo-abort test request carries an expect-abort request header and the value is a number, the analog source station needs to perform abnormal response when representing the test.
Step S408, judging whether the number contained in the expect-abort request header is a negative number; if not, go to step S410; if it is negative, go to step S414.
Step S410, judging whether the number contained in the expect-abort request header is zero or not; if yes, go to step S416; if not, step S418 is performed.
Step S412, returning the complete response data corresponding to the source returning test request to the terminal equipment; and finishing the response.
Step S414, no response data corresponding to the source return test request is returned to the terminal equipment; and finishing the response.
Step S416, after returning the header information of the response data corresponding to the back source test request to the terminal device, closing the connection with the target CDN network; and finishing the response.
Step S418, after returning the header information of the response data corresponding to the back source test request and the response data of the number of bytes corresponding to the number to the terminal device, closing the connection with the target CDN network; and finishing the response.
If the number is a positive number, it indicates that the analog source station can return the header information of the response data corresponding to the ring test request and the number of bytes of response data corresponding to the positive number to the terminal device, for example, 1048576 bytes (equivalent to 1 mbyte) of response data can be responded to when the number is 1048576.
In specific implementation, the expect-abort request header in the source return test request can be dynamically set according to the requirement of a tester so as to control the number of bytes for simulating the abnormal response of the source station to the DN network.
According to the method for testing the CDN back source abnormity, the number of response bytes in abnormal response of the simulation source station can be accurately controlled in a mode that the back source abnormity request carries the expect-abort request header, the execution of other tests cannot be influenced, and because the connection between the request and the simulation source station is only closed, other people cannot be influenced to test by using the simulation source station, so that multiple people can use the same simulation source station to perform the test of the CDN back source abnormity, the test efficiency is improved, and the test effect is good.
Corresponding to the method embodiment, the embodiment of the invention provides a device for testing the CDN back source abnormity, wherein the device is arranged on a terminal device, and the terminal device is connected with a preset simulation source station through a target CDN; as shown in fig. 5, the apparatus includes:
a request receiving module 50, configured to receive a back-to-source test request for the target CDN network, where the back-to-source test request is triggered by a user; wherein, the back source test request comprises a designated back source response instruction; the source return response instruction is used for indicating the response mode of the simulation source station responding to the source return test request.
A request sending module 51, configured to send the back-source test request to the simulation source station through the target CDN network, so that the simulation source station responds to the back-source test request based on the back-source response instruction.
The invention provides a testing device for CDN back source abnormity, which comprises that firstly, terminal equipment receives a back source testing request for a target CDN network, which is triggered by a user; wherein, the back source test request comprises a designated back source response instruction; the source return response instruction is used for indicating a response mode of the simulation source station for responding to the source return test request; and then sending the back-source test request to the simulation source station through the target CDN, so that the simulation source station responds to the back-source test request based on the back-source response instruction. According to the mode, the response mode that the simulation source station responds to the back source test request is controlled through the back source response instruction in the back source test request, so that the disconnection time of the CDN and the simulation source station is finely controlled, various conditions of CDN back source abnormity can be comprehensively tested, meanwhile, the mode only disconnects the current back source test request and the simulation source station, the influence on other tests of the CDN performed in parallel is avoided, and the overall test efficiency is improved.
Specifically, the response mode includes: and the simulation source station returns the data volume of the response data corresponding to the source test request.
In a specific implementation, the back source response instruction includes: presetting an instruction name and an instruction value; wherein the instruction value is to indicate: and the simulation source station returns the data volume of the response data corresponding to the source test request.
Further, the data size of the response data corresponding to the back source test request includes any one of the following: returning complete response data corresponding to the source test request; returning header information of response data corresponding to the source test request and partial response data of the specified data volume; the header information is used for indicating the back source state of the back source test request; returning the head information of response data corresponding to the source test request; and zero data volume.
Further, the device also comprises a format conversion module, which is used for converting the format of the return source test request into a format matched with a preset network transmission protocol; in the converted back-to-source test request, the back-to-source response instruction is set in a request header or a Uniform Resource Locator (URL) of the back-to-source test request.
The implementation principle and the generated technical effect of the testing device for the CDN network back source exception provided in the embodiment of the present invention are the same as those of the foregoing method embodiment, and for brief description, no mention is made in the embodiment of the device, and reference may be made to corresponding contents in the foregoing method embodiment.
Corresponding to the method embodiment, the embodiment of the invention also provides another testing device for the CDN back source abnormity, the device is arranged on a server running with a simulation source station, and the simulation source station is connected with the terminal equipment through a target CDN network; as shown in fig. 6, the apparatus includes:
an instruction receiving module 60, configured to receive a back source test request sent by a target CDN network; wherein, the back source test request comprises a designated back source response instruction; the source return response instruction is used for indicating the response mode of the simulation source station responding to the source return test request.
The instruction extracting module 61 is configured to extract a back-source response instruction from the back-source test request if the back-source test request is received; the back source response instruction is used for indicating the response mode of the simulation source station responding to the back source test request.
And a response module 62 for responding to the back source test request based on the back source response instruction.
When a server corresponding to the simulation source station receives a back source test request sent by a target CDN, the testing device for the CDN back source abnormity extracts a back source response instruction from the back source test request; the source return response instruction is used for indicating a response mode of the simulation source station for responding to the source return test request; and then responds to the back source test request based on the back source response instruction. According to the method, the response mode of the simulated source station responding to the back source test request is controlled through the back source response instruction in the back source test request, so that the simulated source station can perform data response according to the response mode, the disconnection time of the CDN network and the simulated source station can be finely controlled, various conditions of CDN back source abnormity can be comprehensively tested, meanwhile, the mode only disconnects the current back source test request and the simulated source station, the influence on other tests of the CDN network performed in parallel is avoided, and the overall test efficiency is improved.
Specifically, the response mode includes: and the simulation source station returns the data volume of the response data corresponding to the source test request.
The back source response instruction comprises: presetting an instruction name and an instruction value; wherein the instruction value is to indicate: and the simulation source station returns the data volume of the response data corresponding to the source test request.
Further, the response module 62 is configured to perform one or more of the following: if the data volume of the response data is complete response data, returning the complete response data corresponding to the source test request to the terminal equipment; if the data volume of the response data is the header information and the partial response data of the specified data volume, returning the header information of the response data corresponding to the source test request and the partial response data of the specified data volume to the terminal equipment; the header information is used for indicating the back source state of the back source test request; if the data volume of the response data is the head information of the response data, returning the head information of the response data corresponding to the source test request to the terminal equipment; and if the data volume of the response data is zero data volume, not returning any response data corresponding to the source test request to the terminal equipment.
The implementation principle and the generated technical effect of the testing device for the CDN network back source exception provided in the embodiment of the present invention are the same as those of the foregoing method embodiment, and for brief description, no mention is made in the embodiment of the device, and reference may be made to corresponding contents in the foregoing method embodiment.
An embodiment of the present invention further provides a terminal device, configured to run the method for testing the CDN network back source exception shown in fig. 1 to fig. 2, as shown in fig. 7, where the terminal device includes a processor 101 and a memory 100, where the memory 100 stores a machine executable instruction that can be executed by the processor 101, and the processor 101 executes the machine executable instruction to implement the method for testing the CDN network back source exception.
Further, the terminal device shown in fig. 7 further includes a bus 102 and a communication interface 103, and the processor 101, the communication interface 103, and the memory 100 are connected through the bus 102.
The memory 100 may include a high-speed Random Access Memory (RAM) and may further include a non-volatile memory (non-volatile memory), such as at least one disk memory. The communication connection between the network element of the system and at least one other network element is realized through at least one communication interface 103 (which may be wired or wireless), and the internet, a wide area network, a local network, a metropolitan area network, and the like can be used. The bus 102 may be an ISA bus, PCI bus, EISA bus, or the like. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one double-headed arrow is shown in FIG. 7, but this does not indicate only one bus or one type of bus.
The processor 101 may be an integrated circuit chip having signal processing capabilities. In implementation, the steps of the above method may be performed by integrated logic circuits of hardware or instructions in the form of software in the processor 101. The processor 101 may be a general-purpose processor, and includes a Central Processing Unit (CPU), a Network Processor (NP), and the like; the device can also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other Programmable logic device, a discrete Gate or transistor logic device, or a discrete hardware component. The various methods, steps and logic blocks disclosed in the embodiments of the present invention may be implemented or performed. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The steps of the method disclosed in connection with the embodiments of the present invention may be directly implemented by a hardware decoding processor, or implemented by a combination of hardware and software modules in the decoding processor. The software module may be located in ram, flash memory, rom, prom, or eprom, registers, etc. storage media as is well known in the art. The storage medium is located in the memory 100, and the processor 101 reads the information in the memory 100, and completes the steps of the method of the foregoing embodiment in combination with the hardware thereof.
An embodiment of the present invention further provides a server, configured to run the method for testing the CDN network back source exception shown in fig. 3 and 4, where the server includes a processor and a memory, where the memory stores a machine executable instruction that can be executed by the processor, and the processor executes the machine executable instruction to implement the method for testing the CDN network back source exception. The specific structure of the server can be seen from the structure shown in fig. 7, and is not described herein.
The embodiment of the present invention further provides a machine-readable storage medium, where the machine-readable storage medium stores machine-executable instructions, and when the machine-executable instructions are called and executed by a processor, the machine-executable instructions cause the processor to implement the method for testing the CDN network back source exception.
It can be clearly understood by those skilled in the art that, for convenience and brevity of description, the specific working processes of the apparatus and/or the electronic device described above may refer to corresponding processes in the foregoing method embodiments, and are not described herein again.
Finally, it should be noted that: the above-mentioned embodiments are only specific embodiments of the present invention, which are used for illustrating the technical solutions of the present invention and not for limiting the same, and the protection scope of the present invention is not limited thereto, although the present invention is described in detail with reference to the foregoing embodiments, those skilled in the art should understand that: any person skilled in the art can modify or easily conceive the technical solutions described in the foregoing embodiments or equivalent substitutes for some technical features within the technical scope of the present disclosure; such modifications, changes or substitutions do not depart from the spirit and scope of the embodiments of the present invention, and they should be construed as being included therein. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims (12)

1. A testing method for CDN back source abnormity is characterized in that the method is applied to terminal equipment, and the terminal equipment is connected with a preset simulation source station through a target CDN; the method comprises the following steps:
receiving a source returning test request for the target CDN network, which is triggered by a user; wherein, the back source test request comprises a designated back source response instruction; the source returning response instruction is used for indicating a response mode of the simulation source station for responding to the source returning test request; the response mode comprises the following steps: the simulation source station interrupts the response after returning the data volume of the response data corresponding to the back source test request, or the simulation source station does not return the response data and directly disconnects the target CDN network in the back source test request from the simulation source station;
and sending the back source test request to the simulation source station through the target CDN, so that the simulation source station responds to the back source test request based on the back source response instruction.
2. The method of claim 1, wherein the back source response instruction comprises: presetting an instruction name and an instruction value; wherein the instruction value is to indicate: and the simulation source station returns the data volume of the response data corresponding to the back source test request.
3. The method according to claim 1 or 2, wherein the data amount of the response data corresponding to the back source test request comprises any one of the following:
complete response data corresponding to the back source test request;
header information of response data corresponding to the back source test request and partial response data of a specified data volume; the header information is used for indicating the back source state of the back source test request;
header information of response data corresponding to the back source test request;
and zero data volume.
4. The method of claim 1, wherein prior to the step of sending the back-source test request to the simulated source site over the target CDN network, the method further comprises:
converting the format of the back source test request into a format matched with a preset network transmission protocol; in the converted source returning test request, the source returning response instruction is set in a request header or a Uniform Resource Locator (URL) of the source returning test request.
5. A testing method for CDN back source abnormity is characterized in that the method is applied to a server operating a simulation source station, and the simulation source station is connected with a terminal device through a target CDN; the method comprises the following steps:
receiving a back source test request sent by the target CDN; wherein, the back source test request comprises a designated back source response instruction; the source returning response instruction is used for indicating a response mode of the simulation source station for responding to the source returning test request; the response mode comprises the following steps: the simulation source station interrupts the response after returning the data volume of the response data corresponding to the back source test request, or the simulation source station does not return the response data and directly disconnects the target CDN network in the back source test request from the simulation source station;
extracting a back source response instruction from the back source test request;
responding to the back source test request based on the back source response instruction.
6. The method of claim 5, wherein the back source response instruction comprises: presetting an instruction name and an instruction value; wherein the instruction value is to indicate: and the simulation source station returns the data volume of the response data corresponding to the back source test request.
7. The method of claim 5 or 6, wherein the step of responding to the back source test request based on the back source response instruction comprises one or more of:
if the data volume of the response data is complete response data, returning the complete response data corresponding to the back source test request to the terminal equipment;
if the data volume of the response data is the header information and the partial response data with the specified data volume, returning the header information of the response data corresponding to the back source test request and the partial response data with the specified data volume to the terminal equipment; the header information is used for indicating the back source state of the back source test request;
if the data volume of the response data is the head information of the response data, returning the head information of the response data corresponding to the back source test request to the terminal equipment;
and if the data volume of the response data is zero data volume, not returning any response data corresponding to the back source test request to the terminal equipment.
8. A testing device for CDN back source abnormity is characterized in that the device is arranged on a terminal device, and the terminal device is connected with a preset simulation source station through a target CDN; the device comprises:
the request receiving module is used for receiving a source returning test request for the target CDN network, wherein the source returning test request is triggered by a user; wherein, the back source test request comprises a designated back source response instruction; the source returning response instruction is used for indicating a response mode of the simulation source station for responding to the source returning test request; the response mode comprises the following steps: the simulation source station interrupts the response after returning the data volume of the response data corresponding to the back source test request, or the simulation source station does not return the response data and directly disconnects the target CDN network in the back source test request from the simulation source station;
and the request sending module is used for sending the back-source test request to the simulation source station through the target CDN, so that the simulation source station responds to the back-source test request based on the back-source response instruction.
9. A testing device for CDN back source abnormity is characterized in that the device is arranged on a server running with a simulation source station, and the simulation source station is connected with a terminal device through a target CDN; the device comprises:
the instruction receiving module is used for receiving a back source test request sent by the target CDN; wherein, the back source test request comprises a designated back source response instruction; the source returning response instruction is used for indicating a response mode of the simulation source station for responding to the source returning test request; the response mode comprises the following steps: the simulation source station interrupts the response after returning the data volume of the response data corresponding to the back source test request, or the simulation source station does not return the response data and directly disconnects the target CDN network in the back source test request from the simulation source station;
the instruction extracting module is used for extracting a back source response instruction from the back source test request;
and the response module is used for responding the back source test request based on the back source response instruction.
10. A terminal device, comprising a processor and a memory, wherein the memory stores machine executable instructions capable of being executed by the processor, and the processor executes the machine executable instructions to implement the method for testing the CDN network back source exception according to any one of claims 1 to 4.
11. A server, comprising a processor and a memory, the memory storing machine executable instructions executable by the processor, the processor executing the machine executable instructions to implement the method for testing CDN network back-source anomalies of any one of claims 5-7.
12. A machine-readable storage medium having stored thereon machine-executable instructions which, when invoked and executed by a processor, cause the processor to implement the method of testing for CDN network back-source exceptions of any one of claims 1 to 7.
CN202010464721.3A 2020-05-27 2020-05-27 CDN back source abnormity testing method and device and terminal equipment Active CN111628911B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010464721.3A CN111628911B (en) 2020-05-27 2020-05-27 CDN back source abnormity testing method and device and terminal equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010464721.3A CN111628911B (en) 2020-05-27 2020-05-27 CDN back source abnormity testing method and device and terminal equipment

Publications (2)

Publication Number Publication Date
CN111628911A CN111628911A (en) 2020-09-04
CN111628911B true CN111628911B (en) 2021-10-15

Family

ID=72272540

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010464721.3A Active CN111628911B (en) 2020-05-27 2020-05-27 CDN back source abnormity testing method and device and terminal equipment

Country Status (1)

Country Link
CN (1) CN111628911B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113132403A (en) * 2021-04-27 2021-07-16 北京百度网讯科技有限公司 Back-source method and device for content distribution network

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP2878132A1 (en) * 2012-07-24 2015-06-03 Global Invacom Ltd. Video and/or audio data distribution network system
CN107864228A (en) * 2017-12-22 2018-03-30 网宿科技股份有限公司 Connection method for building up and system in a kind of content distributing network

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103747112A (en) * 2013-12-24 2014-04-23 乐视网信息技术(北京)股份有限公司 CDN back-to-source method, first server and system thereof
CN106130791B (en) * 2016-08-12 2022-11-04 飞思达技术(北京)有限公司 Cache equipment service capability traversal test system and method based on service quality
WO2018098820A1 (en) * 2016-12-02 2018-06-07 深圳前海达闼云端智能科技有限公司 Method and device for sending and receiving data, server, and computer program product
CN110912926B (en) * 2019-12-04 2022-03-25 湖南快乐阳光互动娱乐传媒有限公司 Data resource back-source method and device

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP2878132A1 (en) * 2012-07-24 2015-06-03 Global Invacom Ltd. Video and/or audio data distribution network system
CN107864228A (en) * 2017-12-22 2018-03-30 网宿科技股份有限公司 Connection method for building up and system in a kind of content distributing network

Also Published As

Publication number Publication date
CN111628911A (en) 2020-09-04

Similar Documents

Publication Publication Date Title
CN107908541B (en) Interface testing method and device, computer equipment and storage medium
CN103312551B (en) The method of testing of CGI(Common gateway interface) and testing apparatus
CN106484611B (en) Fuzzy test method and device based on automatic protocol adaptation
CN107888446B (en) Protocol robustness testing method and device
CN111045952A (en) Software testing method, flow playback device, terminal equipment and readable storage medium
CN105095367B (en) A kind of acquisition method and device of client data
CN110633198A (en) Block chain-based software test data storage method and system
CN110232012A (en) A kind of fuzz testing language protocol test script and testing engine based on xml
WO2020259551A1 (en) Method and apparatus for handling network connection fault
CN105117344B (en) A kind of Interface integration method of testing and system based on PB
CN111628911B (en) CDN back source abnormity testing method and device and terminal equipment
CN112866193A (en) Equipment deployment method, device, equipment and storage medium
CN113778879A (en) Fuzzy test method and device for interface
CN106972983B (en) Automatic testing device and method for network interface
CN108804315B (en) Test method and device applied to dynamic development, electronic equipment and storage medium
CN112256557B (en) Program regression testing method, device, system, computer equipment and storage medium
CN107888451B (en) Method and device for testing Web server
CN114185808A (en) Automatic testing method and device, electronic equipment and computer readable storage medium
CN113505059A (en) Page monitoring method and device, computer equipment and storage medium
CN110445658B (en) Message processing method and system
CN112650689A (en) Test method, test device, electronic equipment and storage medium
CN109656791B (en) gPC performance test method and device based on Jmeter
CN110532186B (en) Method, device, electronic equipment and storage medium for testing by using verification code
CN114500348A (en) CDN gateway test method and system
CN110287099B (en) Simplified Loadrunner performance test method, server and computer readable storage 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