Traffic back-testing method, device, equipment, storage medium and program product

By using distributed databases and stream processing/batch processing methods in traffic playback technology, the problem of limited storage architecture performance in traditional technology is solved, and efficient processing and response to high concurrency and large-scale data are achieved, adapting to different businesses. Traffic playback on demand.

CN118733627APending Publication Date: 2024-10-01CHINA TRUST TRUST CO LTD +1
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202410773311.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-14
Publication Date
2024-10-01

AI Technical Summary

Technical Problem

In traditional traffic playback technology, the storage architecture has capacity bottlenecks and poor scalability. Especially when processing high-concurrency queries and large-scale data updates, performance is limited, and the pre-processing process is inefficient and cannot respond quickly to changing data sources.

Method used

A distributed database is used to store historical traffic data, and stream processing and batch processing methods are combined to obtain and playback traffic data sets from the distributed database to achieve efficient cleaning, conversion and feature extraction of real-time and batch data to adapt to different business needs. Improve traffic data preprocessing capabilities.

Benefits of technology

It solves the problem of data storage capacity bottlenecks and poor scalability, improves performance in high-concurrency queries and large-scale data updates, achieves rapid response and efficient preprocessing of traffic data, and adapts to the traffic playback needs of different business needs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118733627A_ABST
    Figure CN118733627A_ABST
Patent Text Reader

Abstract

The invention provides a flow back-testing method, device and equipment, a storage medium and a program product, and the method comprises the steps: responding to a back-testing task for a back-testing object, and based on a preset data processing mode and a business rule associated with the back-testing task, carrying out the back-testing of the back-testing object from historical flow data of the back-testing object stored in a distributed database, and obtaining a backtest flow data set of a backtest object specified by the backtest task. And obtaining a back-test result obtained by playing back the back-test flow data set to the back-test object. And outputting a back test result. According to the method, the historical flow data is stored through the distributed database, so that the performance of the method in processing high-concurrency query and large-scale data updating can be improved. Moreover, efficient cleaning, conversion and feature extraction of the real-time traffic data and the batch traffic data can be realized by adopting a stream processing mode and / or a batch processing mode, so that different service requirements are met, and the traffic data preprocessing capability is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of traffic replay technology, and in particular to a traffic replay method, device, equipment, storage medium and program product. Background Art

[0002] Traffic replay is a technology that simulates network requests or service calls based on traffic requests recorded from real scenarios in storage media. It is mainly used in scenarios such as testing, debugging, performance analysis, and troubleshooting.

[0003] In traffic replay, it is often necessary to manage massive amounts of traffic data. Traditional storage architectures have capacity bottlenecks and poor scalability, especially when dealing with high-concurrency queries and large-scale data updates. In addition, the existing preprocessing process for traffic data required for traffic replay is inefficient and cannot quickly respond to changing data sources. Summary of the invention

[0004] The present application provides a traffic backtesting method, apparatus, equipment, storage medium and program product, which are used to provide a technical solution for improving the performance of processing high-concurrency queries and large-scale data updates and the ability to pre-process traffic data.

[0005] In a first aspect, the present application provides a flow backtesting method, the method comprising:

[0006] In response to a backtesting task for a backtesting object, based on a preset data processing method and business rules associated with the backtesting task, a backtesting traffic data set of the backtesting object specified by the backtesting task is obtained from the historical traffic data of the backtesting object stored in a distributed database; wherein the preset data processing method includes a stream processing method and / or a batch processing method, and the historical traffic data includes at least one of a business request timestamp, a business request type, a business request parameter, and a business response result.

[0007] A backtest result is obtained by replaying the backtest traffic data set to the backtest object.

[0008] Output the backtest result.

[0009] In an optional implementation, the business rules include data screening conditions associated with the backtesting task.

[0010] The step of obtaining a backtest traffic data set of the backtest object specified by the backtest task from the historical traffic data of the backtest object stored in a distributed database based on the business rules associated with the backtest task includes:

[0011] The historical traffic data of the backtest object stored in the distributed database is filtered by using the data filtering conditions associated with the backtest task to obtain the backtest traffic data set of the backtest object specified by the backtest task; the data filtering conditions include the time range of data filtering, at least one of the business line, the user group of the business, and the business attribute.

[0012] In an optional implementation manner, the business rules further include data cleaning rules associated with the backtesting task; and the method further includes:

[0013] The backtest traffic data set is cleaned using the data cleaning rules associated with the backtest task; the data cleaning rules include cleaned business fields and / or cleaned business noises.

[0014] In an optional implementation manner, the method further includes:

[0015] The historical traffic data of the backtest object is collected in real time.

[0016] The historical traffic data is indexed based on the business rules and stored in the distributed database in the form of a ring queue.

[0017] In an optional implementation manner, the method further includes:

[0018] The performance index of the business corresponding to the backtest task is determined according to the backtest result and the backtest traffic data set.

[0019] In an optional implementation manner, the method further includes:

[0020] Obtaining stability information of the backtest task according to the backtest result of the backtest task for the backtest object within a preset time period;

[0021] Outputs stability information for the backtest task.

[0022] In an optional implementation manner, the method further includes:

[0023] When it is detected that the business performance of the backtest task represented by the stability information of the backtest task changes, an alarm message is generated; the alarm message is used to prompt that the business performance of the backtest task changes;

[0024] In response to a user's operation on the editor interface of the backtesting task based on the warning information, a parameter and / or structure of the backtesting task is adjusted.

[0025] In an optional implementation manner, the method further includes:

[0026] The backtest data obtained by replaying the backtest traffic data set to the backtest object is obtained and stored to form a backtest record log.

[0027] In an optional implementation manner, the method further includes:

[0028] According to the backtesting results of the backtesting task under different versions, the structure and parameters of the backtesting task are adjusted.

[0029] In a second aspect, the present application provides a flow backtesting device, comprising:

[0030] A response module is used to respond to a backtesting task for a backtesting object, based on a preset data processing method and a business rule associated with the backtesting task, to obtain a backtesting traffic data set of the backtesting object specified by the backtesting task from the historical traffic data of the backtesting object stored in a distributed database; the historical traffic data set includes at least one of a business request timestamp, a business request type, a business request parameter, and a business response result.

[0031] The playback module is used to obtain the backtest result obtained by playing back the backtest traffic data set to the backtest object.

[0032] An output module is used to output the backtest result.

[0033] In a third aspect, the present application provides a flow backtesting device, comprising: a processor, and a memory communicatively connected to the processor;

[0034] The memory stores computer-executable instructions;

[0035] The processor executes the computer-executable instructions stored in the memory to implement the method described in the first aspect.

[0036] In a fourth aspect, the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions, and when the computer-executable instructions are executed by a processor, they are used to implement the method described in the first aspect.

[0037] In a fifth aspect, the present application provides a computer program product, including a computer program, which implements the steps of the method described in the first aspect when executed by a processor.

[0038] The traffic backtesting method or device provided by the present application stores the historical traffic data of the backtesting object in a distributed database. It should be understood that a distributed database stores data in a traditional storage architecture in a dispersed manner on multiple data storage nodes connected via a network to obtain a larger storage capacity and a higher concurrent access volume. Therefore, it can solve the current problems of capacity bottleneck and poor scalability in data storage. In addition, the present application stores historical traffic data in a distributed database, which can improve the performance of the present application in processing high-concurrency queries and large-scale data updates.

[0039] Furthermore, the present application adopts a stream processing method and / or a batch processing method to obtain the backtest traffic data set of the backtest object specified by the backtest task from the historical traffic data of the backtest object stored in the distributed database. It should be understood that the stream processing method is a method of real-time processing of data, and the data will be continuously generated and processed in the form of a stream. And the stream processing method can quickly respond to changes in data and perform data processing and analysis in a timely manner. The batch processing method is a method of offline processing of data, and the data will be batch processed according to a certain time interval or data volume, and batch processing can efficiently process and analyze large amounts of data. Therefore, the present application adopts a stream processing method and / or a batch processing method to achieve efficient cleaning, conversion and feature extraction of real-time traffic data and batch traffic data to adapt to different business needs and improve the ability to pre-process traffic data. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0041] Figure 1 An application scenario diagram of a flow backtesting method provided in an embodiment of the present application;

[0042] Figure 2 A flow chart of a flow backtesting method provided in an embodiment of the present application;

[0043] Figure 3 A structural diagram of a flow backtesting device provided in an embodiment of the present application;

[0044] Figure 4 A schematic diagram of the structure of a flow backtesting device provided in an embodiment of the present application.

[0045] The above drawings have shown clear embodiments of the present application, which will be described in more detail later. These drawings and text descriptions are not intended to limit the scope of the present application in any way, but to illustrate the concept of the present application to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION

[0046] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.

[0047] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those generally understood by those skilled in the art to which the present application belongs. The terms used herein in the specification of the present application are only for the purpose of describing specific embodiments and are not intended to limit the present application. It is understood that the terms "first", "second", etc. used in the present application can be used to describe various information or data in this article, but these elements are not limited by these terms. These terms are only used to distinguish the first information from another information. For example, without departing from the scope of the present application, the first action information can be referred to as the second action information, and similarly, the second action information can be referred to as the first action information. Both the first action information and the second action information are action information, but they are not the same action information.

[0048] First, the terms involved in this application are explained:

[0049] Traffic playback: It is a technology that simulates network requests or service calls based on traffic requests recorded from real scenarios in storage media. It is mainly used in scenarios such as testing, debugging, performance analysis, and troubleshooting.

[0050] Traffic data: usually refers to the amount of data transmitted on the network, which is measured in bits or bytes.

[0051] Distributed database: refers to the use of high-speed computer networks to connect multiple physically dispersed data storage units to form a logically unified database.

[0052] Stream processing method: a method of processing data in real time, in which data is continuously generated and processed in the form of streams.

[0053] Batch processing: offline processing of data, where data is processed in batches at certain time intervals or data volumes.

[0054] When users browse the web, use applications, or conduct online transactions, there is a lot of network traffic transmitted behind the scenes. This traffic contains various requests and responses and is an important part of the normal operation of the application. Traffic replay technology is to resend these actual network traffic to the system or application to simulate the operations and situations in the real environment.

[0055] Traffic replay is a testing technique that simulates the network traffic in the actual production environment and resends it to the system or application. Through traffic replay, the network traffic in a specific time period can be reproduced to evaluate the performance, stability and reliability of the system under different loads and conditions.

[0056] At present, in traffic playback, it is often necessary to manage massive amounts of traffic data. Traditional storage architectures have capacity bottlenecks and poor scalability, especially when processing high-concurrency queries and large-scale data updates. In addition, the existing pre-processing process for traffic data required for traffic playback is inefficient and cannot quickly respond to changing data sources.

[0057] In view of the above problems, the present application proposes the following technical ideas: In view of the capacity bottleneck and poor scalability of the traditional storage architecture in traffic replay, the data storage and retrieval performance problems are solved by horizontal expansion. In view of the inefficiency of the existing preprocessing process of the traffic data required for traffic replay and the inability to quickly respond to the changing data source, a new processing framework is constructed to achieve efficient cleaning, conversion and feature extraction of real-time and batch data to meet different traffic replay business needs. The traffic backtesting method provided in the present application can be used for performance testing, stress testing, security testing and functional testing. During performance testing, the method is used to evaluate the performance indicators of the system under normal load, such as throughput, response time, etc. In stress testing, the method is used to simulate traffic under high load conditions to test the performance and stability of the system under pressure. In security testing, the method is used to simulate traffic under malicious attacks or abnormal conditions to evaluate the defense capabilities of the tested system against security threats. In functional testing, the method is used to verify whether the system correctly handles various types of requests and responses.

[0058] The flow backtesting method provided in the embodiment of the present application may be executed by a flow backtesting device, and the flow backtesting device may be implemented in the form of hardware and / or software.

[0059] Figure 1 An application scenario diagram of a flow backtesting method provided by an embodiment is shown, such as Figure 1As shown, in this application, a traffic backtesting device is used to capture the traffic data generated by the network device, and the captured traffic data is analyzed and simulated. The traffic backtesting device is also used to process the traffic data according to the business rules associated with the backtesting task, and then send the backtesting task to the backtesting object. Among them, the business rules can be edited and sent by the user, or they can be pre-stored in the traffic backtesting system.

[0060] Optionally, the traffic backtesting device captures the traffic data generated by the network device, and analyzes and simulates the captured traffic data, including parsing and reconstruction of various network protocols such as HTTP(S), TCP / IP, WebSocket, etc., so as to accurately send requests as the traffic data is. On this basis, the traffic backtesting device provided in this embodiment also adopts a highly modular architecture, microservice or plug-in approach to ensure that each module can be independently upgraded and expanded, and it is necessary to ensure that the newly added functions do not affect the stability of the original traffic backtesting device.

[0061] The technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems are described in detail below with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below in conjunction with the accompanying drawings.

[0062] Figure 2 1 is a flow chart of a flow backtesting method provided according to an embodiment of the present application. Figure 2 As shown, the method comprises the following steps:

[0063] S101, in response to a backtesting task for a backtesting object, based on a preset data processing method and business rules associated with the backtesting task, a backtesting traffic data set of the backtesting object specified by the backtesting task is obtained from the historical traffic data of the backtesting object stored in a distributed database.

[0064] In this embodiment, the backtest object may include a system, program or other object that needs to be backtested. The backtest task may include performance testing, stress testing, security testing, and functional testing.

[0065] For example, when a new function is launched on the server side, the backtesting task can be to verify the reliability of the new function on the server side. For another example, when a new version is updated on the user side, the backtesting task can be to verify the feasibility of the version on the user side.

[0066] The preset data processing method provided in the embodiment of the present application includes a stream processing method and / or a batch processing method, so as to realize efficient preprocessing of real-time data and batch data in real-time or near real-time scenarios, which can be applied to different business needs.

[0067] For example, when the scale of traffic data is large, batch processing can be used to achieve rapid processing of traffic data. For another example, when traffic data is data that requires a quick response, it is necessary to process and analyze the traffic data in a timely manner, and stream processing can be used. For another example, when traffic data meets both of the above requirements, stream processing and batch processing can be used.

[0068] In this embodiment, the historical traffic data includes at least one of a service request timestamp, a service request type, a service request parameter, and a service response result.

[0069] Optionally, this embodiment determines the historical traffic data according to the requirements of the backtest task. For example, when the requirement of the backtest task is to perform a performance test on the system, the historical traffic data may include a service request type, service request parameters, and service response results.

[0070] In this embodiment, the backtesting task is also associated with a business rule, which is used to obtain the required backtesting traffic data set from the historical traffic data according to the backtesting task.

[0071] Based on the above description, this embodiment can associate different business rules with backtest tasks corresponding to different backtest objects to obtain the historical traffic data required by the backtest object, thereby forming a backtest traffic data set. In addition, in the process of obtaining the backtest traffic data set, a stream processing method and / or a batch processing method are adopted to achieve efficient cleaning, conversion and feature extraction of real-time traffic data and batch traffic data to adapt to different business needs and improve the ability to pre-process traffic data.

[0072] S102, obtaining a backtest result obtained by replaying the backtest traffic data set to the backtest object.

[0073] In this embodiment, the backtest traffic data set is played back into the backtest object, and the relevant functions of the backtest object can be verified, and the performance and stability of the backtest object can also be tested.

[0074] For example, if the backtest traffic data set is obtained by preprocessing the historical traffic data generated in a food ordering system, then the backtest object is the food ordering system, and the backtest task is to verify the food ordering function in the food ordering system. First, the backtest traffic data set is replayed into the food ordering system to obtain the traffic data generated by the food ordering system, and the backtest result is obtained through the traffic data. The backtest result is used to characterize whether the data output of the food ordering system during the food ordering operation matches the data input, so as to verify the food ordering function in the food ordering system.

[0075] For another example, if the backtest traffic data set is obtained by preprocessing the historical traffic data generated in a banking system, the backtest object is the banking system, and the backtest task can be to verify the newly launched statistical deposit function of the banking system. The obtained backtest traffic data set is replayed into the banking system, and the backtest result is used to characterize whether the banking system's function of statistical deposits can return correct statistical data, so as to verify the newly launched statistical deposit function of the banking system.

[0076] Furthermore, since the present application stores traffic data in a distributed system, the multi-node parallel processing capability of the distributed system can be utilized to perform parallel playback of the stored data, thereby improving data storage and retrieval performance through horizontal expansion.

[0077] Optionally, this embodiment can decompose the backtesting task into small tasks that can be executed independently based on the parallel computing model of multi-core CPUs, and execute them in parallel on multiple processor cores, thereby greatly improving the backtesting speed. In addition, this embodiment also introduces advanced memory management and data structure design, such as ring queues or other cache optimization technologies, to reduce unnecessary data duplication and improve the efficiency of data transmission between cores.

[0078] Based on the above description, this embodiment replays the backtest traffic data set to the backtest object to obtain the backtest result, which can verify the functions required by the backtest object.

[0079] S103, output backtesting results.

[0080] In this embodiment, the backtest results can be displayed to the user in a visual manner so that the user can view them. For example, the backtest results are displayed to the user in a report chart, and the user can quickly understand the historical data of the backtest object based on the report chart. For another example, the backtest results are displayed to the user in a graphical manner so that the user can quickly understand the performance indicators of the backtest object.

[0081] Based on the above description, this embodiment stores the historical traffic data of the backtest object in a distributed database. It should be understood that a distributed database is a traditional storage architecture that stores data in a dispersed manner on multiple data storage nodes connected by a network to obtain a larger storage capacity and a higher concurrent access volume. Therefore, it can solve the current problems of capacity bottleneck and poor scalability in data storage. In addition, this application stores historical traffic data in a distributed database, which can improve the performance of this application in processing high-concurrency queries and large-scale data updates.

[0082] Furthermore, the present embodiment adopts a stream processing method and / or a batch processing method to obtain the backtest traffic data set of the backtest object specified by the backtest task from the historical traffic data of the backtest object stored in the distributed database. It should be understood that the stream processing method is a method of real-time processing of data, and the data will be continuously generated and processed in the form of a stream. And the stream processing method can quickly respond to changes in data and perform data processing and analysis in a timely manner. The batch processing method is a method of offline processing of data, and the data will be batch processed according to a certain time interval or data volume, and batch processing can efficiently process and analyze a large amount of data. Therefore, the present embodiment adopts a stream processing method and / or a batch processing method to achieve efficient cleaning, conversion and feature extraction of real-time traffic data and batch traffic data to adapt to different business needs and improve the ability to pre-process traffic data.

[0083] In the embodiment of the present application, the above business rules are used to filter the historical traffic data. The following is a detailed description of the business rules and how to use the business rules to filter the historical traffic data:

[0084] The above business rules include data screening conditions associated with the backtesting task. Based on this, the above step S101 may include:

[0085] Step a1, using the data screening conditions associated with the backtesting task, screen the historical traffic data of the backtesting object stored in the distributed database to obtain the backtesting traffic data set of the backtesting object specified by the backtesting task.

[0086] The data screening conditions include a time range for data screening, at least one of a business line, a user group of the business, and a business attribute.

[0087] For example, when the backtesting task is regression testing, the data screening conditions include the time range of data screening, business line and business attributes.

[0088] For another example, when the backtesting task is data analysis, the data screening conditions include the time range of data screening, business lines, business user groups, and business attributes.

[0089] It is worth noting that business rules can be edited using a rule editor, and when editing, it supports multi-level nesting and parallel execution logic to improve the efficiency of obtaining backtest data sets. Among them, business rules can be simple if-then judgment statements or complex combination rules involving linkage and feedback mechanisms of multiple business scenarios, so that this embodiment can be applied to more business scenarios.

[0090] Optionally, this embodiment also provides a visual or scripted rule writing method to facilitate users to intuitively understand and modify parameters and / or structures of business rules.

[0091] Furthermore, the above business rules also include data cleaning rules associated with the backtesting task. Based on this, the above step S101 may also include:

[0092] Step a2, using the data cleaning rules associated with the backtesting task to clean the backtesting traffic data set; the data cleaning rules include cleaned business fields and / or cleaned business noise.

[0093] By using data cleaning rules to clean the backtest traffic data set, unnecessary business fields and business noise data can be removed, thereby improving the accuracy of the screening of historical traffic data in this embodiment, thereby ensuring that the backtest data set can be correctly parsed and simulated in subsequent applications.

[0094] Usually, the cleaning rules can be set to the cleaned business fields and cleaned business noise to maximize the accuracy of the screening of historical traffic data. Of course, if the backtest task does not consider the impact of the business fields, the cleaning rules can also be set to clean business noise.

[0095] In some examples, the present application effectively stores and manages the traffic data continuously generated by the backtest object to avoid storage and management problems caused by the continuous accumulation of traffic data, including the following steps:

[0096] Step b1, collect historical traffic data of the backtest object in real time.

[0097] At present, API (Application Programming Interface) is mostly used to collect historical traffic data of backtest objects, but the current API interface may not be user-friendly enough, and the learning curve for new users is steep, which is not conducive to rapid development and iteration of strategies. In addition, the analysis tools built into the current API interface may not fully cover all types of strategies, and some complex statistical indicators may require additional code to implement.

[0098] Based on this, this embodiment provides an optimized API interface, which uses an easy-to-use SDK (Software Development Kit) and a visual programming interface, supports drag-and-drop component configuration strategy logic, and lowers the threshold for strategy development. In addition, this embodiment provides an optimized API interface design with a built-in performance analysis indicator library, supports convenient access to more customized indicators, and provides clear documentation and example tutorials to facilitate users to understand and use various risk measurement tools. Based on this, this embodiment can use the optimized API interface to capture more comprehensive and accurate historical traffic data.

[0099] It is worth noting that the optimized API interface in this embodiment is a unified and open API interface formulated according to industry standards, which is convenient for seamless connection with other systems in the future. At the same time, the optimized API interface needs to keep up with new technologies and protocols in order to upgrade compatibility in a timely manner.

[0100] Step b2: indexing the historical traffic data based on the business rules and storing the indexes in a distributed database in the form of a ring queue.

[0101] In this embodiment, the historical traffic data is indexed and stored, so that the required historical traffic data can be obtained according to the index in the subsequent steps. In this embodiment, the historical traffic data is indexed according to the business rules, and the business rules are associated with the backtesting task. Therefore, the backtesting traffic data set can be obtained based on the business rules for the backtesting task.

[0102] The present application stores the acquired historical traffic data in the form of a circular queue in a distributed database. It should be understood that a circular queue is a linear data structure, in which the tail of the queue is connected to the head of the queue to form a loop. Due to its characteristic of circularly utilizing space, the circular queue can effectively handle continuous traffic recording and playback tasks, while avoiding the performance loss caused by frequent allocation and release of memory. Therefore, the historical traffic data of this embodiment is stored in the form of a circular queue, which can efficiently store and manage the traffic data.

[0103] In some examples, after obtaining the backtest results, the backtest task can be further analyzed based on the backtest results to obtain more comprehensive and macro data, providing data support for the update and optimization of subsequent backtest tasks. For example, one or more of the following operations can be performed:

[0104] The first one: Based on the backtesting results, further obtain the performance indicators of the business.

[0105] The above steps may include: determining the performance indicator of the business corresponding to the backtest task according to the backtest result and the backtest traffic data set.

[0106] Among them, the above-mentioned performance indicators are used to characterize the various performances of the backtesting task, and may include at least one of the success rate, false alarm rate, missed alarm rate and response time.

[0107] It should be understood that the performance indicators of the business corresponding to the backtest task can be determined according to the needs of the user. For example, when the backtest task is a new function launch test of the system, the user is more concerned about the success rate and false alarm rate, so the performance indicators of the business corresponding to the backtest task can be set as the success rate and false alarm rate.

[0108] For another example, when the backtesting task is data analysis, the user is concerned about the success rate, false alarm rate, missed alarm rate and response time. The performance indicators of the business corresponding to the backtesting task can be set as success rate, false alarm rate, missed alarm rate and response time.

[0109] Based on the above description, this embodiment determines the performance index of the business corresponding to the backtest task according to the backtest result and the backtest traffic data set to help the user optimize the parameters and / or structure of the backtest task.

[0110] The second method: Based on the backtesting results, obtain the stability information of the backtesting task.

[0111] Optionally, the above steps include: obtaining stability information of the backtest task according to the backtest result of the backtest task for the backtest object within a preset time period. The preset time period may be one week or one month, which may be set according to user needs.

[0112] In this embodiment, the backtest task can be executed at least once within the preset time length. In a large number of cases, the backtest task is executed multiple times within the preset time length, and the multiple executions of the backtest task can be performed in different business scenarios. Based on this, this embodiment can obtain the execution results of the backtest task in different time periods and different business scenarios to test the stability of the backtest task in different time periods and different business scenarios.

[0113] In a specific embodiment, the backtesting task can be set to be executed periodically, and the backtesting results of the backtesting task within a period of time can be obtained, so as to test the stability of the backtesting task in different periods and different business scenarios.

[0114] The above steps may also include: outputting stability information of the backtest task.

[0115] In order to allow the user to more intuitively understand the stability of the backtest task, this embodiment outputs the stability information of the backtest task. The output method can be a visual method, for example, a chart is used to show the user the change process of the stability information of the backtest task within a preset time period.

[0116] Based on the above description, users can not only learn about the stability of the backtesting task based on the stability information of the backtesting task, so that users can understand whether the business performance of the backtesting task is stable, but also analyze the backtesting task based on the stability information of the backtesting task and provide data support.

[0117] Optionally, when the stability information represents that the business performance of the backtest task has changed, an alarm message is generated; the alarm message is used to prompt that the business performance of the backtest task has changed.

[0118] The alarm information in this embodiment can be set according to the degree of refinement required by the user. Not only the overall progress of the backtesting task is monitored, but also the specific details of the backtesting task operation should be paid attention to. Based on this, this embodiment can accurately identify whether the business performance of the backtesting task has changed.

[0119] After the alarm information is generated, the alarm information is sent to relevant personnel so that the relevant personnel can understand that the business performance of the backtest task has changed. In this embodiment, highly targeted alarm information can be sent to relevant personnel through multiple channels (email, SMS, in-application notification, etc.).

[0120] In some examples, when the service performance of the backtest task represented by the alarm information changes significantly and can no longer meet the needs of the user, this embodiment provides an operation that can adjust the parameters and / or structure of the backtest task to ensure the service performance of the backtest task. Optionally, the operation includes:

[0121] In response to the user's operation on the editor interface of the backtest task based on the warning information, the parameters and / or structure of the backtest task are adjusted. The editable interface allows the user to adjust the parameters and / or structure of the backtest task.

[0122] The user can operate the editor interface of the backtest task according to the reason why the business performance of the backtest task changes. For example, when the business performance of the backtest task changes due to inappropriate parameters of the backtest task, the user can adaptively adjust the parameters of the backtest task through the editor interface of the backtest task.

[0123] For another example, when the business performance of the backtesting task changes due to an inappropriate structure of the backtesting task, the user can adaptively adjust the structure of the backtesting task through the editor interface of the backtesting task.

[0124] Based on this, this example can provide a convenient way for users to adjust the backtesting task to ensure the business performance of the backtesting task.

[0125] In some examples, the present application can also optimize the backtesting task by combining the backtesting results of the backtesting task under different versions, so that the business performance of the backtesting task reaches a more ideal state. For example, the following operations can be performed:

[0126] According to the backtesting results of the backtesting task under different versions, the structure and / or parameters of the backtesting task are adjusted.

[0127] In this embodiment, compared with other versions of the backtest task, the current version of the backtest task may add, delete, and modify the nodes of the task. It should be understood that this is just an example, and compared with other versions, the current version of the backtest task may also have parameters or other structures changed, and this embodiment does not make specific limitations on this.

[0128] Optionally, after obtaining the backtest results corresponding to the backtest tasks of different versions, this embodiment compares the multiple backtest results, and determines the better or optimal parameters and / or the optimal structure of the backtest task according to the backtest results corresponding to the backtest tasks of each version. After comparing the parameters and / or the structure of the current version of the backtest task with the optimal parameters and / or the optimal structure of the backtest task, the structure and parameters of the backtest task of the current version are adjusted to optimize the backtest task so that the performance of the backtest task reaches a more ideal state.

[0129] In some examples, the present application records and manages all traffic data generated during the traffic playback process of the backtest task, so as to use these data to trace the relevant parameters of the backtest task. Optionally, the above scheme includes the following steps:

[0130] The backtest data obtained by replaying the backtest traffic data set to the backtest object is obtained and stored to form a backtest record log.

[0131] Obtain all backtest data obtained by replaying the backtest traffic data set to the backtest object. These data at least include the backtest data required to obtain the backtest result, and may also include intermediate data or call data generated when generating the backtest data required for the backtest result. Store these data in the form of a circular queue in a distributed database to form a backtest record log.

[0132] The backtesting log can help users understand the specific execution data of the backtesting task in the subsequent application process, so that users can understand how the backtesting task is run and how the performance indicators are determined, and help users optimize the backtesting task.

[0133] Reference Figure 3 , the embodiment of the present application provides a flow backtesting device, including:

[0134] The response module 301 is used to respond to the backtest task for the backtest object, based on the preset data processing method and the business rules associated with the backtest task, obtain the backtest traffic data set of the backtest object specified by the backtest task from the historical traffic data of the backtest object stored in the distributed database; the historical traffic data set includes at least one of the business request timestamp, business request type, business request parameters, and business response results.

[0135] The replay module 302 is used to obtain the backtest result obtained by replaying the backtest traffic data set to the backtest object.

[0136] The output module 303 is used to output the backtest result.

[0137] In an optional implementation, the business rules include data screening conditions associated with the backtesting task.

[0138] The response module 301 is also used to use the data screening conditions associated with the backtesting task to screen the historical traffic data of the backtesting object stored in the distributed database to obtain the backtesting traffic data set of the backtesting object specified by the backtesting task; the data screening conditions include the time range of data screening, at least one of the business line, the user group of the business, and the business attribute.

[0139] In an optional implementation, the business rules also include data cleaning rules associated with the backtesting task.

[0140] The response module 301 is further used to perform data cleaning on the backtest traffic data set using the data cleaning rules associated with the backtest task; the data cleaning rules include cleaned business fields and / or cleaned business noises.

[0141] In an optional implementation, the response module 301 is further configured to collect historical traffic data of the backtest object in real time, index the historical traffic data based on the business rules, and store the indexes in the distributed database in the form of a circular queue.

[0142] In an optional implementation, the response module 301 is further configured to determine a performance indicator of the business corresponding to the backtest task according to the backtest result and the backtest traffic data set.

[0143] In an optional implementation, the response module 301 is further configured to obtain stability information of the backtest task according to the backtest result of the backtest task for the backtest object within a preset time period; and output the stability information of the backtest task.

[0144] In an optional implementation, the response module 301 is further used to generate an alarm message when it is detected that the business performance of the backtest task represented by the stability information of the backtest task has changed; the alarm message is used to prompt that the business performance of the backtest task has changed.

[0145] The response module 301 is further configured to adjust the parameters and / or structure of the backtest task in response to the user's operation on the editor interface of the backtest task based on the warning information.

[0146] In an optional implementation, the response module 301 is further configured to obtain and store the backtest data obtained by replaying the backtest traffic data set to the backtest object to form a backtest record log.

[0147] In an optional implementation, the response module 301 is further configured to adjust the structure and parameters of the backtesting task according to the backtesting results of the backtesting task in different versions.

[0148] Based on this, the above-mentioned traffic backtesting device adopts distributed storage and computing technology, parallel computing models and modular architecture design to achieve efficient processing of massive historical data, high-performance backtesting model construction, real-condition simulation, flexible strategy management and real-time monitoring and early warning functions, and ensures that the traffic backtesting equipment is highly scalable and compatible to adapt to future business development needs.

[0149] It should be understood that other beneficial effects of the flow backtesting device are the same as the beneficial effects of the flow backtesting method and will not be described in detail here.

[0150] Thirdly, Figure 4 This is a schematic diagram of the structure of the flow backtesting device provided in the embodiment of the present application. Figure 4 As shown, the traffic backtesting device may include: a transceiver 121 , a processor 122 , and a memory 123 .

[0151] The processor 122 executes the computer execution instructions stored in the memory, so that the processor 122 executes the scheme in the above embodiment. The processor 122 can be a general-purpose processor, including a central processing unit CPU, a network processor (network processor, NP), etc.; it can also be a digital signal processor DSP, an application-specific integrated circuit ASIC, a field programmable gate array FPGA or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components.

[0152] The memory 123 is connected to the processor 122 via a system bus and completes communication between them. The memory 123 is used to store computer program instructions.

[0153] The transceiver 121 may be used to obtain tasks to be executed and configuration information of the tasks to be executed.

[0154] The system bus can be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus, etc. The system bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus. The transceiver is used to realize the communication between the database access device and other computers (such as clients, read-write libraries, and read-only libraries). The memory may include random access memory (RAM) and may also include non-volatile memory.

[0155] The traffic backtesting device provided in the embodiment of the present application may be the terminal device of the above embodiment.

[0156] An embodiment of the present application also provides a chip for running instructions, which is used to execute the technical solution based on the traffic backtesting method in the above embodiment.

[0157] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium, in which computer instructions are stored. When the computer instructions are executed on a computer, the computer executes the technical solution based on the traffic backtesting method of the above embodiment.

[0158] In a fifth aspect, an embodiment of the present application further provides a computer program product, which includes a computer program stored in a computer-readable storage medium. At least one processor can read the computer program from the computer-readable storage medium. When at least one processor executes the computer program, the technical solution based on the traffic backtesting method in the above embodiment can be implemented.

[0159] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of modules is only a logical function division, and there may be other division methods in actual implementation, such as multiple modules can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or modules, which can be electrical, mechanical or other forms.

[0160] The modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to implement the solution of this embodiment.

[0161] In addition, each functional module in each embodiment of the present application can be integrated into one processing unit, or each module can exist physically separately, or two or more modules can be integrated into one unit. The above-mentioned module-composed unit can be implemented in the form of hardware or in the form of hardware plus software functional units.

[0162] The above-mentioned integrated module implemented in the form of a software function module can be stored in a computer-readable storage medium. The above-mentioned software function module is stored in a storage medium, including a number of instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor to perform some steps of the methods of various embodiments of the present application.

[0163] It should be understood that the processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), etc. A general-purpose processor may be a microprocessor or any conventional processor. The steps of the method disclosed in the invention may be directly implemented as being executed by a hardware processor, or may be implemented by a combination of hardware and software modules in the processor.

[0164] The memory may include a high-speed RAM memory, and may also include a non-volatile storage NVM, such as at least one disk memory, and may also be a USB flash drive, a mobile hard disk, a read-only memory, a magnetic disk or an optical disk, etc.

[0165] The bus may be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, the bus in the drawings of the present application is not limited to only one bus or one type of bus.

[0166] The above storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk. The storage medium can be any available medium that can be accessed by a general or special purpose computer.

[0167] An exemplary storage medium is coupled to a processor so that the processor can read information from the storage medium and write information to the storage medium. Of course, the storage medium can also be a component of the processor. The processor and the storage medium can be located in an application specific integrated circuit (ASIC). Of course, the processor and the storage medium can also exist as discrete components in an electronic control unit or a main control device.

[0168] Those skilled in the art can understand that all or part of the steps of implementing the above-mentioned method embodiments can be completed by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, the steps of the above-mentioned method embodiments are executed; and the aforementioned storage medium includes: ROM, RAM, disk or optical disk and other media that can store program codes.

[0169] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present application.

Claims

1. A flow backtesting method, It is characterized in that The method comprises: In response to a backtesting task for a backtesting object, based on a preset data processing method and a business rule associated with the backtesting task, a backtesting traffic data set of the backtesting object specified by the backtesting task is obtained from the historical traffic data of the backtesting object stored in a distributed database; wherein the preset data processing method includes a stream processing method and / or a batch processing method, and the historical traffic data includes at least one of a business request timestamp, a business request type, a business request parameter, and a business response result; Obtaining a backtest result obtained by replaying the backtest traffic data set to the backtest object; Output the backtest result.

2. The flow backtesting method according to claim 1, It is characterized in that The business rules include data screening conditions associated with the backtesting task; The step of obtaining a backtest traffic data set of the backtest object specified by the backtest task from the historical traffic data of the backtest object stored in a distributed database based on the business rules associated with the backtest task includes: The historical traffic data of the backtest object stored in the distributed database is filtered by using the data filtering conditions associated with the backtest task to obtain the backtest traffic data set of the backtest object specified by the backtest task; the data filtering conditions include the time range of data filtering, at least one of the business line, the user group of the business, and the business attribute.

3. The flow backtesting method according to claim 2, It is characterized in that The business rules also include data cleaning rules associated with the backtesting task; the method also includes: The backtest traffic data set is cleaned using the data cleaning rules associated with the backtest task; the data cleaning rules include cleaned business fields and / or cleaned business noises.

4. The flow backtesting method according to claim 1, It is characterized in that The method further comprises: Collect historical traffic data of the backtest object in real time; The historical traffic data is indexed based on the business rules and stored in the distributed database in the form of a ring queue.

5. The flow backtesting method according to any one of claims 1 to 4, It is characterized in that The method further comprises: The performance index of the business corresponding to the backtest task is determined according to the backtest result and the backtest traffic data set.

6. The flow backtesting method according to any one of claims 1 to 4, It is characterized in that The method further comprises: Obtaining stability information of the backtest task according to the backtest result of the backtest task for the backtest object within a preset time period; Outputs stability information for the backtest task.

7. The flow backtesting method according to claim 6, It is characterized in that The method further comprises: When it is detected that the business performance of the backtest task represented by the stability information of the backtest task changes, an alarm message is generated; the alarm message is used to prompt that the business performance of the backtest task changes; In response to a user's operation on the editor interface of the backtesting task based on the warning information, a parameter and / or structure of the backtesting task is adjusted.

8. The flow backtesting method according to any one of claims 1 to 4, It is characterized in that The method further comprises: The backtest data obtained by replaying the backtest traffic data set to the backtest object is obtained and stored to form a backtest record log.

9. The flow backtesting method according to any one of claims 1 to 4, It is characterized in that The method further comprises: According to the backtesting results of the backtesting task under different versions, the structure and / or parameters of the backtesting task are adjusted.

10. A flow backtesting device, It is characterized in that include: A response module, configured to respond to a backtest task for a backtest object, and based on a preset data processing method and a business rule associated with the backtest task, obtain a backtest traffic data set of the backtest object specified by the backtest task from the historical traffic data of the backtest object stored in a distributed database; the historical traffic data set includes at least one of a business request timestamp, a business request type, a business request parameter, and a business response result; A playback module, used to obtain a backtest result obtained by playing back the backtest traffic data set to the backtest object; An output module is used to output the backtest result.

11. A flow backtesting device, It is characterized in that include: A processor, and a memory communicatively connected to the processor; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory to implement the method according to any one of claims 1 to 9.

12. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores computer-executable instructions, which are used to implement the method according to any one of claims 1 to 9 when executed by a processor.

13. A computer program product, It is characterized in that The invention comprises a computer program, which, when executed by a processor, implements the steps of the method according to any one of claims 1 to 9.

Citation Information

Cited By

  • Data playback method and device and storage medium

    CN119788931A