Dynamic package sticking optimization method and device and storage medium
By calculating the data flow reception efficiency within the time window and building a boundary recognition model, the problem of sticking in the TCP protocol is solved, efficient data boundary recognition and transmission optimization is achieved, adapting to network changes, and improving system performance and real-timeness.
Patent Information
- Application Number
- CN202510687614.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-27
- Publication Date
- 2025-07-04
- Estimated Expiration
- 2045-05-27
AI Technical Summary
The prior art has problems with stick packets in the streaming transmission of the TCP protocol, resulting in unclear data boundaries, high complexity of the protocol, insufficient real-timeness and poor adaptability, especially in high-frequency, small-packet transmission and complex network environments, poor performance and large processing overhead.
By calculating the reception efficiency of data flow within the preset time window, dynamically adjusting the data cache space, and using convolutional neural network, Transformer model and rule model to build a data flow boundary recognition model, designing a special boundary division strategy for picture, text and audio types, sharding and reorganizing data packets and performing protocol analysis.
It realizes fine processing of data flow in complex network environments, improves transmission performance and real-time performance, adapts to the fluctuations of network data flow, and meets diversified data transmission needs.
Smart Images

Figure CN120263735A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to a method, device, and storage medium for optimizing dynamic packet adhesion, belonging to the technical field of data processing. Background Art
[0002] In the field of network communication, the TCP protocol is widely used due to its reliability and ordered data transmission characteristics.
[0003] However, the streaming transmission mechanism of TCP may lead to the problem of packet adhesion. Especially in high-frequency transmission and complex network environments, the problem of packet adhesion refers to multiple independent data packets being treated as a continuous byte stream at the receiving end, resulting in unclear data boundaries and bringing difficulties to data parsing and application layer processing. Traditional methods for solving the problem of packet adhesion, such as fixed-length protocols, the design of message headers and message bodies, and the use of delimiters to divide data boundaries, all have the following technical defects: High protocol complexity: Some methods require adding additional protocol structures (such as message headers), which complicate the data transmission protocol and reduce the implementation efficiency of the system.
[0004] Insufficient real-time performance: In high-frequency small data packet transmission scenarios, solutions relying on fixed lengths or specific delimiters may lead to increased data latency and cannot meet real-time requirements.
[0005] Poor adaptability: Existing solutions usually cannot flexibly adapt to dynamic changes in network conditions, such as latency fluctuations, jitter, or changes in packet loss rate, and perform poorly especially in complex or unstable network environments.
[0006] High processing overhead: In high-concurrency or large-scale device connection scenarios, the resource overhead required for traditional solutions to process a large number of data packets is too high, affecting the overall performance of the system. Summary of the Invention
[0007] To solve the problems existing in the above-mentioned prior art, the present invention proposes a method, device, and storage medium for optimizing dynamic packet adhesion.
[0008] The technical solution of the present invention is as follows: On the one hand, the present invention provides a method for optimizing dynamic packet adhesion, including the following steps: Receiving a data stream from the network within a preset time window and calculating the receiving efficiency of the data stream, and setting a data cache space for caching the data stream according to the receiving efficiency of the data stream; Constructing a data stream boundary recognition model and inputting the cached data stream into the data stream boundary recognition model for boundary recognition; Fragmenting and then reorganizing the cached data stream into complete data packets according to the boundary recognition result of the cached data stream; After protocol analysis of the data packet, extract the valid data in the data packet, and then transfer the valid data to the upper-layer application.
[0009] As a preferred embodiment of the present invention, the calculation formula for the reception efficiency of the data stream is: ; Where: represents the reception efficiency of the data stream within the current time window; represents the total number of time intervals in the current time window; represents the length of the th time interval within the current time window; represents the adjustment parameter; represents the th data reception traffic within the th time interval; represents the th data reception delay within the th time interval.
[0010] As a preferred embodiment of the present invention, the calculation formula for the data cache space is: ; Where: represents the size of the data cache space under the th time window; represents the preset data cache space reference value; represents the th reception efficiency of the data stream within the th time window; represents the th weight of the th time window; represents the th length of the th time window; represents the th average load of the data reception terminal within the th time window; represents the th average data reception delay within the th time window; represents the th average data reception delay jitter within the th time window; represents the th data reception packet loss rate within the th time window; 、 、 represent weight parameters.
[0011] As a preferred embodiment of the present invention, the data stream boundary recognition model is constructed based on a convolutional neural network model, a Transformer model, and a rule model; The convolutional neural network model is used to extract the features of the cached data stream; The Transformer model is used to identify the data type of the cached data stream according to the characteristics of the cached data stream; The rule model is used to perform boundary division on the cached data stream according to the data type through preset rules, and the data type includes picture type, text type, and audio type.
[0012] As a preferred embodiment of the present invention, the convolutional neural network model sets variable convolutional kernels, and different convolutional kernel sizes are used for cached data streams of different lengths. The specific steps are as follows: Perform preliminary feature extraction on the cached data stream through a preset initial convolutional kernel to obtain corresponding initial features; Extract the mean, variance, maximum value, minimum value, and gradient information of the initial features and splice them to construct a statistical vector; Map the statistical vector to a scale adjustment factor through a lightweight fully connected network, as shown in the following formula: ; Where: Represents the scale adjustment factor; Represents the weight matrix; Represents the statistical vector; Represents the fully connected network; Represents the initial feature; Represents the bias term; Represents the pair And Perform splicing; Represents the Sigmoid activation function; Adjust the initial convolutional kernel size based on the scale adjustment factor, as shown in the following formula: ; Where: Represents the adjusted initial convolutional kernel size; Represents the initial convolutional kernel size; Represents the scale adjustment factor; Represents the length of the cached data stream; Represents the benchmark length of the cached data stream; Re-perform feature extraction on the cached data stream based on the adjusted initial convolutional kernel size to obtain the final features of the cached data stream.
[0013] As a preferred embodiment of the present invention, the data type includes picture type, text type, and audio type; For the cached data stream of the picture type, a plurality of demarcation points are preset, and the cached data stream is preliminarily divided according to the demarcation points; For each preliminarily divided window, extract the statistical features within the window; For every two adjacent windows, calculate the Euclidean distance and cosine distance of the statistical features of the two windows respectively, and perform a weighted sum of the Euclidean distance and cosine distance of the statistical features of the two windows to obtain the comprehensive distance between the two windows; For each preliminarily divided window, extract the pixel values within the window and construct a histogram; For every two adjacent windows, calculate the distance between the corresponding histograms of the two windows, as shown in the following formula: ; Where: represents the distance between the corresponding histograms of the two windows; represents the th data bin in the histogram of the th preliminarily divided window; represents the th data bin in the histogram of the th preliminarily divided window; represents a constant term; For each preliminarily divided window, extract the edge map corresponding to the pixel values within the window through an edge detection operator, and calculate the mean absolute difference between the edge maps of every two adjacent windows, as shown in the following formula: ; Where: represents the mean absolute difference between the edge maps of the two windows; represents the total number of pixels in the edge map; represents the th pixel value in the edge map of the th preliminarily divided window; represents the th pixel value in the edge map of the th preliminarily divided window; Perform a weighted sum of the histogram distance and the mean absolute difference of the edge maps between the two windows to obtain the pixel distribution difference between the two windows; Based on the comprehensive distance between all preliminarily divided windows, calculate the division confidence of each window, as shown in the following formula: ; Where: represents the division confidence of the th preliminarily divided window; represents the th preliminarily divided window and the th preliminarily divided window; represents the th preliminarily divided window and the The pixel distribution difference between the preliminary division windows; , The weight parameter representing the division confidence calculation formula; A preset division confidence threshold, calculate the division confidence of all windows. If the division confidence is greater than the preset division confidence threshold, it is determined that the size of the window is unqualified, and then the size of the window is adjusted and the division confidence of all windows is recalculated; When the window adjustment times exceed the preset adjustment threshold, the number of breakpoints is adjusted and the window division is performed again, and the division confidence of all windows is calculated again. When the division confidence of all windows is less than the preset adjustment threshold, the picture type cache data stream with the boundary division completed is obtained.
[0014] As a preferred embodiment of the present invention, for the cache data stream of the text type, a preset punctuation mark and line break symbol set is provided, and the cache data stream is traversed and identified based on the punctuation mark and line break symbol set to identify the punctuation marks and line break symbols in the cache data stream, and the cache data stream is preliminarily segmented based on the punctuation marks and line break symbols; Repeat the following operations: extract the semantic features of each segment through a pre-trained word embedding model, extract the context sensitivity between each segment and its adjacent segment through a pre-trained context-sensitive model, and combine the adjacent segments with a sensitivity reaching the preset sensitivity threshold with this segment into a new segment; stop the operation until the context sensitivity between each segment and its adjacent segment does not reach the preset sensitivity threshold, and complete the boundary division of the cache data stream of the text type.
[0015] As a preferred embodiment of the present invention, for the cache data stream of the audio type, a plurality of breakpoints are preset, and the cache data stream is preliminarily divided according to the breakpoints; The cache data stream in each window is divided into multiple small frames, and the short-time energy of each small frame is calculated, as shown in the following formula: ; Where: Represents the short-time energy of the th small frame; Represents the length of the th small frame; Represents the sampling point index of the th small frame; Represents the weighted Gaussian window function of the th sampling point; Represents the th sampling point value of the th small frame; Represents the frame shift; Define an energy threshold, and consider small frames with energy lower than the energy threshold as low - energy small frames; Repeat the following operations: Calculate the proportion of low - energy small frames within each window, retain the windows with a proportion smaller than the preset low - energy small - frame proportion threshold, and for the windows with a proportion greater than the preset low - energy small - frame proportion threshold, combine them, re - plan the demarcation points and divide them again; Stop the operation until the proportion of low - energy small frames in all divided windows is smaller than the preset low - energy small - frame proportion threshold, and complete the boundary division of the audio - type cached data stream.
[0016] On the other hand, the present invention also provides an electronic device, including a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the program, the method described in any embodiment of the present invention is implemented.
[0017] On yet another aspect, the present invention also provides a computer - readable storage medium, on which a computer program is stored. When the program is executed by a processor, the method described in any embodiment of the present invention is implemented.
[0018] The present invention has the following beneficial effects: 1. By calculating the reception efficiency of the data stream within a preset time window and dynamically adjusting the data cache space accordingly, the system of the present invention can adapt to the fluctuations of the network data stream in real time and improve the overall transmission performance.
[0019] 2. For data streams of picture, text, and audio types, the present invention adopts specially designed boundary - division strategies respectively to achieve more refined processing and optimization, meeting the needs of diversified data transmission. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] Figure 1 It is a flowchart of the method of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0021] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without making creative efforts belong to the scope of protection of the present invention.
[0022] It should be understood that the step numbers used in the text are only for convenient description and do not limit the execution order of the steps.
[0023] It should be understood that the terms used in the specification of the present invention are only for the purpose of describing specific embodiments and are not intended to limit the present invention. As used in the specification of the present invention and the appended claims, unless the context clearly indicates otherwise, the singular forms "a", "an" and "the" are intended to include the plural forms.
[0024] The terms "comprising" and "including" indicate the presence of the described features, wholes, steps, operations, elements and / or components, but do not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or their combinations.
[0025] The term " / and" refers to any combination and all possible combinations of one or more of the associated listed items, and includes these combinations.
[0026] Embodiment 1: See Figure 1 , a dynamic packet coalescence optimization method, comprising the following steps: Receive data streams from the network within a preset time window and calculate the reception efficiency of the data streams, and set a data cache space according to the data stream reception efficiency for caching the data streams; Construct a data stream boundary recognition model, and input the cached data stream into the data stream boundary recognition model for boundary recognition; Recombine the cached data stream into a complete data packet after slicing according to the boundary recognition result of the cached data stream; Extract the valid data in the data packet after protocol parsing of the data packet, and then transfer the valid data to the upper-layer application.
[0027] As a preferred implementation manner of this embodiment, the calculation formula for the reception efficiency of the data stream is: ; Wherein: represents the reception efficiency of the data stream within the current time window; represents the total number of time intervals within the current time window; represents the length of the th time interval within the current time window; represents an adjustment parameter; represents the th data reception traffic within the th time interval; represents the data reception delay within the
[0028] As a preferred implementation manner of this embodiment, the calculation formula for the data cache space is: ; Wherein: represents the size of the data cache space under the th time window; represents the preset data cache space reference value; represents the th reception efficiency of the data stream within the time window; represents the th weight of the time window; represents the th length of the time window; represents the th average load of the data receiving terminal within the time window; represents the th average data reception delay within the time window; represents the th average data reception delay jitter within the time window; represents the th data reception packet loss rate within the time window; , , represent weight parameters.
[0029] As a preferred implementation manner of this embodiment, the data stream boundary recognition model is constructed based on a convolutional neural network model, a Transformer model, and a rule model; The convolutional neural network model is used to extract the features of the cached data stream; The Transformer model is used to identify the data type of the cached data stream according to the features of the cached data stream; The rule model is used to divide the boundary of the cached data stream according to the data type through preset rules, and the data type includes picture type, text type, and audio type.
[0030] As a preferred implementation manner of this embodiment, the convolutional neural network model sets variable convolutional kernels, and different convolutional kernel sizes are used for cached data streams of different lengths. The specific steps are as follows: Perform preliminary feature extraction on the cached data stream through a preset initial convolutional kernel to obtain corresponding initial features; Extract the mean, variance, maximum value, minimum value, and gradient information of the initial features and splice them to construct a statistical vector; Map the statistical vector to a scale adjustment factor through a lightweight fully connected network, as shown in the following formula: ; where: represents the scale adjustment factor; represents the weight matrix; represents the statistical vector; represents a fully connected network; represents the initial feature; represents the bias term; represents the operation on and performs concatenation; represents the Sigmoid activation function; Adjusts the initial convolution kernel size based on the scale adjustment factor, as shown in the following formula: ; where: represents the adjusted initial convolution kernel size; represents the initial convolution kernel size; represents the scale adjustment factor; represents the length of the cached data stream; represents the reference length of the cached data stream; Re - extracts features from the cached data stream based on the adjusted initial convolution kernel size to obtain the final features of the cached data stream.
[0031] As a preferred implementation manner of this embodiment, the data types include picture type, text type, and audio type; For the cached data stream of picture type, a plurality of demarcation points are preset, and the cached data stream is preliminarily divided according to the demarcation points; For each preliminarily divided window, the statistical features within the window are extracted; For every two adjacent windows, the Euclidean distance and cosine distance between the statistical features of the two windows are calculated respectively, and the weighted sum of the Euclidean distance and cosine distance between the statistical features of the two windows is calculated to obtain the comprehensive distance between the two windows; For each preliminarily divided window, the pixel values within the window are extracted and constructed into a histogram; For every two adjacent windows, the distance between the corresponding histograms of the two windows is calculated, as shown in the following formula: ; where: represents the distance between the corresponding histograms of the two windows; represents the th data bucket in the histogram of the th preliminarily divided window; represents the th data bucket in the histogram of the th preliminarily divided window; represents a constant term; In this embodiment, the histogram is a grayscale image histogram, so there are 256 data buckets, corresponding to the grayscale values from 0 to 255; For each preliminarily divided window, an edge map corresponding to the pixel values within the window is extracted through an edge detection operator, and the mean absolute difference between every two adjacent window edge maps is calculated, as shown in the following formula: ; Where: represents the mean absolute difference between two window edge maps; represents the total number of pixels in the edge map; represents the th pixel value in the edge map of the th preliminarily divided window; represents the th pixel value in the edge map of the th preliminarily divided window; The weighted sum of the histogram distance and the mean absolute difference of the edge maps between two windows is used to obtain the pixel distribution difference between the two windows; Based on the comprehensive distance between all preliminarily divided windows, the division confidence of each window is calculated, as shown in the following formula: ; Where: represents the division confidence of the th preliminarily divided window; represents the comprehensive distance between the th preliminarily divided window and the th preliminarily divided window; represents the pixel distribution difference between the th preliminarily divided window and the th preliminarily divided window; 、 represent the weight parameters of the division confidence calculation formula; A preset division confidence threshold is set, and the division confidence of all windows is calculated. If the division confidence of a window is greater than the preset division confidence threshold, it is determined that the size of the window is unqualified, and then the size of the window is adjusted and the division confidence of all windows is recalculated; When the number of window adjustment times exceeds the preset adjustment threshold, the number of demarcation points is adjusted and the window division is performed again, and the division confidence of all windows is recalculated. When the division confidence of all windows is less than the preset adjustment threshold, the picture type cache data stream with the boundary division completed is obtained.
[0032] As a preferred implementation of this embodiment, for the cached data stream of the text type, a set of preset punctuation marks and line break symbols is provided. Based on the set of punctuation marks and line break symbols, the cached data stream is traversed to identify the punctuation marks and line break symbols in the cached data stream, and the cached data stream is preliminarily segmented based on the punctuation marks and line break symbols; Repeat the following operations: Extract the semantic features of each segment through a pre-trained word embedding model (such as Word2Vec, GloVe), extract the context sensitivity between each segment and its adjacent segment through a pre-trained context-sensitive model (such as BERT, RoBERTa), and combine the adjacent segments whose sensitivity reaches the preset sensitivity threshold with this segment into a new segment; Stop the operation until the context sensitivity between each segment and its adjacent segment does not reach the preset sensitivity threshold, and complete the boundary division of the cached data stream of the text type.
[0033] As a preferred implementation of this embodiment, for the cached data stream of the audio type, a plurality of demarcation points are preset, and the cached data stream is preliminarily divided according to the demarcation points; The cached data stream within each window is divided into multiple small frames, and the short-time energy of each small frame is calculated as shown in the following formula: ; Where: represents the short-time energy of the th small frame; represents the length of the th small frame; represents the sampling point index of the th small frame; represents the weighted Gaussian window function of the th sampling point; represents the th sampling point value of the th small frame; represents the frame shift; The weighted Gaussian window function is specifically as follows: ; Where: is an intermediate parameter, ; represents the width of the weighted Gaussian window function; Define an energy threshold, and regard the small frames with energy lower than the energy threshold as low-energy small frames; Repeat the following operations: calculate the proportion of low - energy small frames within each window, retain the windows with a proportion of low - energy small frames less than the preset low - energy small frame proportion threshold, combine the windows with a proportion greater than the preset low - energy small frame proportion threshold, re - plan the demarcation points and re - divide them; stop the operation until the proportion of low - energy small frames in all divided windows is less than the preset low - energy small frame proportion threshold, and complete the boundary division of the audio - type cached data stream.
[0034] Embodiment Two: A dynamic packet - sticking optimization system includes a network receiving module, a data caching module, a boundary detection module, a data recombination module, a data parsing module, and an upper - layer application interface module; The network receiving module is used to receive data streams from the network within a preset time window and calculate the receiving efficiency of the data streams; The data caching module is used to set a data caching space according to the data stream receiving efficiency for caching the data stream; The boundary detection module is used to construct a data stream boundary recognition model and input the cached data stream into the data stream boundary recognition model for boundary recognition; The data recombination module is used to slice and recombine the cached data stream into complete data packets according to the boundary recognition result of the cached data stream. Specifically: Slice the cached data stream according to the boundary points. The range of each data segment is determined by two adjacent boundary points, ensuring that the start and end positions of the slicing are clear for subsequent recombination; Re - combine the data segments into complete data packets according to the field format of the protocol; The data parsing module is used to parse the protocol of the data packet and extract the valid data in the data packet. Specifically, use a finite - state machine (FSM) to parse the protocol fields in each data packet. The fields include header fields, data bodies, checksum fields, etc.; Verify whether the length and format of each field meet the protocol requirements. For example, the field length should match the protocol specification; For data packets with parsing failures, try to adjust the slicing boundary and re - parse; if some fields allow a certain tolerance range (such as tolerable checksum errors), continue to parse other fields and generate partially valid data; Support multiple protocol types through configurable parsing logic to meet the requirements of different scenarios and data formats; The upper-layer application interface module is used to transfer valid data to the upper-layer application. According to the requirements of the upper-layer application, it converts data packets into a standardized format, such as JSON, Protobuf, or XML, and performs a final integrity check at the interface layer to ensure that the data transferred to the upper layer meets expectations. If incomplete or abnormally formatted data is found, error messages are fed back to the downstream module. It supports multiple upper-layer applications to subscribe to or receive parsed data simultaneously and can dynamically adjust the interface format and transfer logic according to application requirements.
[0035] This system is used to implement the method in the first embodiment and will not be elaborated here.
[0036] Embodiment 3: This embodiment provides an electronic device, including a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the program, it implements the method according to any embodiment of the present invention.
[0037] Embodiment 4: This embodiment provides a computer-readable storage medium, on which a computer program is stored. When the program is executed by a processor, it implements the method according to any embodiment of the present invention.
[0038] In the embodiments of the present application, "at least one" means one or more, and "a plurality" means two or more. "And / or" describes the association relationship of associated objects and indicates that three relationships may exist. For example, A and / or B may represent the cases of A existing alone, A and B existing simultaneously, and B existing alone. Where A and B can be singular or plural. The character " / " generally represents an "or" relationship between the associated objects before and after. "At least one of the following" and its similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one of a, b, and c may represent: a, b, c, a and b, a and c, b and c, or a and b and c, where a, b, and c can be single or multiple.
[0039] Those of ordinary skill in the art can realize that the units and algorithm steps described in the embodiments disclosed herein can be implemented by a combination of electronic hardware, computer software, and electronic hardware. Whether these functions are executed in a hardware or software manner depends on the specific application and design constraints of the technical solution. Professional technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the present application.
[0040] Those skilled in the art can clearly understand that for the convenience and brevity of description, the specific working processes of the systems, devices, and units described above can refer to the corresponding processes in the foregoing method embodiments and will not be elaborated here.
[0041] In several embodiments provided by the present application, if any function is implemented in the form of 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 application, in essence, or the part that contributes to the prior art, or a part of this technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to enable a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in various embodiments of the present application. The foregoing storage medium includes: various media that can store program codes, such as USB flash drives, mobile hard disks, read-only memories (hereinafter referred to as ROM), random access memories (hereinafter referred to as RAM), magnetic disks, or optical discs.
[0042] The above are only the embodiments of the present invention, and do not limit the patent scope of the present invention accordingly. Any equivalent structure or equivalent process transformation made by using the specification and drawings of the present invention, or directly or indirectly applied in other related technical fields, shall be equally included in the patent protection scope of the present invention.
Claims
1. A dynamic packet coalescence optimization method, characterized in that It includes the following steps: Receive a data stream from the network within a preset time window and calculate the reception efficiency of the data stream, and set a data cache space according to the data stream reception efficiency to cache the data stream; Construct a data stream boundary recognition model, and input the cached data stream into the data stream boundary recognition model for boundary recognition; Fragment the cached data stream according to the boundary recognition result of the cached data stream and then reorganize it into a complete data packet; Parse the protocol of the data packet and extract the valid data in the data packet, and then transfer the valid data to the upper-layer application.
2. The dynamic packet coalescence optimization method according to claim 1, wherein The calculation formula for the reception efficiency of the data stream is: ; Wherein: represents the reception efficiency of the data stream within the current time window; represents the total number of time intervals of the current time window; represents the th time interval length within the current time window; represents the adjustment parameter; represents the th data reception traffic within a time interval; represents the th data reception delay within a time interval.
3. A dynamic packet coalescence optimization method according to claim 2, characterized in that The calculation formula for the data cache space is: ; Wherein: represents the size of the data cache space under the th time window; represents the preset data cache space reference value; represents the reception efficiency of the data stream within the th time window; represents the weight of the th time window; represents the length of the th time window; represents the average load of the data receiving terminal within the th time window; represents the average data reception delay within the th time window; represents the average data reception delay jitter within the th time window; represents the data reception packet loss rate within the th time window; , , represent weight parameters.
4. A dynamic packet concatenation optimization method according to claim 1, characterized in that The data stream boundary recognition model is constructed based on a convolutional neural network model, a Transformer model, and a rule model; The convolutional neural network model is used to extract the features of the cached data stream; The Transformer model is used to identify the data type of the cached data stream according to the features of the cached data stream; The rule model is used to divide the boundary of the cached data stream through preset rules according to the data type, and the data type includes picture type, text type, and audio type.
5. A dynamic packet concatenation optimization method according to claim 4, characterized in that The convolutional neural network model sets variable convolutional kernels, and different convolutional kernel sizes are used for cached data streams of different lengths. The specific steps are as follows: Perform preliminary feature extraction on the cached data stream through a preset initial convolutional kernel to obtain corresponding initial features; Extract the mean, variance, maximum value, minimum value, and gradient information of the initial features and splice them to construct a statistical vector; Map the statistical vector to a scale adjustment factor through a lightweight fully connected network, as shown in the following formula: ; Wherein: represents a scale adjustment factor; represents a weight matrix; represents a statistical vector; represents a fully connected network; represents an initial feature; represents a bias term; represents the operation on and to perform concatenation; represents a Sigmoid activation function; Adjust the initial convolutional kernel size based on the scale adjustment factor, as shown in the following formula: ; Wherein: Represents the adjusted initial convolution kernel size; Represents the initial convolution kernel size; Represents the scale adjustment factor; Represents the cache data stream length; Represents the cache data stream reference length; Re-extract the features of the cached data stream based on the adjusted initial convolutional kernel size to obtain the final features of the cached data stream.
6. A dynamic packet coalescence optimization method according to claim 4, characterized in that, For the cached data stream of the picture type, preset multiple demarcation points and perform preliminary division on the cached data stream according to the demarcation points; For each preliminarily divided window, extract the statistical features within the window; For every two adjacent windows, calculate the Euclidean distance and cosine distance of the statistical features of the two windows respectively, and perform weighted summation on the Euclidean distance and cosine distance of the statistical features of the two windows to obtain the comprehensive distance between the two windows; For each preliminarily divided window, extract the pixel values within the window and construct a histogram; For every two adjacent windows, calculate the distance between the corresponding histograms of the two windows, as shown in the following formula: ; Wherein: represents the distance between the histograms corresponding to two windows; represents the th data bucket in the histogram of the th preliminary division window; represents the th data bucket in the histogram of the th preliminary division window; represents the constant term; For each preliminarily divided window, extract the edge map corresponding to the pixel values within the window through an edge detection operator, and calculate the mean absolute difference between the edge maps of every two adjacent windows, as shown in the following formula: ; Wherein: represents the mean absolute difference between two window edge maps; represents the total number of pixels in the edge map; represents the th pixel value in the th preliminary divided window edge map; represents the th pixel value in the th preliminary divided window edge map; Perform weighted summation on the histogram distance and the mean absolute difference of the edge maps between the two windows to obtain the pixel distribution difference between the two windows; Calculate the division confidence of each window based on the comprehensive distance between all preliminarily divided windows, as shown in the following formula: ; Wherein: represents the division confidence of the th preliminary division window; represents the comprehensive distance between the th preliminary division window and the th preliminary division window; represents the pixel distribution difference between the th preliminary division window and the th preliminary division window; , represent the weight parameters of the division confidence calculation formula; Preset a division confidence threshold, calculate the division confidence of all windows. If there is a window with a division confidence greater than the preset division confidence threshold, it is determined that the size of this window is unqualified, and then the size of this window is adjusted and the division confidence of all windows is recalculated; When the number of window adjustment times exceeds the preset adjustment threshold, the number of breakpoints is adjusted and the window division is performed again. Then calculate the division confidence of all windows again. When the division confidence of all windows is less than the preset adjustment threshold, the picture type cache data stream with boundary division completed is obtained.
7. A dynamic packet coalescence optimization method according to claim 4, characterized in that For the cache data stream of the text type, preset a set of punctuation marks and line break symbols. Based on this set of punctuation marks and line break symbols, traverse and identify the punctuation marks and line break symbols in the cache data stream, and perform a preliminary segmentation of the cache data stream based on the punctuation marks and line break symbols; Repeat the following operations: extract the semantic features of each segment through a pre-trained word embedding model, extract the context sensitivity between each segment and its adjacent segments through a pre-trained context-sensitive model, and combine the adjacent segments with a context sensitivity reaching the preset sensitivity threshold with this segment into a new segment; stop the operation until the context sensitivity between each segment and its adjacent segments does not reach the preset sensitivity threshold, and complete the boundary division of the cache data stream of the text type.
8. A dynamic packet concatenation optimization method according to claim 4, characterized in that For the cache data stream of the audio type, preset multiple breakpoints and perform a preliminary division of the cache data stream according to the breakpoints; Divide the cache data stream within each window into multiple small frames, and calculate the short-time energy of each small frame, as shown in the following formula: ; Wherein: represents the short-time energy of the th small frame; represents the length of the th small frame; represents the sampling point index of the th small frame; represents the weighted Gaussian window function of the th sampling point; represents the value of the th sampling point of the th small frame; represents the frame shift; Define an energy threshold, and regard the small frames with energy lower than the energy threshold as low-energy small frames; Repeat the following operations: calculate the proportion of low-energy small frames within each window, retain the windows with a proportion less than the preset low-energy small frame proportion threshold, combine the windows with a proportion greater than the preset low-energy small frame proportion threshold, re-plan the breakpoints and perform a re-division; stop the operation until the proportion of low-energy small frames in all divided windows is less than the preset low-energy small frame proportion threshold, and complete the boundary division of the cache data stream of the audio type.
9. An electronic device, comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the method according to any one of claims 1 to 8.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the method according to any one of claims 1 to 8.
Citation Information
Patent Citations
A TCP stream length connection data analysis method
CN109922081A
Tcp message semi-packet sticking intelligent processing method based on customer input behaviors
CN111555897A
Packet loss rate optimization method and system, electronic equipment and readable storage medium
CN116016370A
Data processing method and server
CN117768407A
Transmission delay limit determination method, device and equipment and readable storage medium
CN118802770A
Cited By
Parameter optimization system for car frame die-casting process
CN121446992A