Traffic data processing method and device

By automatically determining effective traffic using code coverage data in the traffic recording and playback tool, the problem of relying on experience and environmental integrity in the existing technology is solved, the availability of automated configuration and test cases is realized, and labor costs and compatibility risks are reduced. .

CN119201725APending Publication Date: 2024-12-27SHANGHAI HODE INFORMATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411305741.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-18
Publication Date
2024-12-27

AI Technical Summary

Technical Problem

During the traffic cleaning and traffic rewriting process, existing traffic recording and playback tools rely on QA's experience and test environment integrity, resulting in large workloads in early configuration and unstable availability of test cases, which is unable to effectively compatible with service updates and data changes.

Method used

By obtaining the original traffic, sending playback tasks to the preset service instance, collecting code coverage data, determining effective traffic based on the code coverage changes, realizing automatic filtering and generating test cases, reducing manual configuration requirements, and ensuring the availability of test cases.

Benefits of technology

There is no need for QA to perform a large amount of pre-configuration, automatically filter effective traffic, save labor costs, ensure the availability and compatibility of test cases, and adapt to service version changes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119201725A_ABST
    Figure CN119201725A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a traffic data processing method and device. The method comprises the following steps: acquiring at least one piece of original traffic; a playback task is sent to a preset service instance for each piece of original traffic, and the preset service instance is used for playing back the original traffic; collecting code coverage rate data when each piece of original flow is played back through a preset service instance; and determining effective traffic from the at least one piece of original traffic according to the code coverage rate data. The service instance capable of obtaining the code coverage rate in real time is used for replacing all configuration work needing manual preparation in the earlier stage, so that the QA does not need to do any configuration work of flow cleaning, the QA needs to know how to publish the preset service instance, effective flow in recorded flow can be automatically filtered out, and the flow cleaning efficiency is improved. And moreover, the original traffic does not need to be tampered, and the original traffic can be repeatedly used, so that the availability of the test case generated by the traffic is ensured.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of Internet technology, and in particular, to a flow data processing method, apparatus, computer equipment, computer-readable storage medium, and computer program product. Background Art

[0002] The emergence of traffic recording and playback tools has changed the previous situation where test cases needed to be constructed manually. Because there is no need to construct test cases manually, it has largely eliminated the efficiency differences caused by work experience, familiarity with the services, etc. when QA faces services that need to be tested.

[0003] Test cases are usually constructed by recording online traffic through traffic recording and playback tools, and then transforming the traffic into usable test cases through traffic cleaning (setting certain conditions to filter out a part of the traffic) and traffic rewriting (modifying some data of the original traffic). However, the traffic cleaning and traffic rewriting methods in the above solutions expose the following problems: On the one hand, traffic cleaning requires QA to do a lot of preliminary configuration preparation work to obtain the required traffic, and the preliminary preparation work is very dependent on QA's experience and familiarity with the business, which is contrary to the purpose of traffic recording and playback tools. On the other hand, traffic rewriting is to ensure that traffic can be played back normally in the test environment, but if there are service updates or data changes in the test environment, these modifications often do not have good compatibility and timeliness, so the availability of test cases generated by the traffic cannot be guaranteed, that is, such test cases are very dependent on the integrity of the test environment.

[0004] It should be noted that the above content is not necessarily prior art, nor is it intended to limit the scope of patent protection of this application. Summary of the invention

[0005] The embodiments of the present application provide a flow data processing method, apparatus, computer equipment, computer-readable storage medium, and computer program product to solve or alleviate one or more of the technical problems raised above.

[0006] One aspect of an embodiment of the present application provides a flow data processing method, the method comprising: Get at least one piece of original traffic; Sending a playback task to a preset service instance for each original flow respectively, wherein the preset service instance is used to play back the original flow; Use the preset service instance to collect code coverage data when replaying each original traffic. Valid traffic is determined from the at least one original traffic according to the code coverage data.

[0007] Optionally, determining effective traffic from the at least one original traffic according to the code coverage data includes: Determining the currently processed flow from the at least one original flow in sequence; Extracting from the code coverage data a first code coverage before replaying the currently processed traffic and a second code coverage after replaying the currently processed traffic; According to the first code coverage and the second code coverage, it is determined whether the traffic currently being processed is valid traffic.

[0008] Optionally, determining whether the currently processed traffic is valid traffic according to the first code coverage and the second code coverage includes: When the first code coverage rate and the second code coverage rate are the same, determining that the currently processed traffic is invalid traffic; or, When the first code coverage and the second code coverage are different, it is determined that the currently processed traffic is valid traffic.

[0009] Optionally, the preset service instance includes a code coverage collection component; the collecting of code coverage data when replaying each original flow through the preset service instance includes: The code coverage collection component is used to collect code coverage data when replaying each original flow.

[0010] Optionally, the preset service instance further includes a coverage request port; after the step of sending a playback task to the preset service instance for each original flow, the method further includes: A request for obtaining real-time coverage is sent to the coverage request port.

[0011] Optionally, the method further comprises: The request for obtaining real-time coverage is received through the coverage request port, and in response to the request for obtaining real-time coverage, the code coverage data is returned to the playback engine.

[0012] Optionally, the method further comprises: A test case is generated according to the effective traffic.

[0013] Another aspect of an embodiment of the present application provides a flow data processing device, the device comprising: An original traffic acquisition module, used to acquire at least one original traffic; A playback task sending module, used to send a playback task to a preset service instance for each original flow, wherein the preset service instance is used to play back the original flow; The code coverage data collection module is used to collect the code coverage data of each original traffic when replaying it through the preset service instance; The effective traffic determination module is used to determine the effective traffic from the at least one original traffic according to the code coverage data.

[0014] Another aspect of an embodiment of the present application provides a computer device, including: at least one processor; and a memory communicatively coupled to the at least one processor; Wherein: the memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the flow data processing method as described above.

[0015] Another aspect of an embodiment of the present application provides a computer-readable storage medium, in which computer instructions are stored. When the computer instructions are executed by a processor, the flow data processing method described above is implemented.

[0016] Another aspect of an embodiment of the present application provides a computer program product, including a computer program, which implements the traffic data processing method as described above when executed by a processor.

[0017] The technical solution adopted in the embodiment of the present application may include the following advantages: by judging whether the current traffic is valid traffic according to the change of code coverage when replaying the traffic, a service instance that can obtain code coverage in real time is used to replace all the configuration work that needs to be manually prepared in the early stage, so that QA does not need to do any traffic cleaning configuration work. All QA needs to learn is how to publish a preset service instance that can obtain code coverage in real time, so that the valid traffic in the recorded original traffic can be automatically filtered out, which can save labor costs, and there is no need to tamper with the original traffic and the original traffic can be reused. For the current service version, new valid traffic can be taken out from the original traffic to generate test cases, thereby ensuring the availability of the test cases generated by the traffic. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] The accompanying drawings exemplarily illustrate the embodiments and constitute a part of the specification, and together with the text description of the specification, are used to explain the exemplary implementation of the embodiments. The embodiments shown are for illustrative purposes only and do not limit the scope of the claims. In all drawings, the same reference numerals refer to similar but not necessarily identical elements.

[0019] Figure 1 The operating environment diagram of the flow data processing method according to the first embodiment of the present application is schematically shown; Figure 2 The flowchart of the flow data processing method according to the first embodiment of the present application is schematically shown; Figure 3 A schematic diagram of a flow data processing system is shown; Figure 4 A block diagram schematically shows a flow data processing device according to the second embodiment of the present application; and Figure 5 The hardware architecture diagram of the computer device according to the third embodiment of the present application is schematically shown. DETAILED DESCRIPTION

[0020] In order to make the purpose, technical solutions and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not intended to limit the present application. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of the present application.

[0021] It should be noted that the descriptions involving "first", "second", etc. in the embodiments of the present application are only for descriptive purposes and cannot be understood as indicating or implying their relative importance or implicitly indicating the number of technical features indicated. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In addition, the technical solutions between the various embodiments can be combined with each other, but they must be based on the ability of ordinary technicians in the field to implement them. When the combination of technical solutions is contradictory or cannot be implemented, it should be deemed that such combination of technical solutions does not exist and is not within the scope of protection required by this application.

[0022] In the description of the present application, it should be understood that the numerical labels before the steps do not indicate the order in which the steps are executed, but are only used to facilitate the description of the present application and to distinguish each step, and therefore should not be understood as a limitation on the present application.

[0023] First, the following terms are explained: Code coverage: is a software testing metric that measures which parts of the code base are exercised during testing.

[0024] QA:Quality Assurance Quality Management.

[0025] Code Instrumentation: Code Instrumentation is a commonly used technique in software development and testing. It involves inserting additional code snippets (called "probes" or "stub codes") at specific locations in existing programs to collect information, monitor behavior, perform performance analysis, and achieve debugging purposes while the program is running, or implement functions such as hot fixes and plug-ins.

[0026] Secondly, in order to facilitate those skilled in the art to understand the technical solutions provided in the embodiments of the present application, the relevant technologies are described below: The emergence of traffic recording and playback tools has changed the situation where test cases had to be constructed manually. Traffic recording and playback tools can directly use online traffic as test cases, which not only greatly improves the coverage of test scenarios, but also saves the labor cost required when writing test cases. At the same time, there is no need to manually construct test cases, which largely eliminates the efficiency differences caused by work experience, familiarity with services, etc. when QA faces services that need to be tested. Therefore, the usage rate of traffic recording and playback tools is getting higher and higher in the software testing process.

[0027] Currently, the industry generally converts the traffic recorded by traffic recording and playback tools into usable test cases through methods such as traffic cleaning (setting certain conditions to filter out part of the traffic) and traffic rewriting (modifying certain data of the original traffic).

[0028] Regarding the traffic cleaning and traffic rewriting methods mentioned in the technical background, these solutions expose the following problems: 1) A lot of manpower costs are still required. For example, for a certain interface, a lot of traffic will be recorded. How to clean these flows, that is, to determine whether these flows are repeated, is a job that is very coupled with the business. It does not mean that two valid test cases can be generated if the parameters of two flows are completely different, because they may hit the same code logic. This preliminary preparation work is very dependent on the experience of QA and the familiarity with the business, which is contrary to the purpose of the traffic recording and playback tool.

[0029] 2) Dependence on the integrity of the test environment. Modifying certain parameters of the original traffic, such as personnel ID, is intended to ensure that the traffic can be replayed normally in the test environment. However, if there are service updates or data changes in the test environment, these modifications often do not have good compatibility and timeliness, and therefore cannot guarantee the availability of the test cases generated by the traffic.

[0030] To this end, an embodiment of the present application provides a technical solution for flow data processing. In this technical solution, at least one original flow is obtained; a playback task is sent to a preset service instance for each original flow, wherein the preset service instance is used to play back the original flow; the code coverage data when each original flow is played back is collected through the preset service instance; and the effective flow is determined from the at least one original flow according to the code coverage data. By judging whether the current flow is effective flow according to the change in code coverage when the flow is played back, when a flow request is sent to a preset service instance, if the code coverage of the preset service instance changes, it can be considered that this flow hits more code logic, then the test cases generated according to this flow can cover more scenarios, and this flow can be defined as effective flow. Only a service instance that can obtain code coverage in real time can replace all the configuration work that needs to be prepared manually in the early stage, so QA does not need to do any traffic cleaning configuration work. QA only needs to learn how to publish a preset service instance that can obtain code coverage in real time, and can automatically filter out the valid traffic in the recorded original traffic, saving labor costs. In addition, there is no need to tamper with the original traffic, and the original traffic can be reused. For the current service version, new valid traffic can be taken from the original traffic to generate test cases, thereby ensuring the availability of the test cases generated by the traffic. See the following for details.

[0031] Finally, for ease of understanding, an exemplary operating environment is provided below.

[0032] like Figure 1 As shown, the environment diagram includes a service platform 2, a network 4, and a client 6, wherein: The service platform 2 may be composed of a single or multiple computing devices. The multiple computing devices may include virtualized computing instances. Virtualized computing instances may include virtual machines, such as simulations of computer systems, operating systems, servers, etc. The computing device may load a virtual machine based on a virtual image and / or other data defining specific software (e.g., operating system, dedicated application, server) for simulation. As the demand for different types of processing services changes, different virtual machines may be loaded and / or terminated on one or more computing devices. A hypervisor may be implemented to manage the use of different virtual machines on the same computing device.

[0033] The service platform 2 may be configured to communicate with the client 6 or the like via a network 4. The network 4 includes various network devices, such as routers, switches, multiplexers, hubs, modems, bridges, repeaters, firewalls, proxy devices, and / or the like. The network 4 may include physical links, such as coaxial cable links, twisted pair cable links, optical fiber links, combinations thereof, and the like, or wireless links, such as cellular links, satellite links, Wi-Fi links, and the like.

[0034] The service platform 2 can provide storage, reading, writing, querying, deleting and other services, such as providing traffic data processing services for clients.

[0035] The client 6 may be an electronic device running an operating system such as Windows, Android™ or iOS, such as a smart phone, a tablet device, a laptop computer, a virtual reality device, a gaming device, a set-top box, a vehicle terminal, or a smart TV. Based on the above operating system, various applications such as traffic data processing may be run.

[0036] The client 6 may provide / configure a user access page for manipulating the service platform 2 or uploading objects, etc.

[0037] It should be noted that the above devices are exemplary, and the number and type of devices are adjustable in different scenarios or according to different needs.

[0038] The following uses the service platform 2 as the execution subject to introduce the technical solution of the present application through multiple embodiments. It should be noted that these embodiments can be implemented in a variety of different forms and should not be interpreted as being limited to the embodiments described here.

[0039] Embodiment 1 Figure 2 The flowchart of the flow data processing method according to the first embodiment of the present application is schematically shown.

[0040] like Figure 2 As shown, the flow data processing method may include steps S202 to S208, wherein: Step S202, obtaining at least one original flow; Step S204, sending a playback task to a preset service instance for each original flow, wherein the preset service instance is used to play back the original flow; Step S206, collecting code coverage data when replaying each original traffic through a preset service instance; Step S208: determining effective traffic from the at least one original traffic according to the code coverage data.

[0041] The traffic data processing method provided in this embodiment determines whether the current traffic is valid traffic based on the change in code coverage when replaying the traffic, thereby achieving the purpose of using a service instance that can obtain code coverage in real time to replace all the configuration work that needs to be manually prepared in the early stage, so that QA does not need to do any traffic cleaning configuration work. All QA needs to know is how to publish a preset service instance that can obtain code coverage in real time, so that valid traffic in the recorded original traffic can be automatically filtered out. This does not require any business familiarity, thereby saving labor costs, and there is no need to tamper with the original traffic and the original traffic can be reused. For the current service version, new valid traffic is automatically taken out from the original traffic to generate test cases, thereby ensuring the availability of test cases generated by the traffic.

[0042] The following combination Figure 2 , each step in steps S202~S208 and other optional steps are described in detail.

[0043] Step S202 , obtain at least one original flow; The original traffic refers to the original online traffic recorded by the traffic recording and playback tool.

[0044] Step S204 , sending a playback task to a preset service instance for each original flow respectively, wherein the preset service instance is used to play back the original flow; In this embodiment, a playback engine and a preset service instance can be deployed, wherein the playback engine can play back the recorded original traffic one by one into the preset service instance, that is, the playback engine generates a playback task for each original traffic in turn, and sends the playback task to the preset service instance to play back the original traffic in the preset service instance.

[0045] Step S206 , collects code coverage data when replaying each original traffic through the preset service instance; In this implementation, the pre-set service example may include a code coverage collection component. The pre-set service instance may monitor the code coverage when replaying the traffic, and the pre-set service instance may collect the code coverage data when replaying each original traffic.

[0046] Step S208 , determining effective traffic from the at least one original traffic according to the code coverage data.

[0047] Specifically, when a traffic request reaches a preset service instance, if the code coverage of the preset service instance changes, it can be considered that this traffic hits more code logic, and the test cases generated based on this traffic can cover more scenarios. In this embodiment, this traffic is defined as effective traffic.

[0048] By determining the effective traffic from at least one original traffic based on the code coverage data, all the configuration work that needs to be manually prepared in the early stage can be replaced by only one preset service instance that can obtain code coverage in real time, thereby greatly saving labor costs.

[0049] In an optional embodiment of the present application, step S208 may include the following steps: Determining the currently processed flow from the at least one original flow in sequence; Extracting from the code coverage data a first code coverage before replaying the currently processed traffic and a second code coverage after replaying the currently processed traffic; According to the first code coverage and the second code coverage, it is determined whether the traffic currently being processed is valid traffic.

[0050] In this embodiment, a loop logic program is deployed to determine the currently processed traffic from at least one original traffic in turn, and then the first code coverage before replaying the currently processed traffic and the second code coverage after replaying the currently processed traffic are extracted from the code coverage data, and then, according to the first code coverage and the second code coverage, it can be determined whether the currently processed traffic is valid traffic. Return to execute the above steps, determine the next traffic from at least one original traffic as the currently processed traffic, and determine whether the traffic is valid traffic, until the loop judgment is completed for all original traffic, and then end the process.

[0051] In an optional embodiment of the present application, determining whether the currently processed traffic is valid traffic according to the first code coverage and the second code coverage includes: When the first code coverage rate and the second code coverage rate are the same, determining that the currently processed traffic is invalid traffic; or, When the first code coverage and the second code coverage are different, it is determined that the currently processed traffic is valid traffic.

[0052] In this embodiment, valid traffic is selected based on whether the code coverage changes when the traffic is replayed. When the first code coverage and the second code coverage are the same, the currently processed traffic is determined to be invalid traffic; or when the first code coverage and the second code coverage are different, the currently processed traffic is determined to be valid traffic.

[0053] In an optional embodiment of the present application, the preset service instance includes a code coverage collection component; the code coverage data collected when replaying each original flow through the preset service instance includes: The code coverage collection component is used to collect code coverage data when replaying each original flow.

[0054] In this embodiment, the preset service instance includes a code coverage collection component, and the code coverage collection component can be used to collect code coverage data when each original flow is played back, so that valid flow can be screened out using the code coverage data.

[0055] Specifically, the service image running in the pre-set service instance is slightly different from the ordinary service image. Code coverage is collected by using the plug-in method supported by all languages. QA creates a service binary file with code coverage calculation function based on the implementation language of the service to be tested, and makes it into a service image product. Use the image product to publish an instance with code coverage collection function, that is, the pre-set service instance.

[0056] In an optional embodiment of the present application, the preset service instance further includes a coverage request port; after the step of sending a playback task to the preset service instance for each original flow, the method further includes: A request for obtaining real-time coverage is sent to the coverage request port.

[0057] In this embodiment, the preset service instance also includes a coverage request port, and a request for obtaining real-time coverage is sent to the coverage request port through the playback engine.

[0058] In an optional embodiment of the present application, the method further includes: The request for obtaining real-time coverage is received through the coverage request port; and in response to the request for obtaining real-time coverage, the code coverage data is returned to the playback engine.

[0059] In this embodiment, the request for obtaining real-time coverage can be received through the coverage request port, and then, in response to the request for obtaining real-time coverage, the code coverage data is returned to the playback engine, so that the playback engine can determine whether the traffic is valid based on the code coverage data.

[0060] In an optional embodiment of the present application, the method further includes: A test case is generated according to the effective traffic.

[0061] In this embodiment, a test case management platform can be used to generate a test case based on effective traffic, so as to use the test case to perform application-related function or interface testing, etc.

[0062] To further explain the flow data processing method of this embodiment, as an example, Figure 3 The framework structure diagram of a traffic data processing system is shown. The traffic data processing system includes two modules, namely, a playback engine and a coverage instance. The coverage instance includes a special port, namely, a coverage request port. The playback engine sends a playback task to the coverage instance based on the original traffic, and requests the instance coverage from the special port in the coverage instance to obtain the code coverage data when replaying the original traffic. The details are as follows: Playback Engine: 1) Execute the traffic playback task. Because it is necessary to observe the impact of each traffic on the instance code coverage, the playback engine needs to replay the recorded original traffic one by one to the coverage instance when executing the playback task.

[0063] 2) Observe the changes in the code coverage collected by the coverage instance. Before replaying a flow, first record the current code coverage data of the instance. After replaying, request the interface again to obtain the code coverage data and observe whether the code coverage has changed.

[0064] 3) Upload valid traffic. If a certain traffic in 2) causes a change in the instance code coverage, the playback engine will upload the traffic to the test case management platform.

[0065] Coverage instances, i.e. pre-configured service instances: 1) The service image running on the coverage instance is slightly different from the ordinary service image. Code coverage is collected by using the plug-in method supported by all languages. QA creates a service binary file with code coverage calculation function based on the implementation language of the service to be tested, and makes it into a service image product, and uses the image product to publish a service coverage instance.

[0066] 2) During the coverage instance operation a. Provide a special port (also known as the coverage request port) to receive requests from the playback engine to obtain instance coverage.

[0067] b. Coverage files are automatically generated in real time during instance operation to record changes in the current instance code coverage.

[0068] c. When receiving a request from the playback engine to obtain the real-time coverage of an instance, the coverage files are integrated, the code coverage of the instance at this time is calculated, and the code coverage is returned to the playback engine.

[0069] In this embodiment, the change of code coverage in the instance is used to determine whether the current traffic is valid traffic. When a traffic request is sent to an instance, if the code coverage of the instance changes, it can be considered that this traffic hits more code logic, and the test cases generated based on this traffic can cover more scenarios. In this embodiment, this traffic is defined as valid traffic.

[0070] If you want to minimize the requirements for QA experience and business proficiency, then from the perspective of QA, you should consider the target test service as a completely black box service. Combined with the solution for determining effective traffic, QA does not need to do any traffic cleaning configuration work. All QA needs to learn is how to publish an instance that can obtain code coverage in real time, which does not require any business familiarity.

[0071] Embodiment 2 Figure 4 The block diagram of the flow data processing device according to the second embodiment of the present application is schematically shown. The device can be divided into one or more program modules, one or more program modules are stored in a storage medium, and are executed by one or more processors to complete the embodiment of the present application. The program module referred to in the embodiment of the present application refers to a series of computer program instruction segments that can complete specific functions. The following description will specifically introduce the functions of each program module in this embodiment. Figure 4 As shown, the traffic data processing device 400 may include: an original traffic acquisition module 410, a playback task sending module 420, a code coverage data acquisition module 430 and an effective traffic determination module 440, wherein: The original traffic acquisition module 410 is used to acquire at least one original traffic; A playback task sending module 420, used to send a playback task to a preset service instance for each original flow, wherein the preset service instance is used to play back the original flow; The code coverage data collection module 430 is used to collect the code coverage data when replaying each original traffic through a preset service instance; The effective traffic determination module 440 is used to determine the effective traffic from the at least one original traffic according to the code coverage data.

[0072] In an optional embodiment of the present application, the effective flow determination module 440 includes: A currently processed flow determination submodule, used to determine the currently processed flow from the at least one original flow in sequence; A code coverage extraction submodule, used to extract from the code coverage data a first code coverage before replaying the currently processed traffic, and a second code coverage after replaying the currently processed traffic; The effective traffic determination submodule is used to determine whether the currently processed traffic is effective traffic based on the first code coverage and the second code coverage.

[0073] In an optional embodiment of the present application, the effective flow determination submodule includes: A first determining unit is configured to determine that the currently processed traffic is invalid traffic when the first code coverage rate and the second code coverage rate are the same; or The first determining unit is used to determine that the currently processed traffic is valid traffic when the first code coverage rate and the second code coverage rate are different.

[0074] In an optional embodiment of the present application, the preset service instance includes a code coverage collection component; the code coverage data collection module 430 includes: The code coverage data collection submodule is used to collect the code coverage data when replaying each original flow through the code coverage collection component.

[0075] In an optional embodiment of the present application, the preset service instance further includes a coverage request port; and the device further includes: The coverage request sending module is used to send a request for obtaining real-time coverage to the coverage request port.

[0076] In an optional embodiment of the present application, the device further includes: The request receiving module is used to receive the request for obtaining real-time coverage through the coverage request port, and return the code coverage data to the playback engine in response to the request for obtaining real-time coverage.

[0077] In an optional embodiment of the present application, the device further includes: A test case generation module is used to generate a test case according to the effective traffic.

[0078] Embodiment 3 Figure 5 The schematic diagram of the hardware architecture of a computer device 10000 suitable for implementing the flow data processing method according to the third embodiment of the present application is shown. In some embodiments, the computer device 10000 may be a terminal device such as a smart phone, a wearable device, a tablet computer, a personal computer, a vehicle terminal, a game console, a virtual device, a workbench, a digital assistant, a set-top box, a robot, etc. In other embodiments, the computer device 10000 may be a rack server, a blade server, a tower server, or a cabinet server (including an independent server, or a server cluster composed of multiple servers), etc. Figure 5 As shown, the computer device 10000 includes but is not limited to: a memory 10010, a processor 10020, and a network interface 10030 that can communicate with each other through a system bus. Among them: The memory 10010 includes at least one type of computer-readable storage medium, and the readable storage medium includes flash memory, hard disk, multimedia card, card-type memory (such as SD or DX memory), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, magnetic disk, optical disk, etc. In some embodiments, the memory 10010 can be an internal storage module of the computer device 10000, such as a hard disk or memory of the computer device 10000. In other embodiments, the memory 10010 can also be an external storage device of the computer device 10000, such as a plug-in hard disk equipped on the computer device 10000, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. Of course, the memory 10010 can also include both the internal storage module of the computer device 10000 and its external storage device. In this embodiment, the memory 10010 is generally used to store the operating system and various application software installed in the computer device 10000, such as program code of the flow data processing method, etc. In addition, the memory 10010 can also be used to temporarily store various data that have been output or will be output.

[0079] In some embodiments, the processor 10020 may be a central processing unit (CPU), a controller, a microcontroller, a microprocessor, or other chips. The processor 10020 is generally used to control the overall operation of the computer device 10000, such as performing control and processing related to data interaction or communication with the computer device 10000. In this embodiment, the processor 10020 is used to run the program code stored in the memory 10010 or process data.

[0080] The network interface 10030 may include a wireless network interface or a wired network interface, and the network interface 10030 is generally used to establish a communication link between the computer device 10000 and other computer devices. For example, the network interface 10030 is used to connect the computer device 10000 to an external terminal through a network, and to establish a data transmission channel and a communication link between the computer device 10000 and the external terminal. The network may be a wireless or wired network such as an intranet, the Internet, the Global System of Mobile communication (GSM), Wideband Code Division Multiple Access (WCDMA), 4G network, 5G network, Bluetooth, Wi-Fi, etc.

[0081] It should be pointed out that Figure 5 Only a computer device having components 10010 - 10030 is shown, but it should be understood that implementation of all of the components shown is not a requirement, and more or fewer components may alternatively be implemented.

[0082] In this embodiment, the traffic data processing method stored in the memory 10010 can also be divided into one or more program modules and executed by one or more processors (such as processor 10020) to complete the embodiment of the present application.

[0083] Embodiment 4 An embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored, wherein when the computer program is executed by a processor, the steps of the flow data processing method in the embodiment are implemented.

[0084] In this embodiment, the computer-readable storage medium includes flash memory, hard disk, multimedia card, card-type memory (for example, SD or DX memory, etc.), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, disk, optical disk, etc. In some embodiments, the computer-readable storage medium may be an internal storage unit of a computer device, such as a hard disk or memory of the computer device. In other embodiments, the computer-readable storage medium may also be an external storage device of a computer device, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. equipped on the computer device. Of course, the computer-readable storage medium may also include both the internal storage unit of the computer device and its external storage device. In this embodiment, the computer-readable storage medium is generally used to store an operating system and various application software installed on the computer device, such as the program code of the flow data processing method in the embodiment, etc. In addition, the computer-readable storage medium may also be used to temporarily store various types of data that have been output or are to be output.

[0085] Embodiment 5 An embodiment of the present application also provides a computer program product, including a computer program, which implements the method in the above embodiment when executed by a processor.

[0086] Obviously, those skilled in the art should understand that the modules or steps of the above-mentioned embodiments of the present application can be implemented by general-purpose computer devices, they can be concentrated on a single computer device, or distributed on a network composed of multiple computer devices, optionally, they can be implemented by executable program codes of computer devices, so that they can be stored in a storage device and executed by the computer device, and in some cases, the steps shown or described can be executed in a different order from that herein, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. In this way, the embodiments of the present application are not limited to any specific combination of hardware and software.

[0087] It should be noted that the above are only preferred embodiments of the present application, and the patent protection scope of the present application is not limited thereto. Any equivalent structure or equivalent process transformation made using the contents of the specification and drawings of the present application, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present application.

Claims

1. A flow data processing method, characterized in that: The method comprises: Get at least one piece of original traffic; Sending a playback task to a preset service instance for each original flow respectively, wherein the preset service instance is used to play back the original flow; Use the preset service instance to collect code coverage data when replaying each original traffic. Valid traffic is determined from the at least one original traffic according to the code coverage data.

2. The flow data processing method according to claim 1, characterized in that: The determining effective traffic from the at least one original traffic according to the code coverage data includes: Determining the currently processed flow from the at least one original flow in sequence; Extracting from the code coverage data a first code coverage before replaying the currently processed traffic and a second code coverage after replaying the currently processed traffic; According to the first code coverage and the second code coverage, it is determined whether the traffic currently being processed is valid traffic.

3. The flow data processing method according to claim 1, characterized in that: The determining, according to the first code coverage and the second code coverage, whether the currently processed traffic is valid traffic includes: When the first code coverage rate and the second code coverage rate are the same, determining that the currently processed traffic is invalid traffic; or, When the first code coverage and the second code coverage are different, it is determined that the currently processed traffic is valid traffic.

4. The flow data processing method according to claim 1, characterized in that: The preset service instance includes a code coverage collection component; the code coverage data collected when replaying each original flow through the preset service instance includes: The code coverage collection component is used to collect code coverage data when replaying each original flow.

5. The flow data processing method according to claim 1, characterized in that: The preset service instance further includes a coverage request port; after the step of sending a playback task to the preset service instance for each original flow, the method further includes: A request for obtaining real-time coverage is sent to the coverage request port.

6. The flow data processing method according to claim 5, characterized in that: The method further comprises: The request for obtaining real-time coverage is received through the coverage request port, and in response to the request for obtaining real-time coverage, the code coverage data is returned to the playback engine.

7. The flow data processing method according to claim 1, characterized in that: The method further comprises: A test case is generated according to the effective traffic.

8. A flow data processing device, characterized in that: The device comprises: An original traffic acquisition module, used to acquire at least one original traffic; A playback task sending module, used to send a playback task to a preset service instance for each original flow, wherein the preset service instance is used to play back the original flow; The code coverage data collection module is used to collect the code coverage data of each original traffic when replaying it through the preset service instance; The effective traffic determination module is used to determine the effective traffic from the at least one original traffic according to the code coverage data.

9. A computer device, characterized in that: include: at least one processor; and a memory communicatively connected to the at least one processor; wherein: The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the flow data processing method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and when the computer instructions are executed by a processor, the flow data processing method according to any one of claims 1 to 7 is implemented.

11. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the flow data processing method according to claims 1 to 7 are implemented.