A high concurrency communication service platform and method

By monitoring TCP connection status in real time, assessing resource consumption, and constructing pressure and deadlock risk indices, the upper limit of connection reuse is dynamically adjusted, solving the problem of improper setting of connection reuse upper limit in high-concurrency communication services, and achieving efficient resource utilization and stability improvement.

CN120455524BActive Publication Date: 2026-01-27WUHAN YUNJI TIANCHENG INFORMATION TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510791184.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-06-13
Publication Date
2026-01-27
Estimated Expiration
2045-06-13

AI Technical Summary

Technical Problem

In high-concurrency communication service scenarios, an unreasonable connection reuse limit setting may lead to system resource exhaustion, slow service response, or even crashes. Existing systems have failed to effectively solve this problem.

Method used

By monitoring the operational status data of TCP connections in real time, assessing resource consumption, constructing connection reuse pressure and deadlock risk indices, dynamically adjusting the connection reuse limit, and utilizing pressure result analysis and deadlock result analysis mechanisms, intelligent correction of the connection reuse limit can be achieved.

Benefits of technology

It improves the intelligence level of connection scheduling and resource utilization efficiency in high-concurrency scenarios, reduces connection failure rate and system false response probability, improves the stability and throughput of communication services, and enhances the elasticity and availability of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120455524B_ABST
    Figure CN120455524B_ABST
Patent Text Reader

Abstract

The application discloses a high-concurrency communication service platform and method, relates to the technical field of network communication, determines a to-be-served connection in a kernel-level network protocol stack of an operating system, acquires running state data of the to-be-served connection, generates a running data set after preprocessing, evaluates resource consumption of each to-be-served connection on each resource during each multiplexing according to the running data set, acquires an initial connection multiplexing upper limit of the corresponding to-be-served connection, extracts features from the running data set, judges the starting of a stress result analysis mechanism and a dead result analysis mechanism, generates stress results and dead results, and the stress results are used for correcting the initial connection multiplexing upper limit of the corresponding to-be-served connection, and the dead results are used for correcting the initial connection multiplexing upper limit of the corresponding to-be-served connection again, so as to be applied to the operating system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of network communication technology, specifically to a high-concurrency communication service platform and method. Background Technology

[0002] With the continuous expansion of information infrastructure, network communication technology, as the core means of data interaction between computer systems and terminal devices, has been widely deployed in complex environments such as cloud platforms, IoT systems, and edge computing nodes. Within this technology system, high-concurrency communication services, as a key supporting capability for simultaneous access by multiple users and high-frequency data interaction, undertake the tasks of task traffic scheduling and concurrent control of multi-path data transmission. Especially at the protocol reuse level, connection reuse mechanisms are widely used in TCP long connection management to achieve efficient utilization of limited resources. Specifically, in high-concurrency communication scenarios, systems often need to reuse and schedule TCP connections while maintaining stable connection quality to reduce connection reconstruction costs and alleviate system load.

[0003] To address the issue of controlling reuse behavior in the aforementioned high-concurrency communication service scenarios, current systems often only consider the application of connection reuse mechanisms. This is because connection reuse technology can effectively reduce resource overhead and improve system performance in high-concurrency communication services. However, if the connection reuse limit is not set reasonably, it may lead to system resource exhaustion, slower service response, or even crashes. Currently, the system ignores setting a limit on connection reuse on TCP connections. Summary of the Invention

[0004] To address the shortcomings of existing technologies, this invention provides a high-concurrency communication service platform and method, which solves the problems mentioned in the background.

[0005] To achieve the above objectives, the present invention provides the following technical solution: a high-concurrency communication service platform and method, comprising the following steps:

[0006] Identify the pending connections in the operating system kernel-level network protocol stack, obtain the runtime status data of the pending connections, and generate a runtime dataset after preprocessing.

[0007] Based on the running dataset, evaluate the resource consumption of each pending connection on each resource during each reuse, and obtain the initial connection reuse limit for the corresponding pending connection.

[0008] Feature extraction is performed on the running dataset to determine the activation of the stress result analysis mechanism and the dead result analysis mechanism, so as to generate stress results and dead results. The stress results are used to correct the initial connection reuse limit of the corresponding pending connection, and the dead result is used to correct the initial connection reuse limit of the corresponding pending connection again, so as to be applied to the operating system.

[0009] Preferably, in the operating system kernel-level network protocol stack, based on the protocol and business communication behavior carried by each TCP connection, it is determined whether each TCP connection in the operating system kernel-level network protocol stack should be included in the reuse pool, so as to establish a connection reuse mechanism for the corresponding TCP connection, and count the total number of TCP connections included in the reuse pool, and mark the TCP connections included in the reuse pool as connections to be served.

[0010] After the high-concurrency communication service starts, the running status data of the connections to be served is collected in real time, including the CPU time, memory usage, bandwidth usage, waiting time distribution of the connection reuse queue, number of successful and failed connection reuses, connection reuse frequency, and connection health status of the corresponding connection to be served during each reuse. The connection health status includes connection response timeout rate and heartbeat detection failure rate.

[0011] The operational status data is preprocessed to remove duplicate and outlier values ​​and is normalized. Dimensionless processing techniques are then used to standardize the operational status data to eliminate dimensional differences between different parameters, generating an operational dataset.

[0012] Preferably, based on the running dataset, the resource consumption of each connection to be served on each resource during each reuse is evaluated to obtain the average resource consumption across different resource dimensions, including average CPU time, average memory usage, and average bandwidth usage, specifically:

[0013] The average CPU time of each pending connection during each reuse is calculated by using the CPU time consumed by each pending connection in each reuse and the number of reuses.

[0014] The average memory consumption of each pending service connection during each reuse is calculated by using the memory usage of each pending service connection during each reuse and the number of reuses.

[0015] The average bandwidth consumption of each pending connection during each reuse is calculated by using the bandwidth usage of each pending connection during each reuse and the number of reuses.

[0016] Based on the average resource consumption and consumption threshold of each pending connection in different resource dimensions, the theoretical connection reuse count of each pending connection in different resource dimensions is analyzed to obtain the resource reuse set. The resource reuse set includes the theoretical maximum connection reuse count of each pending connection in the CPU resource dimension, the theoretical maximum connection reuse count in the memory resource dimension, and the theoretical maximum connection reuse count in the bandwidth resource dimension.

[0017] The minimum value of the theoretical maximum number of connection reuses is extracted from the resource reuse set and used as the initial connection reuse limit for the corresponding pending connection.

[0018] Preferably, during the operation of the communication service, the running status data of each connection to be served is continuously monitored, and the number of connection reuse failures and the average waiting time of the connection reuse queue are extracted.

[0019] If the proportion of connection reuse failures to total connection requests exceeds a preset threshold, and the average waiting time of the connection reuse queue exceeds a preset time threshold, it indicates that the current connection to be served is under a risk of abnormal resource scheduling in the current connection reuse state, triggering the stress result analysis mechanism; otherwise, the stress result is 1.

[0020] Initiate a stress result analysis mechanism to analyze the resource scheduling stress state of the corresponding pending connections under the current connection reuse status, and calculate the connection reuse stress index of the corresponding pending connections. Specifically: In the formula, The connection reuse pressure index for the corresponding pending connections. This represents the percentage of connection reuse failures out of the total number of connection requests. This is the proportional threshold. The average waiting time for the connection multiplexing queue. This is the time threshold.

[0021] Preferably, when the connection reuse pressure index of the corresponding pending connection is greater than 1, it indicates that the initial connection reuse upper limit of the current pending connection is insufficient. In this case, the initial connection reuse upper limit of the corresponding pending connection will be corrected; otherwise, no correction will be made.

[0022] The specific steps for correction include:

[0023] Extract time-series sample values ​​of connection multiplexing frequency within historical periods from historical data to obtain a sample sequence;

[0024] Based on the sampled sequences, the trend of connection reuse frequency changes over historical periods is analyzed to derive predictive control factors. Specifically, a univariate linear regression is performed on the sampled sequences to construct a univariate linear regression model. The specific expression of the univariate linear regression model is as follows: In the formula, This represents the number of connection reuses for the i-th pending connection at the k-th time sampling point. Let be the slope of the reuse frequency variation trend of the i-th connection to be served. For the k-th time sampling point, Let k be the regression intercept of the i-th connection to be served, k be the time sampling point number, and i be the connection number to be served.

[0025] The slope of the reuse frequency change trend is used as a predictive control factor for adjusting the initial connection reuse upper limit.

[0026] Preferably, the specific steps of the correction also include:

[0027] Based on the predictive adjustment factor adjusted from the initial connection reuse cap, and combined with the connection reuse pressure index of the corresponding pending connections, the initial connection reuse cap for the corresponding pending connections is adjusted to obtain a new connection reuse cap, specifically: ,in, This represents the upper limit for new connection reuse for the i-th pending connection. This represents the initial connection reuse limit for the i-th pending connection. The connection reuse pressure index is the i-th connection to be served.

[0028] Preferably, based on the real-time monitored connection health status, if the connection response timeout rate exceeds the preset timeout threshold and the heartbeat detection failure rate exceeds the preset failure threshold, it indicates that the current corresponding pending connection is at risk of being in a dead state, triggering the dead result analysis mechanism; otherwise, the dead result is 1.

[0029] Initiate a deadlock result analysis mechanism to analyze the risk level of the current pending connection being in a deadlock state, and calculate the deadlock risk index of the corresponding pending connection, specifically: In the formula, The risk index for the apparent failure of the corresponding pending connection. For connection response timeout rate, This is the timeout threshold. For heartbeat detection failure rate, This is the failure threshold.

[0030] Preferably, when the false death risk index exceeds the maximum false death risk index in the historical period, the current corresponding pending connection is determined to be an inactive connection, and a feedback instruction is sent to the other end through the Zero Window notification method;

[0031] When the peer receives the feedback instruction, it removes the corresponding pending connection from the reuse pool and stops sending all data to the corresponding pending connection in order to dynamically optimize resource utilization.

[0032] Preferably, when the deadlock risk index of the corresponding pending connection is greater than 1 and does not exceed the maximum deadlock risk index in the historical period, it indicates that the number of connection reuse failures in the current pending connection is at risk of being distorted by connection deadlock. In this case, the new connection reuse limit of the corresponding pending connection will be adjusted again. Otherwise, no adjustment will be made. The specific adjustment steps include:

[0033] The false death risk index is normalized and compressed using a nonlinear normalization compression function to obtain the compressed false death risk index.

[0034] The adjusted upper limit for connection reuse is calculated as follows: ,in, To correct the upper limit of connection reuse, This is the risk index for apparent death after compression;

[0035] The revised connection reuse limit is used as a further revision of the new connection reuse limit in the corresponding pending connections, and then applied to the operating system.

[0036] A high-concurrency communication service platform includes a data acquisition module, a preliminary design module, and a correction module;

[0037] The acquisition module is used to identify the connections to be served in the operating system kernel-level network protocol stack, and to acquire the running status data of the connections to be served. After preprocessing, it generates a running dataset.

[0038] The initial module is used to evaluate the resource consumption of each connection to be served during each reuse based on the running dataset, and to obtain the initial connection reuse limit of the corresponding connection to be served.

[0039] The correction module is used to extract features from the running dataset, determine the activation of the stress result analysis mechanism and the dead result analysis mechanism, and generate stress results and dead results. The stress results are used to correct the initial connection reuse limit of the corresponding pending connection, and the dead results are used to correct the initial connection reuse limit of the corresponding pending connection again, so as to be applied to the operating system.

[0040] This invention provides a high-concurrency communication service platform and method, which has the following beneficial effects:

[0041] (1) By collecting and standardizing the runtime status data such as CPU time consumption, memory usage, and bandwidth usage of each TCP connection during the reuse process, a runtime dataset is formed to realize connection-level resource consumption modeling and load quantification. Furthermore, the method introduces a connection reuse pressure result analysis mechanism and a dead connection result analysis mechanism. During service operation, it dynamically judges whether there is resource scheduling tension or abnormal state drift of the connection, thereby realizing phased correction of the connection reuse limit and avoiding problems such as connection queuing, resource waste, or dead connection blocking caused by improper reuse limit setting. By introducing the historical reuse frequency change trend for predictive regulation, the reuse limit setting has adaptive capability. At the same time, a dead connection risk index is constructed using the connection response timeout rate and heartbeat failure rate to realize the identification of potential dead connections and the upper limit suppression strategy. It is fed back to the peer through the Zero Window method to eliminate inefficient connection channels from the system level and release scheduling resource space. Finally, this method can effectively improve the intelligence level and resource utilization efficiency of connection reuse scheduling in high-concurrency scenarios, reduce the connection failure rate and the probability of system false response, and improve the stability and throughput of the overall communication service.

[0042] (2) By continuously monitoring the dynamic operating status of each pending connection during the operation of the communication service, a connection reuse pressure index is constructed, and the load intensity and resource matching degree of the current connection reuse scheduling are judged based on the index, thereby realizing intelligent correction of the initial connection reuse upper limit. Compared with the fixed reuse threshold or static experience configuration method in the traditional reuse mechanism, this method automatically activates the pressure result analysis mechanism when the number of connection reuse failures and the waiting time of the reuse queue exceed the preset threshold, and objectively assesses whether there is a tense or unbalanced state in the allocation of connection resources, thereby avoiding abnormalities such as resource overload or connection blocking. By introducing a univariate linear regression modeling method to perform trend analysis on the frequency of connection reuse in historical periods, this invention can accurately extract the dynamic growth or decline trend of connection reuse behavior based on the behavioral characteristics of time series. This trend not only reflects the growth rate of connection reuse demand, but also dynamically adapts to the adjustment of reuse strategy under burst traffic, nonlinear growth or decline, and enhances the elastic response capability of the system in high-concurrency scenarios. Ultimately, by combining the reuse frequency trend adjustment factor with the connection reuse pressure index, a comprehensive correction value for the initial reuse limit is formed, which realizes the intelligent enhancement of connection reuse capacity under high resource scheduling conditions. This not only ensures the continuity of connection reuse services, but also avoids problems such as service delays, queue expansion and failure rate spikes caused by insufficient upper limit, thereby improving the overall system throughput and stability.

[0043] (3) By monitoring the health status of connections in real time and constructing a dead connection risk assessment mechanism based on connection behavior patterns, potential dead connections can be effectively identified to quantify the current connection inactivation trend, exhibiting high sensitivity and dynamic adaptability. When the dead connection risk index exceeds the historical maximum level, the system can immediately determine that the connection is inactive and quickly send feedback instructions to the peer through the Zero Window notification method in the standard network mechanism. Cross-host connection termination coordination can be achieved without building additional control protocols. This method not only reduces development complexity and system overhead, but also achieves a balance between protocol compatibility and deployment flexibility. After receiving the Zero Window feedback, the peer immediately removes the corresponding inactive connection from its maintained reuse pool and terminates data transmission to that connection, avoiding the waste of system resources on unresponsive connections, thereby realizing the recycling and redistribution of connection resources. This mechanism not only reduces the risk of resource hanging and blocking caused by connection dead connections, but also significantly improves the dynamic activity of the reuse pool, ensuring more efficient and accurate resource scheduling in high-concurrency scenarios, thereby enhancing the system's availability, load resistance, and service continuity.

[0044] (4) This invention introduces a nonlinear normalized compression function to suppressively adjust the connection state in the critical range of apparent death risk (apparent death risk index is greater than 1 but has not exceeded the historical maximum value). It can dynamically reduce the connection reuse upper limit without immediately removing the connection, thereby effectively suppressing the distortion interference of potential apparent death risk on resource scheduling accuracy. This mechanism is particularly suitable for handling connections in the early stage of apparent death and with strong uncertainty of state drift. It can prevent excessive removal due to slight anomalies being misjudged as completely inactive. This invention designs a flexible control path, that is, by applying nonlinear compression to the apparent death risk index, the compressed risk value is obtained and used as the reuse upper limit adjustment factor to generate a corrected connection reuse upper limit with more precise control capability, realizing the dynamic reduction adjustment of reuse capability. This mechanism not only retains the evaluation space of connection activity, but also corrects the excessively high setting of the reuse upper limit in the previous round. In addition, when the apparent death risk index exceeds the historical peak, the system can decisively determine that the connection is in a substantial inactive state and remove it in time, reflecting the hierarchical response capability of the system in the process of connection state evolution. Attached Figure Description

[0045] Figure 1 This is a schematic diagram of a high-concurrency communication service method according to the present invention;

[0046] Figure 2 This invention provides a high-concurrency communication service method logic;

[0047] Figure 3 This is a trend chart showing the frequency variation of connection multiplexing in a high-concurrency communication service method of the present invention;

[0048] Figure 4 This is a block diagram of a high-concurrency communication service platform according to the present invention. Detailed Implementation

[0049] 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 skilled in the art without creative effort are within the scope of protection of the present invention. Example

[0050] Please see Figures 1 to 3 This invention provides a high-concurrency communication service method, comprising the following steps:

[0051] Identify the pending connections in the operating system kernel-level network protocol stack, obtain the runtime status data of the pending connections, and generate a runtime dataset after preprocessing.

[0052] The network protocol stack in an operating system is a software module responsible for handling network communication protocols. It mainly resides in the kernel mode of the operating system and is responsible for handling the following from the bottom layer: receiving and sending packets; parsing protocols such as IP, TCP, UDP, ARP, and ICMP; port management and TCP state machine maintenance; establishing and closing connections (such as TCP three-way handshake and four-way handshake); route lookup and packet forwarding.

[0053] Based on the running dataset, evaluate the resource consumption of each pending connection on each resource during each reuse, and obtain the initial connection reuse limit for the corresponding pending connection.

[0054] Feature extraction is performed on the running dataset to determine the activation of the stress result analysis mechanism and the dead result analysis mechanism, so as to generate stress results and dead results. The stress results are used to correct the initial connection reuse limit of the corresponding pending connection, and the dead result is used to correct the initial connection reuse limit of the corresponding pending connection again, so as to be applied to the operating system.

[0055] In this embodiment, by establishing a mechanism for sensing the running status and controlling the reuse behavior of connections waiting to be served in the network protocol stack at the operating system kernel level, the system can effectively improve the connection scheduling efficiency and connection activity identification capability in high-concurrency scenarios, thereby achieving precise dynamic setting of the upper limit of connection reuse and significant optimization of system resource utilization.

[0056] This method, through a three-pronged approach of operational status data-driven operation, resource consumption assessment, and risk perception analysis, enables connection reuse behavior to no longer rely on fixed thresholds or static parameter settings, thus truly achieving intelligent reuse control and dynamic response at the connection level.

[0057] By performing fine-grained evaluations of resource consumption such as CPU time, memory usage, and bandwidth usage for each connection to be served during each reuse process, personalized reuse limits can be set for different connections based on the actual operating load, avoiding resource waste and bottleneck problems caused by a uniform reuse threshold.

[0058] By leveraging the stress result analysis mechanism, the reuse failure rate and queuing delay can be monitored in real time, a connection reuse stress index can be constructed, and the reuse limit can be dynamically adjusted. This can effectively avoid systemic anomalies such as connection blocking and task backlog caused by scheduling resource shortages during the reuse process.

[0059] By combining the analysis of heartbeat detection failure rate and response timeout rate, connections that may be in a dead state can be identified, and a dead state risk index can be constructed. The reuse strategy of the connection can be further improved to prevent dead connections from continuously occupying reuse pool resources and affecting the overall service quality.

[0060] Taking a large online e-commerce platform as an example, when the system faces millions of concurrent accesses from clients during a flash sale, if the traditional static connection limit model is used, the system needs to reserve a large amount of redundant resources to prevent congestion. However, with the method described in this invention, the high-concurrency communication module in the platform's backend can identify the reuse behavior and resource occupancy status of each TCP connection in real time, dynamically set the number of reuses that each connection can withstand, and the system judges whether to increase the connection capacity based on the pressure index. If some connections experience response lag or heartbeat interruption, a fake dead evaluation is immediately performed and an interrupt command is sent to the other end to remove them, thereby ensuring that the requests of active users are processed first, improving the overall business response speed and the system's stress resistance. Example

[0061] Please refer to Figures 1 to 3 Specifically: In the operating system kernel-level network protocol stack, based on the protocols and business communication behaviors carried by each TCP connection, it is determined whether each TCP connection in the operating system kernel-level network protocol stack should be included in the reuse pool, so as to establish a connection reuse mechanism for the corresponding TCP connection, and count the total number of TCP connections included in the reuse pool, and mark the TCP connections included in the reuse pool as connections to be served.

[0062] The pending connection is used to set an appropriate connection reuse limit for subsequent corresponding TCP connections;

[0063] The protocols carried by each TCP connection refer to the application layer protocols or business communication protocols carried by the TCP connection. TCP is a "transport layer protocol" and it does not know "what to transmit". The upper layer protocols, such as HTTP, WebSocket, gRPC, FTP, MQTT, etc., truly define "how to use this TCP channel".

[0064] Business communication behavior refers to whether there is frequent interaction, which can be determined by heartbeat behavior. Heartbeat behavior is a small "liveness detection packet" or "state synchronization packet" that is periodically and actively sent by the client or server to maintain the active state of the connection or to detect the liveness of the other party, and to determine whether there is a subsequent interaction plan and whether the connection needs to be kept alive.

[0065] A reuse pool refers to a set of established, unclosed TCP connections marked as reusable in a system. It is managed and allocated by the connection scheduler to support the distribution of subsequent reuse requests. In other words, it is a resource pool whose members are active TCP connections that support the reuse protocol.

[0066] Connection reuse limit refers to the maximum number of logical sessions or request tasks that are allowed to be reused concurrently within the same TCP connection.

[0067] Connection multiplexing refers to a mechanism where multiple data requests or responses are completed within the same network connection channel, eliminating the need to re-establish a connection each time. This reduces system resource overhead and improves communication efficiency and response speed. However, it's important to note that while connection multiplexing improves performance, unlimited multiplexing can easily lead to problems, including:

[0068] Long-lived connections may cause memory leaks, out-of-order data packets, and residual state.

[0069] All requests are pushed onto a single connection; disconnecting it interrupts all tasks.

[0070] Excessive reuse makes it impossible for load balancing algorithms to reschedule requests;

[0071] DDoS attackers can use reuse mechanisms to continuously occupy connection resources;

[0072] Therefore, in high-concurrency communication services, it is necessary to set a connection reuse limit for the corresponding TCP connections.

[0073] A TCP connection refers to a logical channel established between two terminals, such as a client and a server, for reliable data transmission. It is created by a three-way handshake process and closed by a four-way handshake process. Simply put, it means that one party (client or server) has gone offline or is abnormally stuck, but the other party is unaware of this and continues to send data, resulting in phenomena such as response timeout, data not being returned, and processing being suspended.

[0074] TCP connections can connect to the carrier or underlying channel of a connection multiplexing mechanism. The connection multiplexing mechanism reuses multiple logical requests, tasks or sessions on top of a single TCP connection.

[0075] After the high-concurrency communication service starts, the running status data of the connections to be served is collected in real time, including the CPU time, memory usage, bandwidth usage, waiting time distribution of the connection reuse queue, number of successful and failed connection reuses, connection reuse frequency, and connection health status of the corresponding connection to be served during each reuse. The connection health status includes connection response timeout rate and heartbeat detection failure rate.

[0076] The operational status data is preprocessed to remove duplicate and outlier values ​​and is normalized. Dimensionless processing techniques are then used to standardize the operational status data to eliminate dimensional differences between different parameters, generating an operational dataset.

[0077] For example, when a parameter shows an extremely high value at an instant, and the fluctuation of the preceding and following data exceeds three times the normal range standard deviation, it is judged as an outlier and removed. The outlier is then filled by the weighted average of the adjacent data. Here, the weighting is based on the proximity of the time series, with the closer the distance, the higher the weight.

[0078] The connection heartbeat detection involves periodically sending probe packets to a single connection. If no response is received within a specified time, it is recorded as a heartbeat detection failure for that connection.

[0079] Normalization using the min-max normalization method maps features to the range of 0 to 1. After normalization, the contribution of each feature to the result is more balanced, ensuring the normal operation of the algorithm.

[0080] Based on the runtime dataset, the resource consumption of each pending connection during each reuse is evaluated to obtain average resource consumption across different resource dimensions, including average CPU time, average memory usage, and average bandwidth usage. Specifically:

[0081] The average CPU time of each pending connection during each reuse is calculated by taking into account the CPU time consumed by each pending connection during each reuse and the number of reuses. The specific calculation method is as follows: sum the CPU time consumed by each reuse based on the number of reuses, and then calculate the average value of the summation results to obtain the average CPU time consumed by each reuse.

[0082] The average memory consumption of each pending connection during each reuse is calculated by using the memory usage of each pending connection during each reuse and the number of reuses. The specific calculation method is as follows: sum the memory usage of each reuse based on the number of reuses, and then calculate the average value of the summation results to obtain the average memory consumption of each reuse.

[0083] The average bandwidth consumption of each pending connection in each reuse is calculated by using the bandwidth usage of each pending connection in each reuse and the number of reuses. The specific calculation method is as follows: the bandwidth usage of each reuse is summed according to the number of reuses, and the sum is averaged to obtain the average bandwidth consumption in each reuse.

[0084] Based on the average resource consumption and consumption threshold of each pending connection in different resource dimensions, the theoretical connection reuse count of each pending connection in different resource dimensions is analyzed to obtain the resource reuse set. The resource reuse set includes the theoretical maximum connection reuse count of each pending connection in the CPU resource dimension, the theoretical maximum connection reuse count in the memory resource dimension, and the theoretical maximum connection reuse count in the bandwidth resource dimension.

[0085] The theoretical maximum number of connection reuses in different resource dimensions is obtained by calculating the ratio of the upper limit of the consumption threshold allowed by the system for the corresponding connection to the average resource consumption in the corresponding resource dimension.

[0086] Specifically: The theoretical maximum number of connection reuses for the corresponding pending connection in terms of CPU resources is calculated by the ratio between the system's maximum allowed total CPU time for the corresponding pending connection and its average CPU time.

[0087] The theoretical maximum number of connection reuses in terms of memory resources is calculated by the ratio between the system’s maximum allowed total memory usage for the corresponding pending connection and its average memory consumption.

[0088] The theoretical maximum number of connection reuses in terms of bandwidth resources is calculated by the ratio between the total bandwidth limit allowed by the system for the corresponding pending connection and its average bandwidth consumption.

[0089] The minimum value of the theoretical maximum number of connection reuses is extracted from the resource reuse set and used as the initial connection reuse limit for the corresponding pending connection.

[0090] In this embodiment, the method can perform multi-dimensional operational status awareness, resource consumption assessment, and dynamic modeling of reuse capabilities for multiple TCP connections based on the operating system kernel-level network protocol stack. By rationally constructing a reuse pool, this method effectively identifies connections with reuse value in high-concurrency scenarios and uniformly marks them as connections to be served, thereby improving the system's controllability and granularity precision in connection scheduling.

[0091] By collecting key operational parameters of the connections being served in real time during each reuse, such as CPU time consumption, memory usage, bandwidth usage, connection reuse frequency, and connection health status (including connection response timeout rate and heartbeat failure rate), the pressure distribution on system resources during connection reuse can be effectively quantified. For example, if a connection consumes up to 400ms of CPU time per reuse, far exceeding the average of 200ms for other connections, this connection will show high CPU pressure in resource analysis. Subsequently, the collected status dataset is preprocessed, including outlier removal, standard deviation exceeding the limit judgment, weighted smoothing imputation, and dimensionless normalization, to ensure that the input data has good temporal and feature consistency. For example, if a connection generates a peak instantaneous memory usage of up to 1.2GB, far exceeding the stable period average of 400MB, preprocessing can use the 3σ judgment method to identify it as an outlier and repair it, thereby avoiding single-point anomalies interfering with subsequent calculation logic.

[0092] In the resource assessment phase, the system calculates the average consumption per connection for each resource dimension and, combined with the system's total allowed resource threshold, derives the maximum number of reuses each connection can support under the current resource conditions. For example, if a connection uses an average of 80MB of memory per reuse, and the system's maximum memory threshold for that connection is 800MB, then its theoretical maximum number of connection reuses in terms of memory is 800 / 80 = 10 times. Finally, the minimum value extracted from the reusable upper limits of each resource dimension is used as the initial connection reuse upper limit for the current connection, ensuring that connection reuse behavior operates within the resource safety boundary and preventing single-point connection anomalies from dragging down the overall system scheduling.

[0093] In summary, this scheme constitutes a stable, adaptive, and fine-grained closed-loop control mechanism for connection reuse parameters. Its advantages include avoiding resource misjudgments inherent in traditional average experience-based models, supporting dynamic adjustment at the connection level, enhancing the system's scheduling robustness in the face of sudden high-concurrency traffic, reducing resource waste caused by dead connections, improving reuse efficiency and communication service quality, and achieving a data-driven connection reuse limit control mechanism throughout the entire process through quantitative indicators such as reuse frequency, waiting time, and resource usage ratio. For example, in a video live streaming system, a large number of clients establish TCP connections with the server to pull media streams. The method of this invention can evaluate the reuse potential of each client connection in real time. If certain connections exhibit low resource consumption and high stability during multiple reuses, the system can automatically increase their reuse limit; while for connections with large fluctuations in response and frequent heartbeat failures, their reuse frequency is promptly limited or they are removed from the reuse pool to ensure reasonable allocation of overall bandwidth resources and prevent bandwidth "starvation" problems. Example

[0094] Please refer to Figures 1 to 3 Specifically: During the operation of the communication service, continuously monitor the operating status data of each pending connection, and extract the number of connection reuse failures and the average waiting time of the connection reuse queue;

[0095] If the proportion of connection reuse failures to total connection requests exceeds a preset threshold, and the average waiting time of the connection reuse queue exceeds a preset time threshold, it indicates that the current connection to be served is under a risk of abnormal resource scheduling in the current connection reuse state, triggering the stress result analysis mechanism; otherwise, the stress result is 1.

[0096] The connection reuse queue is one of the core components of the connection reuse mechanism. It is mainly used to manage idle connections waiting to be reused and to coordinate the release and reallocation of connections. In essence, it is a data buffer structure, which is similar to the task queue in a thread pool, but the object of operation is the established TCP connection rather than the thread.

[0097] The average waiting time of the connection reuse queue is a key indicator for measuring the efficiency of the connection reuse mechanism, reflecting the average time it takes for an idle connection to be enqueued and reused.

[0098] Initiate a stress result analysis mechanism to analyze the resource scheduling stress state of the corresponding pending connections under the current connection reuse status, and calculate the connection reuse stress index of the corresponding pending connections. Specifically: In the formula, The connection reuse pressure index for the corresponding pending connections. This represents the percentage of connection reuse failures out of the total number of connection requests. This is the proportional threshold. The average waiting time for the connection multiplexing queue. As a time threshold, It calculates the proportion of connection multiplexing failure rate that exceeds the threshold, reflecting the degree of pressure increase caused by the increased failure rate. The calculation measures the percentage by which the average waiting time of the connection multiplexing queue exceeds the maximum allowed waiting time, reflecting the increased pressure caused by excessively long waiting times.

[0099] A stress result of 1 means that the connection reuse stress index of the corresponding pending connection is equal to 1.

[0100] The connection reuse pressure index is a dynamic quantitative indicator used to measure whether the resource scheduling of the system is under tension, high load or conflict under the current connection reuse state. It reflects the scheduling pressure and resource load distortion carried by the connection reuse mechanism. The features involved in its calculation have all been dimensionless.

[0101] When the connection reuse pressure index of the corresponding pending connection is greater than 1, it indicates that the initial connection reuse limit of the current pending connection is insufficient and the reuse scheduling is tight. At this time, the initial connection reuse limit of the corresponding pending connection will be corrected; otherwise, no correction will be made.

[0102] The specific steps for correction include:

[0103] Extract time-series sample values ​​of connection multiplexing frequency within historical periods from historical data to obtain a sample sequence;

[0104] Based on the sampled sequences, the trend of connection reuse frequency changes over historical periods is analyzed to derive predictive control factors. Specifically, a univariate linear regression is performed on the sampled sequences to construct a univariate linear regression model. The specific expression of the univariate linear regression model is as follows: The least squares method is used to perform linear fitting on the univariate time series to obtain the slope of the trend of the reuse frequency of the corresponding connection to be served.

[0105] In the formula, This represents the number of connection reuses for the i-th pending connection at the k-th time sampling point. Let be the slope of the reuse frequency variation trend of the i-th connection to be served. For the k-th time sampling point, Let k be the regression intercept of the i-th connection to be served, k be the time sampling point number, and i be the connection number to be served.

[0106] The regression intercept is used to assist in fitting the curve and is not directly used for decision-making. Here, it is not the "real number of reuses" in a physical sense, but rather the y-intercept of the line fitted by the least squares method. It is only a part of the regression line.

[0107] Simple linear regression is one of the most basic and common machine learning and statistical modeling methods. Its core purpose is to find the linear relationship between an independent variable x and a dependent variable y based on historical data, and to approximate the relationship with a straight line.

[0108] The slope of the reuse frequency change trend is used as a predictive control factor for adjusting the initial connection reuse upper limit.

[0109] The purpose of analyzing the trend of connection reuse frequency changes over historical periods to derive predictive control factors is to predict whether the system will enter a higher load state in the future.

[0110] Connection reuse frequency refers to the trend of the number of times each TCP connection is reused per unit time over a period of time. The slope of the reuse frequency change trend can reflect the possible future load trend of the current connection. Combined with the current reuse pressure index, it determines the reuse upper limit adjustment strategy of the connection, realizing elastic control and trend adaptation capabilities at the connection granularity.

[0111] When the predictive control factor is greater than 0, it indicates that the frequency of connection reuse is increasing, and the upper limit of reuse can be appropriately increased. When it is equal to 0, the frequency of reuse is stable, and the existing upper limit will be maintained. When it is less than 0, the frequency of use is decreasing, and reuse resources can be appropriately compressed.

[0112] The "no correction" step means that when the pressure result output is 1, the upper limit operation is not corrected and reused.

[0113] Specifically, the specific expression for the sampling sequence is as follows: Where n is the sliding window length and k is the time sampling point number. For the k-th time sampling point, Let i be the number of times the i-th pending connection is reused at the k-th time sampling point, where i is the pending connection number.

[0114] The specific steps for correction also include:

[0115] Based on the predictive adjustment factor adjusted from the initial connection reuse cap, and combined with the connection reuse pressure index of the corresponding pending connections, the initial connection reuse cap for the corresponding pending connections is adjusted to obtain a new connection reuse cap, specifically: ,in, This represents the upper limit for new connection reuse for the i-th pending connection. This represents the initial connection reuse limit for the i-th pending connection. The connection reuse pressure index is the i-th connection to be served.

[0116] In this embodiment, the present invention addresses the problems of frequent connection reuse failures and excessively long queuing times in high-concurrency communication services, which prevent timely adjustments to reuse strategies due to the introduction of a connection reuse pressure analysis mechanism. By combining dynamic monitoring with historical trend modeling, the system can accurately perceive and respond in real time to the reuse status of each pending connection during operation, thereby ensuring the scheduling stability and service robustness of the overall system under sudden loads.

[0117] In practice, the system continuously extracts operational status data for each connection to be served, including the number of connection reuse failures and the average waiting time of the reuse queue. When both of these indicators simultaneously exceed the system's set warning thresholds (e.g., failure rate > 10%, waiting time > 50ms), it is determined that the current connection has a reuse scheduling risk, triggering the calculation of the connection reuse pressure index. This index reflects the resource scheduling tension faced by the current connection. If its value is greater than 1, it indicates that the initial connection reuse limit is insufficient and needs to be corrected.

[0118] To achieve a more intelligent and forward-looking control strategy, the system further extracts historical data sequences of connection reuse frequency over a period of time, such as the number of reuses per minute: [12, 15, 17, 20, 25]. Using a univariate linear regression model, the system fits the trend of increasing reuse frequency over time, obtaining a positive slope, indicating a significant increase in connection load.

[0119] At this point, the slope is used as a predictive adjustment factor and introduced into the calculation of the reuse limit. The logic is that the greater the pressure, the less sufficient the current setting is, so the reuse limit needs to be increased. The higher the activity (i.e. the slope), the more likely the subsequent interaction frequency may increase, so more reuse resources should be reserved. Combining the two, the new limit is predicted to be enhanced in advance to adapt to load changes.

[0120] For example, if the initial limit for a connection is 10, the pressure index is 1.2, and the historical slope is 0.25, then: the new connection reuse limit = 10 * 1.2 * (1 + 0.25) = 15; indicating that the system increases the original reuse limit from 10 to 15 to better cope with the upcoming reuse peak and reduce queuing delays and failure probability.

[0121] In summary, this solution achieves elastic control and predictive optimization of the connection reuse limit based on real-time stress identification and historical trend modeling without interrupting service. Through this mechanism, not only is the agility of connection scheduling improved, but system performance degradation caused by resource waste and reuse failures is also effectively avoided, providing scalable and adaptive service assurance capabilities for high-concurrency environments. Example

[0122] Please refer to Figures 1 to 3 Specifically: Based on the real-time monitored connection health status, if the connection response timeout rate exceeds the preset timeout threshold and the heartbeat detection failure rate exceeds the preset failure threshold, it indicates that the current corresponding pending connection is at risk of being in a dead state, triggering the dead result analysis mechanism; otherwise, the dead result is 1.

[0123] In connection reuse scenarios, a "dead state" refers to a situation where one of the communicating parties is no longer functioning properly, but the connection appears intact from the network perspective. This causes the other party to mistakenly believe the connection is still available, leading to issues such as state drift, data retention, and abnormal system responses. This state typically manifests in the system as follows:

[0124] The client continues to send data to a server that has gone offline;

[0125] The server has already crashed, is abnormally blocked, or the thread it is in has expired but has not released connection resources;

[0126] The connection is still occupying space in the reuse pool;

[0127] The application layer does not see the disconnection notification, but it finds anomalies such as response timeout, data not being returned, and processing being suspended.

[0128] It should be noted that the dead state can severely affect the connection reuse limit control mechanism, and may even directly cause the limit control to fail or become distorted. If a new task is scheduled to a dead connection, the task cannot receive a timely response, which will cause the connection reuse waiting queue to lengthen and the queue to become severely blocked. The limit control logic may incorrectly judge "the limit needs to be increased" due to "too many waiting timeouts", which will further worsen the state. Furthermore, the reuse of a dead connection may cause a heartbeat detection failure. If dead connections are not taken into account, the reuse limit will be excessively increased, causing the limit control to fail or become distorted.

[0129] Initiate a deadlock result analysis mechanism to analyze the risk level of the current pending connection being in a deadlock state, and calculate the deadlock risk index of the corresponding pending connection, specifically: In the formula, The risk index for the apparent failure of the corresponding pending connection. For connection response timeout rate, This is the timeout threshold. For heartbeat detection failure rate, The failure threshold, The calculation measures the proportion of timeout rates that exceed the preset timeout rate threshold. It reflects the increased risk of system crashes due to a rise in timeouts. A timeout may mean that a request has not been responded to for a long time, which is a signal that there is a problem with the system. The higher the threshold is exceeded, the greater the impact on the risk of system crashes. This calculates the proportion of heartbeat failures exceeding the failure rate threshold. The heartbeat mechanism is used to detect the liveness of connections or components between systems. An excessively high heartbeat failure rate suggests that there may be serious problems with internal system communication. This item reflects the increased risk of system crashes due to an increase in heartbeat failures.

[0130] A "dead" result of 1 means that the dead risk index of the corresponding pending connection is equal to 1.

[0131] When the false death risk index exceeds the maximum false death risk index in the historical period, the current corresponding pending connection is determined to be a dead connection, and a feedback instruction is sent to the other end through the Zero Window notification method.

[0132] The apparent death risk index assesses the degree of risk of the system entering a apparent death state, so as to take corresponding measures to avoid the system falling into a false death predicament. The features involved in its calculation have all been dimensionless.

[0133] Zero Window notification is a state mechanism in the TCP protocol whereby the receiver informs the sender that "I cannot receive any more data at this time." Essentially, the receiver sets the window size to 0 in the window field of the TCP packet, telling the sender to pause data transmission.

[0134] When the peer receives the feedback instruction, it removes the corresponding pending connection from the reuse pool and stops sending all data to the corresponding pending connection in order to dynamically optimize resource utilization and avoid connections that continuously occupy resources in the reuse pool but cannot respond to scheduling tasks being removed in time.

[0135] The feedback instruction included: I am currently unable to receive any more data.

[0136] In this embodiment, the present invention achieves effective perception and dynamic release of abnormal resource usage caused by connection state drift or server inactivity in high-concurrency communication services by constructing a linkage mechanism for identifying and eliminating false dead states.

[0137] By monitoring the connection response timeout rate and heartbeat detection failure rate in real time, the system can quickly detect abnormal states where the connection has no feedback for a long time or does not respond as expected. When the connection exceeds the set threshold, the system triggers the dead result analysis mechanism to calculate the dead risk index and determine whether the connection has a high probability of failure.

[0138] For example, in actual operation, if a TCP connection fails to respond to probe packets for 10 consecutive seconds and its historical response timeout rate is higher than 70%, far exceeding the system's 30% threshold, the system will immediately identify it as a candidate for a dead connection. If its corresponding dead connection risk index exceeds the historical maximum risk value (i.e., the most dangerous connection state recorded by the system), the connection is considered inactive. At this time, the system sends a feedback instruction "I cannot receive more data at this time" to the peer through the Zero Window notification mechanism, thereby guiding the peer to terminate all data transmission tasks of the connection. This logical process is specifically divided into the following steps: anomaly identification, real-time collection of the connection's response timeout rate and heartbeat failure rate. If both exceed the preset threshold simultaneously, a dead connection risk calculation is triggered. The dead connection risk assessment obtains a dead connection risk index, which reflects the drift intensity of the connection under the two types of failure behaviors; historical comparison judgment: if the current dead connection risk index > the historical maximum risk value, it indicates that the connection state continues to deteriorate and enters the substantial inactive stage; connection removal: the system removes the dead connection through Zero Window. The Windows notification mechanism sends an interrupt command to the peer, which then removes the connection from the multiplexing pool, releasing its place in the connection table and scheduling resources.

[0139] Through the above mechanism, this invention solves key problems in high-concurrency systems such as the difficulty in timely release of dead connections, long-term resource occupation, and expansion of scheduling queues. It achieves dynamic compression of system load and precise resource reclamation, enhances the adaptive control capability of connection reuse strategy to abnormal states, and further improves the robustness of overall communication services and resource utilization efficiency. Example

[0140] Please refer to Figures 1 to 3 Specifically: when the deadlock risk index of the corresponding pending connection is greater than 1 and does not exceed the maximum deadlock risk index in the historical period, it indicates that the number of connection reuse failures in the current pending connection is at risk of being distorted by connection deadlock. In this case, the new connection reuse limit of the corresponding pending connection will be adjusted again; otherwise, no adjustment will be made.

[0141] Specifically, connection deadlock will distort the statistical results of connection failures. Specifically, deadlocked connections are often repeatedly scheduled and reused, but each time they fail due to no response or timeout. The system counts these as "connection failures". However, these failures are not due to normal task reuse failures, but because the connection itself is no longer available. Essentially, the connection is not interactive, not a task reuse failure. Therefore, the reuse limit of this connection should be appropriately lowered to avoid resource waste and scheduling misjudgments.

[0142] The specific steps for correction include:

[0143] The false death risk index is normalized and compressed using a nonlinear normalization compression function to obtain the compressed false death risk index.

[0144] The nonlinear normalized compression function has the following functional form: ,in, Here are the compressed parameters, and x is the parameter; the nonlinear normalized compression function is used to control its influence weight on the final decision result so that it is not excessively amplified, avoiding uncontrolled penalties or explosive compression in the calculation.

[0145] The adjusted upper limit for connection reuse is calculated as follows: ,in, To correct the upper limit of connection reuse, This is the risk index for apparent death after compression;

[0146] The reuse limit for each connection is suppressed by a false death risk index; that is, the higher the risk, the lower the reuse limit; the lower the risk, the more the reuse limit recovers to its original value.

[0147] The revised connection reuse limit is used as a further revision of the new connection reuse limit in the corresponding pending connections, and then applied to the operating system.

[0148] The "no correction" step means that when the false result outputs 1, the upper limit operation is reused without correction.

[0149] Of course, when the false death risk index exceeds the maximum false death risk index in the historical period, it also indicates that the number of connection reuse failures in the current pending connection is at risk of being distorted by connection false death. However, at this time, we will no longer focus on the degree of distortion risk, but on whether the current pending connection will be removed.

[0150] In this embodiment, the present invention introduces a false death risk index distortion correction mechanism. When the false death risk index exceeds the normal threshold but has not yet reached the historical maximum value, it does not directly perform connection removal processing. Instead, it makes a more flexible and gradual adjustment to the upper limit of connection reuse, which has strong dynamic adaptability and risk mitigation capabilities.

[0151] This mechanism effectively avoids premature reclamation of connection resources due to misjudgment or transient anomalies, ensuring service continuity and resource allocation stability. The progressive relationship between its logical steps lies in the following: Triggering condition judgment: When the connection's apparent death risk index exceeds 1 but does not exceed the historical maximum risk threshold, it indicates that while the connection behavior shows an abnormal trend, it has not yet reached the inactivation standard. At this point, the system judges it as a distortion risk state, meaning the connection may be experiencing performance distortion or scheduling misdirection caused by apparent death. Normalized compression processing: A nonlinear normalized compression function is introduced to form a control factor with a suppressive effect, eliminating direct comparison errors caused by different risk index distributions between different connections, ensuring stable and smooth control results. Reuse upper limit suppression correction: The compressed index is used as a proportional factor applied to the previously corrected new connection reuse upper limit to calculate the current round's revised upper limit. This achieves gentle compression of the upper limit, avoiding direct zeroing or false kills of connections, allowing connections to retain a certain activity window to continue attempting recovery, balancing risk control and service fault tolerance.

[0152] This mechanism can gradually reduce the reuse participation of connections without immediately eliminating them, thus ensuring the health of resource scheduling. On the other hand, it provides an observation window for false alarms or temporary anomalies, implementing a mild strategy of punishment without blocking. Ultimately, it improves the system's adaptive regulation capability, connection stability, and risk tolerance performance in complex high-concurrency environments, while ensuring the fairness and high availability of resource allocation. Example

[0153] Please refer to Figure 4 Specifically: a high-concurrency communication service platform, including a data acquisition module, a preliminary design module, and a correction module;

[0154] The acquisition module is used to identify the connections to be served in the operating system kernel-level network protocol stack, and to acquire the running status data of the connections to be served. After preprocessing, it generates a running dataset.

[0155] The initial module is used to evaluate the resource consumption of each connection to be served during each reuse based on the running dataset, and to obtain the initial connection reuse limit of the corresponding connection to be served.

[0156] The correction module is used to extract features from the running dataset, determine the activation of the stress result analysis mechanism and the dead result analysis mechanism, and generate stress results and dead results. The stress results are used to correct the initial connection reuse limit of the corresponding pending connection, and the dead results are used to correct the initial connection reuse limit of the corresponding pending connection again, so as to be applied to the operating system.

[0157] The thresholds involved in the above embodiments can be calculated using historical data, specifically determined using the principle of mean ± standard deviation.

[0158] Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the appended claims and their equivalents.

Claims

1. A high-concurrency communication service method, characterized in that: Includes the following steps, Identify the pending connections in the operating system kernel-level network protocol stack, obtain the runtime status data of the pending connections, and generate a runtime dataset after preprocessing. Based on the running dataset, evaluate the resource consumption of each pending connection on each resource during each reuse, and obtain the initial connection reuse limit for the corresponding pending connection. Feature extraction is performed on the running dataset to determine the activation of the stress result analysis mechanism and the dead result analysis mechanism, so as to generate stress results and dead results. The stress results are used to correct the initial connection reuse limit of the corresponding pending connection, and the dead result is used to correct the initial connection reuse limit of the corresponding pending connection again, so as to be applied to the operating system. In the operating system kernel-level network protocol stack, based on the protocols and business communication behaviors carried by each TCP connection, it is determined whether each TCP connection in the operating system kernel-level network protocol stack should be included in the reuse pool, so as to establish a connection reuse mechanism for the corresponding TCP connection, and count the total number of TCP connections included in the reuse pool, and mark the TCP connections included in the reuse pool as connections to be served. After the high-concurrency communication service starts, the running status data of the connections to be served is collected in real time, including the CPU time, memory usage, bandwidth usage, waiting time distribution of the connection reuse queue, number of successful and failed connection reuses, connection reuse frequency, and connection health status of the corresponding connection to be served during each reuse. The connection health status includes connection response timeout rate and heartbeat detection failure rate. The operational status data is preprocessed to remove duplicate values, outliers, and normalize the data. Dimensionless processing techniques are then used to standardize the operational status data to eliminate dimensional differences between different parameters and generate an operational dataset. During the operation of the communication service, the running status data of each pending connection is continuously monitored, and the number of connection reuse failures and the average waiting time of the connection reuse queue are extracted. If the proportion of connection reuse failures to total connection requests exceeds a preset threshold, and the average waiting time of the connection reuse queue exceeds a preset time threshold, it indicates that the current connection to be served is under a risk of abnormal resource scheduling in the current connection reuse state, triggering the stress result analysis mechanism; otherwise, the stress result is 1. Initiate a stress result analysis mechanism to analyze the resource scheduling stress state of the corresponding pending connections under the current connection reuse state, and calculate the connection reuse stress index of the corresponding pending connections, specifically: In the formula, The connection reuse pressure index for the corresponding pending connections. This represents the percentage of connection reuse failures out of the total number of connection requests. This is the proportional threshold. The average waiting time for the connection multiplexing queue. This is a time threshold; When the connection reuse pressure index of the corresponding pending connection is greater than 1, it indicates that the initial connection reuse limit of the current pending connection is insufficient. In this case, the initial connection reuse limit of the corresponding pending connection will be corrected; otherwise, no correction will be made. The specific steps for correction include: Extract time-series sample values ​​of connection multiplexing frequency within historical periods from historical data to obtain a sample sequence; Based on the sampled sequences, the trend of connection reuse frequency changes over historical periods is analyzed to derive predictive control factors. Specifically, a univariate linear regression is performed on the sampled sequences to construct a univariate linear regression model. The specific expression of the univariate linear regression model is as follows: In the formula, This represents the number of connection reuses for the i-th pending connection at the k-th time sampling point. Let be the slope of the reuse frequency variation trend of the i-th connection to be served. For the k-th time sampling point, Let k be the regression intercept of the i-th connection to be served, k be the time sampling point number, and i be the connection number to be served. The slope of the reuse frequency change trend is used as a predictive control factor for the initial connection reuse upper limit correction; The specific steps for correction also include: Based on the predictive adjustment factor adjusted from the initial connection reuse cap, and combined with the connection reuse pressure index of the corresponding pending connection, the initial connection reuse cap for the corresponding pending connection is adjusted to obtain a new connection reuse cap, specifically: ,in, This represents the upper limit for new connection reuse for the i-th pending connection. This represents the initial connection reuse limit for the i-th pending connection. The connection reuse pressure index for the i-th pending connection; Based on the real-time monitored connection health status, if the connection response timeout rate exceeds the preset timeout threshold and the heartbeat detection failure rate exceeds the preset failure threshold, it indicates that the current corresponding pending connection is at risk of being in a dead state, triggering the dead result analysis mechanism; otherwise, the dead result is 1. Initiate a deadlock result analysis mechanism to analyze the risk level of the current pending connection being in a deadlock state, and calculate the deadlock risk index of the corresponding pending connection, specifically: In the formula, The risk index for the apparent failure of the corresponding pending connection. For connection response timeout rate, This is the timeout threshold. For heartbeat detection failure rate, This is the failure threshold.

2. The high-concurrency communication service method according to claim 1, characterized in that: Based on the runtime dataset, the resource consumption of each pending connection during each reuse is evaluated to obtain average resource consumption across different resource dimensions, including average CPU time, average memory usage, and average bandwidth usage. Specifically: The average CPU time of each pending connection during each reuse is calculated by using the CPU time consumed by each pending connection in each reuse and the number of reuses. The average memory consumption of each pending service connection during each reuse is calculated by using the memory usage of each pending service connection during each reuse and the number of reuses. The average bandwidth consumption of each pending connection during each reuse is calculated by using the bandwidth usage of each pending connection during each reuse and the number of reuses. Based on the average resource consumption and consumption threshold of each pending connection in different resource dimensions, the theoretical connection reuse count of each pending connection in different resource dimensions is analyzed to obtain the resource reuse set. The resource reuse set includes the theoretical maximum connection reuse count of each pending connection in the CPU resource dimension, the theoretical maximum connection reuse count in the memory resource dimension, and the theoretical maximum connection reuse count in the bandwidth resource dimension. The minimum value of the theoretical maximum number of connection reuses is extracted from the resource reuse set and used as the initial connection reuse limit for the corresponding pending connection.

3. The high-concurrency communication service method according to claim 1, characterized in that: When the false death risk index exceeds the maximum false death risk index in the historical period, the current corresponding pending connection is determined to be a dead connection, and a feedback instruction is sent to the other end through the Zero Window notification method. When the peer receives the feedback instruction, it removes the corresponding pending connection from the reuse pool and stops sending all data to the corresponding pending connection in order to dynamically optimize resource utilization.

4. The high-concurrency communication service method according to claim 3, characterized in that: When the deadlock risk index of the corresponding pending connection is greater than 1 and does not exceed the maximum deadlock risk index in the historical period, it indicates that the number of connection reuse failures in the current pending connection is at risk of being distorted by connection deadlock. In this case, the new connection reuse limit of the corresponding pending connection will be adjusted again. Otherwise, no adjustment will be made. The specific adjustment steps include: The false death risk index is normalized and compressed using a nonlinear normalization compression function to obtain the compressed false death risk index. The adjusted upper limit for connection reuse is calculated as follows: ,in, To correct the upper limit of connection reuse, This is the risk index for apparent death after compression; The revised connection reuse limit is used as a further revision of the new connection reuse limit in the corresponding pending connections, and then applied to the operating system.

5. A high-concurrency communication service platform, used to implement the high-concurrency communication service method according to any one of claims 1 to 4, characterized in that: It includes a data acquisition module, a preliminary design module, and a correction module; The acquisition module is used to identify the connections to be served in the operating system kernel-level network protocol stack, and to acquire the running status data of the connections to be served. After preprocessing, it generates a running dataset. The initial module is used to evaluate the resource consumption of each connection to be served during each reuse based on the running dataset, and to obtain the initial connection reuse limit of the corresponding connection to be served. The correction module is used to extract features from the running dataset, determine the activation of the stress result analysis mechanism and the dead result analysis mechanism, and generate stress results and dead results. The stress results are used to correct the initial connection reuse limit of the corresponding pending connection, and the dead results are used to correct the initial connection reuse limit of the corresponding pending connection again, so as to be applied to the operating system.

Citation Information

Patent Citations

  • High-concurrency data transmission method based on http2 protocol and related equipment

    CN111343252A

  • Request state keeping method and device based on HTTP long connection pool

    CN118301201A