A method and device for optimizing streaming media audio
By detecting the number of streaming audio, device performance and network data, the calculation can satisfy the index and adjust the bit rate, solving the problem that multiple streaming audio cannot meet the optimal state and audio lag when playing at the same time, improving the user experience.
Patent Information
- Application Number
- CN202411016114.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-27
- Publication Date
- 2025-04-18
- Estimated Expiration
- 2044-07-27
AI Technical Summary
Existing streaming audio optimization methods cannot meet the optimal state playback when multiple streaming audios are played simultaneously, and cannot adapt to network changes in real time to audio stutter.
Through JavaScript, the number of streaming audio is detected and recorded, the device performance and network data are collected, the device performance coefficient and network quality coefficient are calculated, and whether the streaming media is satisfied is determined based on the exponential can be satisfied. If it is not satisfied, the bit rate will be adjusted according to the priority index.
It effectively reduces the stutter rate of streaming audio and improves the user experience.
Smart Images

Figure CN119071277B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of wireless transmission, and more particularly to a method and device for optimizing streaming media audio. Background Art
[0002] Streaming audio is a technology that transmits and plays audio content in real time over the Internet, without requiring users to download the entire audio file to start listening. Streaming audio is commonly used in applications such as online music, podcasts, Internet radio stations, and live audio. It uses streaming protocols (such as HTTP Live Streaming or RTSP) to transmit audio data in segments to user devices, and the device decodes and plays the data immediately after receiving it.
[0003] The existing streaming audio optimization method is to optimize audio through encoding, compression optimization, and network status monitoring and adaptation. However, this optimization method will result in the inability to play multiple streaming audios at the same time in the optimal state when multiple streaming audios are played simultaneously on the device, and the inability to adapt to the streaming audio in real time will cause audio stuttering.
[0004] In view of the above problems, the present invention proposes a solution. Summary of the invention
[0005] In order to overcome the above-mentioned defects of the prior art, the present invention provides a method and device for optimizing streaming media audio to solve the problems existing in the above-mentioned background technology.
[0006] To achieve the above object, the present invention provides the following technical solutions:
[0007] A method for optimizing streaming audio comprises the following steps:
[0008] Step 1: Use JavaScript to detect and record the number of currently open streaming audio on the device's web page;
[0009] Step 2: Collect the current device performance, which includes CPU usage and memory usage. The device performance coefficient is calculated based on the device performance. The calculation formula is: EP stands for the device performance coefficient, C stands for the CPU usage, and M stands for the memory usage.
[0010] Step 3: Collect current network-related data, including network jitter, packet loss rate, and network bandwidth stability, normalize the network jitter, packet loss rate, and network bandwidth stability, and calculate the network quality coefficient based on the normalized network-related data. The calculation formula is: Where NQ represents the network quality coefficient, NJ represents the network jitter degree, NL represents the packet loss rate, and NS represents the network bandwidth stability;
[0011] Step 4: Normalize the number of streaming audio, device performance coefficient, and network quality coefficient, and calculate the satisfiability index based on the normalized number of streaming audio, device performance coefficient, and network quality coefficient. The calculation formula is: Where CS is the satisfiability index, NUM L It is represented by the number of streaming audios, EP is represented by the equipment performance coefficient, NQ is represented by the network quality coefficient, and a1, a2, and a3 are the weight coefficients of the number of streaming audios, the equipment performance coefficient, and the network quality coefficient;
[0012] Step 5: Determine the use of streaming media based on the satisfiability index;
[0013] Step 6: If it is determined that the current usage of all streaming audio can be met, no bit rate intervention is performed. If it is determined that the current usage of all streaming audio cannot be met, one is selected from all streaming audios based on the priority index to maintain the optimal bit rate, and the bit rates of the remaining streaming audios are adjusted based on the priority index.
[0014] Preferably, the network jitter degree calculation step is:
[0015] Step 3.1: Set the detection time period, record the timestamp of each data packet arriving within the detection time period, calculate the difference of the arrival time of consecutive data packets, and obtain the time interval sequence;
[0016] Step 3.2: Use the time interval sequence as a feature, and use the time interval sequence of all data packets as a data set, where each time interval sequence in the data set is a data point;
[0017] Step 3.3: Use the K-means clustering method to input the standardized time interval series into the clustering algorithm to obtain the final clustering result;
[0018] Step 3.4: Analyze and calculate the degree of network jitter based on the final clustering results.
[0019] Preferably, the step of using the K-means clustering method to input the standardized time interval sequence into the clustering algorithm to obtain the final clustering result is:
[0020] Step 3.3.1: Determine the optimal number of clusters K by the elbow method, and randomly select K data points in the data set as the initial cluster centers;
[0021] Step 3.3.2: For each data point, calculate its Euclidean distance to each initial cluster center and assign it to the cluster corresponding to the nearest initial cluster center;
[0022] Step 3.3.3: After traversing all data points, the initial clusters are obtained. For each initial cluster, the data points in it are calculated to get the new cluster center.
[0023] Step 3.3.4: Repeat steps 3.3.2 and 3.3.3 until the cluster center no longer changes and the final cluster is obtained.
[0024] Preferably, the step of analyzing and calculating the degree of network jitter according to the final clustering result is:
[0025] According to the final clustering clusters obtained, the variance of the data points in each final clustering cluster is calculated as the degree of cluster jitter;
[0026] The weight of each final cluster is calculated by calculating the ratio of the number of data points in each final cluster to the total number of data points in the data set;
[0027] The jitter degree of all clusters is weighted and summed up, and the average is calculated to obtain the network jitter degree, which is calculated as follows: Where NJ represents the degree of network jitter, K is the number of clusters, σ j It is represented as the cluster jitter degree of the jth final cluster, γ j It is represented as the weight of the jth final cluster.
[0028] Preferably, the step of judging the use of streaming media according to the satisfiability index is:
[0029] The satisfiability index is compared with a preset threshold. If the satisfiability index is greater than the preset threshold, it is determined that the current usage of all streaming audio can be satisfied. If the streaming audio is less than the preset threshold, it is determined that the current usage of all streaming audio cannot be satisfied.
[0030] Preferably, the step of selecting one to maintain the optimal bit rate from all streaming audios according to the priority index is:
[0031] Step 6.1: During the detection period, by extracting server-side data, collect the user's behavior data on streaming media audio during the detection period, wherein the behavior data includes the number of times the user clicks to play and pause and the number of times the user adjusts the volume;
[0032] Step 6.2: Collecting user engagement data on streaming audio during the detection period by extracting server-side data, where the engagement data is the number of comments provided by the user during audio playback;
[0033] Step 6.3: Calculate user interactivity based on behavior data and engagement data. The calculation formula is: Where IT represents user interactivity, N p Represented as the total number of times the user clicks play and pause, N v Represents the total number of times the volume is adjusted by the user, N c Represents the total number of comments provided by users during audio playback;
[0034] Step 6.4: Collect the initial bit rate of each streaming audio, normalize the initial bit rate and user interactivity, and calculate the priority index through the normalized initial bit rate and user interactivity. The calculation formula is: Where PT is the priority index, B is the initial bit rate, IT is the user interactivity, and B max Expressed as the highest initial bit rate among all streaming audio, IT max Indicated as the highest user interactivity of all streaming audio;
[0035] Step 6.5: Sort the priority index of each streaming audio from high to low, and select the streaming audio with the highest priority index to maintain the optimal bit rate.
[0036] Preferably, the step of adjusting the bit rate according to the priority index is:
[0037] Set a priority index threshold, calculate the ratio of the priority index of the streaming audio to the priority index threshold, and then multiply it by the initial bit rate to calculate the actual bit rate. The calculation formula is: AB represents the actual bit rate, PT represents the priority index, PT0 represents the priority index threshold, B represents the initial bit rate, and the streaming audio bit rate is adjusted according to the actual bit rate.
[0038] Preferably, a device for optimizing streaming media audio comprises:
[0039] The streaming media data collection module is used to collect streaming media related data, including the amount of streaming media audio, device performance and network status data, and transmit the streaming media related data to the streaming media data analysis module and the streaming media data evaluation module;
[0040] The streaming media data analysis module is used to receive the streaming media related data transmitted by the streaming media data acquisition module, analyze the streaming media related data to obtain the device performance coefficient and the network quality coefficient, and transmit the device performance coefficient and the network quality coefficient to the streaming media data evaluation module;
[0041] The streaming media data evaluation module is used to receive the streaming media audio quantity, device performance coefficient and network quality coefficient transmitted by the streaming media data acquisition module and the streaming media data analysis module, and perform a comprehensive evaluation to obtain a satisfiability index, and transmit the satisfiability index to the user interaction data acquisition module;
[0042] The user interaction data collection module is used to receive the satisfiability index transmitted by the streaming media data evaluation module, judge the use of the streaming media according to the satisfiability index, and if the use is not satisfied, collect the user interaction data of each streaming media and transmit it to the interaction data evaluation module;
[0043] An interaction data evaluation module is used to receive the user interaction data transmitted by the user interaction data acquisition module, evaluate it to obtain a priority index, and transmit the priority index to the bit rate adjustment module;
[0044] The bit rate adjustment module is used to receive the priority index transmitted by the interactive data evaluation module and adjust the bit rate according to the priority index.
[0045] Technical effects and advantages of the present invention:
[0046] Detect and record the number of streaming audio currently opened, collect the current device performance, which includes CPU usage and memory usage, calculate the device performance coefficient based on the device performance, collect current network-related data and calculate the network quality coefficient, calculate the satisfiability index based on the number of streaming audio, the device performance coefficient and the network quality coefficient, judge the use of streaming media based on the satisfiability index, if it is determined that the use of all streaming audio cannot be met at present, adjust the bit rate based on the priority index, effectively reduce the freeze rate of streaming audio and improve user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] Figure 1 It is the overall flow chart of the present invention. DETAILED DESCRIPTION
[0048] The technical solution of the present invention will be clearly and completely described below in conjunction with the accompanying drawings in the present invention. In addition, the forms of the various structures recorded in the following embodiments are merely illustrative. The method and device for streaming media audio optimization involved in the present invention are not limited to the various structures recorded in the following embodiments. All other implementations obtained by ordinary technicians in this field without making creative work belong to the scope of protection of the present invention.
[0049] The present invention provides a method for optimizing streaming media audio, comprising the following steps:
[0050] Step 1: Use JavaScript to detect and record the number of currently open streaming audio on the device's web page;
[0051] Step 2: Collect the current device performance, which includes CPU usage and memory usage. The device performance coefficient is calculated based on the device performance. The calculation formula is: EP stands for the device performance coefficient, C stands for the CPU usage rate, which indicates how busy the CPU is. A higher CPU usage rate indicates a higher CPU load, and M stands for the memory usage rate, which indicates the current memory usage. A higher memory usage rate indicates a higher memory load;
[0052] Step 3: Collect current network-related data, including network jitter, packet loss rate, and network bandwidth stability, normalize the network jitter, packet loss rate, and network bandwidth stability, and calculate the network quality coefficient based on the normalized network-related data. The calculation formula is: Where NQ represents the network quality coefficient, NJ represents the network jitter degree, NL represents the packet loss rate, and NS represents the network bandwidth stability;
[0053] In this embodiment, it should be specifically explained that the packet loss rate is that the network packet loss rate is collected according to the set collection time interval within the detection time period, and the average packet loss rate collected each time is calculated to obtain an average packet loss rate, which is recorded as the packet loss rate of the detection time period;
[0054] In this embodiment, it should be specifically explained that the steps for calculating the network bandwidth stability are:
[0055] The network bandwidth data is collected according to the set collection time interval during the detection period, and the standard deviation of the network bandwidth data collected each time is calculated inversely to obtain the network bandwidth stability.
[0056] The network jitter refers to the inconsistency of the time intervals at which continuously transmitted data packets arrive at the receiving end in a data network. Ideally, data packets should arrive at uniform time intervals, but due to factors such as network congestion, routing changes, hardware delays, etc., these intervals can vary, resulting in jitter. High jitter can have a negative impact on real-time applications such as VoIP, video conferencing, and online gaming, manifesting as intermittent, stuck, or delayed audio and video, seriously affecting the user experience.
[0057] The packet loss rate refers to the ratio of data packets lost during data transmission to the total number of data packets sent. In computer networks, data is usually transmitted in the form of data packets. The packet loss rate can be expressed as a percentage and is usually determined by monitoring the difference between the sent and received data packets. A high packet loss rate may be caused by network congestion, equipment failure, signal interference or unstable network connection, which may affect the integrity and efficiency of data transmission, especially in real-time communication or large file transfer. A high packet loss rate may cause data retransmission or reduced service quality.
[0058] The network bandwidth refers to the maximum rate or capacity of data transmission in a computer network, usually measured in terms of the amount of data transmitted per second. It determines how much data the network can transmit and the speed at which it can transmit, and affects the quality of experience of users when browsing the web, watching videos, downloading files, and other activities on the network.
[0059] In this embodiment, it should be specifically explained that the steps for calculating the network jitter degree are:
[0060] Step 3.1: Set the detection time period, record the timestamp of each data packet arriving within the detection time period, calculate the difference of the arrival time of consecutive data packets, and obtain the time interval sequence;
[0061] Step 3.2: Use the time interval sequence as a feature and standardize the time interval, such as subtracting the mean and dividing by the standard deviation to eliminate the dimension effect. The time interval sequence of all data packets is used as a data set, and each time interval sequence in the data set is a data point.
[0062] Step 3.3: Use K-means clustering method to input the standardized time interval sequence into the clustering algorithm to obtain the final clustering result. The K-means clustering method is an unsupervised learning algorithm used to divide the data set into K clusters so that the similarity of data points within the same cluster is maximized and the similarity of data points between different clusters is minimized. It achieves this goal by defining the cluster center and minimizing the distance from the data point to the center of the cluster to which it belongs. K-means clustering is widely used in fields such as data mining, image compression, and customer segmentation to reveal the inherent structure and patterns in the data;
[0063] Step 3.4: Analyze and calculate the degree of network jitter based on the final clustering results.
[0064] In this embodiment, it should be specifically explained that the steps of using the K-means clustering method to input the standardized time interval sequence into the clustering algorithm to obtain the final clustering result are:
[0065] Step 3.3.1: Determine the optimal number of clusters K by the elbow method, and randomly select K data points in the data set as the initial cluster centers;
[0066] The elbow method is a technique for determining the optimal number of clusters in K-means clustering. It selects the optimal K value by calculating the total within-cluster squared error (SSE) for different K values and plotting the relationship between K value and SSE. When the K value is increased, the SSE gradually decreases, but when the K value reaches a certain point, the reduction in SSE becomes significantly smaller, forming an "elbow" on the graph. The K value at this "elbow" is the optimal number of clusters, because increasing the K value before this point can significantly reduce the SSE, while increasing the K value after that has little effect on the SSE.
[0067] The initial cluster centers are K data points selected at the beginning of the K-means clustering algorithm, which are used as initial cluster centers. Each initial cluster center represents the center point of a cluster, and the algorithm then assigns the remaining data points to the nearest cluster center based on these centers, and continuously updates the cluster centers to optimize the internal similarity of the cluster.
[0068] Step 3.3.2: For each data point, calculate its Euclidean distance to each initial cluster center. The calculation formula is: Where d(P i , α j ) is expressed as the Euclidean distance from the i-th data point to the j-th cluster center, and it is assigned to the cluster corresponding to the nearest initial cluster center;
[0069] The Euclidean distance is the straight-line distance between two points in Euclidean space, and is often used to measure the distance between data points. In K-means clustering, the Euclidean distance is used to calculate the distance from each data point to the initial cluster center, helping to determine which cluster the data point should be assigned to in order to minimize the differences within the cluster.
[0070] Step 3.3.3: After traversing all data points, we get the initial clusters. For each initial cluster, we calculate the mean of the data points in it and get the new cluster center. The calculation formula is: where α′ j Represented as the new cluster center of the jth cluster, C j Represented as the set of all data points contained in the jth cluster, |C j | represents the number of data points in the jth cluster, P i is the eigenvalue of the i-th data point of the j-th cluster;
[0071] Step 3.3.4: Repeat steps 3.3.2 and 3.3.3 until the cluster center no longer changes and the final cluster is obtained.
[0072] In this embodiment, it should be specifically explained that the step of analyzing and calculating the network jitter degree according to the final clustering result is:
[0073] According to the final clustering clusters obtained, the variance of the data points in each final clustering cluster is calculated as the degree of cluster jitter;
[0074] According to the final clusters obtained, the weight of each final cluster is obtained by calculating the ratio of the number of data points in each final cluster to the total number of data points in the data set. The calculation formula is: where γ j is represented as the weight of the jth final cluster, |C j | represents the number of data points in the jth cluster, and n is the total number of data points in the data set;
[0075] The jitter degree of all clusters is weighted and summed up, and the average is calculated to obtain the network jitter degree, which is calculated as follows: Where NJ represents the degree of network jitter, K is the number of clusters, σ j It is represented as the cluster jitter degree of the jth final cluster, γ j It is represented as the weight of the jth final cluster.
[0076] Step 4: Normalize the number of streaming audio, device performance coefficient, and network quality coefficient, and calculate the satisfiability index based on the normalized number of streaming audio, device performance coefficient, and network quality coefficient. The calculation formula is: Where CS is the satisfiability index, NUM LIt is expressed as the number of streaming audio. The more streaming audio is played at the same time, the lower the network and device's ability to play all audio streams with high quality. Specifically, the satiable index reflects the load of network and device resources when processing multiple audio streams. As the number of streaming audio increases, resources such as bandwidth and processing power need to be allocated among more streams, which may lead to a decline in the playback quality of each stream, including buffering, delay, and reduced sound quality. EP is expressed as the device performance coefficient. The higher the performance of the device, the stronger its ability to play multiple streaming audio at the same time with high quality. Specifically, the device performance coefficient measures the processing power of the device, including CPU speed, memory capacity, and other hardware resources. When the device performance coefficient increases, the device can handle the decoding and playback tasks of multiple audio streams more efficiently, reducing buffering time, delay, and other playback problems. NQ is expressed as the network quality coefficient. The higher the network quality, the stronger its ability to play multiple streaming audio at the same time with high quality. Specifically, the network quality coefficient comprehensively measures indicators such as network bandwidth, delay, jitter, and packet loss rate. When the network quality coefficient increases, the network connection is more stable, the bandwidth is more sufficient, the data transmission speed and reliability are higher, and multiple streaming audio streams can be supported to be played simultaneously without buffering, delay, and sound quality degradation. a1, a2, and a3 are weight coefficients of the number of streaming audios, the device performance coefficient, and the network quality coefficient, and this embodiment does not specifically calculate the specific values of a1, a2, and a3;
[0077] Step 5: judging the usage of streaming media according to the satisfiability index, and judging whether the usage of all streaming audio can be satisfied at present;
[0078] In this embodiment, it should be specifically explained that the step of judging the use of streaming media according to the satisfiability index is:
[0079] The satisfiability index is compared with a preset threshold. If the satisfiability index is greater than the preset threshold, it is determined that the current usage of all streaming audio can be satisfied. If the streaming audio is less than the preset threshold, it is determined that the current usage of all streaming audio cannot be satisfied.
[0080] Step 6: If it is determined that the current usage of all streaming audio can be met, no bit rate intervention is performed. If it is determined that the current usage of all streaming audio cannot be met, one is selected from all streaming audios based on the priority index to maintain the optimal bit rate, and the bit rates of the remaining streaming audios are adjusted based on the priority index.
[0081] In this embodiment, it should be specifically explained that the step of selecting a step for maintaining the optimal bit rate from all streaming audios according to the priority index is:
[0082] Step 6.1: During the detection period, by extracting server-side data, collect the user's behavior data on streaming media audio during the detection period, wherein the behavior data includes the number of times the user clicks to play and pause and the number of times the user adjusts the volume;
[0083] Step 6.2: Collecting user engagement data on streaming audio during the detection period by extracting server-side data, where the engagement data is the number of comments provided by the user during audio playback;
[0084] Step 6.3: Calculate user interactivity based on behavior data and engagement data. The calculation formula is: Where IT represents user interactivity, N p It is represented by the total number of times the user clicks play and pause. This reflects the user's control and interaction frequency of audio playback. v Indicates the total number of times the volume is adjusted for the user. This indicates the user's need to adjust the volume during the listening process. c Represents the total number of comments provided by users during audio playback. This reflects the user's feedback and interaction frequency; (N p ×N v ) The user's comprehensive interactive behavior of audio control and volume adjustment is taken into account by multiplying the number of play / pause times and the number of volume adjustment times. The more interactions, the more active the user is; Add the number of user comments to the product and then perform a square root operation. This process can prevent extreme values of a single parameter from excessively affecting the result, while providing a smooth user interactivity value;
[0085] Step 6.4: Collect the initial bit rate of each streaming audio through JavaScript, normalize the initial bit rate and user interactivity, and calculate the priority index through the normalized initial bit rate and user interactivity. The calculation formula is: Where PT is the priority index, B is the initial bit rate, IT is the user interactivity, and B max Expressed as the highest initial bit rate among all streaming audio, IT max Expressed as the highest user interactivity among all streaming audios, this formula is obtained by multiplying the initial bit rate and user interactivity of each streaming audio, and then dividing it by the product of the highest initial bit rate and the highest user interactivity, to obtain a priority index between 0 and 1. This index can be used to determine which streaming audio has a higher priority for allocation of a higher bit rate;
[0086] JavaScript is a high-level, interpreted programming language that is widely used in Web development. It was originally developed by Netscape to implement dynamic and interactive functions in Web pages. JavaScript is a multi-paradigm language that supports event-driven, functional, and imperative programming styles;
[0087] The initial bit rate refers to the encoding rate of the audio stream when it starts playing, that is, the number of bits transmitted per second. It is usually expressed in kbps (kilobits per second), reflecting the degree of compression of the audio data and the sound quality. The initial bit rate is crucial in the streaming media playback process because it directly affects the quality of the audio and the bandwidth requirements. A higher bit rate usually means better sound quality, but it also requires more network bandwidth and is suitable for high-speed Internet environments; while a lower bit rate reduces bandwidth consumption while ensuring basic sound quality, and is more suitable for use in conditions with poor network conditions;
[0088] Step 6.5: Sort the priority index of each streaming audio from high to low, and select the streaming audio with the highest priority index to maintain the optimal bit rate.
[0089] In this embodiment, it should be specifically explained that the step of adjusting the bit rate according to the priority index is:
[0090] Set a priority index threshold, calculate the ratio of the priority index of the streaming audio to the priority index threshold, and then multiply it by the initial bit rate to calculate the actual bit rate. The calculation formula is: AB represents the actual bit rate, PT represents the priority index, PT0 represents the priority index threshold, B represents the initial bit rate, and the streaming audio bit rate is adjusted according to the actual bit rate.
[0091] In this embodiment, it is necessary to specifically explain a device for optimizing streaming media audio, the device comprising:
[0092] The streaming media data collection module is used to collect streaming media related data, including the amount of streaming media audio, device performance and network status data, and transmit the streaming media related data to the streaming media data analysis module and the streaming media data evaluation module;
[0093] The streaming media data analysis module is used to receive the streaming media related data transmitted by the streaming media data acquisition module, analyze the streaming media related data to obtain the device performance coefficient and the network quality coefficient, and transmit the device performance coefficient and the network quality coefficient to the streaming media data evaluation module;
[0094] The streaming media data evaluation module is used to receive the streaming media audio quantity, device performance coefficient and network quality coefficient transmitted by the streaming media data acquisition module and the streaming media data analysis module, and perform a comprehensive evaluation to obtain a satisfiability index, and transmit the satisfiability index to the user interaction data acquisition module;
[0095] A user interaction data collection module is used to receive the satisfiability index transmitted by the streaming media data evaluation module, judge the use of streaming media according to the satisfiability index, and if it is not satisfied, collect the user interaction data of each streaming media and transmit it to the interaction data evaluation module;
[0096] An interaction data evaluation module is used to receive the user interaction data transmitted by the user interaction data acquisition module, evaluate it to obtain a priority index, and transmit the priority index to the bit rate adjustment module;
[0097] The bit rate adjustment module is used to receive the priority index transmitted by the interactive data evaluation module and adjust the bit rate according to the priority index.
[0098] Finally: The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the protection scope of the present invention.
[0099] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A method for optimizing streaming media audio, characterized in that: The following steps are involved: Step 1: Use JavaScript to detect and record the number of currently open streaming audio on the device's web page; Step 2: Collect the current device performance, which includes CPU usage and memory usage. The device performance coefficient is calculated based on the device performance. The calculation formula is: , where EP represents the device performance coefficient, C represents the CPU usage, and M represents the memory usage; Step 3: Collect current network-related data, including network jitter, packet loss rate, and network bandwidth stability, normalize the network jitter, packet loss rate, and network bandwidth stability, and calculate the network quality coefficient based on the normalized network-related data. The calculation formula is: , where NQ represents the network quality coefficient, NJ represents the network jitter degree, NL represents the packet loss rate, and NS represents the network bandwidth stability; Step 4: Normalize the number of streaming audio, device performance coefficient, and network quality coefficient, and calculate the satisfiability index based on the normalized number of streaming audio, device performance coefficient, and network quality coefficient. The calculation formula is: , where CS is the satisfiability index, NUM L It is represented by the number of streaming audios, EP is represented by the equipment performance coefficient, NQ is represented by the network quality coefficient, and a1, a2, and a3 are the weight coefficients of the number of streaming audios, the equipment performance coefficient, and the network quality coefficient; Step 5: Determine the use of streaming media based on the satisfiability index; Step 6: If it is determined that the usage of all streaming audio can be satisfied at present, no bit rate intervention is performed; if it is determined that the usage of all streaming audio cannot be satisfied at present, one is selected from all streaming audios according to the priority index to maintain the optimal bit rate, and the bit rates of the remaining streaming audios are adjusted according to the priority index; The steps of selecting a method to maintain the optimal bit rate among all streaming audios according to the priority index are as follows: Step 6.1: During the detection period, by extracting server-side data, collect the user's behavior data on streaming media audio during the detection period, wherein the behavior data includes the number of times the user clicks to play and pause and the number of times the user adjusts the volume; Step 6.2: Collecting user engagement data on streaming audio during the detection period by extracting server-side data, where the engagement data is the number of comments provided by the user during audio playback; Step 6.3: Calculate user interactivity based on behavior data and engagement data. The calculation formula is: , where IT represents user interactivity, Np represents the total number of times users click play and pause, Nv represents the total number of times users adjust the volume, and Nc represents the total number of comments provided by users during audio playback; Step 6.4: Collect the initial bit rate of each streaming audio, normalize the initial bit rate and user interactivity, and calculate the priority index through the normalized initial bit rate and user interactivity. The calculation formula is: , where PT represents the priority index, B represents the initial bit rate, IT represents the user interactivity, Bmax represents the highest initial bit rate among all streaming audios, and ITmax represents the highest user interactivity among all streaming audios; Step 6.5: Sort the priority index of each streaming audio from high to low, and select the streaming audio with the highest priority index to maintain the optimal bit rate.
2. The method for optimizing streaming media audio according to claim 1, characterized in that: The steps for calculating the network jitter degree are as follows: Step 3.1: Set the detection time period, record the timestamp of each data packet arriving within the detection time period, calculate the difference of the arrival time of consecutive data packets, and obtain the time interval sequence; Step 3.2: Use the time interval sequence as a feature, and use the time interval sequence of all data packets as a data set, where each time interval sequence in the data set is a data point; Step 3.3: Use the K-means clustering method to input the standardized time interval series into the clustering algorithm to obtain the final clustering result; Step 3.4: Analyze and calculate the degree of network jitter based on the final clustering results.
3. The method for optimizing streaming media audio according to claim 2, characterized in that: The K-means clustering method is used to input the standardized time interval sequence into the clustering algorithm to obtain the final clustering result in the following steps: Step 3.3.1: Determine the optimal number of clusters K by the elbow method, and randomly select K data points in the data set as the initial cluster centers; Step 3.3.2: For each data point, calculate its Euclidean distance to each initial cluster center and assign it to the cluster corresponding to the nearest initial cluster center; Step 3.3.3: After traversing all data points, the initial clusters are obtained. For each initial cluster, the data points in it are calculated to get the new cluster center. Step 3.3.4: Repeat steps 3.3.2 and 3.3.3 until the cluster center no longer changes and the final cluster is obtained.
4. The method for optimizing streaming media audio according to claim 2, characterized in that: The steps of analyzing and calculating the network jitter degree according to the final clustering result are as follows: According to the final clustering clusters obtained, the variance of the data points in each final clustering cluster is calculated as the degree of cluster jitter; The weight of each final cluster is calculated by calculating the ratio of the number of data points in each final cluster to the total number of data points in the data set; The jitter degree of all clusters is weighted and summed up, and the average is calculated to obtain the network jitter degree, which is calculated as follows: , where NJ represents the degree of network jitter, K is the number of clusters, It is expressed as the cluster jitter degree of the jth final cluster, It is represented as the weight of the jth final cluster.
5. The method for optimizing streaming media audio according to claim 1, characterized in that: The steps of judging the use of streaming media according to the satisfiability index are as follows: The satisfiability index is compared with a preset threshold. If the satisfiability index is greater than the preset threshold, it is determined that the current usage of all streaming audio can be satisfied. If the streaming audio is less than the preset threshold, it is determined that the current usage of all streaming audio cannot be satisfied.
6. The method for optimizing streaming media audio according to claim 1, characterized in that: The step of adjusting the bit rate according to the priority index is: Set a priority index threshold, calculate the ratio of the priority index of the streaming audio to the priority index threshold, and then multiply it by the initial bit rate to calculate the actual bit rate. The calculation formula is: , where AB represents the actual bit rate, PT represents the priority index, PT0 represents the priority index threshold, B represents the initial bit rate, and the streaming audio bit rate is adjusted according to the actual bit rate.
7. A device for implementing the method for optimizing streaming media audio according to any one of claims 1 to 6, characterized in that: include: The streaming media data collection module is used to collect streaming media related data, including the amount of streaming media audio, device performance and network status data, and transmit the streaming media related data to the streaming media data analysis module and the streaming media data evaluation module; The streaming media data analysis module is used to receive the streaming media related data transmitted by the streaming media data acquisition module, analyze the streaming media related data to obtain the device performance coefficient and the network quality coefficient, and transmit the device performance coefficient and the network quality coefficient to the streaming media data evaluation module; The streaming media data evaluation module is used to receive the streaming media audio quantity, device performance coefficient and network quality coefficient transmitted by the streaming media data acquisition module and the streaming media data analysis module, and perform a comprehensive evaluation to obtain a satisfiability index, and transmit the satisfiability index to the user interaction data acquisition module; The user interaction data collection module is used to receive the satisfiability index transmitted by the streaming media data evaluation module, judge the use of the streaming media according to the satisfiability index, and if the use is not satisfied, collect the user interaction data of each streaming media and transmit it to the interaction data evaluation module; An interaction data evaluation module is used to receive the user interaction data transmitted by the user interaction data acquisition module, evaluate it to obtain a priority index, and transmit the priority index to the bit rate adjustment module; The bit rate adjustment module is used to receive the priority index transmitted by the interactive data evaluation module and adjust the bit rate according to the priority index.
Citation Information
Patent Citations
Packing method for streaming media transmission in intercom system
CN102740064A
Streaming media live-streaming buffer determining method, device and equipment and storage medium
CN109587551A