CN114285774B - 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
CN114285774B
CN114285774B CN202111498649.7A CN202111498649A CN114285774B CN 114285774 B CN114285774 B CN 114285774B CN 202111498649 A CN202111498649 A CN 202111498649A CN 114285774 B CN114285774 B CN 114285774B
Authority
CN
China
Prior art keywords
flow recording
flow
recording data
file
server
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
CN202111498649.7A
Other languages
Chinese (zh)
Other versions
CN114285774A (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

Landscapes

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

Abstract

The invention provides a flow recording method, a 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 marking according to a preset marking rule flow; 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, so that the situation that more resources of the server are occupied is avoided, 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 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 online, and when the application systems need to be modified, the application systems are often modified in a mode of more automatic regression scripts, however, the efficiency and the correctness of the modification mode are difficult to ensure, so that the traffic recording and playback technology is generated.
The flow recording and playback technology is a test technology for recording data flow files of an application system and storing the flow in a tested system in a file mode to carry out regression test. The real traffic can be grabbed through traffic recording, and the real traffic 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 larger, the stored data is more redundant, and the efficiency of calling the flow recording file corresponding to the test case in the flow playback process is lower.
Disclosure of Invention
In order to solve the technical problems, the invention provides a flow recording method, a device, an electronic device and a storage medium, which avoid occupying more resources of a server in the flow recording process and improve the searching efficiency of flow recording files, and the specific scheme is as follows:
in a first aspect, a traffic recording method is provided, applied to a server, 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 flow recording data;
and storing the flow recording data according to the groups.
In a preferred embodiment, before the marking the flow record 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;
the 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 a preferred embodiment, the preprocessing the marked flow record data according to the preprocessing method includes:
and decomposing the flow recording request data in the flow recording file into single flow recording requests according to a preset decomposition dimension.
In a preferred embodiment, the grouping the traffic recording data after preprocessing includes:
grouping data of the flow recording request according to the service scene to which the flow recording request belongs;
and naming the grouped flow request data according to the service scene and the request interface of the flow recording request.
In a preferred embodiment, the method further comprises:
and 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 to the client.
In a second aspect, a traffic recording method is provided, applied to a proxy server, and the method includes:
collecting flow recording data according to preset flow recording conditions;
the flow recording data are sent 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 after receiving a regression/automation test request initiated by the client, sending a call request of the flow recording file to the server so that the server calls a corresponding target flow recording file.
In a third aspect, a traffic recording apparatus is provided, applied to a server, where the apparatus includes:
the acquisition module is used for acquiring flow recording data meeting preset flow recording conditions;
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 flow recording data;
and the storage module is used for storing the flow recording data according to the groups.
In a fourth aspect, a traffic recording apparatus is provided, applied to a proxy server, where the apparatus includes:
the acquisition module is used for acquiring flow recording data according to preset flow recording conditions;
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 flow recording data;
the sending module is also used for sending a flow recording file calling request to the server after receiving the regression/automation test request initiated by the client, so that the server can call the corresponding target flow recording file according to the flow recording file calling request.
In a fifth aspect, there is provided an electronic device comprising:
one or more processors; and
a memory associated with the one or more processors, the memory for storing program instructions that, when read for execution by the one or more processors, perform the method as described above.
In a sixth aspect, a computer storage medium is provided, on which a computer program is stored, wherein the program, when executed by a processor, implements a method as described above.
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 side, and all flow recording data are prevented from being sent to the server, so that more resources of the server are prevented from being occupied; the flow recording data after marking is preprocessed according to the preprocessing method, only the data needing grouping is reserved, and then the preprocessed flow recording data is grouped, so that the flow recording file is conveniently called later, and the flow playback efficiency is improved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for the description of the embodiments will be briefly described below, and it is apparent that the drawings in the following description are only some embodiments of the present invention, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a flowchart of a flow recording method applied to a server in 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 process of recording a stream according to an embodiment of the present invention;
FIG. 3 is a flowchart of a flow recording method applied to a proxy server according to an embodiment of the present invention;
fig. 4 is a schematic diagram of a flow recording device applied to a server according to an embodiment of the present invention;
FIG. 5 is a schematic diagram of a flow recording device applied to a proxy server according to an embodiment of the present invention;
fig. 6 is a schematic diagram of an electronic device according to an embodiment of the invention.
Detailed Description
In order that the invention may be readily understood, a more complete description of the invention will be rendered by reference to the appended drawings. The drawings illustrate preferred embodiments of the invention. 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. The term "and/or" as used herein 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, the terminal sends request data to the 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 which responds to the request data, the data volume of the flow recording data stored in the server in the process is larger, on one hand, more resources of the server are occupied, on the other hand, the time for calling the corresponding flow recording data in the flow playback process is longer, and the flow recording method in the invention increases the proxy server, on the other hand, the proxy server collects the flow recording data, only sends the flow recording data meeting the preset flow recording condition to the server through the third party platform, so that more resources of the server are prevented from being occupied, on the other hand, the flow recording data is preprocessed and grouped and stored for calling the flow recording file in the subsequent flow playback process conveniently.
The following describes a flow recording method, a device, an electronic apparatus and a storage medium in the present invention 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, and the method includes:
s101, acquiring flow recording data meeting preset flow recording conditions.
In this step, the client connects to the proxy server, and the client sends the request file to the server through the proxy server, and the server responds to generate response data after receiving the request data, and the proxy server listens to the request data and the response data to generate flow recording data, so that the flow recording data includes the request data and the response data interacted between the server and the client. The proxy server is pre-configured with preset flow recording conditions, and screens out flow recording files meeting the flow recording conditions, wherein the preset flow recording conditions can be specified domain names or request URL, or can be specified to filter domain names or request URL (Uniform Resource Locator ), the proxy server captures flow recording data according to the flow recording conditions, the flow recording data comprises request data and response data, and the request data comprises information such as request URL (Uniform Resource Locator ), ip, port (computer port), raw header names, methods, headers (titles), bodies (main bodies) and the like; the response file includes information such as ip, port, raw HeadNames, status Code, status Message, headers, size, body, etc.
S102, marking the flow recording data according to a preset marking rule.
In this step, after receiving the flow recording data, the server automatically stores the flow recording data in a local area, and marks the flow recording data according to a preset marking rule, that is, marks different marks on the flow recording data, for example, the request data can be marked, the marking rule is preconfigured, different marks can be marked on different flow recording data according to different preset marking rules, the marking rule can be a description of a service scene, a time of flow recording, a request URL, and the like.
S103, preprocessing the marked flow recording data according to a preprocessing method.
S104, grouping the preprocessed flow recording data.
S104, storing the flow recording data according to the groups.
In the above steps, preprocessing is performed on the flow recording data, redundant data can be removed in the preprocessing process, data which can be grouped is left, then the server groups the flow recording data according to a preset grouping rule, and then the flow recording 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 side through the third-party platform, so that all the flow recording files are prevented from being sent to the server, more resources of the server are prevented from being occupied, and further, the server marks the flow recording data according to the preset marking rules, thereby facilitating subsequent preprocessing and grouping and improving the flow recording efficiency; the flow recording data after marking is preprocessed according to the preprocessing method, only the data needing grouping is reserved, and then the preprocessed flow recording data is grouped, so that the flow recording file is conveniently called later, and the flow playback efficiency is improved.
In a preferred embodiment, before marking the flow record 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 this embodiment, after obtaining flow recording data, the server stores the flow recording data in a file form to obtain a flow recording file, where the flow recording file may be a test case used in the flow playback process, the file ID may be a test case ID, the service scene may include a bill, and the scenes such as payment and shopping cart purchasing are confirmed.
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, thereby improving the searching efficiency and further improving the processing efficiency of the flow recording playback request.
In a preferred embodiment, preprocessing the marked flow record data according to the preprocessing method includes:
and disassembling the flow recording request data in the flow recording file into a single flow recording request according to a preset disassembly dimension.
In this embodiment, the preprocessing method may be a preset disassembling method, after the server marks the traffic recording data, all the traffic recording requests corresponding to each service scenario in the traffic recording data are disassembled, and specifically, the traffic recording data may be disassembled according to dimensions such as a request method, a request state (status), a request time, an end time, a host (host), a path (path), a request parameter (query data), a response file, etc., so that subsequent traffic data packets are facilitated.
In a preferred embodiment, grouping the pre-processed traffic recording data includes:
grouping data of the flow recording request according to the service scene to which the flow recording request belongs;
and naming the grouped flow request data according to the service scene and the request interface of the flow recording request.
In this embodiment, the request interface and the service scenario of each disassembled flow recording request are determined, the flow recording files are 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 under the same scenario, n is added in sequence at the back (n represents the number of flow recording requests), and if the flow recording files comprise multiple service scenarios, multiple rule groups are generated.
In the invention, each flow recording request is split 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 rapidly positioned according to the flow playback request during flow playback.
In a preferred embodiment, the method further comprises:
and after receiving a flow recording file calling request sent by the 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 this embodiment, the call request may be directly sent to the server by the client, or the regression/automation test request may be sent to the proxy server by the client, the proxy server performs matching of the flow recording file according to the regression/automation test request, sends the flow recording file call request to the server, and after receiving the call request, the server substitutes the target flow recording file according to the target request interface and the target service scene in the flow recording file call request, specifically, determines the corresponding target packet according to the target request interface and the target service scene, then determines the target file ID corresponding to the target flow recording file from the target packet according to the target service scene, and calls the target flow recording file according to the target file ID, thereby being capable of quickly positioning the target flow recording file and improving the searching efficiency of the target flow recording file.
After determining the target flow record file, the server can directly return to the client, or can return to the client through the proxy server.
As shown in fig. 2, the interaction process among the client, the proxy server and the server in the process of recording the traffic in the present invention is as follows: the client initiates a flow recording request, and the 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 preset flow recording conditions; 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 the server through a third party platform; the server marks the flow recording file; the server preprocesses the marked flow recording file and then groups the flow recording file; the server classifies and stores the grouped flow recording files; the client initiates a regression/automation test request; the proxy server performs matching and sends a flow recording file calling request to the server; the server determines a target flow recording file and sends the target flow recording file 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, acquiring flow recording data according to set flow recording conditions;
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;
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 conditions to the server side, and all the flow recording data are prevented from being sent to the server, so that the occupation of more resources of the server is avoided, and further, the server side marks according to the flow recording data, thereby facilitating subsequent grouping and improving the flow recording efficiency; recording data marking according to a preset marking rule flow; 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 conveniently called later, and the flow playback efficiency is improved.
In a preferred embodiment, the flow record file call request includes a target request interface and a target service scene;
the method further comprises the following steps after sending the flow recording file calling request to the server:
receiving a target flow recording file which is returned by the server and is determined according to a target request interface and a target service scene;
and sending the target flow recording file to the client.
In the invention, the proxy server sends a call request to the server, and the server determines the target flow recording file according to the target request interface and the target service scene in the call request, specifically, determines the corresponding target group according to the target request interface and the target service scene, then determines the target file ID corresponding to the target flow recording file from the target group according to the target service scene, and calls the target flow recording file according to the target file ID, thereby being capable of rapidly positioning the target flow recording file and improving the searching efficiency of the target flow recording file.
As shown in fig. 4, the present invention further provides a flow recording device, which includes:
an obtaining module 401, configured to obtain flow recording data that meets a preset flow recording condition;
the marking module 402 is configured to record data marking according to a preset marking rule;
a preprocessing module 403, configured to preprocess the marked flow record data according to a preprocessing method;
a grouping module 404, configured to group the preprocessed traffic recording data;
and the storage module 405 is configured to store the flow recording data according to packets.
In a preferred embodiment, the storage module 405 is further configured to store the flow record data in a file form to obtain a flow record file; the marking module 402 is further configured to mark 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 module 403 is further configured to disassemble the flow record request data in the flow record file into single flow record requests according to a preset disassembly dimension.
In a preferred embodiment, the grouping module 404 further includes a grouping unit, configured to group the traffic recording request data according to the traffic scenario to which the traffic recording request belongs; and the naming unit is used for naming the grouped flow request data according to the service scene and the request interface of the flow recording request.
In a preferred embodiment, the system further includes a calling module, configured to, after receiving a call request of the flow record file sent by the client, call the target flow record file according to a target request interface and a target service scene in the call request and return the call request to the client.
The flow recording device can realize the beneficial effects of the flow recording method applied to the server, and the detailed description is omitted.
As shown in fig. 5, the present invention further provides a traffic recording device, which is applied to a proxy server, and the device includes:
the acquisition module 501 is used for acquiring flow recording data according to set flow recording conditions;
the sending module 502 is configured to send the flow recording data to the server through the 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 flow record file call request to the server after receiving the regression/automation test request initiated by the client, so that the server calls the corresponding target flow record file according to the flow record file call request.
In a preferred embodiment, the flow record file call request includes a target request interface and a target service scene;
the receiving module is used for receiving a target flow record file which is returned by the server and is determined according to the target request interface and the target service scene;
the sending module is also used for sending the target flow recording file to the client.
The flow recording device in the invention can realize the beneficial effects of the flow recording method applied to the proxy server as described above, and the description is omitted here.
The invention also provides an electronic device, comprising:
one or more processors; and
a memory associated with the one or more processors, the memory for storing program instructions that, when read for execution by the one or more processors, perform a flow recording method applied in a server.
The implementation process and the technical effects that can be achieved in this embodiment refer to the beneficial effects of the flow recording method applied to the server as described above, and are not described herein again.
The invention also provides an electronic device, comprising:
one or more processors; and
a memory associated with the one or more processors, the memory for storing program instructions that, when read for execution by the one or more processors, perform a traffic recording method applied in a proxy server.
The implementation process and the technical effects that can be achieved in this embodiment refer to the beneficial effects of the flow recording method applied to the proxy server as described above, and are not described herein again.
The present invention also provides a computer readable storage medium, on which a computer program is stored, the computer program when executed by a processor implements a flow recording method as described above applied to a server, and the implementation process and the technical effects that can be implemented by the method are referred to as the foregoing description, which is not repeated herein.
The invention also provides a computer readable storage medium, on which a computer program is stored, which when executed by a processor implements a flow recording method as described above applied to a proxy server, and the implementation process and the technical effects that can be achieved by the method are described above, and are not repeated here.
Fig. 6 illustrates an architecture of an electronic device, which may 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, video display adapter 611, disk drive 612, input/output interface 613, network interface 614, and memory 620 may be communicatively coupled via a communications bus 630.
The processor 610 may be implemented by a general-purpose CPU (Central Processing Unit ), a microprocessor, an application specific integrated circuit (Application Specific Integrated Circuit, ASIC), or one or more integrated circuits, etc., for executing related programs to implement the technical scheme provided by the present invention.
The Memory 620 may be implemented in the form of ROM (Read Only Memory), 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 the low-level operation 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 embodiments of the present invention. In general, when the technical solution provided by the present invention is implemented by software or firmware, relevant program codes are stored in the memory 620 and invoked by the processor 610 to be executed.
The input/output interface 613 is used to connect with an input/output module to realize information input and output. The input/output module may be configured as a component in a device (not shown) or may be external to the device to provide corresponding functionality. Wherein the input devices may include a keyboard, mouse, touch screen, microphone, various types of sensors, etc., and the output devices may include a display, speaker, vibrator, indicator lights, etc.
The network interface 614 is used to connect communication modules (not shown) to enable communication interactions of the device with other devices. The communication module may implement communication through a wired manner (such as USB, network cable, etc.), or may implement communication through a wireless manner (such as mobile network, WIFI, bluetooth, etc.).
Bus 630 includes a path to transfer information between components of the device (e.g., 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 illustrate only the processor 610, video display adapter 611, disk drive 612, input/output interface 613, network interface 614, memory 620, bus 630, etc., the device may include other components necessary to achieve proper operation in an implementation. Furthermore, it will be appreciated by those skilled in the art that the apparatus may include only the components necessary to implement the present invention, and not all of the components shown in the drawings.
The computer program product of the present invention comprises a computer program, carried on a computer readable medium, comprising program code for performing the method shown in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network via a communication device, or from memory, or from ROM. The above-described functions defined in the method of the embodiment of the present invention are performed when the computer program is executed by a processor.
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. The computer readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples 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 present 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 contrast, in embodiments of the present invention, the computer-readable signal medium may comprise a data signal propagated in baseband or as part of a carrier wave, with the computer-readable program code embodied therein. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. A 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, fiber optic cables, RF (Radio Frequency), and the like, or any suitable combination thereof.
The computer readable medium may be contained in the server; or may exist alone without being assembled into the server. The computer readable medium carries one or more programs which, when executed by the server, cause the server to: acquiring a frame rate of an application on the terminal in response to detecting that a peripheral mode of the terminal is not activated; when the frame rate meets the screen-extinguishing condition, judging whether a client is acquiring screen information of a 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 ++ 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 kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computer (for example, through the Internet using an Internet service provider).
In this specification, each embodiment is described in a progressive manner, and identical and similar parts of each embodiment are all referred to each other, and each embodiment mainly describes differences from other embodiments. In particular, for a system or system embodiment, since it is substantially similar to a method embodiment, the description is relatively simple, with reference to the description of the method embodiment being made in part. The systems and system embodiments described above are merely illustrative, wherein the elements illustrated as separate elements may or may not be physically separate, and the elements shown as elements may or may not be physical elements, may be located in one place, or may be distributed over a plurality of network elements. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment. Those of ordinary skill in the art will understand and implement the present invention without undue burden.
The flow recording method, the device, the electronic equipment and the storage medium provided by the invention are described in detail, and specific examples are applied to the description of the principle and the implementation mode of the invention, and the description of the above examples is only used for helping to understand the method and the core idea of the invention; also, it is within the scope of the present invention to be modified by those of ordinary skill in the art in light of the present teachings. In view of the foregoing, this description should not be construed as limiting the invention.

Claims (8)

1. The 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;
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;
preprocessing the marked flow recording data according to a preprocessing method;
grouping the preprocessed flow recording data;
storing the flow recording data according to the groups;
the 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;
the preprocessing of the marked flow recording data according to the preprocessing method comprises the following steps:
and decomposing the flow recording request data in the flow recording file into single flow recording requests according to a preset decomposition dimension.
2. The method of claim 1, wherein the grouping the pre-processed traffic recording data comprises:
grouping data of the flow recording request according to the service scene to which the flow recording request belongs;
and naming the grouped flow request data according to the service scene and the request interface of the flow recording request.
3. The method according to any one of claims 1 to 2, further comprising:
and 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 to the client.
4. The traffic recording method is characterized by being applied to a proxy server side, and comprises the following steps:
collecting flow recording data according to preset flow recording conditions;
storing the flow recording data in a file form to obtain a flow recording file;
the flow recording data are sent 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;
after receiving a regression/automation test request initiated by a client, sending a call request of a flow recording file to the server so that the server calls a corresponding target flow recording file;
the 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;
the preprocessing of the marked flow recording data according to the preprocessing method comprises the following steps:
and decomposing the flow recording request data in the flow recording file into single flow recording requests according to a preset decomposition dimension.
5. A traffic recording apparatus for implementing the method of claim 1, applied to a server, said apparatus comprising:
the acquisition module is used for acquiring flow recording data meeting preset flow recording conditions;
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 flow recording data;
and the storage module is used for storing the flow recording data according to the groups.
6. A traffic recording apparatus for implementing the method of claim 4, applied to a proxy server side, said apparatus comprising:
the acquisition module is used for acquiring flow recording data according to preset flow recording conditions;
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 flow recording data;
the sending module is also used for sending a flow recording file calling request to the server after receiving the regression/automation test request initiated by the client, so that the server can call the corresponding target flow recording file according to the flow recording file calling request.
7. An electronic device, comprising:
one or more processors; and
a memory associated with the one or more processors for storing program instructions which, when read for execution by the one or more processors, perform the method of any one of claims 1 to 3.
8. A computer storage medium having stored thereon a computer program, wherein the program when executed by a processor implements the method of any of claims 1 to 3.
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 CN114285774A (en) 2022-04-05
CN114285774B true 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)

Families Citing this family (1)

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

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
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

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7013251B1 (en) * 1999-12-15 2006-03-14 Microsoft Corporation Server recording and client playback of computer network characteristics

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
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

Also Published As

Publication number Publication date
CN114285774A (en) 2022-04-05

Similar Documents

Publication Publication Date Title
CN111581291B (en) Data processing method, device, electronic equipment and readable medium
CN111177617A (en) Web direct operation and maintenance method and device based on operation and maintenance management system and electronic equipment
CN112328419B (en) Test case generation method and device of remote procedure call interface, storage medium and electronic equipment
CN110753089B (en) Method, device, medium and electronic equipment for managing client
CN111177112A (en) Database blocking method and device based on operation and maintenance management system and electronic equipment
CN107644075B (en) Method and device for collecting page information
CN112597047A (en) Test method, test device, electronic equipment and computer readable medium
CN115640285B (en) Power abnormality information transmission method, device, electronic equipment and medium
CN114285774B (en) Flow recording method and device, electronic equipment and storage medium
CN111309304B (en) Method, device, medium and electronic equipment for generating IDL file
CN115996179A (en) Service node testing method and device, readable medium and electronic equipment
CN109218338B (en) Information processing system, method and device
CN117076250A (en) Data processing method and device
CN107247661B (en) Method and system for supporting automatic verification of installation package of application
CN116132625A (en) Supervision method and device for transaction flow
CN114936156A (en) Method and device for processing automatic driving simulation task
CN111831530A (en) Test method and device
CN111274150B (en) Service instance access method and device and electronic equipment
CN112203113B (en) Video stream structuring method and device, electronic equipment and computer readable medium
CN113608996B (en) Mirror image compiling test method, system, device and readable storage medium
CN113722206A (en) Data annotation method and device, electronic equipment and computer readable medium
CN112559087B (en) Information generation method, apparatus, electronic device and computer readable medium
CN109005084B (en) Method, electronic device, and computer-readable medium for verifying network connection
CN114157647A (en) Method and device for tracking webpage browsed by user, electronic equipment and storage medium
CN117762668A (en) Network data acquisition method, device, medium and equipment

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