Tracking task table processing method and device, equipment and medium

By configuring independent task queues and task tables for each connection tracking task, the lock competition problem in traditional connection tracking is solved, and the system's concurrent processing capability and network services are improved.

CN119835190AActive Publication Date: 2025-04-15CHINA TELECOM CLOUD TECH CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202411744392.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-30
Publication Date
2025-04-15
Estimated Expiration
2044-11-30

AI Technical Summary

Technical Problem

In traditional connection tracking implementations, lock competition problems caused by the increase in connection number seriously affect the processing efficiency of connection tracking and the overall performance of the network.

Method used

By configuring independent task queues and task tables for each connection tracking task, multiple processing units are avoided to compete access to the global connection tracking table, thereby eliminating the lock competition problem.

Benefits of technology

This method greatly enhances the system's concurrent processing capabilities, reduces processing delays, improves the response speed of network services, and provides a smoother and more efficient network experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119835190A_ABST
    Figure CN119835190A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a processing method and device for a tracking task table, equipment and a medium. The method comprises the steps that to-be-processed data and an arrangement strategy connected with a tracking task are obtained; determining at least one connection tracking task according to the arrangement strategy of the connection tracking tasks; according to the at least one connection tracking task, configuring at least one independent task queue corresponding to each connection tracking task in the at least one connection tracking task; according to the independent task queues, configuring at least one independent task table corresponding to each independent task queue in the at least one independent task queue; determining at least one to-be-processed data component according to the to-be-processed data; and according to a preset matching rule, writing the at least one to-be-processed data component into the at least one independent task queue, and processing an independent task table corresponding to the independent task queue. The independent task queue and task table design reduces the waiting and synchronization overhead between the processing units, so that the message can be processed more quickly.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of tracking task processing, and in particular to a method, device, equipment and medium for processing a tracking task table. Background Art

[0002] In data communication networks, connection tracking (CT) is a crucial function that monitors and manages the connection status in the network to ensure the correct forwarding of data packets and the stable operation of the network. With the continuous increase in network traffic and the sharp increase in the number of connections, the size of the connection tracking table has also expanded, which has put extremely high demands on the processing efficiency of connection tracking.

[0003] In traditional connection tracking implementations, a centralized table structure is usually used to store and manage all connection states. This implementation works well when the number of connections is small, but as the number of connections increases, table access and update operations become more frequent, leading to serious lock contention problems. Specifically, when multiple processing threads or processes need to access or modify the connection tracking table at the same time, they must compete to obtain the table lock to ensure data consistency. However, the lock acquisition and release process not only adds additional overhead, but may also cause the processing thread or process to wait and block, which seriously affects the processing efficiency of connection tracking and the overall performance of the network.

[0004] In addition, lock contention in the connection tracking table may also lead to increased processing delays and decreased throughput. In a highly competitive scenario, the processing thread or process may need to wait for a long time for the lock to be released, resulting in increased message processing delays, which in turn affects the response speed of network services and user experience. At the same time, lock contention also limits the system's ability to handle concurrent connections, making it difficult to improve throughput. Summary of the invention

[0005] In view of the above problems, embodiments of the present invention are proposed to provide a method, apparatus, device and medium for processing a tracking task table that overcomes the above problems or at least partially solves the above problems.

[0006] In order to solve the above problem, an embodiment of the present invention discloses a method for processing a connection tracking task table, the method comprising:

[0007] Obtaining a layout strategy for data to be processed and connection tracking tasks; the connection tracking task is a task responsible for recording the connection status of data in the network;

[0008] Determining at least one connection tracking task according to the arrangement strategy of the connection tracking task;

[0009] According to the at least one connection tracking task, configuring at least one independent task queue corresponding to each connection tracking task in the at least one connection tracking task;

[0010] According to the at least one independent task queue, configuring at least one independent task table corresponding to each independent task queue in the at least one independent task queue;

[0011] Determining at least one data component to be processed according to the data to be processed;

[0012] Writing the at least one to-be-processed data component into the at least one independent task queue according to a preset matching rule;

[0013] According to the at least one to-be-processed data component in the at least one independent task queue, the independent task table corresponding to the independent task queue is processed.

[0014] Optionally, determining at least one data component to be processed according to the data to be processed includes:

[0015] Acquire five-tuple information of the data to be processed; the five-tuple information includes the IP address of the sender of the data to be processed, the port number of the sender of the data to be processed, the IP address of the receiver of the data to be processed, the port number of the receiver of the data to be processed, and the transmission protocol number of the data packet to be processed;

[0016] At least one data component to be processed is determined according to the quintuple information of the data to be processed and a preset quintuple information matching rule.

[0017] Optionally, processing the independent task table corresponding to the independent task queue according to the at least one to-be-processed data component in the at least one independent task queue comprises:

[0018] Obtaining quintuple information of the data component to be processed;

[0019] The independent task table corresponding to the independent task queue is updated according to the five-tuple information of the at least one to-be-processed data component in the at least one independent task queue.

[0020] Optionally, writing the at least one to-be-processed data component into the at least one independent task queue according to a preset matching rule comprises:

[0021] Determine a hash value of the data component to be processed according to the five-tuple information of the data component to be processed;

[0022] According to the hash value and a preset matching rule, the at least one to-be-processed data component is written into the at least one independent task queue.

[0023] Optionally, determining at least one data component to be processed according to the quintuple information of the data to be processed and a preset quintuple information matching rule includes:

[0024] Get the first processing thread;

[0025] Determine at least one data component to be processed according to the first processing thread, the quintuple information of the data to be processed, and a preset quintuple information matching rule;

[0026] Optionally, writing the at least one to-be-processed data component into the at least one independent task queue according to the hash value and a preset matching rule comprises:

[0027] According to the first processing thread, the hash value and a preset matching rule, the at least one to-be-processed data component is written into the at least one independent task queue.

[0028] Optionally, each connection tracking task in the at least one connection tracking task has a second processing thread corresponding to one of the at least one connection tracking tasks, and updating the independent task table corresponding to the independent task queue according to the five-tuple information of the at least one to-be-processed data component in the at least one independent task queue includes:

[0029] The independent task table corresponding to the independent task queue is processed according to the five-tuple information of the at least one to-be-processed data component in the at least one independent task queue and the second processing thread of the at least one independent task queue.

[0030] On the other hand, an embodiment of the present invention discloses a device for processing a connection tracking task table, the device comprising:

[0031] A processing strategy acquisition module, used to acquire the data to be processed and the placement strategy of the connection tracking task; the connection tracking task is a task responsible for recording the connection status of the data in the network;

[0032] A tracking task placement module, configured to determine at least one connection tracking task according to a placement strategy of the connection tracking task;

[0033] a task queue configuration module, configured to configure, according to the at least one connection tracking task, at least one independent task queue corresponding to each connection tracking task in the at least one connection tracking task;

[0034] A task table configuration module, configured to configure at least one independent task table corresponding to each independent task queue in the at least one independent task queue according to the at least one independent task queue;

[0035] A data component determination module, used to determine at least one data component to be processed according to the data to be processed;

[0036] A data component writing module, used for writing the at least one to-be-processed data component into the at least one independent task queue according to a preset matching rule;

[0037] The task table updating module is used to process the independent task table corresponding to the independent task queue according to the at least one to-be-processed data component in the at least one independent task queue.

[0038] Optionally, the data component determination module includes:

[0039] A five-tuple acquisition submodule, used to acquire five-tuple information of the data to be processed; the five-tuple information includes the IP address of the sender of the data to be processed, the port number of the sender of the data to be processed, the IP address of the receiver of the data to be processed, the port number of the receiver of the data to be processed and the transmission protocol number of the data packet to be processed;

[0040] The first data component processing submodule is used to determine at least one data component to be processed according to the quintuple information of the data to be processed and a preset quintuple information matching rule.

[0041] Optionally, the task list updating module includes:

[0042] A component quintuple acquisition submodule, used to acquire quintuple information of the data component to be processed;

[0043] The first task table processing submodule is used to update the independent task table corresponding to the independent task queue according to the five-tuple information of the at least one to-be-processed data component in the at least one independent task queue.

[0044] Optionally, the data component writing module includes:

[0045] A hash value confirmation submodule, used to determine the hash value of the data component to be processed according to the quintuple information of the data component to be processed;

[0046] The first matching submodule is used to write the at least one to-be-processed data component into the at least one independent task queue according to the hash value and a preset matching rule.

[0047] Optionally, the first data component processing submodule includes:

[0048] A first thread confirmation unit, used to obtain a first processing thread;

[0049] A second data component processing unit, configured to determine at least one data component to be processed according to the first processing thread, the five-tuple information of the data to be processed, and a preset five-tuple information matching rule;

[0050] Optionally, the first matching submodule includes:

[0051] The second matching unit is used to write the at least one to-be-processed data component into the at least one independent task queue according to the first processing thread, the hash value and a preset matching rule.

[0052] Optionally, each connection tracking task in the at least one connection tracking task has a second processing thread corresponding to the first task table processing submodule, and the first task table processing submodule includes:

[0053] The second task table processing unit is used to process the independent task table corresponding to the independent task queue according to the five-tuple information of the at least one to-be-processed data component in the at least one independent task queue and the second processing thread of the at least one independent task queue.

[0054] Correspondingly, an embodiment of the present invention discloses an electronic device, comprising: a processor, a memory, and a computer program stored in the memory and capable of running on the processor, wherein the computer program, when executed by the processor, implements the various steps of the above-mentioned connection tracking task table processing method embodiment.

[0055] Accordingly, an embodiment of the present invention discloses a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, each step of the above-mentioned connection tracking task table processing method embodiment is implemented.

[0056] Embodiments of the present invention include the following advantages: By configuring an independent task queue and task table for each connection tracking task, embodiments of the present invention effectively avoid competitive access to the global connection tracking table by multiple processing units in traditional implementations, thereby completely eliminating the lock contention problem. Since each connection tracking task has an independent task queue and task table, this enables the system to process multiple connection tracking tasks at the same time without worrying about resource competition or waiting. This feature greatly enhances the concurrent processing capabilities of the system, allowing the system to more easily cope with the needs of large-scale concurrent connections and message processing. The independent task queue and task table design reduces the waiting and synchronization overhead between processing units, allowing messages to be processed faster. This improvement reduces the processing delay of connection tracking and improves the response speed of network services, thereby providing users with a smoother and more efficient network experience. BRIEF DESCRIPTION OF THE DRAWINGS

[0057] Figure 1 It is a flowchart of a method for processing a tracking task list according to an embodiment of the present invention;

[0058] Figure 2 is a flowchart of another embodiment of a method for processing a tracking task list of the present invention;

[0059] Figure 3 It is a schematic diagram of distributing CT tasks by a PMD thread according to an embodiment of a method for processing a tracking task table of the present invention;

[0060] Figure 4 It is a timing diagram of a PMD thread when the processing method of the tracking task table of the present invention is not applied;

[0061] Figure 5 It is a timing diagram of a PMD thread of an embodiment of a processing method for tracking a task table of the present invention;

[0062] Figure 6 It is a timing diagram of a PMD thread of another embodiment of a method for processing a connection tracking task table of the present invention;

[0063] Figure 7 It is a structural block diagram of an embodiment of a processing device for tracking task tables of the present invention. DETAILED DESCRIPTION

[0064] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.

[0065] The connection tracking task is responsible for recording, tracking and managing the network connection status during the network communication process.

[0066] When two endpoints begin to communicate, the connection tracking task identifies and records the establishment of this new connection. This usually involves extracting key information such as the source IP address, destination IP address, source port number, and destination port number of the data packet in order to uniquely identify the connection.

[0067] Connection status maintenance: During the life cycle of a connection, the connection tracking task will continuously track and update the status of the connection. For example, it records the sending and receiving of data packets, the duration of the connection, the sequence number of the data packet, etc. This information is very important for network management, troubleshooting, and security auditing. Performance optimization and load balancing: Through the information collected by the connection tracking task, network administrators can understand the traffic patterns and bottlenecks of the network, so as to make corresponding performance optimization and load balancing adjustments. The connection tracking task plays a vital role in network communications. It not only improves the security, reliability, and performance of the network, but also provides network administrators with rich network management information and data support.

[0068] OVS-DPDK refers to Open vSwitch with Data Plane Development Kit, which is a technology that uses Data Plane Development Kit (DPDK) in Open vSwitch (OVS).

[0069] Open vSwitch (OVS) is an open source virtual switch that supports multiple virtualization technologies, such as Xen, KVM, VMware, etc., and is widely used in cloud computing, network function virtualization (NFV) and other scenarios.

[0070] Data Plane Development Kit (DPDK) is a set of development platforms and interfaces for fast data packet processing developed by Intel. It provides high-performance data packet processing algorithms and user-mode data packet processing libraries, which can greatly improve data processing performance and throughput.

[0071] OVS-DPDK uses the high-performance packet processing library provided by DPDK to move packet processing from kernel mode to user mode. By bypassing the kernel protocol stack and using high-performance packet processing algorithms, OVS-DPDK accelerates the data plane.

[0072] One of the core concepts of the embodiment of the present invention is to solve the lock contention problem when the CT tasks update the CT table by using the method that each CT task has its own independent task table.

[0073] Reference Figure 1, shows a flowchart of a method for processing a connection tracking task table according to an embodiment of the present invention, which may specifically include the following steps:

[0074] Step 101, obtaining a placement strategy for data to be processed and a connection tracking task; the connection tracking task is a task responsible for recording the connection status of data in the network;

[0075] This step is the preparation stage, which requires obtaining two types of information. The first is the message. The second is the connection tracking task placement strategy, which is used to guide how to allocate and organize connection tracking tasks. The strategy can be formulated based on multiple factors such as network topology, traffic pattern, system resources, and business needs.

[0076] Step 102, determining at least one connection tracking task according to the arrangement strategy of the connection tracking task;

[0077] According to the deployment strategy obtained in step 101, it is specifically determined which connection tracking tasks need to be performed. These tasks may include monitoring the status of specific network connections, recording the transmission path of data packets, detecting abnormal connections, etc., and can be dynamically adjusted according to business needs.

[0078] Step 103: configuring, according to the at least one connection tracking task, at least one independent task queue corresponding to each connection tracking task in the at least one connection tracking task;

[0079] In order to process connection tracking tasks in parallel, the system configures a task queue for each task. These queues are used to store pending data related to the task, ensuring orderly processing of data and isolation between tasks.

[0080] In one example, the queue can be a lock-free queue, which is a data structure that does not use a lock mechanism (such as a mutex or a read-write lock) to achieve thread safety. It uses complex atomic operations (such as CAS operations) to ensure correctness and consistency in a multi-threaded environment. The design goal of a lock-free queue is to provide high-performance enqueue and dequeue operations in high-concurrency scenarios, avoiding the performance overhead and potential deadlock problems caused by the lock mechanism. The implementation method can be a linked list-based lock-free queue or an array-based lock-free queue:

[0081] Step 104, configuring at least one independent task table corresponding to each independent task queue in the at least one independent task queue according to the at least one independent task queue;

[0082] In order to correspond to the task queue, an independent task table needs to be configured for each task queue. These tables are used to store the status information, processing results, etc. of the connection tracking task, and are the core data structure of task execution.

[0083] Step 105, determining at least one data component to be processed according to the data to be processed;

[0084] Decompose the data to be processed into multiple data components. These data components may be divided according to factors such as packet type, source, destination, etc., so as to be more efficiently allocated to different connection tracking tasks for processing.

[0085] In one example, the data to be processed may be a collection of messages. In network communication, a message is the basic unit of data transmission, which contains the information to be sent and possible control information such as source address, destination address, protocol type, etc. Messages can be any form of data, such as text, image, audio, video, or control instructions, etc., which are encapsulated into a specific format for easy transmission and processing in the network.

[0086] According to the preset segmentation method, the message set is segmented into individual messages, and these messages are parsed to obtain their processing methods and corresponding matching information;

[0087] Step 106, writing the at least one to-be-processed data component into the at least one independent task queue according to a preset matching rule;

[0088] The data components to be processed are assigned to the corresponding task queues according to preset matching rules, such as based on packet characteristics, task priorities, etc. This step ensures that the data can be accurately assigned to the connection tracking task responsible for processing it.

[0089] In one example, after the matching information of the individual messages is obtained, the individual messages are assigned to the lock-free queue of the corresponding CT task according to the matching information and the preset matching rule.

[0090] Step 107, processing the independent task table corresponding to the independent task queue according to the at least one to-be-processed data component in the at least one independent task queue;

[0091] According to the data components in the task queue, the corresponding task table is processed. The processing behavior includes updating the connection status, recording the transmission information, detecting anomalies, etc. Through the independent task queue and task table design, the system can process multiple connection tracking tasks in parallel and efficiently, improving the overall processing performance and response speed.

[0092] By configuring an independent task queue and task table for each connection tracking task, the embodiment of the present invention effectively avoids the contention access to the global connection tracking table by multiple processing units in the traditional implementation, thereby completely eliminating the lock contention problem. Since each connection tracking task has an independent task queue and task table, this enables the system to process multiple connection tracking tasks at the same time without worrying about resource competition or waiting. This feature greatly enhances the concurrent processing capabilities of the system, allowing the system to more easily cope with the needs of large-scale concurrent connections and message processing. The independent task queue and task table design reduces the waiting and synchronization overhead between processing units, allowing messages to be processed more quickly. This improvement reduces the processing delay of connection tracking and improves the response speed of network services, thereby providing users with a smoother and more efficient network experience.

[0093] Reference Figure 2 , shows a flowchart of another method for processing a connection tracking task table according to an embodiment of the present invention, which may specifically include the following steps:

[0094] Step 201, obtaining a placement strategy for data to be processed and a connection tracking task; the connection tracking task is a task responsible for recording the connection status of data in the network;

[0095] This step is the preparation stage, which requires obtaining two types of information. The first is the message. The second is the connection tracking task placement strategy, which is used to guide how to allocate and organize connection tracking tasks. The strategy can be formulated based on multiple factors such as network topology, traffic pattern, system resources, and business needs.

[0096] Step 202, determining at least one connection tracking task according to the arrangement strategy of the connection tracking task;

[0097] According to the deployment strategy obtained in step 201, it is specifically determined which connection tracking tasks need to be performed. These tasks may include monitoring the status of specific network connections, recording the transmission path of data packets, detecting abnormal connections, etc., which can be dynamically adjusted according to business needs.

[0098] Step 203: configuring, according to the at least one connection tracking task, at least one independent task queue corresponding to each connection tracking task in the at least one connection tracking task;

[0099] In order to process connection tracking tasks in parallel, the system configures a task queue for each task. These queues are used to store pending data related to the task, ensuring orderly processing of data and isolation between tasks.

[0100] In one example, the queue can be a lock-free queue, which is a data structure that does not use a lock mechanism (such as a mutex or a read-write lock) to achieve thread safety. It uses complex atomic operations (such as CAS operations) to ensure correctness and consistency in a multi-threaded environment. The design goal of a lock-free queue is to provide high-performance enqueue and dequeue operations in high-concurrency scenarios, avoiding the performance overhead and potential deadlock problems caused by the lock mechanism. The implementation method can be a linked list-based lock-free queue or an array-based lock-free queue:

[0101] Step 204, configuring at least one independent task table corresponding to each independent task queue in the at least one independent task queue according to the at least one independent task queue;

[0102] In order to correspond to the task queue, an independent task table needs to be configured for each task queue. These tables are used to store the status information, processing results, etc. of the connection tracking task, and are the core data structure of task execution.

[0103] Step 205, obtaining five-tuple information of the data to be processed; the five-tuple information includes the IP address of the sender of the data to be processed, the port number of the sender of the data to be processed, the IP address of the receiver of the data to be processed, the port number of the receiver of the data to be processed and the transmission protocol number of the data packet to be processed;

[0104] The quintuple is a set of key attributes used to uniquely identify a network session or connection. It includes: Sender's IP address: the source IP of the data packet. Sender's port number: the port used by the application or service at the source of the data packet. Receiver's IP address: the destination IP of the data packet. Receiver's port number: the port used by the application or service at the destination of the data packet. Transport protocol number: a digital identifier indicating the transport layer protocol (such as TCP, UDP, etc.) used by the data packet.

[0105] Step 206: Determine at least one data component to be processed according to the quintuple information of the data to be processed and a preset quintuple information matching rule.

[0106] During the message processing, the system first obtains the five-tuple information of the message, and then checks the five-tuple information according to the preset matching rules. Based on the matching results, the system determines the message that needs to be further processed and adds it to the end of the corresponding lock-free queue for subsequent CT concurrent threads to process. In this way, the system can efficiently manage and process data packets or messages in the network based on the five-tuple information and matching rules.

[0107] In one embodiment, step 206 includes the following sub-steps:

[0108] Sub-step S11, obtaining a first processing thread;

[0109] In one example, the first processing thread can be a PMD thread. The Poll Mode Driver (PMD) thread is a thread model in DPDK that handles most of the work on the data path. It is responsible for receiving, classifying, and processing data packets. The PMD thread receives data packets by polling input ports, and classifies and processes the data packets. It uses receive (RX) and transmit (TX) queues (commonly referred to as rxqs and txqs) to manage the flow of data packets.

[0110] Sub-step S12, determining at least one data component to be processed according to the first processing thread, the quintuple information of the data to be processed, and a preset quintuple information matching rule.

[0111] By combining the efficient processing capabilities of PMD threads with the accuracy of quintuple information matching rules, the network management system can process data packets quickly and accurately.

[0112] Step 207, writing the at least one to-be-processed data component into the at least one independent task queue according to a preset matching rule;

[0113] The data components to be processed are assigned to the corresponding task queues according to preset matching rules, such as based on packet characteristics, task priorities, etc. This step ensures that the data can be accurately assigned to the connection tracking task responsible for processing it.

[0114] In one example, after the matching information of the individual messages is obtained, the individual messages are assigned to the lock-free queues of the corresponding CT tasks according to the matching information and the preset matching rules.

[0115] In one embodiment, step 207 includes the following sub-steps:

[0116] Sub-step S21, determining a hash value of the data component to be processed according to the five-tuple information of the data component to be processed;

[0117] Sub-step S22: writing the at least one to-be-processed data component into the at least one independent task queue according to the hash value and a preset matching rule.

[0118] The preset matching rule may be based on a range of hash values, a specific hash value pattern, or other conditions related to hash values, and may be determined according to business needs;

[0119] By calculating hash values ​​and writing data components into independent task queues according to hash values ​​and preset matching rules, a fast, flexible and efficient data processing mechanism is provided for the system. This mechanism not only improves the speed and efficiency of data processing, but also enhances the scalability, reliability and flexibility of the system.

[0120] In one embodiment, sub-step S22 further includes the following sub-steps:

[0121] Sub-step S211: writing the at least one to-be-processed data component into the at least one independent task queue according to the first processing thread, the hash value and a preset matching rule.

[0122] The PMD thread will decide which independent task queue to write at least one data component to be processed into based on the calculated hash value and the preset matching rules. This process is fast and efficient because the hash value provides a fast classification basis, and the preset matching rules ensure the flexibility and accuracy of processing.

[0123] Step 208: Process the independent task table corresponding to the independent task queue according to the at least one to-be-processed data component in the at least one independent task queue.

[0124] According to the data components in the task queue, the corresponding task table is processed. The processing behavior includes updating the connection status, recording the transmission information, detecting anomalies, etc. Through the independent task queue and task table design, the system can process multiple connection tracking tasks in parallel and efficiently, improving the overall processing performance and response speed.

[0125] In one embodiment, step 208 includes the following sub-steps:

[0126] Sub-step S31, obtaining quintuple information of the data component to be processed;

[0127] Before processing the independent task table, the system first needs to obtain the quintuple information of the data component to be processed.

[0128] The quintuple information usually includes the source IP address, source port number, destination IP address, destination port number and protocol type, which is the key information for identifying network data flows.

[0129] The purpose of obtaining the quintuple information is to accurately update the independent task table in the subsequent steps and track and process specific data flows.

[0130] Sub-step S32: updating the independent task table corresponding to the independent task queue according to the five-tuple information of the at least one to-be-processed data component in the at least one independent task queue.

[0131] After obtaining the five-tuple information of the data component to be processed, the independent task table is updated according to this information. The update may include recording the processing status of the data component, updating the timestamp, adding relevant metadata or annotations, etc. By updating the independent task table, the system can track and manage the status and progress of the task in real time, and provide decision support for subsequent processing.

[0132] By updating the independent task table according to the data components to be processed in the independent task queue, an accurate, scalable and fine-grained task management mechanism is provided for the system. This mechanism not only improves the efficiency and accuracy of task processing, but also enhances the reliability and maintainability of the system.

[0133] In one embodiment, each connection tracking task in the at least one connection tracking task has a second processing thread corresponding to the at least one connection tracking task, and sub-step S32 includes the following sub-steps:

[0134] Sub-step S321, processing the independent task table corresponding to the independent task queue according to the five-tuple information of the at least one to-be-processed data component in the at least one independent task queue and the second processing thread of the at least one independent task queue:

[0135] Determine the CT task thread responsible for processing the data in the current independent task queue. CT task threads are threads specially designed to process specific types of tasks or data streams, and they correspond one-to-one to independent task queues.

[0136] In one example, based on the acquired five-tuple information and the determined CT task thread, the system updates the independent task table corresponding to the independent task queue. The update includes recording the processing status of the data component, the processing timestamp, the identifier of the CT task thread responsible for processing, and any other metadata or annotations related to task processing. The CT task thread processes the data component according to the information in the independent task table. During the processing, the thread may update the task table to reflect the progress or status change of the task. For example, when the task is completed, the thread updates the task status to "completed" and records the completion time.

[0137] By configuring an independent task queue and task table for each connection tracking task, the embodiment of the present invention effectively avoids the competitive access to the global connection tracking table by multiple processing units in the traditional implementation, thereby completely eliminating the lock contention problem. Since each connection tracking task has an independent task queue and task table, this enables the system to process multiple connection tracking tasks at the same time without worrying about resource competition or waiting. This feature greatly enhances the concurrent processing capabilities of the system, allowing the system to more easily cope with the needs of large-scale concurrent connections and message processing. The independent task queue and task table design reduces the waiting and synchronization overhead between processing units, allowing messages to be processed more quickly. This improvement reduces the processing delay of connection tracking and improves the response speed of network services, thereby providing users with a smoother and more efficient network experience.

[0138] Reference Figure 3 , showing a schematic diagram of PMD thread distribution of CT tasks according to an embodiment of a method for processing a tracking task table of the present invention;

[0139] The left side shows multiple PMD modules, pmd 1, pmd 2, and pmd K, which represent different physical data processing entrances. The data of each PMD module flows to a hash algorithm module. These circular nodes are marked as hash, which are responsible for performing fast calculations based on the characteristics of the data to determine which queue the data should be distributed to.

[0140] In the figure, we can see multiple queues, such as queue 1 and queue N, which act as intermediate buffers to temporarily store tasks distributed by the hash algorithm. These queues ensure that tasks wait in order and avoid confusion in data processing.

[0141] On the right is the core of CT task processing - CT handler module, such as CT handler 1, CT handler 2 and CT handler N. Each CT handler is responsible for processing tasks in a specific queue, and each handler is equipped with a "CT table" to store or process task-related data.

[0142] The entire workflow is as follows: After the PMD receives the data, the data is first distributed through the hash algorithm module, and then sent to the corresponding queue to wait. The data in the queue will eventually be distributed to the corresponding CT handler for processing, and the CT table assists this process to ensure the correct processing and storage of the data.

[0143] This architecture design achieves balanced distribution of tasks through a hash algorithm, effectively improving the system's processing efficiency and throughput, avoiding overload of the processing unit, and ensuring efficient and stable data processing.

[0144] Reference Figure 4 , shows a timing diagram of the PMD thread when the processing method of the tracking task table of the present invention is not applied.

[0145] First, when PMD1 starts processing the CT process, it will enter the "pre-CT process" and "CT process" stages in sequence. In the "CT process" stage, PMD1 will perform a series of addition and deletion operations on the CT table, which require a global CT table lock to ensure data consistency. Therefore, PMD1 will hold this lock until its operations are completed.

[0146] However, while PMD1 holds the global lock, PMD2 and PMD3 need to wait for PMD1 to release the lock so that they can also operate on the CT table. This waiting state is called the "blocked" state. Since PMD2 and PMD3 cannot continue to perform other tasks during the waiting period, this leads to a waste of CPU processing power.

[0147] When PMD1 completes the operation and releases the global lock, PMD2 and PMD3 will enter the "CT process" stage in turn to perform corresponding addition and deletion operations on the CT table. Then, they will enter the "CT post-process" stage in turn for subsequent processing.

[0148] Reference Figure 5 , showing a timing diagram of a PMD thread of an embodiment of a processing method for tracking a task table of the present invention;.

[0149] First, the PMD modules (including PMD1, PMD2, and PMD3) are executed in sequence, and each module contains multiple cycles (such as pmd cycle i, pmd cycle i+1, etc.). These cycles represent different stages or tasks of the PMD modules during execution. After each PMD module is executed, the control flow enters the pre-CT process, which is a preparation stage for entering the CT process.

[0150] In the process before the improvement, the CT process needs to wait for the global CT table lock when entering. This means that if the global lock is occupied by other processes or threads, the CT process must wait until the lock is released. This waiting will lead to a waste of CPU processing power because the CPU cannot perform other tasks during this time.

[0151] However, in the improved process, the execution mode of the CT process has changed significantly. Due to the application of the processing method of the tracking task table disclosed in the embodiment of the present invention, the CT process no longer needs to seize the global CT table lock when entering. Therefore, the CT process can start execution immediately after the PMD module is executed, without waiting for the global lock. This makes fuller use of the processing power of the CPU, because the CPU can perform other tasks or operations during the period of waiting for the release of the global lock.

[0152] The arrow from pmd cycle i to the pre-CT process indicates that the pre-CT process is entered after the PMD cycle ends; and the arrow from the pre-CT process to the CT process indicates that the CT process is entered after the pre-CT process is executed, and this step is no longer restricted by the global lock after the improvement.

[0153] The figure also shows the process relationship in the CT1 and CT2 modules. The CT1 and CT2 modules each contain multiple cycles (such as CT1 cycle i-1, CT1 cycle i, etc.; CT2 cycle i-1, etc.), which represent different stages or tasks of the CT module during execution.

[0154] Reference Figure 6 , showing a timing diagram of a PMD thread of another embodiment of a method for processing a connection tracking task table of the present invention;

[0155] In this embodiment, the PMD thread will be responsible for the tasks of the CT thread, responsible for the distribution of CT tasks, the processing of CT tasks, the update of the CT task table, etc. Figure 6 For example:

[0156] The figure mainly contains three key parts: PMD1, PMD2 and PMD3, each of which represents a different processing module or thread. Each PMD module contains CT pre-processing and CT post-processing processes, while PMD2 and PMD3 also contain CT processing processes.

[0157] Working mechanism of PMD thread:

[0158] Each PMD thread is responsible for processing its associated port packet receiving queue. In a processing cycle, the PMD thread will first poll its associated packet receiving queue. After the polling is completed, the PMD thread will query the head of the CT task queue to see if there is a task to be processed. If there is a task, it will be processed; if not, it will enter the next PMD processing cycle.

[0159] CT concurrent threads can be merged with PMD threads to jointly process CT tasks. This means that in some cases, CT tasks can be processed directly by PMD threads without the need for separate CT concurrent threads.

[0160] The dotted arrow in the figure indicates an optional processing path. Specifically, when the PMD thread processes a CT task, if the calculated CT concurrent task number is the same as the CT task number contained in the current PMD thread, the step of inserting the task into the lock-free queue can be skipped and subsequent processing can be performed directly. This optional path improves the processing efficiency of the system and avoids unnecessary task insertion and queue operations.

[0161] It should be noted that, for the sake of simplicity, the method embodiments are described as a series of action combinations, but those skilled in the art should be aware that the embodiments of the present invention are not limited by the order of the actions described, because according to the embodiments of the present invention, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily required by the embodiments of the present invention.

[0162] Reference Figure 7 , shows a structural block diagram of an embodiment of a processing device for a connection tracking task table of the present invention, which may specifically include the following modules:

[0163] The processing strategy acquisition module 301 is used to acquire the arrangement strategy of the data to be processed and the connection tracking task; the connection tracking task is a task responsible for recording the connection status of the data in the network;

[0164] A tracking task placement module 302, configured to determine at least one connection tracking task according to the connection tracking task placement strategy;

[0165] The task queue configuration module 303 is used to configure at least one independent task queue corresponding to each connection tracking task in the at least one connection tracking task according to the at least one connection tracking task;

[0166] A task table configuration module 304, configured to configure at least one independent task table corresponding to each independent task queue in the at least one independent task queue according to the at least one independent task queue;

[0167] A data component determination module 305, configured to determine at least one data component to be processed according to the data to be processed;

[0168] A data component writing module 306, configured to write the at least one to-be-processed data component into the at least one independent task queue according to a preset matching rule;

[0169] The task table updating module 307 is used to process the independent task table corresponding to the independent task queue according to the at least one to-be-processed data component in the at least one independent task queue.

[0170] In one embodiment, the data component determination module includes:

[0171] A five-tuple acquisition submodule, used to acquire five-tuple information of the data to be processed; the five-tuple information includes the IP address of the sender of the data to be processed, the port number of the sender of the data to be processed, the IP address of the receiver of the data to be processed, the port number of the receiver of the data to be processed and the transmission protocol number of the data packet to be processed;

[0172] The first data component processing submodule is used to determine at least one data component to be processed according to the quintuple information of the data to be processed and a preset quintuple information matching rule.

[0173] In one embodiment, the task list updating module includes:

[0174] A component quintuple acquisition submodule, used to acquire quintuple information of the data component to be processed;

[0175] The first task table processing submodule is used to update the independent task table corresponding to the independent task queue according to the five-tuple information of the at least one to-be-processed data component in the at least one independent task queue.

[0176] In one embodiment, the data component writing module includes:

[0177] A hash value confirmation submodule, used to determine the hash value of the data component to be processed according to the quintuple information of the data component to be processed;

[0178] The first matching submodule is used to write the at least one to-be-processed data component into the at least one independent task queue according to the hash value and a preset matching rule.

[0179] In one embodiment, the first data component processing submodule includes:

[0180] A first thread confirmation unit, used to obtain a first processing thread;

[0181] A second data component processing unit, configured to determine at least one data component to be processed according to the first processing thread, the five-tuple information of the data to be processed, and a preset five-tuple information matching rule;

[0182] In one embodiment, the first matching submodule includes:

[0183] The second matching unit is used to write the at least one to-be-processed data component into the at least one independent task queue according to the first processing thread, the hash value and a preset matching rule.

[0184] In one embodiment, each connection tracking task in the at least one connection tracking task has a second processing thread corresponding to the first task table processing submodule, and the first task table processing submodule includes:

[0185] The second task table processing unit is used to process the independent task table corresponding to the independent task queue according to the five-tuple information of the at least one to-be-processed data component in the at least one independent task queue and the second processing thread of the at least one independent task queue.

[0186] By configuring an independent task queue and task table for each connection tracking task, the embodiment of the present invention effectively avoids the competitive access to the global connection tracking table by multiple processing units in the traditional implementation, thereby completely eliminating the lock contention problem. Since each connection tracking task has an independent task queue and task table, this enables the system to process multiple connection tracking tasks at the same time without worrying about resource competition or waiting. This feature greatly enhances the concurrent processing capabilities of the system, allowing the system to more easily cope with the needs of large-scale concurrent connections and message processing. The independent task queue and task table design reduces the waiting and synchronization overhead between processing units, allowing messages to be processed more quickly. This improvement reduces the processing delay of connection tracking and improves the response speed of network services, thereby providing users with a smoother and more efficient network experience.

[0187] As for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0188] An embodiment of the present invention further provides an electronic device, including:

[0189] It includes a processor, a memory, and a computer program stored in the memory and capable of running on the processor. When the computer program is executed by the processor, the various processes of the above-mentioned connection tracking task table processing method embodiment are implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.

[0190] An embodiment of the present invention also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the various processes of the above-mentioned connection tracking task table processing method embodiment are implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.

[0191] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.

[0192] It will be appreciated by those skilled in the art that the embodiments of the present invention may be provided as methods, devices, or computer program products. Therefore, the embodiments of the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the embodiments of the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.

[0193] The embodiments of the present invention are described with reference to the flowcharts and / or block diagrams of the methods, terminal devices (systems), and computer program products according to the embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of the processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing terminal device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing terminal device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0194] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing terminal device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0195] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal device so that a series of operating steps are executed on the computer or other programmable terminal device to produce a computer-implemented process, thereby providing instructions for executing on the computer or other programmable terminal device to implement the process. Figure 1 A process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.

[0196] Although the preferred embodiments of the present invention have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the embodiments of the present invention.

[0197] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or terminal device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or terminal device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or terminal device including the elements.

[0198] The above is a detailed introduction to the processing method, device, equipment and medium for tracking task tables provided by the present invention. Specific examples are used in this article to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea; at the same time, for general technical personnel in this field, according to the ideas of the present invention, there will be changes in the specific implementation methods and application scopes. In summary, the content of this specification should not be understood as a limitation on the present invention.

Claims

1. A method for processing a connection tracking task table, characterized in that: The method comprises: Obtaining a layout strategy for data to be processed and connection tracking tasks; the connection tracking task is a task responsible for recording the connection status of data in the network; Determining at least one connection tracking task according to the arrangement strategy of the connection tracking task; According to the at least one connection tracking task, configuring at least one independent task queue corresponding to each connection tracking task in the at least one connection tracking task; According to the at least one independent task queue, configuring at least one independent task table corresponding to each independent task queue in the at least one independent task queue; Determining at least one data component to be processed according to the data to be processed; Writing the at least one to-be-processed data component into the at least one independent task queue according to a preset matching rule; According to the at least one to-be-processed data component in the at least one independent task queue, the independent task table corresponding to the independent task queue is processed.

2. The method according to claim 1, characterized in that The step of determining at least one data component to be processed according to the data to be processed includes: Acquire five-tuple information of the data to be processed; the five-tuple information includes the IP address of the sender of the data to be processed, the port number of the sender of the data to be processed, the IP address of the receiver of the data to be processed, the port number of the receiver of the data to be processed, and the transmission protocol number of the data packet to be processed; At least one data component to be processed is determined according to the quintuple information of the data to be processed and a preset quintuple information matching rule.

3. The method according to claim 2, characterized in that The step of processing the independent task table corresponding to the independent task queue according to the at least one to-be-processed data component in the at least one independent task queue comprises: Obtaining quintuple information of the data component to be processed; The independent task table corresponding to the independent task queue is updated according to the five-tuple information of the at least one to-be-processed data component in the at least one independent task queue.

4. The method according to claim 3, characterized in that The step of writing the at least one to-be-processed data component into the at least one independent task queue according to a preset matching rule comprises: Determine a hash value of the data component to be processed according to the five-tuple information of the data component to be processed; According to the hash value and a preset matching rule, the at least one to-be-processed data component is written into the at least one independent task queue.

5. The method according to claim 4, characterized in that The determining at least one data component to be processed according to the quintuple information of the data to be processed and a preset quintuple information matching rule comprises: Get the first processing thread; At least one data component to be processed is determined according to the first processing thread, the quintuple information of the data to be processed, and a preset quintuple information matching rule.

6. The method according to claim 5, characterized in that The step of writing the at least one to-be-processed data component into the at least one independent task queue according to the hash value and the preset matching rule comprises: According to the first processing thread, the hash value and a preset matching rule, the at least one to-be-processed data component is written into the at least one independent task queue.

7. The method according to claim 4, characterized in that Each of the at least one connection tracking tasks has a second processing thread corresponding to one of the at least one connection tracking tasks, and updating the independent task table corresponding to the independent task queue according to the five-tuple information of the at least one to-be-processed data component in the at least one independent task queue comprises: The independent task table corresponding to the independent task queue is processed according to the five-tuple information of the at least one to-be-processed data component in the at least one independent task queue and the second processing thread of the at least one independent task queue.

8. A device for processing a connection tracking task table, characterized in that: The device comprises: A processing strategy acquisition module, used to acquire the data to be processed and the placement strategy of the connection tracking task; the connection tracking task is a task responsible for recording the connection status of the data in the network; A tracking task placement module, configured to determine at least one connection tracking task according to a placement strategy of the connection tracking task; a task queue configuration module, configured to configure, according to the at least one connection tracking task, at least one independent task queue corresponding to each connection tracking task in the at least one connection tracking task; A task table configuration module, configured to configure at least one independent task table corresponding to each independent task queue in the at least one independent task queue according to the at least one independent task queue; A data component determination module, used to determine at least one data component to be processed according to the data to be processed; A data component writing module, used for writing the at least one to-be-processed data component into the at least one independent task queue according to a preset matching rule; The task table updating module is used to process the independent task table corresponding to the independent task queue according to the at least one to-be-processed data component in the at least one independent task queue.

9. An electronic device, characterized in that: include: A processor, a memory, and a computer program stored in the memory and capable of running on the processor, wherein when the computer program is executed by the processor, the steps of the method for processing the connection tracking task table according to any one of claims 1 to 7 are implemented.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the method for processing the connection tracking task table according to any one of claims 1 to 7 are implemented.

Citation Information

Patent Citations

  • Electronic device providing fast packet forwarding with reference to additional network address translation table

    CN111147611A

  • Network traffic processing method, related equipment and readable storage medium

    CN112749028A

  • Flow table processing method and device

    CN115955446A

  • Method and apparatus for dynamically balancing task processing while maintaining task order

    US20180365053A1

  • Network Congestion Notification Method, Agent Node, and Computer Device

    US20200177513A1