CN114285774A - Flow recording method and device, electronic equipment and storage medium - Google Patents

Flow recording method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN114285774A
CN114285774A CN202111498649.7A CN202111498649A CN114285774A CN 114285774 A CN114285774 A CN 114285774A CN 202111498649 A CN202111498649 A CN 202111498649A CN 114285774 A CN114285774 A CN 114285774A
Authority
CN
China
Prior art keywords
flow recording
flow
traffic
recording data
request
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202111498649.7A
Other languages
Chinese (zh)
Other versions
CN114285774B (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.)
Guangzhou Pinwei Software Co Ltd
Original Assignee
Guangzhou Pinwei Software 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 Guangzhou Pinwei Software Co Ltd filed Critical Guangzhou Pinwei Software Co Ltd
Priority to CN202111498649.7A priority Critical patent/CN114285774B/en
Publication of CN114285774A publication Critical patent/CN114285774A/en
Application granted granted Critical
Publication of CN114285774B publication Critical patent/CN114285774B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention provides a traffic recording method, a traffic recording device, electronic equipment and a storage medium, wherein the method comprises the following steps: acquiring flow recording data meeting preset flow recording conditions; recording data according to preset marking rule flow to mark; preprocessing the marked flow recording data according to a preprocessing method; grouping the preprocessed flow recording data; the flow recording data are stored according to the grouping, all flow recording files are prevented from being sent to the server, therefore, more resources of the server are prevented from being occupied, marking and preprocessing are carried out on the flow recording data, redundant data are removed, only needed data are reserved, and then grouping is carried out, so that the efficiency of searching the flow recording files in the flow playback process is improved.

Description

Flow recording method and device, electronic equipment and storage medium
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a method and an apparatus for recording traffic, an electronic device, and a storage medium.
Background
With the continuous development of the internet industry, more and more application systems are on-line, and when the application systems need to be modified, the application systems are modified in a mode of more automatic regression scripts, however, the efficiency and the correctness of the modification mode are difficult to guarantee, and therefore, the traffic recording and playback technology comes up.
The flow recording and playback technology is a testing technology for recording a data stream file of an application system and storing flow into a tested system in a file mode to perform regression testing. The real flow can be captured through flow recording, and the real flow can be reused for subsequent testing through playback. However, in the current flow recording process, the data volume of the flow recording file received by the server is large, the stored data is redundant, and the efficiency of calling the flow recording file corresponding to the test case in the flow playback process is low.
Disclosure of Invention
In order to solve the technical problems, the invention provides a traffic recording method, a traffic recording device, an electronic device and a storage medium, which avoid occupying more resources of a server in the traffic recording process and improve the searching efficiency of a traffic recording file, and the specific scheme is as follows:
in a first aspect, a traffic recording method is provided, which is applied to a server side, and the method includes:
acquiring flow recording data meeting preset flow recording conditions;
marking the flow recording data according to a preset marking rule;
preprocessing the marked flow recording data according to a preprocessing method;
grouping the preprocessed traffic recording data;
and storing the flow recording data according to groups.
In a preferred embodiment, before the marking the flow recording data according to the preset marking rule, the method further includes:
storing the flow recording data in a file form to obtain a flow recording file;
marking the flow recording data according to a preset marking rule further comprises:
marking the flow recording file according to the file ID corresponding to the flow recording file and the service scene.
In a preferred embodiment, the preprocessing the marked flow recording data according to the preprocessing method includes:
and resolving the flow recording request data in the flow recording file into a single flow recording request according to a preset resolving dimension.
In a preferred embodiment, the grouping the pre-processed traffic record data includes:
grouping the data of the flow recording request according to the service scene to which the flow recording request belongs;
and naming the grouped traffic request data according to the service scene and the request interface of the traffic recording request.
In a preferred embodiment, the method further comprises:
after receiving a flow recording file calling request sent by a client, calling a target flow recording file according to a target request interface and a target service scene in the flow recording file calling request and returning the target flow recording file to the client.
In a second aspect, a traffic recording method is provided, which is applied to a proxy server, and the method includes:
collecting flow recording data according to a preset flow recording condition;
sending the flow recording data to a server through a third-party platform so that the server marks the flow recording data according to a preset marking rule; preprocessing the marked flow recording data according to a preprocessing method; grouping the preprocessed traffic recording data;
and after receiving a regression/automation test request initiated by a client, sending a call request of the flow recording file to the server so as to enable the server to call the corresponding target flow recording file.
In a third aspect, a traffic recording apparatus is provided, which is applied to a server side, and the apparatus includes:
the acquisition module is used for acquiring the traffic recording data meeting the preset traffic recording condition;
the marking module is used for marking the flow recording data according to a preset marking rule;
the preprocessing module is used for preprocessing the marked flow recording data according to a preprocessing method;
the grouping module is used for grouping the preprocessed traffic recording data;
and the storage module is used for storing the flow recording data according to groups.
In a fourth aspect, a traffic recording apparatus is provided, which is applied to a proxy server, and the apparatus includes:
the acquisition module is used for acquiring the flow recording data according to the preset flow recording condition;
the sending module is used for sending the flow recording data to a server through a third-party platform so that the server marks the flow recording data according to a preset marking rule; preprocessing the marked flow recording data according to a preprocessing method; grouping the preprocessed traffic recording data;
the sending module is further used for sending a flow recording file calling request to the server after receiving a regression/automation test request initiated by a client, so that the server calls a corresponding target flow recording file according to the flow recording file calling request.
In a fifth aspect, an electronic device is provided, comprising:
one or more processors; and
a memory associated with the one or more processors for storing program instructions that, when read and executed by the one or more processors, perform the method as previously described.
A sixth aspect provides a computer storage medium having a computer program stored thereon, wherein the program when executed by a processor implements the method as previously described.
In the invention, the server receives the flow recording file meeting the preset flow recording condition and sends the flow recording file to the server end, so that all flow recording data are prevented from being sent to the server, more resources of the server are prevented from being occupied, furthermore, the server marks the flow recording data according to the preset marking rule, the follow-up pretreatment and grouping are facilitated, and the flow recording efficiency is improved; and preprocessing the marked flow recording data according to a preprocessing method, only reserving the data to be grouped, and then grouping the preprocessed flow recording data, so that the subsequent calling of flow recording files is facilitated, and the flow playback efficiency is improved.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is a flowchart of a traffic recording method applied in a server according to an embodiment of the present invention;
fig. 2 is a schematic diagram illustrating an interaction process among a client, a proxy server, and a server in a traffic recording process according to an embodiment of the present invention;
fig. 3 is a flowchart of a traffic recording method applied in a proxy server according to an embodiment of the present invention;
fig. 4 is a schematic diagram of a traffic recording device applied in a server according to an embodiment of the present invention;
fig. 5 is a schematic diagram of a traffic recording device applied in a proxy server according to an embodiment of the present invention;
fig. 6 is an architecture diagram of an electronic device in an embodiment of the invention.
Detailed Description
To facilitate an understanding of the invention, the invention will now be described more fully with reference to the accompanying drawings. Preferred embodiments of the present invention are shown in the drawings. This invention 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.
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs. The terminology used herein in the description of the invention is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. As used herein, the term "and/or" includes any and all combinations of one or more of the associated listed items.
As mentioned in the background art, in the current flow recording process, a terminal sends request data to a server, the server responds to the request data to generate corresponding response data, the server stores the request data of the terminal and the response data of the server responding to the request data, and the data volume of the flow recording data stored in the server in the process is large, so that on one hand, more resources of the server are occupied, and on the other hand, the time for calling the corresponding flow recording data in the flow playback process is long And measuring the calling of the recording file.
A traffic recording method, an apparatus, an electronic device, and a storage medium according to the present invention will be described in detail with reference to the accompanying drawings.
As shown in fig. 1, the present invention provides a traffic recording method, which is applied to a server side, and the method includes:
s101, obtaining flow recording data meeting preset flow recording conditions.
In this step, the client is connected to the proxy server, the client sends the request file to the server through the proxy server and the third-party platform, the server responds to the request data after receiving the request data to generate response data, and the proxy server monitors the request data and the response data to generate traffic recording data, so that the traffic recording data includes the request data and the response data interacted between the server and the client. A proxy server pre-configures preset traffic recording conditions and screens out traffic recording files meeting the traffic recording conditions, where the preset traffic recording conditions may be a specified domain name or a specified request URL, or a specified filtering domain name or a specified request URL (Uniform Resource Locator), the proxy server captures traffic recording data according to the traffic recording conditions, and the traffic recording data includes request data and response data, where the request data includes information such as the request URL (Uniform Resource Locator), ip, port (computer port), raw header names, method, headers (title), and body (main body); the response file includes information such as ip, port, raw HeaderNames, status Code, status Message, headers, size, and body.
And S102, marking the flow recording data according to a preset marking rule.
In this step, after receiving the traffic recording data, the server automatically stores the traffic recording data to the local, and marks the traffic recording data according to a preset marking rule, that is, marks different marks on the traffic recording data, for example, the request data may be marked, the marking rule is configured in advance, different marks may be marked on the different traffic recording data according to different preset marking rules, and the marking rule may be a description of a service scene, may also be a time for recording traffic, may also be a request URL, and the like.
And S103, preprocessing the marked flow recording data according to a preprocessing method.
And S104, grouping the preprocessed flow recording data.
And S104, storing the flow recording data according to groups.
In the above steps, the traffic record data is preprocessed, redundant data can be removed in the preprocessing process, data which can be grouped is left, then the server groups the traffic record data according to a preset grouping rule, and then the traffic record data is stored according to grouping classification and can be stored in a database corresponding to the server.
In the invention, the proxy server sends the flow recording files meeting the preset flow recording conditions to the server end through the third-party platform, and all the flow recording files are prevented from being sent to the server, so that more resources of the server are prevented from being occupied; and preprocessing the marked flow recording data according to a preprocessing method, only reserving the data to be grouped, and then grouping the preprocessed flow recording data, so that the subsequent calling of flow recording files is facilitated, and the flow playback efficiency is improved.
In a preferred embodiment, before marking the flow recording data according to the preset marking rule, the method further includes:
storing the traffic recording data in a file form to obtain a traffic recording file;
marking the flow recording data according to the preset marking rule further comprises:
marking the flow recording file according to the file ID corresponding to the flow recording file and the service scene.
In this embodiment, after obtaining the traffic recording data, the server first stores the traffic recording data in a file form to obtain a traffic recording file, where the traffic recording file may be a test case used in a traffic playback process, the file ID may be a test case ID, a service scenario may include a scenario of placing an order, confirming payment, shopping cart purchase, and the like, and the traffic recording file is marked by the case ID and the service scenario, for example, the traffic recording file may be marked by 1627619069254-shopping cart purchase, 1627625345004-placing an order.
In the invention, the flow recording file is marked through the file ID and the service scene, so that the target flow recording file can be quickly positioned in the flow recording file calling process, the searching efficiency is improved, and the processing efficiency of the flow recording playback request is further improved.
In a preferred embodiment, preprocessing the marked flow recording data according to a preprocessing method includes:
and resolving the flow recording request data in the flow recording file into a single flow recording request according to a preset resolving dimension.
In this embodiment, the preprocessing method may be a preset parsing method, and after marking the traffic recorded data, the server parses all traffic recorded requests corresponding to each service scene in the traffic recorded data, specifically, the traffic recorded data may be parsed according to dimensions such as a request method, a request state (status), a request time (start time, end time), a host (host), a path (path), a request parameter (query data), and a response file, so as to facilitate subsequent grouping of the traffic data.
In a preferred embodiment, grouping the pre-processed traffic record data includes:
grouping the data of the flow recording request according to the service scene to which the flow recording request belongs;
and naming the grouped traffic request data according to the service scene and the request interface of the traffic recording request.
In this embodiment, a request interface and a service scenario of each disassembled traffic recording request are determined, a traffic recording file is divided into different groups according to the request interface and the service scenario, each group is named by the request interface and the service scenario, if the same interface is requested for multiple times in the same scenario, n (n represents the number of traffic recording requests) is sequentially added in the back, and if the traffic recording file includes multiple service scenarios, multiple rule groups are generated.
In the invention, each flow recording request is separated by preprocessing the flow recording data, and then grouping is carried out according to the request interface and the service scene, so that the corresponding flow recording file can be quickly positioned according to the flow playback request during flow playback.
In a preferred embodiment, the method further comprises:
after receiving a flow recording file calling request sent by a client, a target request interface and a target service scene in the root flow recording file calling request call a target flow recording file and return the target flow recording file to the substitute client.
In this embodiment, a call request may be directly sent to the server through the client, or a regression/automation test request may be sent to the proxy server through the client, the proxy server performs matching of a traffic record file according to the regression/automation test request, sends a traffic record file call request to the server, after receiving the call request, the server substitutes a target traffic record file according to a target request interface and a target service scene in the traffic record file call request, specifically, determines a corresponding target packet according to the target request interface and the target service scene, then determines a target file ID corresponding to the target traffic record file from the target packet according to the target service scene, calls the target traffic record file according to the target file ID, and thereby can quickly locate the target traffic record file, the searching efficiency of the target flow recording file is improved.
After the target flow recording file is determined, the server can directly return to the client, and can also return to the client through the proxy server.
As shown in fig. 2, an interactive process among the client, the proxy server and the server in the traffic recording process of the present invention is as follows: a client initiates a flow recording request, and a proxy server starts a flow recording process; the client initiates a request, and the server responds to the request; the proxy server captures a flow recording file meeting a preset flow recording condition; the client sends a flow recording ending instruction, and the proxy server ends the recording process; the proxy server sends the flow recording file to a server through a third-party platform; marking the flow recording file by the server; preprocessing the marked flow recording files by the server, and then grouping; the server classifies and stores the grouped traffic recording files; a client initiates a regression/automation test request; the proxy server carries out matching and sends a flow recording file calling request to the server; the server determines that a target flow recording file is sent to the proxy server; and the proxy server sends the target flow recording file to the client.
As shown in fig. 3, the present invention further provides a traffic recording method, applied to a proxy server, where the method includes:
s301, collecting flow recording data according to a set flow recording condition;
s302, sending the flow recording data to a server through a third-party platform so that the server marks the flow recording data according to a preset marking rule; preprocessing the marked flow recording data according to a preprocessing method; grouping the preprocessed flow recording data;
and S303, after receiving a regression/automation test request initiated by the client, sending a flow recording file calling request to the server so that the server flow recording file calling request calls a corresponding target flow recording file.
In the invention, the proxy server sends the flow recording data meeting the preset flow recording condition to the server end, and all the flow recording data are prevented from being sent to the server, so that more resources of the server are prevented from being occupied; recording data according to preset marking rule flow to mark; preprocessing the marked flow recording data according to a preprocessing method; the preprocessed flow recording data are grouped, so that the flow recording file can be called conveniently in the follow-up process, and the flow playback efficiency is improved.
In a preferred embodiment, the flow recording file call request includes a target request interface and a target service scene;
after sending the flow recording file calling request to the server, the method further comprises the following steps:
receiving a target flow recording file which is returned by the server and determined according to the target request interface and the target service scene;
and sending the target flow recording file to the client.
In the invention, the proxy server sends a calling request to the server, the server determines a target flow recording file according to a target request interface and a target service scene in the calling request, specifically, a corresponding target group is determined according to the target request interface and the target service scene, then a target file ID corresponding to the target flow recording file is determined from the target group according to the target service scene, and the target flow recording file is called according to the target file ID, so that the target flow recording file can be quickly positioned, and the searching efficiency of the target flow recording file is improved.
As shown in fig. 4, the present invention also provides a traffic recording apparatus, which includes:
an obtaining module 401, configured to obtain traffic recording data that meets a preset traffic recording condition;
a marking module 402, configured to mark data according to a preset marking rule;
a preprocessing module 403, configured to preprocess the marked flow recording data according to a preprocessing method;
a grouping module 404, configured to group the preprocessed traffic recording data;
and a storage module 405, configured to store the traffic recording data in a packet.
In a preferred embodiment, the storage module 405 is further configured to store the traffic record data in a file form to obtain a traffic record file; the marking module 402 is further configured to mark the traffic recording file according to the file ID corresponding to the traffic recording file and the service scene.
In a preferred embodiment, the preprocessing module 403 is further configured to split the traffic recording request data in the traffic recording file into single traffic recording requests according to a preset splitting dimension.
In a preferred embodiment, the grouping module 404 further includes a grouping unit, configured to group the traffic recording request data according to a service scenario to which the traffic recording request belongs; and the naming unit is used for naming the grouped traffic request data according to the service scene and the request interface of the traffic recording request.
In a preferred embodiment, the system further includes a calling module, configured to, after receiving a call request of the traffic recording file sent by the client, call the target traffic recording file according to a target request interface and a target service scenario in the call request, and return the target traffic recording file to the client.
The traffic recording device of the present invention can achieve the beneficial effects of the traffic recording method applied to the server as described above, and is not described herein again.
As shown in fig. 5, the present invention further provides a traffic recording apparatus, which is applied in a proxy server, and the apparatus includes:
the acquisition module 501 is configured to acquire traffic recording data according to a set traffic recording condition;
a sending module 502, configured to send the flow recording data to a server through a third-party platform, so that the server marks the flow recording data according to a preset marking rule; preprocessing the marked flow recording data according to a preprocessing method; grouping the preprocessed flow recording data;
the sending module 502 is further configured to send a traffic recording file call request to the server after receiving a regression/automation test request initiated by the client, so that the server calls a corresponding target traffic recording file according to the traffic recording file call request.
In a preferred embodiment, the flow recording file call request includes a target request interface and a target service scene;
the receiving module is used for receiving a target flow recording file which is returned by the server and determined according to the target request interface and the target service scene;
the sending module is further used for sending the target flow recording file to the client.
The traffic recording device of the present invention can achieve the beneficial effects of the traffic recording method applied to the proxy server as described above, and is not described herein again.
The present invention also provides an electronic device, comprising:
one or more processors; and
a memory associated with the one or more processors for storing program instructions that, when read and executed by the one or more processors, perform a traffic recording method applied in a server.
For the implementation process and the technical effects that can be achieved in this embodiment, please refer to the beneficial effects of the traffic recording method applied in the server as described above, which are not described herein again.
The present invention also provides an electronic device, comprising:
one or more processors; and
a memory associated with the one or more processors for storing program instructions that, when read and executed by the one or more processors, perform a traffic recording method applied in a proxy server.
For the implementation process and the technical effects that can be achieved in this embodiment, please refer to the beneficial effects of the traffic recording method applied to the proxy server as described above, which are not described herein again.
The present invention further provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the method for recording traffic applied in a server as described above, and please refer to the foregoing description for the implementation process of the method and the technical effects that can be achieved, which are not described herein again.
The present invention further provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the method for recording traffic applied to a proxy server, and please refer to the foregoing description for the implementation process of the method and the technical effects that can be achieved, which are not described herein again.
Fig. 6 illustrates an architecture of an electronic device, which may specifically include a processor 610, a video display adapter 611, a disk drive 612, an input/output interface 613, a network interface 614, and a memory 620. The processor 610, the video display adapter 611, the disk drive 612, the input/output interface 613, the network interface 614, and the memory 620 may be communicatively connected by a communication bus 630.
The processor 610 may be implemented by a general-purpose CPU (Central Processing Unit), a microprocessor, an Application Specific Integrated Circuit (ASIC), or one or more Integrated circuits, and is configured to execute related programs to implement the technical solution provided by the present invention.
The Memory 620 may be implemented in the form of a ROM (Read Only Memory), a RAM (Random Access Memory), a static storage device, a dynamic storage device, or the like. The memory 620 may store an operating system 621 for controlling the operation of the computer system, a Basic Input Output System (BIOS) for controlling low-level operations of the computer system. In addition, a web browser 623, a data storage management system 624, a device identification information processing system 625, and the like may also be stored. The device identification information processing system 625 may be an application program that implements the operations of the foregoing steps in the embodiment of the present invention. In summary, when the technical solution provided by the present invention is implemented by software or firmware, the relevant program codes are stored in the memory 620 and called for execution by the processor 610.
The input/output interface 613 is used for connecting an input/output module to realize information input and output. The i/o module may be configured as a component in a device (not shown) or may be external to the device to provide a corresponding function. The input devices may include a keyboard, a mouse, a touch screen, a microphone, various sensors, etc., and the output devices may include a display, a speaker, a vibrator, an indicator light, etc.
The network interface 614 is used for connecting a communication module (not shown in the figure) to realize the communication interaction between the device and other devices. The communication module can realize communication in a wired mode (such as USB, network cable and the like) and also can realize communication in a wireless mode (such as mobile network, WIFI, Bluetooth and the like).
Bus 630 includes a path that transfers information between the various components of the device, such as processor 610, video display adapter 611, disk drive 612, input/output interface 613, network interface 614, and memory 620.
It should be noted that although the above devices only show the processor 610, the video display adapter 611, the disk drive 612, the input/output interface 613, the network interface 614, the memory 620, the bus 630, etc., in a specific implementation, the device may also include other components necessary for normal operation. Furthermore, it will be understood by those skilled in the art that the apparatus described above may also include only the components necessary to implement the inventive arrangements, and need not include all of the components shown in the figures.
The computer program product of the invention comprises a computer program carried on a computer readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network via the communication means, or installed from the memory, or installed from the ROM. The computer program, when executed by a processor, performs the functions defined above in the method of embodiments of the invention.
It should be noted that the computer readable medium of the embodiments of the present invention may be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer 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 of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer 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. In embodiments of the invention, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In embodiments of the present invention, however, a computer readable signal medium may comprise a propagated data signal with computer 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 computer readable signal medium may also be any computer readable medium that is not a computer 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 computer readable medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, optical cables, RF (Radio Frequency), etc., or any suitable combination of the foregoing.
The computer readable medium may be embodied in the server; or may exist separately and not be assembled into the server. The computer readable medium carries one or more programs which, when executed by the server, cause the server to: when the peripheral mode of the terminal is detected to be not activated, acquiring a frame rate of an application on the terminal; when the frame rate meets the screen-off condition, judging whether a client acquires screen information of the terminal; and controlling the screen to enter an immediate dimming mode in response to the judgment result that the client does not acquire the screen information of the terminal.
Computer program code for carrying out operations for embodiments of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, 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 client computer, partly on the client computer, as a stand-alone software package, partly on the client computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the client computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
The embodiments in the present specification are described in a progressive manner, and the same and similar parts among the embodiments are referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, the system or system embodiments are substantially similar to the method embodiments and therefore are described in a relatively simple manner, and reference may be made to some of the descriptions of the method embodiments for related points. The above-described system and system embodiments are only illustrative, wherein the units described as separate parts may or may not be physically separate, and the parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment. One of ordinary skill in the art can understand and implement it without inventive effort.
The traffic recording method, the traffic recording device, the electronic device, and the storage medium provided by the present invention are described in detail above, and a specific example is applied in the text to explain the principle and the implementation of the present invention, and the description of the above embodiment is only used to help understanding the method and the core idea of the present invention; meanwhile, for a person skilled in the art, according to the idea of the present invention, the specific embodiments and the application range may be changed. In view of the above, the present disclosure should not be construed as limiting the invention.

Claims (10)

1. A traffic recording method is characterized by being applied to a server side, and comprises the following steps:
acquiring flow recording data meeting preset flow recording conditions;
marking the flow recording data according to a preset marking rule;
preprocessing the marked flow recording data according to a preprocessing method;
grouping the preprocessed traffic recording data;
and storing the flow recording data according to groups.
2. The method of claim 1, wherein marking the flow recording data according to a preset marking rule further comprises:
storing the flow recording data in a file form to obtain a flow recording file;
marking the flow recording data according to a preset marking rule further comprises:
marking the flow recording file according to the file ID corresponding to the flow recording file and the service scene.
3. The method of claim 2, wherein preprocessing the marked flow recording data according to a preprocessing method comprises:
and resolving the flow recording request data in the flow recording file into a single flow recording request according to a preset resolving dimension.
4. The method of claim 3, wherein the grouping the pre-processed traffic recording data comprises:
grouping the data of the flow recording request according to the service scene to which the flow recording request belongs;
and naming the grouped traffic request data according to the service scene and the request interface of the traffic recording request.
5. The method according to any one of claims 2 to 4, further comprising:
after receiving a flow recording file calling request sent by a client, calling a target flow recording file according to a target request interface and a target service scene in the flow recording file calling request and returning the target flow recording file to the client.
6. A traffic recording method is characterized in that the method is applied to a proxy server side, and the method comprises the following steps:
collecting flow recording data according to a preset flow recording condition;
sending the flow recording data to a server through a third-party platform so that the server marks the flow recording data according to a preset marking rule; preprocessing the marked flow recording data according to a preprocessing method; grouping the preprocessed traffic recording data;
and after receiving a regression/automation test request initiated by a client, sending a call request of the flow recording file to the server so as to enable the server to call the corresponding target flow recording file.
7. A flow recording device is characterized in that the flow recording device is applied to a server side, and the device comprises:
the acquisition module is used for acquiring the traffic recording data meeting the preset traffic recording condition;
the marking module is used for marking the flow recording data according to a preset marking rule;
the preprocessing module is used for preprocessing the marked flow recording data according to a preprocessing method;
the grouping module is used for grouping the preprocessed traffic recording data;
and the storage module is used for storing the flow recording data according to groups.
8. A flow recording device is applied to a proxy server side, and the device comprises:
the acquisition module is used for acquiring the flow recording data according to the preset flow recording condition;
the sending module is used for sending the flow recording data to a server through a third-party platform so that the server marks the flow recording data according to a preset marking rule; preprocessing the marked flow recording data according to a preprocessing method; grouping the preprocessed traffic recording data;
the sending module is further used for sending a flow recording file calling request to the server after receiving a regression/automation test request initiated by a client, so that the server calls a corresponding target flow recording file according to the flow recording file calling request.
9. An electronic device, comprising:
one or more processors; and
a memory associated with the one or more processors for storing program instructions that, when read and executed by the one or more processors, perform the method of any of claims 1-5.
10. A computer storage medium having a computer program stored thereon, wherein the program when executed by a processor implements the method of any one of claims 1 to 5.
CN202111498649.7A 2021-12-09 2021-12-09 Flow recording method and device, electronic equipment and storage medium Active CN114285774B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111498649.7A CN114285774B (en) 2021-12-09 2021-12-09 Flow recording method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111498649.7A CN114285774B (en) 2021-12-09 2021-12-09 Flow recording method and device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN114285774A true CN114285774A (en) 2022-04-05
CN114285774B CN114285774B (en) 2023-10-13

Family

ID=80871374

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111498649.7A Active CN114285774B (en) 2021-12-09 2021-12-09 Flow recording method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN114285774B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114884844A (en) * 2022-06-14 2022-08-09 上海幻电信息科技有限公司 Flow recording method and system

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060031054A1 (en) * 1999-12-15 2006-02-09 Microsoft Corporation Server recording and client playback of computer network characteristics
CN110474820A (en) * 2019-07-17 2019-11-19 阿里巴巴集团控股有限公司 Traffic playback method, device, electronic equipment
CN112491652A (en) * 2020-11-18 2021-03-12 国家计算机网络与信息安全管理中心 Network flow sample processing method and device for testing
CN112532490A (en) * 2020-11-30 2021-03-19 武汉悦学帮网络技术有限公司 Regression testing system and method and electronic equipment
CN112765045A (en) * 2021-04-07 2021-05-07 四川新网银行股份有限公司 Case template-based flow playback method
CN113422794A (en) * 2021-02-09 2021-09-21 阿里巴巴集团控股有限公司 Traffic recording and playback processing method and device and electronic equipment
CN113472687A (en) * 2021-07-15 2021-10-01 北京京东振世信息技术有限公司 Data processing method and device
CN113709059A (en) * 2021-08-27 2021-11-26 中国工商银行股份有限公司 Link flow recording method and node

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060031054A1 (en) * 1999-12-15 2006-02-09 Microsoft Corporation Server recording and client playback of computer network characteristics
CN110474820A (en) * 2019-07-17 2019-11-19 阿里巴巴集团控股有限公司 Traffic playback method, device, electronic equipment
CN112491652A (en) * 2020-11-18 2021-03-12 国家计算机网络与信息安全管理中心 Network flow sample processing method and device for testing
CN112532490A (en) * 2020-11-30 2021-03-19 武汉悦学帮网络技术有限公司 Regression testing system and method and electronic equipment
CN113422794A (en) * 2021-02-09 2021-09-21 阿里巴巴集团控股有限公司 Traffic recording and playback processing method and device and electronic equipment
CN112765045A (en) * 2021-04-07 2021-05-07 四川新网银行股份有限公司 Case template-based flow playback method
CN113472687A (en) * 2021-07-15 2021-10-01 北京京东振世信息技术有限公司 Data processing method and device
CN113709059A (en) * 2021-08-27 2021-11-26 中国工商银行股份有限公司 Link flow recording method and node

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114884844A (en) * 2022-06-14 2022-08-09 上海幻电信息科技有限公司 Flow recording method and system
CN114884844B (en) * 2022-06-14 2023-12-26 上海幻电信息科技有限公司 Flow recording method and system

Also Published As

Publication number Publication date
CN114285774B (en) 2023-10-13

Similar Documents

Publication Publication Date Title
CN111177617A (en) Web direct operation and maintenance method and device based on operation and maintenance management system and electronic equipment
CN107644075B (en) Method and device for collecting page information
CN109218041B (en) Request processing method and device for server system
CN114285774A (en) Flow recording method and device, electronic equipment and storage medium
CN112632425B (en) Method, device, equipment and storage medium for generating offline resource file
CN115996179A (en) Service node testing method and device, readable medium and electronic equipment
CN105068926A (en) Program test method and device thereof
CN110489326B (en) IDS-based HTTPAPI debugging method device, medium and equipment
CN109542743B (en) Log checking method and device, electronic equipment and computer readable storage medium
CN111813685A (en) Automatic testing method and device
CN113763008A (en) Application promotion tracking method, device, server, equipment and medium
CN114465919B (en) Network service testing method, system, electronic equipment and storage medium
CN114416597A (en) Test case record generation method and device
CN109756393B (en) Information processing method, system, medium, and computing device
CN113132447A (en) Reverse proxy method and system
CN111767447A (en) Method and device for determining user traffic path
CN111831530A (en) Test method and device
CN114157647A (en) Method and device for tracking webpage browsed by user, electronic equipment and storage medium
CN116561015B (en) Map application testing method, electronic device and computer readable medium
CN114449052B (en) Data compression method and device, electronic equipment and storage medium
CN111708684B (en) Recording method and device for page access and computer system
CN109005084B (en) Method, electronic device, and computer-readable medium for verifying network connection
CN112445498B (en) Program installation method and device, electronic equipment and storage medium
CN112203113B (en) Video stream structuring method and device, electronic equipment and computer readable medium
CN117082047A (en) Data processing method and device

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