A connection pool communication processing method, device and medium
Patent Information
- Application Number
- CN202510928499.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-04
- Publication Date
- 2026-09-22
- Estimated Expiration
- 2045-07-04
AI Technical Summary
[0005]本发明实施例的目的是提供一种连接池通信处理方法、设备及介质,可以解决现有技术中连接聚合方案带来的控制消息被大数据块阻塞,尾延迟波动剧烈的问题,以及无差别连接池化方案,带来的混合传输控制消息与数据消息时,大流量分片引发小报文排队延迟,且静态资源配置无法适应负载变化,具有优先级倒置的风险,其关键路径的元数据操作容易因带宽竞争无法及时完成,从而影响系统稳定性的问题
[0046]由上述技术方案可以看出,本发明提供的一种连接池通信处理方法,包括:获取当前进程中各待传输数据的长度信息以及业务类型字段;根据业务类型字段将各待传输数据分类至第一优先级连接池和第二优先级连接池;其中,第一优先级连接池的优先级高于第二优先级连接池;在第一优先级连接池中,当业务类型字段对应的待传输数据的优先级不同时,优先级高的待传输数据先传输;当业务类型字段对应的待传输数据的优先级相同时,长度信息表征的数据长度对应的优先级高的待传输数据先传输;在第二优先级连接池中,长度信息表征的数据长度对应的优先级高的待传输数据先传输;其中,长度信息表征的数据长度与优先级负相关。由此可见,本发明根据业务类型字段动态划分连接池,在不同连接池中优先级高的待传输数据优先传输,有效降低了网络环境混合消息传输时带来的尾时延问题,同时兼顾高优消息的低时延性,以及有效降低连接数,降低资源占用。
Smart Images

Figure CN120812111B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of data transmission technology, and in particular to a connection pool communication processing method, device and medium. Background Technology
[0002] Remote Direct Memory Access (RDMA) technology provides microsecond-level latency and hundreds of Gbps-level throughput for distributed storage systems through three core mechanisms: kernel bypass, zero-copy, and hardware offloading. Its internal RoCEv2 (RDMA over Converged Ethernet v2) protocol, with its Ethernet-based compatibility, has become the mainstream choice for large-scale data centers. However, in ultra-large-scale parallel architectures, the fully interconnected communication mode between multiple processes can lead to an exponential explosion in the number of connections, resulting in problems such as a surge in memory consumption, excessive connection maintenance overhead, and low fault recovery efficiency.
[0003] Current optimization schemes fall into two categories. The first is a single-connection aggregation scheme, which mainly converges many-to-many communication to a shared channel. However, a single channel needs to handle an exponential level of concurrent requests, which can lead to control messages being blocked by large data blocks and severe tail latency fluctuations. The second is an indiscriminate connection pooling scheme, which reduces the total number of connections to some extent. However, when mixing control and data messages, large-volume fragmentation causes queuing delays for small packets, and static resource configuration cannot adapt to load changes, posing a risk of priority inversion. Furthermore, metadata operations on critical paths are prone to failure to complete in a timely manner due to bandwidth contention, thus affecting system stability.
[0004] It is evident that finding a traffic classification-based RDMA connection pooling communication optimization method is a problem that needs to be solved by those skilled in the art. Summary of the Invention
[0005] The purpose of this invention is to provide a connection pool communication processing method, device, and medium that can solve the problems of control messages being blocked by large data blocks and severe tail latency fluctuations caused by connection aggregation schemes in the prior art, as well as the problems of large-volume fragmentation causing small packet queuing delays when mixed transmission of control messages and data messages in indiscriminate connection pooling schemes, and the inability of static resource configuration to adapt to load changes, which poses a risk of priority inversion. Furthermore, the metadata operations of critical paths are prone to failure to be completed in a timely manner due to bandwidth contention, thereby affecting system stability.
[0006] To address the aforementioned technical problems, in one aspect, embodiments of the present invention provide a connection pool communication processing method, comprising:
[0007] Obtain the length information and service type field of each piece of data to be transmitted in the current process;
[0008] Based on the service type field, each piece of data to be transmitted is classified into a first priority connection pool and a second priority connection pool; wherein, the first priority connection pool has a higher priority than the second priority connection pool.
[0009] In the first priority connection pool, when the priorities of the data to be transmitted corresponding to the service type field are different, the data with higher priority is transmitted first; when the priorities of the data to be transmitted corresponding to the service type field are the same, the data with higher priority corresponding to the data length represented by the length information is transmitted first.
[0010] In the second priority connection pool, data with higher priority corresponding to the data length represented by the length information is transmitted first;
[0011] Among them, the length information represents the data length, which is negatively correlated with the priority.
[0012] In some embodiments, classifying each piece of data to be transmitted into a first priority connection pool and a second priority connection pool based on a service type field includes:
[0013] Determine whether the business type field indicates that the data to be transmitted belongs to a functional category;
[0014] If so, the data to be transmitted is the first priority data, and the first priority data is assigned to the first priority connection pool;
[0015] If not, the data to be transmitted is of the second priority, and the second priority data is assigned to the second-level connection pool.
[0016] In some embodiments, classifying each piece of data to be transmitted into a first priority connection pool and a second priority connection pool based on a service type field further includes:
[0017] Determine whether the data to be transmitted contains a transmission identifier;
[0018] If so, the data to be transmitted with the transmission identifier is the first priority data, and the first priority data is assigned to the first priority connection pool.
[0019] In some embodiments, when the data to be transmitted corresponding to the business type field has different priorities, the data with higher priority is transmitted first, including:
[0020] Determine whether the data to be transmitted corresponding to the business type field belongs to the repair data in the functional data category;
[0021] If so, then the data to be transmitted for repair purposes will be transmitted first.
[0022] If not, the data to be transmitted corresponding to the business type field belongs to the control data in the functional data category, and the data to be transmitted belonging to the control data category will be transmitted after the data to be transmitted belonging to the repair data category is transmitted.
[0023] In some embodiments, when the data to be transmitted corresponding to the business type field has different priorities, the data to be transmitted with higher priority is transmitted first, which also includes:
[0024] If the data to be transmitted has a transmission identifier, the priority of the data to be transmitted with the transmission identifier, the data to be transmitted that belongs to repair data, and the data to be transmitted that belongs to control data decreases in that order, with the data to be transmitted with the transmission identifier being transmitted first.
[0025] In some embodiments, data with higher priority corresponding to the data length represented by the length information is transmitted first, including:
[0026] Determine whether the data length corresponding to the length information is lower than the length boundary threshold;
[0027] If so, data to be transmitted that is below the length boundary threshold will be transmitted first;
[0028] If not, then transmit the current data to be transmitted after the data to be transmitted is below the length boundary threshold.
[0029] In some embodiments, obtaining the length boundary threshold includes:
[0030] Obtain the length information of each data to be transmitted within a preset time period;
[0031] When the length of data represented by any half of the length information is lower than the first threshold, the first threshold is used as the length boundary threshold.
[0032] or;
[0033] Obtain the length information of each historical data to be transmitted;
[0034] The length of the data represented by the length information of each historical data to be transmitted in each time period is analyzed by an adaptive model to obtain the second threshold corresponding to each time period.
[0035] Use the second threshold corresponding to the time period to which the current moment belongs as the length boundary threshold.
[0036] In some embodiments, the process of transmitting data to be transmitted further includes:
[0037] Determine whether the utilization rate of the first priority connection pool is greater than the first allocation threshold;
[0038] If so, the capacity in the second priority connection pool that is below the second allocation threshold will be allocated to the first priority connection pool to achieve the purpose of expanding the first priority connection pool.
[0039] Determine whether the capacity in the second priority connection pool below the second allocation threshold includes data to be transmitted;
[0040] If so, the data to be transmitted within the capacity of the second allocation threshold will be allocated to the first priority connection pool.
[0041] On the other hand, the present invention also provides an electronic device, comprising:
[0042] Memory, used to store computer programs;
[0043] A processor for executing computer programs to implement the steps of the connection pool communication processing method described above.
[0044] On the other hand, the present invention also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps of the connection pool communication processing method described above.
[0045] On the other hand, the present invention also provides a computer program product, including a computer program / instruction that, when executed by a processor, implements the steps of the connection pool communication processing method based on traffic classification described above.
[0046] As can be seen from the above technical solution, the connection pool communication processing method provided by the present invention includes: obtaining the length information and service type field of each data to be transmitted in the current process; classifying each data to be transmitted into a first priority connection pool and a second priority connection pool according to the service type field; wherein, the priority of the first priority connection pool is higher than that of the second priority connection pool; in the first priority connection pool, when the priorities of the data to be transmitted corresponding to the service type field are different, the data to be transmitted with higher priority is transmitted first; when the priorities of the data to be transmitted corresponding to the service type field are the same, the data to be transmitted with higher priority corresponding to the data length represented by the length information is transmitted first; in the second priority connection pool, the data to be transmitted with higher priority corresponding to the data length represented by the length information is transmitted first; wherein, the data length represented by the length information is negatively correlated with the priority. Therefore, the present invention dynamically divides the connection pool according to the service type field, and prioritizes the transmission of data to be transmitted with higher priority in different connection pools, effectively reducing the tail latency problem caused by mixed message transmission in the network environment, while also taking into account the low latency of high-priority messages, and effectively reducing the number of connections and resource consumption. Attached Figure Description
[0047] To more clearly illustrate the embodiments of the present invention, the accompanying drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0048] Figure 1 A flowchart of a connection pool communication processing method provided in an embodiment of the present invention;
[0049] Figure 2 A framework diagram provided for embodiments of the present invention;
[0050] Figure 3 This is a structural diagram of an electronic device provided in an embodiment of the present invention. Detailed Implementation
[0051] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the protection scope of the present invention.
[0052] The terms "comprising" and "having," and any variations thereof, in the specification and accompanying drawings of this invention are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or apparatus that includes a series of steps or units is not limited to the steps or units listed, but may include steps or units not listed.
[0053] To enable those skilled in the art to better understand the present invention, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.
[0054] Next, we will describe in detail the connection pool communication processing method, device and medium provided by the embodiments of the present invention.
[0055] Figure 1 A flowchart of a connection pool communication processing method provided in an embodiment of the present invention is shown below. Figure 1 As shown, it includes the following steps:
[0056] S10: Obtain the length information and business type field of each data to be transmitted in the current process.
[0057] S11: Classify the data to be transmitted into the first priority connection pool and the second priority connection pool according to the service type field.
[0058] In specific embodiments, such as Figure 2 As shown, the connection pool communication processing method provided by this invention is specifically applied to two processes that connect and transmit data. The process includes multiple parallel processing units that can simultaneously process multiple data sets to be transmitted, further reducing the processing efficiency of data transmission. Furthermore, the process includes two connection pools: a first priority connection pool and a second priority connection pool, used to divide the data to be transmitted into these two pools. Different connection pools use different bandwidths for data transmission.
[0059] This invention categorizes data to be transmitted into connection pools based on parsing the service type field and offloading CRC (Cyclic Redundancy Check) checks. Essentially, the service type field determines the data type of the data to be transmitted. If the data type is non-standard (functional) data, it is assigned to the first priority connection pool; if the data type is standard, it is assigned to the second priority connection pool. It's important to note that non-standard data has a higher priority than standard data because it involves control and repair processes; therefore, it also indicates that the first priority connection pool has a higher priority than the second priority connection pool.
[0060] To ensure that the first-priority connection pool has a higher priority than the second-priority connection pool, it needs to be configured before use. The first-priority connection pool is configured with a shallow queue (high-frequency scheduling, depth ≤ 1024) and hardware acceleration strategies (RoCEv2 protocol priority flow control and power factor correction; each transmission channel is bound to an independent Protection Domain (PD) for fault isolation and secure access). The second-priority connection pool is configured with a deep queue (depth ≥ 1024) and batch transmission optimization, supporting RDMA_READ / WRITE semantics for zero-copy large data stream processing; each transmission channel is also bound to an independent Protection Domain (PD) for fault isolation and secure access. Upon node startup, the initial pool size is pre-calculated based on network interface card hardware capabilities and service requirements; a typical configuration is a 30%-40% proportion of the first-priority connection pool and a 60%-70% proportion of the second-priority connection pool.
[0061] Meanwhile, the process configuration also includes: protocol stack priority pass-through, marking each channel with a service level (such as DSCP differential service code point) in the user-space driver layer, which is converted into a priority queue identifier in the RoCEv2 protocol link layer to ensure consistent service quality across the entire link from application to hardware.
[0062] S12: In the first priority connection pool, when the priorities of the data to be transmitted corresponding to the service type field are different, the data to be transmitted with higher priority is transmitted first; when the priorities of the data to be transmitted corresponding to the service type field are the same, the data to be transmitted with higher priority corresponding to the data length represented by the length information is transmitted first.
[0063] In this embodiment, the data to be transmitted in the first priority connection pool is non-standard data. Therefore, the data to be transmitted in the first priority connection pool has a certain functionality, and different functions have different priorities when implemented. Thus, when the priorities of the data to be transmitted corresponding to the service type field are different, the data with higher priority is transmitted first. When the priorities of the data to be transmitted corresponding to the service type field are different, the data with higher priority corresponding to the data length represented by the length information is transmitted first. The data length represented by the length information is negatively correlated with the priority, which can be understood as the shorter the data length, the higher its priority.
[0064] For example: The first priority connection pool includes three data to be transmitted. The first data to be transmitted is repair data with a length of 5KB; the second data to be transmitted is repair data with a length of 3KB; and the third data to be transmitted is control data with a length of 1KB. The priority of the repair data is higher than that of the control data. In this case, the transmission order of the data to be transmitted is: second data to be transmitted - first data to be transmitted - third data to be transmitted.
[0065] S13: In the second priority connection pool, the data with the higher priority corresponding to the data length represented by the length information is transmitted first.
[0066] In this embodiment, the data to be transmitted in the second priority connection pool is non-standard data. Therefore, the data to be transmitted in the second priority connection pool has no functionality and is simply waiting to be transmitted. Thus, it is not necessary to analyze the service type field of the current data to be transmitted; only the data length represented by the length information needs to be analyzed. Data with higher priority corresponding to the data length represented by the length information is transmitted first. Similarly, the data length represented by the length information is negatively correlated with the priority; that is, the shorter the data length, the higher its priority.
[0067] For example: If the second priority connection pool contains three data to be transmitted, where the first data to be transmitted has a length of 5KB, the second data to be transmitted has a length of 3KB, and the third data to be transmitted has a length of 1KB, then the transmission order of the data to be transmitted is: third data to be transmitted - second data to be transmitted - first data to be transmitted.
[0068] As can be seen from the above technical solution, the connection pool communication processing method provided by the present invention includes: obtaining the length information and service type field of each data to be transmitted in the current process; classifying each data to be transmitted into a first priority connection pool and a second priority connection pool according to the service type field; wherein, the priority of the first priority connection pool is higher than that of the second priority connection pool; in the first priority connection pool, when the priorities of the data to be transmitted corresponding to the service type field are different, the data to be transmitted with higher priority is transmitted first; when the priorities of the data to be transmitted corresponding to the service type field are the same, the data to be transmitted with higher priority corresponding to the data length represented by the length information is transmitted first; in the second priority connection pool, the data to be transmitted with higher priority corresponding to the data length represented by the length information is transmitted first; wherein, the data length represented by the length information is negatively correlated with the priority. Therefore, the present invention dynamically divides the connection pool according to the service type field, and prioritizes the transmission of data to be transmitted with higher priority in different connection pools, effectively reducing the tail latency problem caused by mixed message transmission in the network environment, while also taking into account the low latency of high-priority messages, and effectively reducing the number of connections and resource consumption.
[0069] In some embodiments, the specific implementation of step S11 above, which classifies each piece of data to be transmitted into the first priority connection pool and the second priority connection pool according to the service type field, is as follows:
[0070] Determine whether the business type field indicates that the data to be transmitted belongs to a functional category;
[0071] If so, the data to be transmitted is the first priority data, and the first priority data is assigned to the first priority connection pool;
[0072] If not, the data to be transmitted is of the second priority, and the second priority data is assigned to the second-level connection pool.
[0073] In other words, this invention defines functional data as first-priority data, which needs to be placed in a first-priority connection pool; and classifies regular data (non-functional data) as second-priority data, which needs to be placed in a second-priority connection pool. Since the first-priority connection pool has a higher priority than the second-priority connection pool, it can also be determined that the priority of first-priority data is higher than the priority of second-priority data.
[0074] In addition, there is another possibility: when regular data needs to be transmitted in a short period of time and has a high priority, it can be marked and then the data to be transmitted can be assigned to the first priority data based on the mark. That is, it is determined whether the data to be transmitted has a transmission mark; if so, the data to be transmitted with the transmission mark is the first priority data and is assigned to the first priority connection pool.
[0075] Therefore, in the above situation, when the priorities of the data to be transmitted corresponding to the business type field are different, the specific implementation of transmitting the data to be transmitted first with higher priority is divided into two cases: the first case is that the first priority connection pool only includes the data to be transmitted belonging to the functional class; the second case is that the first priority connection pool includes the data to be transmitted belonging to the functional class and the data to be transmitted with transmission identifier.
[0076] For the first type of connection pool, where the first priority connection pool only includes data to be transmitted belonging to the functional data category, the priority of repair data within the functional data category is higher than that of control data. Therefore, the implementation is as follows: determine whether the data to be transmitted corresponding to the business type field belongs to the repair data category within the functional data category; if so, the data to be transmitted belonging to the repair data category is transmitted first; if not, the data to be transmitted corresponding to the business type field belongs to the control data category within the functional data category, and the data to be transmitted belonging to the control data category is transmitted after the data to be transmitted belonging to the repair data category. In other words, for the first type of connection pool, where the first priority connection pool only includes data to be transmitted belonging to the functional data category, the transmission order of the data to be transmitted is: data to be transmitted belonging to the repair data category - data to be transmitted belonging to the control data category.
[0077] For the second type of first-priority connection pool, which includes data to be transmitted that is functional data and data to be transmitted with transmission identifiers, the priority of data to be transmitted with transmission identifiers, data to be transmitted that is repair data, and data to be transmitted that is control data decreases in that order, with data to be transmitted with transmission identifiers being transmitted first. In other words, it can be understood that for the second type of first-priority connection pool, which includes data to be transmitted that is functional data and data to be transmitted with transmission identifiers, the transmission order of the data to be transmitted is: data to be transmitted with transmission identifiers - data to be transmitted that is repair data - data to be transmitted that is control data.
[0078] It should be noted that the embodiments provided by the present invention are only one possible implementation method, but are not limited to this only implementation method. Users can set their own implementation methods according to their needs.
[0079] This invention provides a method for classifying data to be transmitted and a method for determining the transmission order of data under this classification. This method can ensure a significant reduction in the tail latency of the data to be transmitted, ensure that the current transmission service meets the sub-millisecond response requirements under any load conditions, and prevent high-priority data to be transmitted from being interfered with by other data to be transmitted, thus avoiding command lag under heavy business pressure.
[0080] In some embodiments, since the data length represented by the length information is negatively correlated with the priority, but comparing each value corresponding to the data length would increase the computation significantly, the present invention can determine the corresponding priority by judging the length boundary threshold. The specific implementation is as follows: determine whether the data length represented by the length information is lower than the length boundary threshold; if so, the data to be transmitted that is lower than the length boundary threshold has a higher priority and is transmitted first; if not, the data to be transmitted that is higher than the length boundary threshold has a lower priority and is transmitted later. That is to say, it can be understood that when the data length represented by the length information in the data to be transmitted is lower than the first length boundary threshold, there is no distinction between the data to be transmitted; similarly, when the data length represented by the length information in the data to be transmitted is higher than the first length boundary threshold, there is no distinction between the data to be transmitted.
[0081] For example: If the first length threshold is 6KB, and there are two data items to be transmitted that are below the first length threshold and two data items that are above the first length threshold, then the length of the first data item to be transmitted is 3KB, the length of the second data item to be transmitted is 4KB, the length of the third data item to be transmitted is 8KB, and the length of the fourth data item to be transmitted is 9KB. The transmission order is as follows: First: First data item to be transmitted - Second data item to be transmitted - Third data item to be transmitted - Fourth data item to be transmitted; Second: Second data item to be transmitted - First and Second data items to be transmitted - Third data item to be transmitted - Fourth data item to be transmitted; Third: First data item to be transmitted - Second data item to be transmitted - Fourth data item to be transmitted - Third data item to be transmitted; Fourth: Second data item to be transmitted - First data item to be transmitted - Fourth data item to be transmitted - Third data item to be transmitted.
[0082] Of course, priority can also be determined based on the data length indicated by the length information. In this case, the smaller the data length, the higher the priority. For example, if the first piece of data to be transmitted is 3KB, the second piece of data is 4KB, the third piece of data is 8KB, and the fourth piece of data is 9KB, then there is only one possible transmission order: first piece of data to be transmitted - second piece of data to be transmitted - third piece of data to be transmitted - fourth piece of data to be transmitted.
[0083] Accordingly, there are two ways to obtain the length boundary threshold. For the first method: obtain the length information of each data to be transmitted within a preset time period; when the data length represented by any half of the length information is lower than the first threshold, the first threshold is used as the length boundary threshold. For example, if the initial length boundary threshold is set to 8KB, when the data length of 50% of the data to be transmitted recently is ≤4KB, 4KB is automatically used as the length boundary threshold, ensuring that the classification result matches the current load characteristics. For the second method: obtain the length information of each historical data to be transmitted; perform length analysis on the data length represented by the length information of each historical data to be transmitted within each time period using an adaptive model to obtain the second threshold corresponding to each time period; use the second threshold corresponding to the time period to which the current time belongs as the length boundary threshold. For example: if the second threshold corresponding to the first time period (24:00-6:00) is 4KB; the second threshold corresponding to the second time period (6:00-12:00) is 14KB; the second threshold corresponding to the third time period (12:00-16:00) is 8KB; the second threshold corresponding to the fourth time period (18:00-24:00) is 6KB; when the current time belongs to the third time period, the length boundary threshold is 8KB.
[0084] It should be noted that the embodiments provided by the present invention are only one possible implementation method, but are not limited to this only implementation method. Users can set their own implementation methods according to their needs.
[0085] The embodiments of the present invention provide a method for determining the transmission order based on length information, which distinguishes types in a more refined way, and ensures that high-priority data to be transmitted will not be interfered with by other data to be transmitted, thus avoiding command lag under heavy business pressure.
[0086] In some embodiments, the connection pool communication processing method provided by the present invention further includes, during the process of transmitting data to be transmitted:
[0087] Determine whether the utilization rate of the first priority connection pool is greater than the first allocation threshold;
[0088] If so, the capacity in the second priority connection pool that is below the second allocation threshold will be allocated to the first priority connection pool to achieve the purpose of expanding the first priority connection pool.
[0089] Determine whether the capacity in the second priority connection pool below the second allocation threshold includes data to be transmitted;
[0090] If so, the data to be transmitted within the capacity of the second allocation threshold will be allocated to the first priority connection pool.
[0091] In other words, in this embodiment of the invention, flexible resource allocation is adopted, and the capacity of each pool is dynamically adjusted based on real-time monitoring data. When the utilization rate in the first priority connection pool is greater than the first allocation threshold (e.g., 80%), the connection pool is automatically expanded; conversely, when the idle rate of the first priority connection pool is detected to be continuously higher than 30%, some of its connections are suspended to release hardware resources; the same applies to the second priority connection pool.
[0092] The specific expansion behavior is as follows: Capacity in the second priority connection pool that is below the second allocation threshold (e.g., 30%) is allocated to the first priority connection pool. At this point, the capacity in the first priority connection pool is the sum of its own capacity and the capacity corresponding to the second allocation threshold, thus achieving the expansion of the first priority connection pool. Furthermore, when the capacity allocated from the second priority connection pool to the first priority connection pool includes data to be transmitted, that data is also allocated to the first priority connection pool.
[0093] Meanwhile, in terms of configuration, if there is a backlog in the first priority connection pool queue, the traffic limit of the second priority connection pool is triggered, reducing the sending rate of the data to be transmitted in the second priority connection pool, and giving priority to freeing up bandwidth resources to process critical messages (first priority data).
[0094] In this invention, the expansion of the first priority connection pool can be achieved using a predictive function. For example, if the utilization rate is 5% in each cycle (two minutes) and the utilization rate in the current cycle is 78%, then in the next cycle, the utilization rate will be 83%, which is greater than the first allocation threshold (e.g., 80%). Therefore, the expansion operation of the first priority connection pool can be achieved in the current cycle.
[0095] Therefore, the connection pool communication processing method provided by the present invention has the following advantages:
[0096] 1. Optimize resource utilization
[0097] 1.1 The total number of channels between its processes is reduced, significantly reducing memory usage and network card cache pressure.
[0098] 1.2 The dynamic resource allocation mechanism keeps the utilization rate of the two connection pools stable in the golden range in the long term, avoiding extreme states of resource idleness and overload. This can improve resource utilization and enable rapid response when business surges.
[0099] 2. Improved network communication quality
[0100] 2.1 High-priority control significantly reduces the tail latency of data to be transmitted, ensuring that the metadata service meets the sub-millisecond response requirements under any load conditions, and that high-priority data to be transmitted will not be interfered with by business data, avoiding command lag under heavy business pressure.
[0101] 2.2 By eliminating mutual interference between large and small data to be transmitted through physical isolation, the throughput fluctuation range of large data to be transmitted is more stable. Furthermore, thanks to the reduction in the tail latency of metadata, the overall transmission latency is also reduced, thereby improving the performance and stability of the storage system.
[0102] 3. Enhanced system robustness
[0103] 3.1 Centralized management of the connection pool simplifies the fault recovery process. After a node restarts abnormally, the transmission channel can be rebuilt in seconds, which is significantly faster than traditional solutions.
[0104] Figure 3 A structural diagram of an electronic device provided in an embodiment of the present invention, such as... Figure 3 As shown, the electronic device includes: a memory 60 for storing computer programs;
[0105] The processor 61 is used to implement the steps of the connection pool communication processing method as described in the above embodiments when executing a computer program.
[0106] The electronic devices provided in this embodiment may include, but are not limited to, smartphones, tablets, laptops, or desktop computers.
[0107] The processor 61 may include one or more processing cores, such as a quad-core processor or an octa-core processor. The processor 61 may be implemented using at least one hardware form selected from Digital Signal Processing (DSP), Field-Programmable Gate Array (FPGA), and Programmable Logic Array (PLA). The processor 61 may also include a main processor and a coprocessor. The main processor, also known as the Central Processing Unit (CPU), is used to process data in the wake-up state; the coprocessor is a low-power processor used to process data in the standby state. In some embodiments, the processor 61 may integrate a Graphics Processing Unit (GPU), which is responsible for rendering and drawing the content to be displayed on the screen. In some embodiments, the processor 61 may also include an Artificial Intelligence (AI) processor, which handles computational operations related to machine learning.
[0108] The memory 60 may include one or more computer-readable storage media, which may be non-transitory. The memory 60 may also include high-speed random access memory and non-volatile memory, such as one or more disk storage devices or flash memory devices. In this embodiment, the memory 60 is used to store at least the following computer program 601, which, after being loaded and executed by the processor 61, is capable of implementing the relevant steps of the connection pool communication processing method disclosed in any of the foregoing embodiments. In addition, the resources stored in the memory 60 may also include an operating system 602 and data 603, etc., and the storage method may be temporary storage or permanent storage. The operating system 602 may include Windows, Unix, Linux, etc.
[0109] In some embodiments, the electronic device may further include a display screen 62, an input / output interface 63, a communication interface 64, a power supply 65, and a communication bus 66.
[0110] Those skilled in the art will understand that Figure 3 The structures shown do not constitute a limitation on electronic devices and may include more or fewer components than those shown.
[0111] It is understood that if the connection pool communication processing method in the above embodiments is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the current technology, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and executes all or part of the steps of the methods in the various embodiments of the present invention. The aforementioned storage medium includes: USB flash drive, mobile hard disk, read-only memory (ROM), random access memory (RAM), electrically erasable programmable ROM, register, hard disk, removable disk, CD-ROM, magnetic disk or optical disk, and other media capable of storing program code.
[0112] Based on this, embodiments of the present invention also provide a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps of the connection pool communication processing method described above.
[0113] Based on this, embodiments of the present invention also provide a computer program product, including a computer program / instruction, which, when executed by a processor, implements the steps of the connection pool communication processing method based on traffic classification described above.
[0114] The foregoing has provided a detailed description of a connection pool communication processing method, device, and medium provided by embodiments of the present invention. The various embodiments are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the apparatus disclosed in the embodiments, since it corresponds to the method disclosed in the embodiments, the description is relatively simple; relevant parts can be referred to in the method section.
[0115] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.
[0116] The foregoing has provided a detailed description of the connection pool communication processing method, device, and medium provided by the present invention. Specific examples have been used to illustrate the principles and implementation methods of the present invention. The descriptions of the embodiments above are merely for the purpose of helping to understand the method and core ideas of the present invention. It should be noted that those skilled in the art can make various improvements and modifications to the present invention without departing from its principles, and these improvements and modifications also fall within the protection scope of the claims of the present invention.
Claims
1. A connection pool communication processing method, applied to inter-process communication in a distributed storage system based on the RoCEv2 protocol, characterized in that, include: Configure a first-priority connection pool and a second-priority connection pool. The first-priority connection pool is configured with a shallow queue and hardware acceleration strategy, and the queue depth is no greater than a preset first depth threshold. The second-priority connection pool is configured with a deep queue and batch transmission optimization, and the queue depth is no less than a preset second depth threshold. It supports RDMA_READ / WRITE semantics to achieve zero-copy big data stream processing. Each transmission channel is bound to an independent protection domain. In the user-space driver layer, a service level identifier is marked for each transmission channel. The service level identifier is converted into a priority queue identifier in the RoCEv2 protocol link layer to ensure consistent service quality across the entire link from application to hardware. Obtain the length information and service type field of each piece of data to be transmitted in the current process; The data to be transmitted is classified into the first priority connection pool and the second priority connection pool according to the service type field; wherein the first priority connection pool has a higher priority than the second priority connection pool. In the first priority connection pool, when the priorities of the data to be transmitted corresponding to the service type field are different, the data to be transmitted with higher priority is transmitted first; when the priorities of the data to be transmitted corresponding to the service type field are the same, the data to be transmitted with higher priority corresponding to the data length represented by the length information is transmitted first. In the second priority connection pool, the data to be transmitted with the higher priority corresponding to the data length represented by the length information is transmitted first. Wherein, the length information representing the data length is negatively correlated with the priority; During the transmission of the data to be transmitted, it is determined whether the utilization rate of the first priority connection pool is greater than the first allocation threshold; if so, the capacity of the second priority connection pool that is lower than the second allocation threshold is allocated to the first priority connection pool to achieve the purpose of expanding the first priority connection pool; it is determined whether the capacity of the second priority connection pool that is lower than the second allocation threshold includes the data to be transmitted; if so, the data to be transmitted in the capacity of the second allocation threshold is allocated to the first priority connection pool.
2. The connection pool communication processing method according to claim 1, characterized in that, The step of classifying each piece of data to be transmitted into a first priority connection pool and a second priority connection pool according to the service type field includes: Determine whether the business type field indicates that the data to be transmitted belongs to a functional category; If so, the data to be transmitted is first priority data, and the first priority data is assigned to the first priority connection pool; If not, the data to be transmitted is of the second priority, and the second priority data is assigned to the second priority connection pool.
3. The connection pool communication processing method according to claim 2, characterized in that, The step of classifying each piece of data to be transmitted into a first priority connection pool and a second priority connection pool according to the service type field further includes: Determine whether the data to be transmitted contains a transmission identifier; If so, the data to be transmitted with the transmission identifier is the first priority data, and the first priority data is assigned to the first priority connection pool.
4. The connection pool communication processing method according to claim 3, characterized in that, When the priorities of the data to be transmitted corresponding to the service type field are different, the data with higher priority is transmitted first, including: Determine whether the data to be transmitted corresponding to the business type field belongs to the repair data in the functional data category; If so, the data to be transmitted that belongs to the repair data will be transmitted first; If not, the data to be transmitted corresponding to the business type field belongs to the control data in the functional data, and after the data to be transmitted belonging to the repair data is transmitted, the data to be transmitted belonging to the control data is transmitted.
5. The connection pool communication processing method according to claim 4, characterized in that, The provision that when the priorities of the data to be transmitted corresponding to the service type field are different, the data to be transmitted with higher priority is transmitted first further includes: If the data to be transmitted carries the transmission identifier, the priority of the data to be transmitted carrying the transmission identifier, the data to be transmitted belonging to the repair data, and the data to be transmitted belonging to the control data decreases in that order, and the data to be transmitted carrying the transmission identifier is transmitted first.
6. The connection pool communication processing method according to claim 1, characterized in that, The data to be transmitted with higher priority corresponding to the data length represented by the length information is transmitted first, including: Determine whether the data length corresponding to the length information is lower than the length boundary threshold; If so, the data to be transmitted that is below the length boundary threshold will be transmitted first; If not, then after the data to be transmitted is below the length boundary threshold, the current data to be transmitted is transmitted.
7. The connection pool communication processing method according to claim 6, characterized in that, Obtaining the length boundary threshold includes: Obtain the length information of each of the data to be transmitted within a preset time period; When the data length represented by any half of the length information is lower than the first threshold, the first threshold is used as the length boundary threshold. or; Obtain the length information of each historical data to be transmitted; An adaptive model is used to analyze the length of the data represented by the length information corresponding to each of the historical data to be transmitted in each time period, so as to obtain the second threshold corresponding to each time period. The second threshold corresponding to the time period to which the current time belongs is used as the length boundary threshold.
8. An electronic device, characterized in that, include: Memory, used to store computer programs; A processor for executing the computer program to implement the steps of the connection pool communication processing method as described in any one of claims 1 to 7.
9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the steps of the connection pool communication processing method as described in any one of claims 1 to 7.