Traffic playback method, apparatus, device, and storage medium

By marking and splitting the target traffic, calculating the playback time points, and performing load balancing, the high concurrency and low efficiency problems of traffic recording and playback in distributed architecture are solved, achieving high-precision traffic playback results.

CN116708306BActive Publication Date: 2026-05-19INDUSTRIAL AND COMMERCIAL BANK OF CHINA
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
INDUSTRIAL AND COMMERCIAL BANK OF CHINA
Filing Date
2023-06-13
Publication Date
2026-05-19

AI Technical Summary

Technical Problem

In a distributed architecture, traffic recording and playback suffers from problems such as high concurrency, low playback efficiency, and low playback time accuracy.

Method used

By acquiring target traffic, marking and recording it, splitting it into multiple target sub-traffic, calculating the replay time node for each sub-traffic, and performing load balancing distribution and replay, timing consistency is ensured.

Benefits of technology

It achieves high-precision traffic replay, solves the problem of splitting and replaying in high-concurrency scenarios, and improves the performance and timing consistency of the replay system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116708306B_ABST
    Figure CN116708306B_ABST
Patent Text Reader

Abstract

The present disclosure provides a traffic playback method and device, equipment and storage medium, which can be applied to the fields of distributed technology and financial technology. The method comprises the following steps: obtaining target traffic, wherein the target traffic is obtained by marking and recording the to-be-recorded traffic; splitting the target traffic transmitted to the database to obtain at least one target sub-traffic; calculating a target playback time node corresponding to each target sub-traffic; and playing back each target sub-traffic according to the target playback time node corresponding to the target sub-traffic.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the fields of distributed technology and financial technology, and in particular to a method, apparatus, device, medium and program product for traffic replay. Background Technology

[0002] With the rapid development of internet finance, financial products and service models are constantly innovating, making it difficult for traditional monolithic IT (Internet Technology) architectures to maintain the rapid development of the financial industry. As a result, financial information systems are transforming towards distributed architectures.

[0003] However, related technologies for traffic recording and playback in distributed architectures suffer from problems such as high concurrency, low playback efficiency, and low playback time accuracy. Therefore, how to achieve high-precision traffic playback is a technical problem that needs to be solved in related technologies. Summary of the Invention

[0004] In view of the above problems, this disclosure provides a method, apparatus, device, medium and program product for playback of traffic.

[0005] According to a first aspect of this disclosure, a traffic replay method is provided, comprising:

[0006] Obtain the target traffic, where the target traffic represents the traffic to be recorded obtained by performing marking and recording operations;

[0007] The target traffic transmitted to the database is split into at least one target sub-traffic.

[0008] The target playback time node corresponding to each of the above target sub-flows is calculated;

[0009] Each of the above target sub-traffic flows will be replayed according to the target replay time node corresponding to the above target sub-traffic flow.

[0010] According to embodiments of this disclosure, the target traffic includes at least one identification information corresponding to the acquisition address.

[0011] According to embodiments of this disclosure, the aforementioned target traffic transmitted to the database is split to obtain at least one target sub-traffic, including:

[0012] Based on the identification information in the target traffic, the target traffic is split according to the identification information to obtain at least one target sub-traffic, wherein the number of target sub-traffic is the same as the number of identification information, and the target sub-traffic includes identification information corresponding to the target sub-traffic.

[0013] According to embodiments of this disclosure, the above-described traffic replay method further includes:

[0014] Before calculating the target playback time node corresponding to each of the above target sub-traffic flows, load balancing is performed on the at least one target sub-traffic flow to obtain at least one sub-task corresponding to each first target node, wherein the sub-task includes the identification information corresponding to the target sub-traffic flow; and

[0015] For each of the above-mentioned subtasks corresponding to each of the above-mentioned first target nodes, the target sub-traffic corresponding to the above-mentioned identification information in the above-mentioned subtask is obtained from the above-mentioned database using the above-mentioned first target node, thereby obtaining at least one target sub-traffic corresponding to each of the above-mentioned first target nodes.

[0016] According to embodiments of this disclosure, the above calculation of the target playback time node corresponding to each of the above target sub-traffic flows includes:

[0017] For each of the aforementioned target sub-traffic corresponding to each of the aforementioned first target nodes, obtain the recording time node corresponding to the aforementioned target sub-traffic and the recording time node corresponding to the aforementioned target traffic from the aforementioned target sub-traffic; and

[0018] Based on the recording time node corresponding to the target sub-traffic, the recording time node corresponding to the target traffic, and the playback time node corresponding to the target traffic, the target playback time node corresponding to the target sub-traffic is calculated.

[0019] According to embodiments of this disclosure, the above-described traffic replay method further includes:

[0020] Each of the aforementioned target sub-traffic items, calculated at the aforementioned target playback time points, is stored in the target cluster in real time.

[0021] According to embodiments of this disclosure, the above-mentioned playback of each target sub-traffic according to the target playback time node corresponding to the target sub-traffic includes:

[0022] The load balancing distribution of each of the target sub-traffic items stored in the target cluster in real time is performed to obtain at least one target sub-traffic item corresponding to each second target node.

[0023] For each of the above second target nodes, each of the above target sub-traffic corresponding to the above second target node is stored in the above second target node according to the corresponding above target playback time node, so as to obtain the time sequence queue corresponding to the above second target node;

[0024] Based on the time-series queue corresponding to each of the second target nodes, each target sub-traffic is replayed according to the corresponding target replay time node.

[0025] A second aspect of this disclosure provides a traffic playback apparatus, comprising: an acquisition module, a splitting module, a calculation module, and a playback module. The acquisition module is used to acquire target traffic, wherein the target traffic represents traffic obtained by performing marking and recording operations on traffic to be recorded. The splitting module is used to split the target traffic transmitted to a database to obtain at least one target sub-traffic. The calculation module is used to calculate a target playback time node corresponding to each of the target sub-traffic. The playback module is used to play back each of the target sub-traffic according to the target playback time node corresponding to the target sub-traffic.

[0026] A third aspect of this disclosure provides an electronic device comprising: one or more processors; and a memory for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors perform the methods described above.

[0027] A fourth aspect of this disclosure also provides a computer-readable storage medium having executable instructions stored thereon, which, when executed by a processor, cause the processor to perform the methods described above.

[0028] The fifth aspect of this disclosure also provides a computer program product, including a computer program that, when executed by a processor, implements the above-described method.

[0029] According to the traffic replay method, apparatus, device, medium, and program products provided in this disclosure, based on the identification information added to the target traffic by the tagging operation, the target traffic transmitted to the database can be split into at least one target sub-traffic, which can solve the problem of high-concurrency traffic splitting from the source. The target replay time node corresponding to each target sub-traffic can be calculated so that each target sub-traffic can be replayed according to the target replay time node corresponding to the target sub-traffic, so that the replay traffic achieves time sequence consistency. Attached Figure Description

[0030] The foregoing contents, as well as other objects, features, and advantages of this disclosure, will become clearer from the following description of embodiments with reference to the accompanying drawings, in which:

[0031] Figure 1 This diagram illustrates an application scenario of the traffic replay method according to an embodiment of the present disclosure.

[0032] Figure 2 A flowchart illustrating a traffic replay method according to an embodiment of the present disclosure is shown schematically.

[0033] Figure 3 This diagram schematically illustrates a system architecture for implementing a traffic replay method according to an embodiment of the present disclosure.

[0034] Figure 4 A schematic block diagram of a flow playback device according to an embodiment of the present disclosure is shown; and

[0035] Figure 5 A block diagram schematically illustrates an electronic device suitable for implementing a traffic playback method according to an embodiment of the present disclosure. Detailed Implementation

[0036] The embodiments of the present disclosure will now be described with reference to the accompanying drawings. However, it should be understood that these descriptions are exemplary only and are not intended to limit the scope of the disclosure. In the following detailed description, numerous specific details are set forth to provide a thorough understanding of the embodiments of the present disclosure for ease of explanation. However, it will be apparent that one or more embodiments may be practiced without these specific details. Furthermore, descriptions of well-known structures and techniques are omitted in the following description to avoid unnecessarily obscuring the concepts of the present disclosure.

[0037] The terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit this disclosure. The terms “comprising,” “including,” etc., as used herein indicate the presence of the stated features, steps, operations, and / or components, but do not exclude the presence or addition of one or more other features, steps, operations, or components.

[0038] All terms used herein (including technical and scientific terms) have the meanings commonly understood by those skilled in the art, unless otherwise defined. It should be noted that the terms used herein are to be interpreted in a manner consistent with the context of this specification, and not in an idealized or overly rigid way.

[0039] When using expressions such as "at least one of A, B, and C", they should generally be interpreted in accordance with the meaning that is commonly understood by a person skilled in the art (e.g., "a system having at least one of A, B, and C" should include, but is not limited to, a system having A alone, a system having B alone, a system having C alone, a system having A and B, a system having A and C, a system having B and C, and / or a system having A, B, and C, etc.).

[0040] In the technical solutions disclosed herein, the collection, storage, use, processing, transmission, provision, disclosure, and application of data (including but not limited to user personal information) comply with the provisions of relevant laws and regulations, necessary confidentiality measures have been taken, and they do not violate public order and good morals.

[0041] In implementing this disclosure, it was discovered that to mitigate the impact of architectural complexity on the system, traffic replay is typically used to ensure system testing under complex architectures. Therefore, ensuring the accuracy of traffic replay is crucial; thus, achieving high-precision traffic replay is a technical problem that needs to be solved in related technologies.

[0042] Therefore, embodiments of this disclosure provide a traffic playback method, including: acquiring target traffic, wherein the target traffic represents the traffic to be recorded obtained by performing marking and recording operations; splitting the target traffic transmitted to a database to obtain at least one target sub-traffic; calculating the target playback time node corresponding to each target sub-traffic; and playing back each target sub-traffic according to the target playback time node corresponding to the target sub-traffic.

[0043] Figure 1 The diagram illustrates an application scenario of the traffic replay method according to an embodiment of the present disclosure.

[0044] like Figure 1 As shown, application scenario 100 according to this embodiment may include a first terminal device 101, a second terminal device 102, a third terminal device 103, a network 104, and a server 105. The network 104 serves as a medium for providing a communication link between the first terminal device 101, the second terminal device 102, the third terminal device 103, and the server 105. The network 104 may include various connection types, such as wired or wireless communication links, or fiber optic cables, etc.

[0045] Users can interact with server 105 via network 104 using at least one of the first terminal device 101, second terminal device 102, and third terminal device 103 to receive or send messages, etc. Various communication client applications can be installed on the first terminal device 101, second terminal device 102, and third terminal device 103, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social media platform software, etc. (for example only).

[0046] The first terminal device 101, the second terminal device 102, and the third terminal device 103 can be various electronic devices with displays and support web browsing, including but not limited to smartphones, tablets, laptops, and desktop computers.

[0047] Server 105 can be a server that provides various services, such as a backend management server that supports websites browsed by users using the first terminal device 101, the second terminal device 102, and the third terminal device 103 (this is just an example). The backend management server can analyze and process data such as received user requests, and feed back the processing results (such as web pages, information, or data obtained or generated according to user requests) to the terminal devices.

[0048] For example, the target traffic can be obtained through server 105. The target traffic represents the traffic to be recorded after marking and recording operations. The target traffic transmitted to the database is split to obtain at least one target sub-traffic. The target playback time node corresponding to each target sub-traffic is calculated, so that each target sub-traffic can be played back according to the target playback time node corresponding to the target sub-traffic.

[0049] It should be noted that the traffic replay method provided in this embodiment can generally be executed by server 105. Correspondingly, the traffic replay device provided in this embodiment can generally be located in server 105. The traffic replay method provided in this embodiment can also be executed by a server or server cluster that is different from server 105 and capable of communicating with the first terminal device 101, the second terminal device 102, the third terminal device 103, and / or server 105. Correspondingly, the traffic replay device provided in this embodiment can also be located in a server or server cluster that is different from server 105 and capable of communicating with the first terminal device 101, the second terminal device 102, the third terminal device 103, and / or server 105.

[0050] It should be understood that Figure 1 The number of terminal devices, networks, and servers shown is merely illustrative. Depending on implementation needs, any number of terminal devices, networks, and servers can be included.

[0051] The following will be based on Figure 1 The described scene, through Figures 2-3 The traffic replay method of the disclosed embodiments is described in detail.

[0052] Figure 2 A flowchart illustrating a traffic replay method according to an embodiment of the present disclosure is shown schematically.

[0053] like Figure 2 As shown, the method 200 includes operations S210 to S240.

[0054] In operation S210, acquire the target traffic.

[0055] According to embodiments of this disclosure, the target traffic can characterize the traffic to be recorded obtained by performing tagging and recording operations. Traffic to be recorded can be tagged according to different containers or hosts (i.e., different traffic sources) through traffic tagging, thereby distinguishing traffic from different containers or hosts.

[0056] For example, target traffic can be characterized as traffic generated by a task issued by an application, which may contain multiple containers or host machines (servers). Recording traffic can be characterized as the process of collecting information from the tasks issued by the application.

[0057] In operation S220, the target traffic transmitted to the database is split to obtain at least one target sub-traffic.

[0058] According to embodiments of this disclosure, target traffic transmitted to the database can be split according to the identification information added by the tagging operation to obtain target sub-traffic from different containers or hosts, thereby solving the problem of high-concurrency traffic splitting from the source.

[0059] In operation S230, the target playback time node corresponding to each target sub-flow is calculated.

[0060] According to embodiments of this disclosure, for each target sub-traffic, the target playback time node for each target sub-traffic can be calculated based on the recording time node corresponding to the target sub-traffic, the recording time node corresponding to the target traffic, and the playback time node corresponding to the target traffic.

[0061] In operation S240, each target sub-traffic is replayed according to the target replay time node corresponding to the target sub-traffic.

[0062] According to embodiments of this disclosure, based on the target playback time node corresponding to each target sub-traffic, the target sub-traffic can be played back according to the corresponding target playback time node, so that the playback traffic achieves timing consistency.

[0063] According to embodiments of this disclosure, based on the identification information added to the target traffic by the marking operation, the target traffic transmitted to the database can be split into at least one target sub-traffic, which can solve the problem of high-concurrency traffic splitting from the source. The target playback time node corresponding to each target sub-traffic can be calculated so that each target sub-traffic can be played back according to the target playback time node corresponding to the target sub-traffic, so that the playback traffic achieves timing consistency.

[0064] Figure 3 A schematic diagram illustrating a system architecture for implementing a traffic replay method according to an embodiment of the present disclosure is provided.

[0065] like Figure 3 As shown, the system architecture 300 for implementing the traffic replay method may include a user node cluster 310, a gateway node cluster 320, a database 330, a replay factory node cluster 340, a replay task allocation node 350, a Kafka (open-source stream processing platform) cluster 360 (target cluster), and a replay node cluster 370. The user node cluster 310 may include multiple user nodes, the gateway node cluster 320 may include multiple gateway nodes, the replay factory node cluster 340 may include multiple replay factory nodes (first target nodes), and the replay node cluster 370 may include multiple replay nodes (second target nodes).

[0066] According to embodiments of this disclosure, target traffic can be obtained by marking and recording traffic to be recorded through user nodes in user node cluster 310.

[0067] According to embodiments of this disclosure, user nodes in user node cluster 310 transmit target traffic to gateway nodes in gateway node cluster 320. That is, gateway node cluster 320 can perform the aforementioned operation S210, wherein load balancing for each target traffic item can refer to: determining the load capacity information of each gateway node; determining the quantity of target traffic corresponding to each gateway node based on the load capacity information of each gateway node; and transmitting the corresponding quantity of target traffic to the gateway nodes.

[0068] According to an embodiment of this disclosure, the gateway nodes in the gateway node cluster 320 can transmit and save (persist) the target traffic to the database 330, and the database 330 can perform the above-described operation S220.

[0069] According to embodiments of this disclosure, the replay task allocation node 350 can use RPC (Remote Procedure Call Protocol) service calls to distribute subtasks to the replay factory nodes in the replay factory node cluster 340. The purpose is to utilize the load balancing strategy of the Dubbo framework to evenly distribute subtasks, thereby improving the performance of the replay system by increasing the number of replay factory nodes in high-concurrency traffic scenarios. Specifically, the replay factory nodes can register as Dubbo services (an open-source distributed service framework) as service providers, and the replay task allocation node 350, as a consumer, distributes tasks via RPC service calls, and can use a round-robin load balancing method to distribute subtasks.

[0070] According to embodiments of this disclosure, the replay factory nodes in the replay factory node cluster 340 can perform the above-described operation S230. The replay nodes in the replay node cluster 370 can perform the above-described operation S240.

[0071] According to embodiments of this disclosure, a horizontally scalable, highly available time-series playback traffic recording and playback system can be built based on the system architecture 300 that implements the traffic playback method.

[0072] According to embodiments of this disclosure, the target traffic includes at least one identification information corresponding to the acquisition address.

[0073] According to embodiments of this disclosure, the target traffic may include at least one target sub-traffic. Each target sub-traffic may originate from a different source. Identification information corresponding to the target sub-traffic may be added to the target traffic to distinguish each target sub-traffic. The identification information may be in the form of a QR code, but is not limited thereto; it may also be in the form of a barcode or a numerical identifier.

[0074] According to embodiments of this disclosure, the address obtained may include, but is not limited to, the container address, and may also include the server address. Any address used to characterize the source of the target traffic is acceptable.

[0075] According to embodiments of this disclosure, by adding at least one identification information corresponding to the acquisition address to the target traffic, the source of the target sub-traffic can be conveniently and accurately determined, thereby enabling the differentiation of multiple target sub-traffic.

[0076] According to embodiments of this disclosure, for example, Figure 2 The operation S220 shown splits the target traffic transmitted to the database to obtain at least one target sub-traffic, and may include the following operations.

[0077] For example, based on the identification information in the target traffic, the target traffic can be split according to the identification information to obtain at least one target sub-traffic.

[0078] According to embodiments of this disclosure, the number of target sub-traffic and the number of identification information are the same, and the target sub-traffic may include identification information corresponding to the target sub-traffic.

[0079] According to embodiments of this disclosure, target traffic may include at least one identification information. Each identification information corresponds to a target sub-traffic. The identification information is used to characterize the source of the target sub-traffic, such as an address.

[0080] According to embodiments of this disclosure, dividing target traffic according to containers or host machines (e.g., network addresses) can solve the problem of high-concurrency traffic splitting from the source, with good splitting effect and fast and accurate results.

[0081] According to embodiments of this disclosure, when performing such Figure 2 Before operation S230 shown, the traffic replay method may also include the following operations.

[0082] For example, before calculating the target playback time node corresponding to each target sub-traffic, load balancing is performed on at least one target sub-traffic to obtain at least one sub-task corresponding to each first target node. The sub-task may include identification information corresponding to the target sub-traffic. For each sub-task corresponding to each first target node, using the first target node, the target sub-traffic corresponding to the identification information in the sub-task is retrieved from the database to obtain at least one target sub-traffic corresponding to each first target node.

[0083] According to embodiments of this disclosure, a subtask is assigned to each target sub-traffic. The subtask may include identification information.

[0084] According to embodiments of this disclosure, load balancing for each target sub-traffic can involve: determining the load capacity information of each first target node; determining the number of target sub-traffic items corresponding to each first target node based on the load capacity information of each first target node; and storing the corresponding number of target sub-traffic items in the first target node.

[0085] According to embodiments of this disclosure, load capacity information can characterize the number of target sub-traffic items currently being processed by the first target node. A higher load capacity value indicates a stronger load capacity of the first target node, meaning it can handle a relatively larger number of target sub-traffic items. The load capacity information can be determined based on the number of target sub-traffic items currently being processed by the first target node.

[0086] For example, if the number of target sub-traffic items currently being processed by the first target node A is 6, its load capacity information can be determined to be 0.4. If the number of target sub-traffic items currently being processed by the other first target node B is 8, its load capacity information can be determined to be 0.3. Based on the load capacity information of first target node A (0.4) and first target node B (0.3), the load capacity of first target node A is stronger than that of first target node B. If there are 6 target sub-traffic items to be allocated to first target nodes A and B, then based on the load capacity information of first target node A (0.4) and first target node B (0.3), it can be determined that 4 target sub-traffic items will be allocated to first target node A and 2 target sub-traffic items will be allocated to first target node B.

[0087] According to embodiments of this disclosure, a first target node is used to retrieve target sub-traffic corresponding to the identification information of a subtask from a database. The allocation between the first target node and the subtask can be based on load capacity information. A first target node with high load capacity can handle more subtasks, improving processing capacity while ensuring that subtasks are processed. This allows for improved performance of the playback system in high-concurrency traffic scenarios by leveraging the first target node with high load capacity.

[0088] According to embodiments of this disclosure, for example, Figure 2 The operation S230 shown calculates the target playback time node corresponding to each target sub-flow, and may include the following operations.

[0089] For example, for each target sub-traffic corresponding to each first target node, the recording time node corresponding to the target sub-traffic and the recording time node corresponding to the target traffic are obtained from the target sub-traffic. Based on the recording time node corresponding to the target sub-traffic, the recording time node corresponding to the target traffic, and the playback time node corresponding to the target traffic, the target playback time node corresponding to the target sub-traffic is calculated.

[0090] According to embodiments of this disclosure, the recording time node corresponding to the target sub-traffic can characterize the start time of recording the target sub-traffic. The recording time node corresponding to the target traffic can characterize the start time of recording the target traffic. The playback time node corresponding to the target traffic can characterize the playback time. The playback time can be a predetermined playback time.

[0091] According to embodiments of this disclosure, the start recording interval between a target sub-traffic flow and a target flow can be determined based on the recording time node corresponding to the target sub-traffic flow and the recording time node corresponding to the target flow. Furthermore, the target playback time node corresponding to the target sub-traffic flow can be determined based on the start recording interval and the playback time node corresponding to the target flow.

[0092] According to embodiments of this disclosure, the target playback time node corresponding to the target sub-traffic can be calculated using the following formula, based on the recording time node corresponding to the target sub-traffic, the recording time node corresponding to the target traffic, and the playback time node corresponding to the target traffic.

[0093] For example, the target playback time node corresponding to the target sub-traffic = A * the recording time node corresponding to the target sub-traffic - B * the recording time node corresponding to the target sub-traffic + C * the playback time node corresponding to the target traffic.

[0094] Where A, B, and C are weights, respectively.

[0095] According to the embodiments of this disclosure, the target playback time node calculated in the above manner can be combined with the actual situation, so that the target playback time node can be calculated accurately and flexibly allocated, thereby improving the user experience.

[0096] According to embodiments of this disclosure, when performing such Figure 2 After the operation S230 shown, and the following is executed: Figure 2 Before operation S240 shown, the traffic replay method may also include the following operations.

[0097] For example, each target sub-traffic that has been calculated at the target playback time point is stored in the target cluster in real time.

[0098] According to embodiments of this disclosure, the target cluster may refer to a Kafka cluster or a Kafka queue.

[0099] According to the embodiments of this disclosure, the first target node can store the target sub-traffic calculated at the target playback time node into the target cluster. In order to achieve the effect of consistent storage time for multiple target sub-traffic when there are multiple target sub-traffic in the target cluster, multiple target sub-traffic obtained from the target cluster can be stored into the time sequence queue according to the target playback time node.

[0100] According to embodiments of this disclosure, for example, Figure 2 The operation S240 shown replays each target sub-traffic according to the target replay time node corresponding to the target sub-traffic, and may include the following operations.

[0101] For example, load balancing is performed on each target sub-traffic stored in real time in the target cluster to obtain at least one target sub-traffic corresponding to each second target node. For each second target node, each target sub-traffic corresponding to the second target node is stored in the second target node according to the corresponding target replay time node, resulting in a time-series queue corresponding to the second target node. Based on the time-series queue corresponding to each second target node, each target sub-traffic is replayed according to the corresponding target replay time node.

[0102] According to embodiments of this disclosure, load balancing for each target sub-traffic can involve: determining the load capacity information of each second target node; determining the number of target sub-traffic items corresponding to each second target node based on the load capacity information of each second target node; and storing the corresponding number of target sub-traffic items in the second target nodes.

[0103] According to embodiments of this disclosure, load capacity information can characterize the amount of target sub-traffic currently stored by the second target node. A higher load capacity value indicates a stronger load capacity of the second target node, meaning it can store a relatively larger amount of target sub-traffic. The load capacity information can be determined based on the amount of target sub-traffic currently stored by the second target node.

[0104] For example, if the number of target sub-traffic items currently stored on second target node A is 6, its load capacity information can be determined to be 0.4. If the number of target sub-traffic items currently stored on second target node B is 8, its load capacity information can be determined to be 0.3. Based on the load capacity information of second target node A (0.4) and second target node B (0.3), the load capacity of second target node A is stronger than that of second target node B. If there are 6 target sub-traffic items to be allocated to second target nodes A and B for storage, based on the load capacity information of second target node A (0.4) and second target node B (0.3), it can be determined that 4 target sub-traffic items will be stored on second target node A and 2 target sub-traffic items will be stored on second target node B.

[0105] According to embodiments of this disclosure, multiple target sub-traffic items stored in a second target node can be generated into a time-series queue based on target playback time nodes. Multiple target sub-traffic items can then be played back according to the sorting method of the time-series queue.

[0106] According to the embodiments of this disclosure, the target sub-traffic stored in the target cluster in real time is load balanced and distributed to the second target node, and each target sub-traffic is stored in the second target node according to the corresponding target playback time node to obtain a time sequence queue, so as to use the time sequence queue to play back the target sub-traffic according to the target playback time node, thereby achieving the effect of consistent playback timing.

[0107] It should be noted that, unless it is explicitly stated that there is a sequential order of execution between different operations, or that there is a sequential order of execution between different operations in terms of technical implementation, the execution order between multiple operations may not be significant, and multiple operations may be executed simultaneously.

[0108] Based on the above-described traffic playback method, this disclosure also provides a traffic playback device. The following will be combined with... Figure 4 The device is described in detail.

[0109] Figure 4 A schematic block diagram of a traffic playback device according to an embodiment of the present disclosure is shown.

[0110] like Figure 4As shown, the traffic playback device 400 of this embodiment includes an acquisition module 410, a splitting module 420, a calculation module 430, and a playback module 440.

[0111] The acquisition module 410 is used to acquire target traffic, wherein the target traffic represents the traffic to be recorded obtained by performing marking and recording operations. In one embodiment, the acquisition module 410 can be used to perform the operation S210 described above, which will not be repeated here.

[0112] The splitting module 420 is used to split the target traffic transmitted to the database to obtain at least one target sub-traffic. In one embodiment, the splitting module 420 can be used to perform the operation S220 described above, which will not be repeated here.

[0113] The calculation module 430 is used to calculate the target playback time node corresponding to each target sub-flow. In one embodiment, the calculation module 430 can be used to perform the operation S230 described above, which will not be repeated here.

[0114] The playback module 440 is used to play back each target sub-traffic according to the target playback time node corresponding to the target sub-traffic. In one embodiment, the playback module 440 can be used to perform the operation S240 described above, which will not be repeated here.

[0115] According to embodiments of this disclosure, the splitting module 420 includes a first obtaining unit.

[0116] The first obtaining unit is used to split the target traffic according to the identification information in the target traffic to obtain at least one target sub-traffic, wherein the number of target sub-traffic is the same as the number of identification information, and the target sub-traffic includes identification information corresponding to the target sub-traffic.

[0117] According to embodiments of this disclosure, the splitting module 420 further includes a second obtaining unit and a third obtaining unit.

[0118] The second obtaining unit is used to perform load balancing on at least one target sub-traffic before calculating the target playback time node corresponding to each target sub-traffic, and to obtain at least one sub-task corresponding to each first target node, wherein the sub-task includes identification information corresponding to the target sub-traffic.

[0119] The third obtaining unit is used to obtain, for each subtask corresponding to each first target node, the target sub-traffic corresponding to the identification information in the subtask from the database using the first target node, so as to obtain at least one target sub-traffic corresponding to each first target node.

[0120] According to embodiments of this disclosure, the calculation module 430 includes an acquisition unit and a calculation unit.

[0121] The acquisition unit is used to acquire, for each target sub-traffic corresponding to each first target node, the recording time node corresponding to the target sub-traffic and the recording time node corresponding to the target traffic from the target sub-traffic.

[0122] The calculation unit is used to calculate the target playback time node corresponding to the target sub-traffic based on the recording time node corresponding to the target traffic, the recording time node corresponding to the target traffic, and the playback time node corresponding to the target traffic.

[0123] According to embodiments of this disclosure, the computing module 430 further includes a storage unit.

[0124] The storage unit is used to store each target sub-traffic that has been calculated at the target playback time node into the target cluster in real time.

[0125] According to embodiments of this disclosure, the playback module 440 includes a fourth acquisition unit, a fifth acquisition unit, and a playback unit.

[0126] The fourth obtaining unit is used to perform load balancing distribution on each target sub-traffic stored in the target cluster in real time, and obtain at least one target sub-traffic corresponding to each second target node.

[0127] The fifth obtaining unit is used to store each target sub-flow corresponding to the second target node in the second target node according to the corresponding target playback time node for each second target node, so as to obtain the time sequence queue corresponding to the second target node.

[0128] The playback unit is used to play back each target sub-traffic according to the corresponding target playback time node based on the time sequence queue corresponding to each second target node.

[0129] According to embodiments of this disclosure, any plurality of modules among the acquisition module 410, splitting module 420, calculation module 430, and playback module 440 may be combined into one module, or any one of these modules may be split into multiple modules. Alternatively, at least a portion of the functionality of one or more of these modules may be combined with at least a portion of the functionality of other modules and implemented in one module. According to embodiments of this disclosure, at least one of the acquisition module 410, splitting module 420, calculation module 430, and playback module 440 may be at least partially implemented as hardware circuitry, such as a field-programmable gate array (FPGA), a programmable logic array (PLA), a system-on-a-chip, a system-on-a-substrate, a system-on-package, an application-specific integrated circuit (ASIC), or implemented in hardware or firmware by any other reasonable means of integrating or packaging the circuitry, or implemented in software, hardware, or firmware, or in any suitable combination of any of these three implementation methods. Alternatively, at least one of the acquisition module 410, splitting module 420, calculation module 430, and playback module 440 may be implemented at least partially as a computer program module that can perform corresponding functions when the computer program module is run.

[0130] Figure 5 A block diagram schematically illustrates an electronic device suitable for implementing a traffic playback method according to an embodiment of the present disclosure.

[0131] like Figure 5 As shown, an electronic device 500 according to an embodiment of the present disclosure includes a processor 501, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 502 or a program loaded from a storage portion 508 into a random access memory (RAM) 503. The processor 501 may include, for example, a general-purpose microprocessor (e.g., a CPU), an instruction set processor and / or an associated chipset and / or a special-purpose microprocessor (e.g., an application-specific integrated circuit (ASIC)), etc. The processor 501 may also include onboard memory for caching purposes. The processor 501 may include a single processing unit or multiple processing units for performing different actions of the method flow according to an embodiment of the present disclosure.

[0132] RAM 503 stores various programs and data required for the operation of electronic device 500. Processor 501, ROM 502, and RAM 503 are interconnected via bus 504. Processor 501 performs various operations of the method flow according to embodiments of the present disclosure by executing programs in ROM 502 and / or RAM 503. It should be noted that the programs may also be stored in one or more memories other than ROM 502 and RAM 503. Processor 501 may also perform various operations of the method flow according to embodiments of the present disclosure by executing programs stored in said one or more memories.

[0133] According to embodiments of this disclosure, the electronic device 500 may further include an input / output (I / O) interface 505, which is also connected to a bus 504. The electronic device 500 may also include one or more of the following components connected to the input / output (I / O) interface 505: an input section 506 including a keyboard, mouse, etc.; an output section 507 including a cathode ray tube (CRT), liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 508 including a hard disk, etc.; and a communication section 509 including a network interface card such as a LAN card, modem, etc. The communication section 509 performs communication processing via a network such as the Internet. A drive 510 is also connected to the input / output (I / O) interface 505 as needed. A removable medium 511, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., is installed on the drive 510 as needed so that computer programs read from it can be installed into the storage section 508 as needed.

[0134] This disclosure also provides a computer-readable storage medium, which may be included in the device / apparatus / system described in the above embodiments; or it may exist independently and not assembled into the device / apparatus / system. The computer-readable storage medium carries one or more programs that, when executed, implement the method according to the embodiments of this disclosure.

[0135] According to embodiments of this disclosure, the computer-readable storage medium may be a non-volatile computer-readable storage medium, such as including, but not limited to: portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof. In this disclosure, the computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. For example, according to embodiments of this disclosure, the computer-readable storage medium may include ROM 502 and / or RAM 503 and / or one or more memories other than ROM 502 and RAM 503 described above.

[0136] Embodiments of this disclosure also include a computer program product comprising a computer program containing program code for performing the methods shown in the flowchart. When the computer program product is run on a computer system, the program code is used to cause the computer system to implement the item recommendation method provided in the embodiments of this disclosure.

[0137] When the computer program is executed by the processor 501, it performs the functions defined in the system / apparatus of this disclosure embodiments. According to embodiments of this disclosure, the systems, apparatuses, modules, units, etc., described above can be implemented by computer program modules.

[0138] In one embodiment, the computer program may rely on a tangible storage medium such as an optical storage device or a magnetic storage device. In another embodiment, the computer program may also be transmitted and distributed in the form of signals over a network medium, and may be downloaded and installed via the communication section 509, and / or installed from a removable medium 511. The program code contained in the computer program can be transmitted using any suitable network medium, including but not limited to: wireless, wired, etc., or any suitable combination thereof.

[0139] In such an embodiment, the computer program can be downloaded and installed from a network via communication section 509, and / or installed from removable medium 511. When the computer program is executed by processor 501, it performs the functions defined in the system of this disclosure embodiment. According to embodiments of this disclosure, the systems, devices, apparatuses, modules, units, etc., described above can be implemented by computer program modules.

[0140] According to embodiments of this disclosure, program code for executing the computer programs provided in embodiments of this disclosure can be written in any combination of one or more programming languages. Specifically, these computational programs can be implemented using high-level procedural and / or object-oriented programming languages, and / or assembly / machine languages. Programming languages ​​include, but are not limited to, languages ​​such as Java, C++, Python, "C", or similar programming languages. The program code can execute entirely on the user's computing device, partially on the user's device, partially on a remote computing device, or entirely on a remote computing device or server. In cases involving remote computing devices, the remote computing device can be connected to the user's computing device via any type of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computing device (e.g., via the Internet using an Internet service provider).

[0141] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram or flowchart, and combinations of blocks in a block diagram or flowchart, may be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.

[0142] Those skilled in the art will understand that the features described in the various embodiments and / or claims of this disclosure can be combined or combined in various ways, even if such combinations or combinations are not explicitly described in this disclosure. In particular, the features described in the various embodiments and / or claims of this disclosure can be combined or combined in various ways without departing from the spirit and teachings of this disclosure. All such combinations and / or combinations fall within the scope of this disclosure.

[0143] The embodiments of this disclosure have been described above. However, these embodiments are for illustrative purposes only and are not intended to limit the scope of this disclosure. Although various embodiments have been described above, this does not mean that the measures in the various embodiments cannot be used advantageously in combination. The scope of this disclosure is defined by the appended claims and their equivalents. Various substitutions and modifications can be made by those skilled in the art without departing from the scope of this disclosure, and all such substitutions and modifications should fall within the scope of this disclosure.

Claims

1. A method for replaying traffic, comprising: Obtain target traffic, wherein the target traffic is characterized by the traffic to be recorded obtained by performing marking and recording operations; The target traffic transmitted to the database is split according to the identification information added by the tagging operation to obtain at least one target sub-traffic, wherein the identification information is used to characterize the source of the target sub-traffic to distinguish the traffic source; Based on the recording time node corresponding to the target sub-traffic and the recording time node corresponding to the target traffic, the start recording interval between the target sub-traffic and the target traffic is determined, and based on the start recording interval and the playback time node corresponding to the target traffic, the target playback time node corresponding to each target sub-traffic is calculated. Each target sub-flow is replayed according to the target replay time node corresponding to the target sub-flow.

2. The method according to claim 1, wherein, The target traffic includes at least one identification information corresponding to the acquisition address.

3. The method according to claim 2, wherein, The step of splitting the target traffic transmitted to the database to obtain at least one target sub-traffic includes: Based on the identification information in the target traffic, the target traffic is split according to the identification information to obtain at least one target sub-traffic, wherein the number of target sub-traffic is the same as the number of identification information, and the target sub-traffic includes identification information corresponding to the target sub-traffic.

4. The method according to claim 3, further comprising: Before calculating the target playback time node corresponding to each target sub-traffic, load balancing is performed on the at least one target sub-traffic to obtain at least one sub-task corresponding to each first target node, wherein the sub-task includes the identification information corresponding to the target sub-traffic; and For each subtask corresponding to each first target node, the target sub-traffic corresponding to the identification information in the subtask is obtained from the database using the first target node, thereby obtaining at least one target sub-traffic corresponding to each first target node.

5. The method according to claim 1, further comprising: Each target sub-traffic, calculated at the target playback time node, is stored in the target cluster in real time.

6. The method according to claim 5, wherein, The step of replaying each target sub-traffic according to the target replay time node corresponding to the target sub-traffic includes: Load balancing is performed on each target sub-traffic stored in the target cluster in real time to obtain at least one target sub-traffic corresponding to each second target node; For each second target node, each target sub-traffic corresponding to the second target node is stored in the second target node according to the corresponding target playback time node, to obtain a time-series queue corresponding to the second target node; Based on the time-series queue corresponding to each second target node, each target sub-traffic is replayed according to the corresponding target replay time node.

7. A flow playback device, comprising: The acquisition module is used to acquire target traffic, wherein the target traffic is characterized by the traffic to be recorded after performing marking and recording operations; The splitting module is used to split the target traffic transmitted to the database according to the identification information added by the tagging operation to obtain at least one target sub-traffic, wherein the identification information is used to characterize the source of the target sub-traffic to distinguish the traffic source; The calculation module is used to determine the start recording interval between target sub-traffic and target traffic based on the recording time node corresponding to the target sub-traffic and the recording time node corresponding to the target traffic, and to calculate the target playback time node corresponding to each target sub-traffic based on the start recording interval and the playback time node corresponding to the target traffic. The playback module is used to play back each target sub-traffic according to the target playback time node corresponding to the target sub-traffic.

8. An electronic device, comprising: One or more processors; Storage device for storing one or more programs. Wherein, when the one or more programs are executed by the one or more processors, the one or more processors perform the method according to any one of claims 1 to 6.

9. A computer-readable storage medium having stored thereon executable instructions that, when executed by a processor, cause the processor to perform the method according to any one of claims 1 to 6.

10. A computer program product comprising a computer program that, when executed by a processor, implements the method according to any one of claims 1 to 6.