Anti-packet-loss strategy switching method, device and storage medium

By obtaining client network status data, determining the credibility and switching the anti-packet loss strategy, the problem of game video screen lag caused by network status changes in the prior art is solved, and the stability and fluency of video stream data transmission is achieved.

CN115514456BActive Publication Date: 2025-07-25MIGU INTERACTIVE ENTERTAINMENT CO LTD +2
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211153915.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-09-21
Publication Date
2025-07-25
Estimated Expiration
2042-09-21

AI Technical Summary

Technical Problem

In the prior art, the anti-packet loss strategy is no longer adjusted after the server is determined, resulting in the problem of game video screen stuttering when the client network state changes.

Method used

By obtaining the network status data of the client, the current trustworthiness is determined, and based on the trustworthiness, whether to switch the anti-packet loss policy to match the policy with the network status.

Benefits of technology

It avoids the phenomenon of stuttering when the client plays game video screens, and improves the stability and fluency of video streaming data transmission.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115514456B_ABST
    Figure CN115514456B_ABST
Patent Text Reader

Abstract

The present application discloses a method, device and storage medium for anti-packet loss policy switching. The method includes the steps of: obtaining first network status data of a client; determining a current credibility based on the first network status data; and determining whether to switch the anti-packet loss policy based on the current credibility. In the present application, the current credibility is determined through the first network status data of the client, and whether to switch the anti-packet loss policy is determined through the current credibility, so as to switch the anti-packet loss policy according to the first network status data, rather than not adjusting the anti-packet loss policy after the anti-packet loss policy is determined. Thereby, the switched anti-packet loss policy can correspond to the network status of the client, and further avoids the picture freeze when the client plays the game video picture.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the technical field of data transmission, and in particular, to a method, device, and storage medium for switching anti-packet loss strategies. Background Art

[0002] When the server transmits video stream data packets to the client, the transmission is based on an anti-packet loss strategy. Among them, the video stream data packets are used for the client to render and play game video images. The anti-packet loss strategies include NACK (Negative acknowledgements, packet loss retransmission), FEC (Forward Error Correction, forward error correction), and packet replication, etc. NACK is used to retransmit lost data packets when the client determines packet loss, FEC is used to recover data packets through error correction codes when the client determines packet loss, and packet replication is that the server sends multiple identical data packets to the client. Correspondingly, NACK is used for network scenarios with high latency and large bandwidth, and FEC and packet replication are used for network states with low latency and small bandwidth.

[0003] Currently, the anti-packet loss strategy is determined before the server transmits video stream data packets to the client and is not adjusted subsequently. However, the network state of the client is complex and changeable. When the determined anti-packet loss strategy is not applicable to the network state of the client (for example, the network state of the client is low latency and small bandwidth, while the anti-packet loss strategy is NACK), the client is bound to experience stuttering when playing game video images. Summary of the Invention

[0004] In view of this, embodiments of this application provide a method, device, and storage medium for switching anti-packet loss strategies, aiming to avoid stuttering of the video image when the client plays game video images.

[0005] To achieve the above object, this application provides an anti-packet loss strategy switching method, and the method includes:

[0006] Obtain the first network state data of the client;

[0007] Based on the first network state data, determine the current credibility;

[0008] Based on the current credibility, determine whether to switch the anti-packet loss strategy.

[0009] Exemplarily, the determining the current credibility based on the first network state data includes:

[0010] Obtain the gains of each anti-packet loss strategy based on the first network state data; each anti-packet loss strategy includes the current anti-packet loss strategy;

[0011] Calculate the product of each gain and the first network state data respectively to obtain multiple benefits;

[0012] Calculate the benefit difference between each non-current packet loss resistance strategy and the current packet loss resistance strategy in each packet loss resistance strategy respectively to obtain the current credibility.

[0013] Exemplarily, the first network state data includes at least one attribute;

[0014] The obtaining of the gain of each packet loss resistance strategy based on the first network state data includes:

[0015] Determine the gain corresponding to each attribute under each packet loss resistance strategy;

[0016] Wherein, any attribute corresponds to a gain under any packet loss resistance strategy.

[0017] Exemplarily, the determining of the gain corresponding to each attribute under each packet loss resistance strategy includes:

[0018] Obtain the second network state data uploaded by the client when adopting each packet loss resistance strategy within a preset duration; the second network state data includes the attributes included in the first network state data; the end moment of the preset duration is before the start moment of executing the packet loss resistance strategy switching method;

[0019] Calculate the first information entropy of each of the attributes based on the second network state data;

[0020] Determine the frame drop rate corresponding to the second network state data;

[0021] Calculate the second information entropy of each packet loss resistance strategy based on the frame drop rate;

[0022] Calculate the difference between each second information entropy and the first information entropy respectively to obtain the gain corresponding to each attribute under each packet loss resistance strategy.

[0023] Exemplarily, the calculating of the first information entropy of each of the attributes based on the second network state data includes:

[0024] Calculate the first information entropy H1 of any attribute by using the following formula:

[0025]

[0026] Wherein, i is the second network state data identifier, X i is the i-th second network state data or the data interval where the i-th second network state data is located, size(T) is the total number of second network state data, size(X i ) is used to calculate X iThe number of occurrences of , wherein the data interval is one of the pre-divided data intervals.

[0027] Exemplarily, determining the jam rate corresponding to the second network status data includes:

[0028] The jam rate g is determined using the following formula:

[0029] g=(fa) / a

[0030] Among them, f is the actual frame interval when the client plays the game video screen, and a is the standard frame interval; the game video screen is generated based on the video stream data packet, and the network status when the video stream data is received corresponds to the second network status data.

[0031] Exemplarily, the calculating the second information entropy of each anti-packet loss strategy based on the jam rate includes:

[0032] For any anti-packet loss strategy among the anti-packet loss strategies, its second information entropy H2 is calculated by the following formula:

[0033]

[0034] Among them, m1 is the amount of first data in the second network status data, the jam rate corresponding to the first data is greater than or equal to the preset jam rate threshold, and the client adopts any of the anti-packet loss strategies when the first data is uploaded; m2 is the amount of second data in the second network status data, the jam rate corresponding to the second data is less than the preset jam rate threshold, and the client adopts any of the anti-packet loss strategies when the second data is uploaded; size(T) is the total amount of second network status data.

[0035] Exemplarily, any non-current anti-packet loss strategy corresponds to a current credibility;

[0036] The determining whether to switch the anti-packet loss strategy based on the current credibility includes:

[0037] If the maximum current credibility is greater than or equal to the preset credibility threshold, it is determined to switch the anti-packet loss strategy, and the anti-packet loss strategy after switching is any non-current anti-packet loss strategy corresponding to the maximum current credibility;

[0038] or,

[0039] Obtain the historical credibility of each non-current anti-packet loss strategy;

[0040] The historical credibility corresponding to each non-current anti-packet loss strategy and the current credibility are respectively formed into a credibility set to obtain multiple credibility sets;

[0041] Calculate the switching trend factor based on the credibility sets corresponding to the respective non-current anti-packet-loss strategies;

[0042] If the maximum switching trend factor is greater than or equal to the preset switching trend factor threshold, determine to switch the anti-packet-loss strategy, and the switched anti-packet-loss strategy is the non-current anti-packet-loss strategy corresponding to the maximum switching trend factor:

[0043] Among them, the switching trend factor S corresponding to any non-current anti-packet-loss strategy is calculated using the following formula:

[0044] S = (size(E≥0) - size(E<0)) / size(E) × E 方差

[0045] Among them, the size(E≥0) is used to calculate the number of elements in the credibility set corresponding to any non-current anti-packet-loss strategy whose value is greater than or equal to 0; the size(E<0) is used to calculate the number of elements in the credibility set corresponding to any non-current anti-packet-loss strategy whose value is less than 0; the size(E) is the total number of elements in the credibility set corresponding to any non-current anti-packet-loss strategy; and the E 方差 is the variance of all element values in the credibility set corresponding to any non-current anti-packet-loss strategy.

[0046] In addition, to achieve the above object, the present application also provides an anti-packet-loss strategy switching device, which includes a memory, a processor, and an anti-packet-loss strategy switching program stored on the memory and executable on the processor. When the anti-packet-loss strategy switching program is executed by the processor, the steps of the anti-packet-loss strategy switching method described above are implemented.

[0047] In addition, to achieve the above object, the present application also provides a computer-readable storage medium, on which an anti-packet-loss strategy switching program is stored. When the anti-packet-loss strategy switching program is executed by a processor, the steps of the anti-packet-loss strategy switching method described above are implemented.

[0048] Compared with the prior art, which transmits video stream data packets through a determined packet loss resistance strategy, resulting in a lag phenomenon when the client plays the game video screen when the network state changes to a network state that does not correspond to the current packet loss resistance strategy, the present application obtains the first network state data of the client; based on the first network state data, determines the current credibility; and based on the current credibility, determines whether to switch the packet loss resistance strategy. The present application determines the current credibility through the first network state data of the client, and determines whether to switch the packet loss resistance strategy through the current credibility, thereby switching the packet loss resistance strategy based on the first network state data, rather than not adjusting the packet loss resistance strategy after determining the packet loss resistance strategy. As a result, the switched packet loss resistance strategy can correspond to the network state of the client, thereby avoiding screen lag when the client plays the game video screen. BRIEF DESCRIPTION OF THE DRAWINGS

[0049] Figure 1 is a schematic flowchart of the first embodiment of the packet loss resistance strategy switching method of the present application;

[0050] Figure 2 is a schematic diagram of the functional modules of the preferred embodiment of the packet loss resistance strategy switching device of the present application;

[0051] Figure 3 is a schematic diagram of the structure of the hardware operating environment involved in the solution of the embodiment of the present application.

[0052] The implementation, functional features, and advantages of the objectives of the present application will be further described with reference to the embodiments and the accompanying drawings. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0053] It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0054] The present application provides a packet loss resistance strategy switching method, referring to Figure 1 , Figure 1 is a schematic flowchart of the first embodiment of the packet loss resistance strategy switching method of the present application.

[0055] The embodiments of the present application provide an embodiment of the packet loss resistance strategy switching method. It should be noted that although the logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order from that here. The packet loss resistance strategy switching method can be applied to a server. For the sake of convenience of description, the execution subject is omitted hereinafter to describe each step of the packet loss resistance strategy switching method. The packet loss resistance strategy switching method includes:

[0056] Step S110, obtaining the first network state data of the client;

[0057] The client refers to terminal devices such as mobile phones and tablets that play game screens. Among them, the client does not run the game, and the game actually runs on the cloud game server. The cloud game server is a server, which can be the same server as the server that executes the anti-packet loss policy switching method of this application, or can be a different server.

[0058] When a user plays a cloud game through the client, the current network state of the client is understood through the first network state data. Among them, the first network state data includes at least one of the data of bandwidth, delay, and loss. Among them, bandwidth represents the currently predicted bandwidth value of the client, delay represents latency, and loss represents the packet loss rate. The quality of the network state can be intuitively reflected by the first network state data. Specifically, the smaller the bandwidth value, the higher the latency, or the larger the packet loss rate, the worse the network state; the larger the bandwidth value, the lower the latency, or the smaller the packet loss rate, the better the network state. That is, the quality of the network state is positively correlated with the bandwidth value and negatively correlated with the latency and the packet loss rate.

[0059] Exemplarily, the first network state data can be data representing the network state of the client within a time interval, or can be real-time data representing the network state of the client, that is, data representing the network state of the client at a moment.

[0060] For the first network state data being data representing the network state of the client within a time interval, the data of bandwidth, delay, and loss are statistical values of this time interval, and the statistical values include average values, medians, etc. For example, if the time interval is 10s, the first network state data is sampled by the client every 10s. Taking the sampling of the packet loss rate as an example, if the client collects 100 packet loss rates within 10s, then the statistical value corresponding to the 100 packet loss rates is used as the first network state data; correspondingly, the bandwidth value and the latency are also statistical values within these 10s.

[0061] For the first network state data being real-time data representing the network state of the client, that is, the data of bandwidth, delay, and loss are real-time data, the first network state data is recorded and uploaded by the client every time it receives a video stream data packet sent by the cloud game server. For example, when the client receives a video stream data packet, the latency is 10ms and the packet loss rate is 1.2%, then the first network state data includes 10ms and 1.2%.

[0062] Step S120, based on the first network state data, determine the current credibility;

[0063] The credibility (confidence level) characterizes the trend of whether to switch the anti-packet loss strategy. The larger the value, the more necessary it is to switch the anti-packet loss strategy; the smaller the value, the less necessary it is to switch the anti-packet loss strategy. It should be noted that the current credibility can more intuitively determine whether to switch the anti-packet loss strategy relative to the first network state data.

[0064] Step S130, based on the current credibility, determine whether to switch the anti-packet loss strategy.

[0065] It can be understood that since the current credibility is determined based on the first network state data, therefore, whether to switch the anti-packet loss strategy is determined based on the current network state of the client. Specifically, after the network state changes, if the current credibility meets certain conditions, it means that the current anti-packet loss strategy is no longer applicable to the changed network state. At this time, the current anti-packet loss strategy can be switched to an anti-packet loss strategy applicable to the changed network state.

[0066] Compared with the prior art where video stream data packets are transmitted through a determined anti-packet loss strategy, resulting in a phenomenon of stuttering when the client plays the game video screen when the network state changes to a network state not corresponding to the current anti-packet loss strategy, the present application obtains the first network state data of the client; based on the first network state data, determines the current credibility; based on the current credibility, determines whether to switch the anti-packet loss strategy. The present application determines the current credibility through the first network state data of the client, and determines whether to switch the anti-packet loss strategy through the current credibility, so as to switch the anti-packet loss strategy based on the first network state data, rather than not adjusting the anti-packet loss strategy after determining the anti-packet loss strategy. Thus, the switched anti-packet loss strategy can correspond to the network state of the client, and further avoids stuttering of the client when playing the game video screen.

[0067] Exemplarily, the determining the current credibility based on the first network state data includes:

[0068] Step a, obtain the gains of each anti-packet loss strategy based on the first network state data; each anti-packet loss strategy includes the current anti-packet loss strategy;

[0069] Step b, calculate the product of each gain and the first network state data respectively to obtain multiple benefits;

[0070] Assume the benefit is V, the first network state data is G, each anti-packet loss strategy includes FEC and NACK, the gain under FEC is FEC(G), and the gain under NACK is NACK(G), then the benefit V under FEC FEC = G × FEC(G), the benefit V under NACK NACK= G × NACK(G). Here, the current packet loss resistance strategy is FEC or NACK.

[0071] Step c, calculate the benefit difference between each non-current packet loss resistance strategy and the current packet loss resistance strategy in each packet loss resistance strategy respectively to obtain the current credibility.

[0072] For example, when the current packet loss resistance strategy is FEC, the non-current packet loss resistance strategy is NACK, and the benefit corresponding to FEC is V FEC , and the benefit corresponding to NACK is V NACK , then the current credibility E NACK = V NACK - V FEC ; Another example is when the current packet loss resistance strategy is FEC, the non-current packet loss resistance strategies include NACK and packet replication, and the benefit corresponding to FEC is V FEC , the benefit corresponding to NACK is V NACK , and the benefit corresponding to packet replication is V BFZ , then the current credibility E corresponding to NACK NACK = V NACK - V FEC , and the current credibility E corresponding to packet replication BFz = V BFz - V FEC .

[0073] Exemplarily, the first network state data includes at least one attribute, and there are at least two implementation manners for obtaining the gain of each packet loss resistance strategy based on the first network state data. One is that one attribute corresponds to one gain under one packet loss resistance strategy, and the other is that all attributes correspond to one gain under one packet loss resistance strategy. Among them, the attribute includes at least one of bandwidth, delay, and loss.

[0074] For the case where one attribute corresponds to one gain under one packet loss resistance strategy, obtaining the gain of each packet loss resistance strategy based on the first network state data includes:

[0075] Step a1, determine the gain corresponding to each attribute under each packet loss resistance strategy;

[0076] Among them, any one attribute corresponds to one gain under any one packet loss resistance strategy.

[0077] When the first network state data includes one attribute, the first network state data G only includes the data corresponding to one attribute.

[0078] For example, when the attribute is bandwidth (B), the data corresponding to the attribute B is B x, correspondingly, assuming the benefit is V, each packet loss resistance strategy includes FEC and NACK, the gain of attribute B under FEC is FEC(B), and the gain of attribute B under NACK is NACK(B), then the benefit V under FEC FEC = B x × FEC(B), the benefit V under NACK NACK = B x × NACK(B).

[0079] When the first network status data includes multiple attributes, the first network status data G includes data corresponding to multiple attributes.

[0080] For example, the attributes include bandwidth (B), delay (D), and loss (L). Correspondingly, assuming the benefit is V, each packet loss resistance strategy includes FEC, NACK, and packet replication, where FEC is the current packet loss resistance strategy. The gain of attribute B under FEC is FEC(B), the gain of attribute B under NACK is NACK(B), and the gain of attribute B under packet replication is BFZ(B); the gain of attribute D under FEC is FEC(D), the gain of attribute D under NACK is NACK(D), and the gain of attribute D under packet replication is BFZ(D); the gain of attribute L under FEC is FEC(L), the gain of attribute L under NACK is NACK(L), and the gain of attribute L under packet replication is BFZ(L); the data corresponding to attribute B is B x , the data corresponding to attribute D is D y , the data corresponding to attribute B is L z , then the benefit V under FEC FEC = B x × FEC(B) + D y × FEC(D) + L z × FEC(L), the benefit V under NACK NACK = B x × NACK(B) + D y × NACK(D) + L z × NACK(L), the benefit V under packet replication BFZ = B x × BFZ(B) + D y × BFZ(D) + L z × BFZ(L).

[0081] For the case where each attribute corresponds to a gain under one packet loss resistance strategy, obtaining the gains of each packet loss resistance strategy based on the first network status data includes:

[0082] Step a2, determining the gains corresponding to all attributes under each packet loss resistance strategy.

[0083] When the first network status data includes an attribute, the first network status data G only includes the data corresponding to one attribute.

[0084] For example, if the attribute is bandwidth (B), the data corresponding to attribute B is B x , correspondingly, assuming the revenue is V, the anti-packet-loss strategies include FEC and NACK, the gain of attribute B under FEC is FEC(B), and the gain of attribute B under NACK is NACK(B), then the revenue V under FEC FEC = B x × FEC(B), and the revenue V under NACK NACK = B x × NACK(B).

[0085] When the first network status data includes multiple attributes, the first network status data G includes the data corresponding to multiple attributes.

[0086] For example, the attributes include bandwidth (B), delay (D), and loss (L). Correspondingly, assuming the revenue is V, the anti-packet-loss strategies include FEC, NACK, and packet replication, where FEC is the current anti-packet-loss strategy. The gain of all attributes under FEC is FEC(ALL); the gain of all attributes under NACK is NACK(ALL); the gain of all attributes under packet replication is BFZ(ALL); the data corresponding to attribute B is B x , the data corresponding to attribute D is D y , the data corresponding to attribute L is L z , then the revenue V under FEC FEC = (B x + D y + L z ) × FEC(ALL), the revenue V under NACK NACK = (B x + D y + L z ) × NACK(ALL), and the revenue V under packet replication BFZ = (B x + D y + L z ) × BFZ(ALL).

[0087] Exemplarily, determining the gain corresponding to each attribute under each anti-packet-loss strategy includes:

[0088] Step a11: Obtain the second network status data uploaded by the client when adopting each packet loss resistance strategy within a preset duration; the second network status data includes the attributes included in the first network status data; the end moment of the preset duration is before the start moment of executing the packet loss resistance strategy switching method.

[0089] The specific implementation manner of the second network status data is basically the same as that of the above-mentioned first network status data, and will not be elaborated here.

[0090] Exemplarily, when the non-current packet loss resistance strategy is one, the second network status data is the network status data uploaded by the client under one packet loss resistance strategy; when the non-current packet loss resistance strategy is multiple, the second network status data is the network status data uploaded by the client under each packet loss resistance strategy respectively.

[0091] The second network status data is obtained by probing the client by setting each packet loss resistance strategy respectively. Specifically, assume that each packet loss resistance strategy includes FEC, NACK, and packet replication. Set the packet loss resistance strategy to FEC, and set the collection time to the first preset collection time. Collect the network status data uploaded by the client at a preset period within the first preset collection time; set the packet loss resistance strategy to NACK, and set the collection time to the second preset collection time. Collect the network status data uploaded by the client at a preset period within the second preset collection time; set the packet loss resistance strategy to packet replication, and set the collection time to the third preset collection time. Collect the network status data uploaded by the client at a preset period within the third preset collection time. Among them, the sum of the first preset collection time, the second preset collection time, and the third preset collection time is the preset duration. The first preset collection time, the second preset collection time, and the third preset collection time may be equal or not equal, and the specific value of the preset duration can be set as needed, and this embodiment does not make a specific limitation.

[0092] It should be noted that the reason for setting the period for the client to upload network status data is that the user's network status changes in real time. If the packet loss resistance strategy is determined according to the real-time changing network status, the data calculation frequency is too high, which will cause the server to reach the performance bottleneck and cause the server to crash. Therefore, by uploading network status data at a preset period by the client, server crashes can be avoided, thereby improving the stability of cloud games.

[0093] Step a12: Calculate the first information entropy of each attribute based on the second network status data;

[0094] Step a13: Determine the frame drop rate corresponding to the second network status data.

[0095] The stutter rate can be uploaded by the client, or calculated from the actual frame interval uploaded by the client when the client plays the game video screen. When the stutter rate is uploaded by the client, since the stutter rate is calculated by the client, it is necessary to send a standard frame interval to the client so that the client can calculate the stutter rate based on the standard frame interval.

[0096] Step a14, calculating the second information entropy of each anti-packet loss strategy based on the jamming rate;

[0097] Step a15, respectively calculating the difference between each second information entropy and the first information entropy to obtain the corresponding gain of each attribute under each anti-packet loss strategy.

[0098] Exemplarily, the calculating the first information entropy of each of the attributes based on the second network status data includes:

[0099] The first information entropy H1 of any attribute is calculated using the following formula:

[0100]

[0101] in, i is the second network status data identifier, X i is the i-th second network status data or the data interval where the i-th second network status data is located, size(T) is the total number of second network status data, size(X i ) is used to calculate X i The number of occurrences of , wherein the data interval is one of the pre-divided data intervals.

[0102] P i is the probability of the i-th second network status data or the data interval where the i-th second network status data is located in all the second network status data. For example, if the attribute is loss, its corresponding value is 1%, there are 100 second network status data in total, and the second network status data with a loss value of 1% appears 3 times, then the probability of the value is 3%.

[0103] It should be noted that the first information entropy is related to the attribute but has nothing to do with the anti-packet loss strategy.

[0104] Data intervals can be divided based on experience or historical data.

[0105] Taking the attribute of delay as an example, based on experience, it is determined that the delay of the client fluctuates between 50 and 200. Divide 50 - 200 into preset equal parts (set according to needs, not specifically limited in this embodiment). For example, if the preset equal parts are 10, then the data intervals of delay can be obtained: {(D1, D2], (D2, D3],...(D10, D11]}, where D1 is 0, D2 is 50, D3 is 65, D4 is 80, and so on, D10 is 185, and Dn is infinity. Correspondingly, the data intervals of bandwidth can be obtained: {(B1, B2], (B2, B3],...(Bn - 1, Bn]}; the data intervals of loss: {(L1, L2], (L2, L3],...(Ln - 1, Ln]}. Where n is the preset equal parts plus one.

[0106] Correspondingly, taking the attribute of loss as an example, after determining through historical data that the packet loss rate of the client fluctuates between 1% and 5%, a data interval: {(L1, L2], (L2, L3],...(Ln - 1, Ln]} can be obtained through a process similar to the above process of dividing 50 - 200 into preset equal parts based on experience to determine that the delay of the client fluctuates between 50 and 200, and the corresponding data intervals of delay: {(D1, D2], (D2, D3],...(D10, D11]} and bandwidth: {(B1, B2], (B2, B3],...(Bn - 1, Bn]}. Where the historical data can be the network status data 1 minute ago, the network status data 1 hour ago, etc., which are the network status data before a preset time; the historical data can also be the network status data updated over time, such as the network status data within 1 minute - 2 minutes before the start time of each execution of the anti-packet-loss policy switching method, or the network status data within 2 minutes - 3 minutes before the start time of each execution of the anti-packet-loss policy switching method, etc.

[0107] After dividing multiple data intervals, classify the second network status data into the corresponding data intervals. For example, there is a second network status data whose attribute includes delay and its value is 80, and there is a data interval (65, 80], then classify the data corresponding to delay in this second network status data into the data interval (65, 80].

[0108] It can be understood that for X i is the i-th second network status data and X i is the data interval where the i-th second network status data is located. The difference between the two is that the latter can significantly reduce the amount of calculation, thereby improving the efficiency of switching the anti-packet-loss policy.

[0109] Exemplarily, when the server calculates the jam rate, determining the jam rate corresponding to the second network status data includes:

[0110] The jam rate g is determined using the following formula:

[0111] g=(fa) / a

[0112] Among them, f is the actual frame interval when the client plays the game video screen, and a is the standard frame interval; the game video screen is generated based on the video stream data packet, and the network status when the video stream data is received corresponds to the second network status data.

[0113] The actual frame interval of the client is received, and the jam rate is determined based on the actual frame interval. The value corresponding to the network state when the client receives the video stream data packet is the second network state data, the client generates a game video screen through the video stream data packet, and when the client plays the game video screen, the interval between two adjacent game video screen frames is the actual frame interval, such as the playback interval between the current screen and the previous screen.

[0114] It should be noted that when the client uploads the second network status data, the actual frame interval can be uploaded synchronously, and can even be merged into a data packet with the second network status data, and then the data packet is uploaded to the server. Correspondingly, the current anti-packet loss strategy can also be uploaded synchronously or merged into a data packet and uploaded synchronously. Among them, the anti-packet loss strategy is specified by the server, so the current anti-packet loss strategy can also be not uploaded, and the server can obtain the current anti-packet loss strategy recorded by it.

[0115] It should be noted that, similar to the collection of the second network status data, assuming that the frame rate of the cloud game server is 30 frames per second, the cloud game server sends a data packet every 33ms, that is, the standard frame interval is 33ms. Under ideal conditions, the client will receive 300 frames within these 10s. However, due to delays or packet loss, only 289 frames may be received within these 10s, because the interval between some game video frames is more than 33ms. At this time, the average value of the actual frame interval f is 10 / 289.

[0116] It can be understood that the computing power of the server is more powerful than that of the client. Therefore, the calculation process takes less time when the jam rate is calculated on the server.

[0117] Exemplarily, the calculating the second information entropy of each anti-packet loss strategy based on the jam rate includes:

[0118] For any anti-packet loss strategy among the anti-packet loss strategies, its second information entropy H2 is calculated by the following formula:

[0119]

[0120] Among them, m1 is the quantity of the first data in the second network status data, the corresponding freezing rate of the first data is greater than or equal to the preset freezing rate threshold, and the client adopts any of the anti-packet-loss strategies when uploading the first data; m2 is the quantity of the second data in the second network status data, the corresponding freezing rate of the second data is less than the preset freezing rate threshold, and the client adopts any of the anti-packet-loss strategies when uploading the second data; the size(T) is the total quantity of the second network status data.

[0121] The preset freezing rate threshold can be set as needed, such as 2%, 3%, etc. Generally, the freezing rate when people can obviously feel the picture freeze is 2%. Therefore, it is recommended to set the preset freezing rate threshold to 2%.

[0122] The gain under FEC is calculated by the following formula:

[0123] FEC(B)=H 2(FEC) -H 1(B) ; FEC(D)=H 2(FEC) -H 1(D) ; FEC(L)=H 2(FEC) -H 1(L) ;

[0124] The gain under NACK is calculated by the following formula:

[0125] NACK(B)=H 2(NACK) -H 1(B) ; NACK(D)=H 2(NACK) -H 1(D) ; NACK(L)=H 2(NACK) -H 1(L) ;

[0126] The gain under packet replication is calculated by the following formula:

[0127] BFZ(B)=H 2(BFZ) -H 1(B) ; BFZ(D)=H 2(BFZ) -H 1(D) ; BFZ(L)=H 2(BFZ) -H 1(L) ;

[0128] Among them, H2( FEC ) is the second information entropy corresponding to FEC, H 2(NACK) is the second information entropy corresponding to NACK, H 2(BFZ) is the second information entropy corresponding to packet replication; H 1(B) is the first information entropy corresponding to bandwidth, H 1(D)The first information entropy corresponding to delay, H 1(L) The first information entropy corresponding to loss.

[0129] Exemplarily, any non-current packet loss resistance strategy corresponds to a current credibility.

[0130] Determining whether to switch the packet loss resistance strategy based on the current credibility includes:

[0131] If the maximum current credibility is greater than or equal to the preset credibility threshold, it is determined to switch the packet loss resistance strategy, and the switched packet loss resistance strategy is any non-current packet loss resistance strategy corresponding to the maximum current credibility;

[0132] Or,

[0133] Obtain the historical credibility corresponding to each non-current packet loss resistance strategy;

[0134] Form a credibility set by respectively combining the historical credibility corresponding to each non-current packet loss resistance strategy and the current credibility, and obtain multiple credibility sets;

[0135] Calculate the switching trend factor based on the credibility set corresponding to each non-current packet loss resistance strategy respectively;

[0136] If the maximum switching trend factor is greater than or equal to the preset switching trend factor threshold, it is determined to switch the packet loss resistance strategy, and the switched packet loss resistance strategy is the non-current packet loss resistance strategy corresponding to the maximum switching trend factor;

[0137] Among them, the switching trend factor S corresponding to any non-current packet loss resistance strategy is calculated using the following formula:

[0138] S = (size(E≥0) - size(E<0)) / size(E) × E 方差

[0139] Among them, the size(E≥0) is used to calculate the number of elements in the credibility set corresponding to any non-current packet loss resistance strategy whose value is greater than or equal to 0; the size(E<0) is used to calculate the number of elements in the credibility set corresponding to any non-current packet loss resistance strategy whose value is less than 0; the size(E) is the total number of elements in the credibility set corresponding to any non-current packet loss resistance strategy; the E 方差 Is the variance of all element values in the credibility set corresponding to any non-current packet loss resistance strategy.

[0140] If the maximum current confidence level is greater than or equal to the preset confidence level threshold, then determine to switch the packet loss resistant strategy, and the switched packet loss resistant strategy is any non-current packet loss resistant strategy corresponding to the maximum current confidence level. When the current confidence level is greater than or equal to the preset confidence level threshold, the switched packet loss resistant strategy is any non-current packet loss resistant strategy corresponding to the maximum current confidence level; when the current confidence level is less than the preset confidence level threshold, do not switch the packet loss resistant strategy. Among them, the preset confidence level threshold can be set as needed, and this embodiment does not make specific limitations.

[0141] For example, the preset confidence level threshold is 3, the current packet loss resistant strategy is FEC, the non-current packet loss resistant strategies include NACK and packet replication, the current confidence level corresponding to NACK is 2.8, and the current confidence level corresponding to packet replication is 4. Then the maximum current confidence level is 4, and any non-current packet loss resistant strategy corresponding to 4 is packet replication, that is, switch from FEC to packet replication; another example is that the preset confidence level threshold is 2, the current packet loss resistant strategy is NACK, the non-current packet loss resistant strategies include FEC and packet replication, the current confidence level corresponding to FEC is 2.8, and the current confidence level corresponding to packet replication is 3. Since the current confidence level corresponding to packet replication is greater than the current confidence level corresponding to FEC, that is, the maximum current confidence level is the current confidence level corresponding to packet replication, then NACK needs to be switched to packet replication more, rather than switched to FEC.

[0142] For the case where the historical confidence level needs to be calculated to obtain the switching trend factor, and the switching trend factor is used to determine whether to switch the packet loss resistant strategy. The historical confidence levels corresponding to each non-current packet loss resistant strategy are a preset number, and this preset number can be set as needed, such as 30, 40, etc. Generally, the larger the preset number, the more accurate the decision on whether to switch the packet loss resistant strategy in the end. It should be noted that the preset number should not be too large, because the network state of the client too long ago may vary greatly from the current network state change situation, and too large a preset number may reduce the accuracy of the decision on whether to switch the packet loss resistant strategy. Therefore, when setting the preset number, the above two factors can be considered for setting, so as to improve the accuracy of the decision on whether to switch the packet loss resistant strategy.

[0143] Taking the preset number as 29 as an example, define a sliding window of size 30, and determine a first initial value with a value of 0 and a second initial value with a value of 0. The data included in this sliding window is the current confidence level and the 29 historical confidence levels (E1, E2...E29) closest to the current one. Traverse the values of each confidence level in the sliding window. When the value is greater than or equal to 0, increment the above first initial value by one; when the value is less than 0, increment the above second initial value by one. After the traversal, determine the updated first initial value as size(E≥0), and determine the updated second initial value as size(E<0).

[0144] When the above switching trend factor S is greater than or equal to the preset value threshold, determine the switching anti-packet loss strategy; when the above switching trend factor S is less than the preset value threshold, determine not to switch the anti-packet loss strategy. For example, if the preset value threshold is 2, when the switching trend factor S is greater than or equal to 2, determine the switching anti-packet loss strategy; when the above switching trend factor S is less than 2, determine not to switch the anti-packet loss strategy.

[0145] The following uses a preferred embodiment to elaborate on the anti-packet loss strategy switching method of the present application:

[0146] Assume the first network state data G(bandwidth, delay, loss), and the data corresponding to bandwidth is B x and the data corresponding to delay is D y and the data corresponding to loss is L z , and when uploading G, synchronously upload the current anti-packet loss strategy and the actual frame interval f, where the current anti-packet loss strategy is FEC, which is synchronously sent by the server when sending video stream data packets. Each anti-packet loss strategy includes FEC and NACK.

[0147] Obtain the second network state data uploaded by the client when adopting each anti-packet loss strategy within a preset duration; the second network state data includes the attributes included in the first network state data; the end moment of the preset duration is before the start moment of executing the anti-packet loss strategy switching method.

[0148] According to historical data, divide multiple data intervals for each attribute in the second network state data, and classify the second network state data into the corresponding data intervals.

[0149] Use the following formula to calculate the first information entropy H1 of any attribute:

[0150]

[0151] where i is the second network state data identifier, X i is the data interval where the i-th second network state data is located, size(T) is the total number of second network state data, and size(X i ) is used to calculate the occurrence times of X i . Thus, the first information entropy H 1(B) corresponding to bandwidth, the first information entropy H 1(D) corresponding to delay, and the first information entropy H 1(L) corresponding to loss are obtained.

[0152] For any packet loss resistance strategy among the various packet loss resistance strategies, calculate its second information entropy H2 through the following formula:

[0153]

[0154] Wherein, m1 is the number of first data in the second network state data, the freezing rate corresponding to the first data is greater than or equal to a preset freezing rate threshold, and the client adopts the any packet loss resistance strategy when uploading the first data; m2 is the number of second data in the second network state data, the freezing rate corresponding to the second data is less than the preset freezing rate threshold, and the client adopts the any packet loss resistance strategy when uploading the second data; the size(T) is the total number of the second network state data. Thus, the second information entropy H corresponding to FEC 2(FEC) , the second information entropy H corresponding to NACK 2(NACK) .

[0155] Determine the freezing rate g using the following formula:

[0156] g = (f - a) / a

[0157] Wherein, f is the actual frame interval when the client plays the game video picture, and a is the standard frame interval; the game video picture is generated based on video stream data packets, and the network state when the video stream data is received corresponds to the second network state data.

[0158] Calculate the gain of bandwidth under FEC, FEC(B) = H 2(FEC) -H 1(B) ; the gain of delay under FEC, FEC(D) = H 2(FEC) -H 1(D) ; the gain of loss under FEC, FEC(L) = H 2(FEC) -H 1(L) .

[0159] Calculate the gain of bandwidth under NACK, NACK(B) = H 2(NACK) -H 1(B) ; the gain of delay under NACK, NACK(D) = H 2(NACK) -H 1(D) ; the gain of loss under NACK, NACK(L) = H 2(NACK) -H 1(L) .

[0160] Calculate the benefit V under FEC FEC = B x ×FEC(B) + D y ×FEC(D) + L z× FEC(L); Calculate the benefit V under NACK NACK = B x × NACK(B) + D y × NACK(D) + L z × NACK(L); Thus, obtain the current credibility E corresponding to NACK NACK = V NACK - V FEC .

[0161] Define a sliding window of size 30. Through this sliding window, collect the 29 most recent historical credibilities (E1, E2, ..., E29) before the start time of executing the anti-packet-loss policy switching method, and the current credibility. Use the following formula to calculate the switching trend factor S:

[0162] S = (size(E ≥ 0) - size(E < 0)) / size(E) × E 方差

[0163] wherein, the size(E ≥ 0) is used to calculate the number of elements in the credibility set corresponding to any non-current anti-packet-loss policy whose value is greater than or equal to 0; the size(E < 0) is used to calculate the number of elements in the credibility set corresponding to any non-current anti-packet-loss policy whose value is less than 0; the size(E) is the total number of elements in the credibility set corresponding to any non-current anti-packet-loss policy; and the E 方差 is the variance of all element values in the credibility set corresponding to any non-current anti-packet-loss policy.

[0164] When S is greater than or equal to 2, the current anti-packet-loss policy is switched from FEC to NACK; if S is less than 2, the current anti-packet-loss policy is maintained as FEC, and the current anti-packet-loss policy is not switched from FEC to NACK.

[0165] In addition, referring to Figure 2 , this application also provides an anti-packet-loss policy switching device, and the device includes:

[0166] A receiving module 10, configured to obtain first network status data of a client;

[0167] A first determination module 20, configured to determine the current credibility based on the first network status data;

[0168] A second determination module 30, configured to determine whether to switch the anti-packet-loss policy based on the current credibility.

[0169] Exemplarily, the first determination module 20 is specifically configured to:

[0170] Obtain the gains of each packet loss resistance strategy based on the first network state data; each of the packet loss resistance strategies includes the current packet loss resistance strategy;

[0171] Calculate the product of each gain and the first network state data respectively to obtain multiple benefits;

[0172] Calculate the benefit difference between each non-current packet loss resistance strategy and the current packet loss resistance strategy in each packet loss resistance strategy respectively to obtain the current credibility.

[0173] Exemplarily, the first network state data includes at least one attribute;

[0174] The first determination module 20 is further configured to:

[0175] Determine the gains corresponding to each attribute under each packet loss resistance strategy;

[0176] Wherein, any one attribute corresponds to one gain under any one packet loss resistance strategy.

[0177] Exemplarily, the first determination module 20 is further configured to:

[0178] Obtain the second network state data uploaded by the client when adopting each packet loss resistance strategy within a preset duration; the second network state data includes the attributes included in the first network state data; the end moment of the preset duration is before the start moment of executing the packet loss resistance strategy switching method;

[0179] Calculate the first information entropy of each of the attributes based on the second network state data;

[0180] Determine the frame drop rate corresponding to the second network state data;

[0181] Calculate the second information entropy of each packet loss resistance strategy based on the frame drop rate;

[0182] Calculate the difference between each second information entropy and the first information entropy respectively to obtain the gains corresponding to each attribute under each packet loss resistance strategy.

[0183] Exemplarily, the first determination module 20 is further configured to:

[0184] Calculate the first information entropy H1 of any one attribute by using the following formula:

[0185]

[0186] Wherein, i is the second network state data identifier, X i is the i-th second network state data or the data interval where the i-th second network state data is located, size(T) is the total number of second network state data, size(Xi ) is used to calculate X i The number of occurrences of , wherein the data interval is one of the pre-divided data intervals.

[0187] Exemplarily, the first determining module 20 is further configured to:

[0188] The jam rate g is determined using the following formula:

[0189] g=(fa) / a

[0190] Among them, f is the actual frame interval when the client plays the game video screen, and a is the standard frame interval; the game video screen is generated based on the video stream data packet, and the network status when the video stream data is received corresponds to the second network status data.

[0191] Exemplarily, the first determining module 20 is further configured to:

[0192] For any anti-packet loss strategy among the anti-packet loss strategies, its second information entropy H2 is calculated by the following formula:

[0193]

[0194] Among them, m1 is the amount of first data in the second network status data, the jam rate corresponding to the first data is greater than or equal to the preset jam rate threshold, and the client adopts any of the anti-packet loss strategies when the first data is uploaded; m2 is the amount of second data in the second network status data, the jam rate corresponding to the second data is less than the preset jam rate threshold, and the client adopts any of the anti-packet loss strategies when the second data is uploaded; size(T) is the total amount of second network status data.

[0195] Exemplarily, any non-current anti-packet loss strategy corresponds to a current credibility;

[0196] The second determining module 30 is specifically used for:

[0197] If the maximum current credibility is greater than or equal to the preset credibility threshold, it is determined to switch the anti-packet loss strategy, and the anti-packet loss strategy after switching is any non-current anti-packet loss strategy corresponding to the maximum current credibility;

[0198] or,

[0199] Obtain the historical credibility of each non-current anti-packet loss strategy;

[0200] The historical credibility corresponding to each non-current anti-packet loss strategy and the current credibility are respectively formed into a credibility set to obtain multiple credibility sets;

[0201] Calculate the switching trend factor based on the credibility sets corresponding to each non-current packet loss resistance strategy respectively;

[0202] If the maximum switching trend factor is greater than or equal to the preset switching trend factor threshold, determine to switch the packet loss resistance strategy, and the switched packet loss resistance strategy is the non-current packet loss resistance strategy corresponding to the maximum switching trend factor;

[0203] Among them, use the following formula to calculate the switching trend factor S corresponding to any non-current packet loss resistance strategy:

[0204] S = (size(E≥0) - size(E<0)) / size(E) × E 方差

[0205] Among them, the size(E≥0) is used to calculate the number of elements in the credibility set corresponding to any non-current packet loss resistance strategy whose value is greater than or equal to 0; the size(E<0) is used to calculate the number of elements in the credibility set corresponding to any non-current packet loss resistance strategy whose value is less than 0; the size(E) is the total number of elements in the credibility set corresponding to any non-current packet loss resistance strategy; the E 方差 is the variance of all element values in the credibility set corresponding to any non-current packet loss resistance strategy.

[0206] The specific implementation manner of the packet loss resistance strategy switching device in this application is basically the same as that of each embodiment of the above packet loss resistance strategy switching method, and will not be elaborated here.

[0207] In addition, this application also provides a packet loss resistance strategy switching device. Exemplarily, Figure 3 is the structural schematic diagram of the hardware operating environment of the packet loss resistance strategy switching device.

[0208] Such as Figure 3 shown, this packet loss resistance strategy switching device may include a processor 301, a communication interface 302, a memory 303, and a communication bus 304. Among them, the processor 301, the communication interface 302, and the memory 303 complete mutual communication through the communication bus 304. The memory 303 is used to store a computer program; the processor 301 is used to implement the following packet loss resistance strategy switching method when executing the program stored on the memory 303:

[0209] Obtain the first network status data of the client;

[0210] Based on the first network status data, determine the current credibility;

[0211] Based on the current credibility, determine whether to switch the packet loss resistance strategy.

[0212] Exemplarily, determining the current credibility based on the first network status data includes:

[0213] Obtaining the gains of each packet loss resistance strategy based on the first network status data; each packet loss resistance strategy includes the current packet loss resistance strategy;

[0214] Calculating the product of each gain and the first network status data respectively to obtain multiple benefits;

[0215] Calculating the benefit differences between each non - current packet loss resistance strategy and the current packet loss resistance strategy in each packet loss resistance strategy respectively to obtain the current credibility.

[0216] Exemplarily, the first network status data includes at least one attribute;

[0217] The obtaining the gains of each packet loss resistance strategy based on the first network status data includes:

[0218] Determining the gains corresponding to each attribute under each packet loss resistance strategy;

[0219] Wherein, any attribute corresponds to one gain under any packet loss resistance strategy.

[0220] Exemplarily, the determining the gains corresponding to each attribute under each packet loss resistance strategy includes:

[0221] Obtaining the second network status data uploaded by the client when adopting each packet loss resistance strategy within a preset duration; the second network status data includes the attributes included in the first network status data; the end moment of the preset duration is before the start moment of executing the packet loss resistance strategy switching method;

[0222] Calculating the first information entropy of each of the attributes based on the second network status data;

[0223] Determining the frame drop rate corresponding to the second network status data;

[0224] Calculating the second information entropy of each packet loss resistance strategy based on the frame drop rate;

[0225] Calculating the differences between each second information entropy and the first information entropy respectively to obtain the gains corresponding to each attribute under each packet loss resistance strategy.

[0226] Exemplarily, the calculating the first information entropy of each of the attributes based on the second network status data includes:

[0227] Calculating the first information entropy H1 of any attribute using the following formula:

[0228]

[0229] Wherein, i is the identifier of the second network status data, X i is the i-th second network status data or the data interval where the i-th second network status data is located, size(T) is the total number of second network status data, size(X i ) is used to calculate the occurrence times of X i , and the data interval is one of the pre-divided data intervals.

[0230] Exemplarily, determining the stuttering rate corresponding to the second network status data includes:

[0231] Determining the stuttering rate g using the following formula:

[0232] g = (f - a) / a

[0233] where f is the actual frame interval when the client plays the game video screen, a is the standard frame interval; the game video screen is generated based on video stream data packets, and the network status when the video stream data is received corresponds to the second network status data.

[0234] Exemplarily, calculating the second information entropy of each packet loss resistance strategy based on the stuttering rate includes:

[0235] For any one of the packet loss resistance strategies, calculating its second information entropy H2 through the following formula:

[0236]

[0237] where m1 is the number of the first data in the second network status data, the stuttering rate corresponding to the first data is greater than or equal to the preset stuttering rate threshold, and the client uses the any packet loss resistance strategy when the first data is uploaded; m2 is the number of the second data in the second network status data, the stuttering rate corresponding to the second data is less than the preset stuttering rate threshold, and the client uses the any packet loss resistance strategy when the second data is uploaded; the size(T) is the total number of second network status data.

[0238] Exemplarily, any non-current packet loss resistance strategy corresponds to a current credibility;

[0239] Based on the current credibility, determining whether to switch the packet loss resistance strategy includes:

[0240] If the maximum current credibility is greater than or equal to the preset credibility threshold, it is determined to switch the packet loss resistance strategy, and the switched packet loss resistance strategy is any non-current packet loss resistance strategy corresponding to the maximum current credibility;

[0241] Or,

[0242] Obtain the historical credibility corresponding to each non-current packet loss resistance strategy;

[0243] Respectively form a credibility set with the historical credibility corresponding to each non-current packet loss resistance strategy and the current credibility, and obtain multiple credibility sets;

[0244] Calculate the switching trend factor based on the credibility set corresponding to each non-current packet loss resistance strategy respectively;

[0245] If the maximum switching trend factor is greater than or equal to the preset switching trend factor threshold, determine to switch the packet loss resistance strategy, and the switched packet loss resistance strategy is the non-current packet loss resistance strategy corresponding to the maximum switching trend factor;

[0246] Among them, the switching trend factor S corresponding to any non-current packet loss resistance strategy is calculated using the following formula:

[0247] S = (size(E≥0) - size(E<0)) / size(E) × E 方差

[0248] Among them, the size(E≥0) is used to calculate the number of elements in the credibility set corresponding to any non-current packet loss resistance strategy whose value is greater than or equal to 0; the size(E<0) is used to calculate the number of elements in the credibility set corresponding to any non-current packet loss resistance strategy whose value is less than 0; the size(E) is the total number of elements in the credibility set corresponding to any non-current packet loss resistance strategy; the E 方差 is the variance of all element values in the credibility set corresponding to any non-current packet loss resistance strategy.

[0249] The communication bus 304 mentioned in the above packet loss resistance strategy switching device may be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. This communication bus 304 can be divided into an address bus, a data bus, a control bus, etc. For the sake of simplicity of representation, only a thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.

[0250] The communication interface 302 is used for communication between the above packet loss resistance strategy switching device and other devices.

[0251] The memory 303 may include a Random Access Memory (RAM), or may also include a non-volatile memory (NM), such as at least one disk memory. Optionally, the memory 303 may also be at least one storage device located far from the aforementioned processor 301.

[0252] The aforementioned processor 301 may be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), etc.; it may also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.

[0253] The specific implementation manner of the anti-packet-loss policy switching device in this application is basically the same as that of each embodiment of the above anti-packet-loss policy switching method, and will not be elaborated here.

[0254] In addition, an embodiment of this application also proposes a computer-readable storage medium, on which an anti-packet-loss policy switching program is stored. When the anti-packet-loss policy switching program is executed by a processor, the following anti-packet-loss policy switching method is implemented:

[0255] Obtain the first network status data of the client;

[0256] Based on the first network status data, determine the current credibility;

[0257] Based on the current credibility, determine whether to switch the anti-packet-loss policy.

[0258] Exemplarily, the determining the current credibility based on the first network status data includes:

[0259] Obtain the gains of each anti-packet-loss policy based on the first network status data; each anti-packet-loss policy includes the current anti-packet-loss policy;

[0260] Calculate the product of each gain and the first network status data respectively to obtain multiple benefits;

[0261] Calculate the benefit difference between each non-current anti-packet-loss policy and the current anti-packet-loss policy in each anti-packet-loss policy respectively to obtain the current credibility.

[0262] Exemplarily, the first network status data includes at least one attribute;

[0263] Obtaining the gain of each packet loss resistance strategy based on the first network status data includes:

[0264] Determining the gain corresponding to each attribute under each packet loss resistance strategy;

[0265] Wherein, any attribute corresponds to a gain under any packet loss resistance strategy.

[0266] Exemplarily, determining the gain corresponding to each attribute under each packet loss resistance strategy includes:

[0267] Obtaining second network status data uploaded by the client when adopting each packet loss resistance strategy within a preset duration; the second network status data includes the attributes included in the first network status data; the end moment of the preset duration is before the start moment of executing the packet loss resistance strategy switching method;

[0268] Calculating the first information entropy of each attribute based on the second network status data;

[0269] Determining the carding rate corresponding to the second network status data;

[0270] Calculating the second information entropy of each packet loss resistance strategy based on the carding rate;

[0271] Calculating the difference between each second information entropy and the first information entropy respectively to obtain the gain corresponding to each attribute under each packet loss resistance strategy.

[0272] Exemplarily, calculating the first information entropy of each attribute based on the second network status data includes:

[0273] Calculating the first information entropy H1 of any attribute by using the following formula:

[0274]

[0275] Wherein, i is the second network status data identifier, X i is the i-th second network status data or the data interval where the i-th second network status data is located, size(T) is the total number of second network status data, size(X i ) is used to calculate the occurrence times of X i , and the data interval is one of the pre-divided data intervals.

[0276] Exemplarily, determining the carding rate corresponding to the second network status data includes:

[0277] Determining the carding rate g by using the following formula:

[0278] g = (f - a) / a

[0279] Wherein, f is the actual frame interval when the client plays the game video screen, and a is the standard frame interval; the game video screen is generated based on video stream data packets, and the network state when the video stream data is received corresponds to the second network state data.

[0280] Exemplarily, calculating the second information entropy of each packet loss resistance strategy based on the packet loss rate includes:

[0281] For any one of the packet loss resistance strategies, calculate its second information entropy H2 through the following formula:

[0282]

[0283] Wherein, m1 is the quantity of the first data in the second network state data, the packet loss rate corresponding to the first data is greater than or equal to the preset packet loss rate threshold, and the client adopts the any one of the packet loss resistance strategies when the first data is uploaded; m2 is the quantity of the second data in the second network state data, the packet loss rate corresponding to the second data is less than the preset packet loss rate threshold, and the client adopts the any one of the packet loss resistance strategies when the second data is uploaded; size(T) is the total quantity of the second network state data.

[0284] Exemplarily, any non-current packet loss resistance strategy corresponds to a current credibility.

[0285] Determining whether to switch the packet loss resistance strategy based on the current credibility includes:

[0286] If the maximum current credibility is greater than or equal to the preset credibility threshold, it is determined to switch the packet loss resistance strategy, and the switched packet loss resistance strategy is any non-current packet loss resistance strategy corresponding to the maximum current credibility;

[0287] Or,

[0288] Obtain the historical credibility corresponding to each non-current packet loss resistance strategy;

[0289] Respectively form a credibility set with the historical credibility corresponding to each non-current packet loss resistance strategy and the current credibility, and obtain multiple credibility sets;

[0290] Respectively calculate the switching trend factor based on the credibility set corresponding to each non-current packet loss resistance strategy;

[0291] If the maximum switching trend factor is greater than or equal to the preset switching trend factor threshold, it is determined to switch the packet loss resistance strategy, and the switched packet loss resistance strategy is the non-current packet loss resistance strategy corresponding to the maximum switching trend factor;

[0292] Among them, the switching trend factor S corresponding to any non-current packet loss resistance strategy is calculated using the following formula:

[0293] S = (size(E≥0) - size(E<0)) / size(E) × E 方差

[0294] Among them, the size(E≥0) is used to calculate the number of elements in the credibility set corresponding to any non-current packet loss resistance strategy whose value is greater than or equal to 0; the size(E<0) is used to calculate the number of elements in the credibility set corresponding to any non-current packet loss resistance strategy whose value is less than 0; the size(E) is the total number of elements in the credibility set corresponding to any non-current packet loss resistance strategy; the E 方差 is the variance of all element values in the credibility set corresponding to any non-current packet loss resistance strategy.

[0295] The specific implementation manner of the computer-readable storage medium of the present application is basically the same as that of each embodiment of the above packet loss resistance strategy switching method, and will not be elaborated here.

[0296] It should be noted that in this article, the terms "including", "comprising" or any other variant thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements not only includes those elements, but also includes other elements not expressly listed, or also includes elements inherent to such process, method, article or device. Without further limitation, an element defined by the statement "including one..." does not exclude the existence of another identical element in the process, method, article or device including that element.

[0297] The serial numbers of the above embodiments of the present application are only for description and do not represent the advantages and disadvantages of the embodiments.

[0298] Through the description of the above embodiments, those skilled in the art can clearly understand that the above embodiment methods can be implemented by means of software plus a necessary general hardware platform. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes: several instructions for causing a terminal device (which can be a mobile phone, computer, server, device, or network device, etc.) to execute the methods described in each embodiment of the present application.

[0299] The above are only the preferred embodiments of the present application, and do not limit the patent scope of the present application accordingly. Any equivalent structure or equivalent process transformation made by using the content of the specification and drawings of the present application, or directly or indirectly applied in other related technical fields, shall be similarly included in the patent protection scope of the present application.

Claims

1. A method for switching anti-packet-loss strategies, characterized in that, The method includes: Obtaining first network status data of a client; Based on the first network status data, determining a current credibility; the credibility is associated with the gains of each packet loss prevention strategy and the first network status data, and the uploaded network status data has an upload period, and the credibility is more intuitive than the first network status data; Based on the current credibility, determining whether to switch the packet loss prevention strategy; The determining the current credibility based on the first network status data includes: Obtaining the gains of each packet loss prevention strategy based on the first network status data; each packet loss prevention strategy includes the current packet loss prevention strategy; Respectively calculating the product of each gain and the first network status data to obtain a plurality of benefits; Respectively calculating the benefit differences between each non-current packet loss prevention strategy and the current packet loss prevention strategy in each packet loss prevention strategy to obtain the current credibility; The first network status data includes at least one attribute; The obtaining the gains of each packet loss prevention strategy based on the first network status data includes: Determining the gains corresponding to each attribute under each packet loss prevention strategy; Wherein, any one attribute corresponds to one gain under any one packet loss prevention strategy; The determining the gains corresponding to each attribute under each packet loss prevention strategy includes: Obtaining second network status data uploaded by the client when adopting each packet loss prevention strategy within a preset duration; the second network status data includes the attributes included in the first network status data; the end moment of the preset duration is before the start moment of executing the packet loss prevention strategy switching method; Calculating the first information entropy of each of the attributes based on the second network status data; Determining the frame freeze rate corresponding to the second network status data; Calculating the second information entropy of each packet loss prevention strategy based on the frame freeze rate; Respectively calculating the differences between each second information entropy and the first information entropy to obtain the gains corresponding to each attribute under each packet loss prevention strategy.

2. The method according to claim 1, characterized in that The calculating the first information entropy of each of the attributes based on the second network status data includes: Calculating the first information entropy H1 of any one attribute by using the following formula: Among them, i is the second network status data identifier, X i is the i-th second network status data or the data interval where the i-th second network status data is located, size(T) is the total number of second network status data, size(X i ) is used to calculate the occurrence times of X i , and the data interval is one of the pre-divided data intervals.

3. The method according to claim 1, wherein The determining the frame freeze rate corresponding to the second network status data includes: Determining the frame freeze rate g by using the following formula: g = (f - a) / a Wherein, f is the actual frame interval when the client plays the game video picture, and a is the standard frame interval; the game video picture is generated based on video stream data packets, and the network status when the video stream data is received corresponds to the second network status data.

4. The method according to claim 3, characterized in that The calculating the second information entropy of each packet loss prevention strategy based on the frame freeze rate includes: For any one packet loss prevention strategy among each packet loss prevention strategy, calculating its second information entropy H2 by using the following formula: Wherein, m1 is the quantity of the first data in the second network status data, the freezing rate corresponding to the first data is greater than or equal to a preset freezing rate threshold, and the client adopts any of the anti-packet-loss strategies when uploading the first data; m2 is the quantity of the second data in the second network status data, the freezing rate corresponding to the second data is less than the preset freezing rate threshold, and the client adopts any of the anti-packet-loss strategies when uploading the second data; the size(T) is the total quantity of the second network status data.

5. The method according to claim 2 or 4, characterized in that Any non-current anti-packet-loss strategy corresponds to a current credibility. Determining whether to switch the anti-packet-loss strategy based on the current credibility includes: If the maximum current credibility is greater than or equal to a preset credibility threshold, it is determined to switch the anti-packet-loss strategy, and the switched anti-packet-loss strategy is any non-current anti-packet-loss strategy corresponding to the maximum current credibility; Or, Obtain the historical credibility corresponding to each non-current anti-packet-loss strategy; Form a credibility set by respectively combining the historical credibility corresponding to each non-current anti-packet-loss strategy and the current credibility, and obtain multiple credibility sets; Calculate the switching trend factor based on the credibility set corresponding to each non-current anti-packet-loss strategy respectively; If the maximum switching trend factor is greater than or equal to a preset switching trend factor threshold, it is determined to switch the anti-packet-loss strategy, and the switched anti-packet-loss strategy is the non-current anti-packet-loss strategy corresponding to the maximum switching trend factor; Wherein, the switching trend factor S corresponding to any non-current anti-packet-loss strategy is calculated by the following formula: S = (size(E≥0) - size(E<0)) / size(E) × E 方差 Among them, the size(E≥0) is used to calculate the number of elements in the credibility set corresponding to any non-current packet loss resistance strategy whose values are greater than or equal to 0; the size(E<0) is used to calculate the number of elements in the credibility set corresponding to any non-current packet loss resistance strategy whose values are less than 0; the size(E) is the total number of elements in the credibility set corresponding to any non-current packet loss resistance strategy; the E 方差 is the variance of all element values in the credibility set corresponding to any non-current packet loss resistance strategy.

6. An anti-packet-loss strategy switching device, characterized in that The anti-packet-loss strategy switching device includes a memory, a processor, and an anti-packet-loss strategy switching program stored on the memory and executable on the processor. When the anti-packet-loss strategy switching program is executed by the processor, the steps of the anti-packet-loss strategy switching method according to any one of claims 1 to 5 are implemented.

7. A computer-readable storage medium, characterized in that, An anti-packet-loss strategy switching program is stored on the computer-readable storage medium. When the anti-packet-loss strategy switching program is executed by the processor, the steps of the anti-packet-loss strategy switching method according to any one of claims 1 to 5 are implemented.

Citation Information

Patent Citations

  • Dynamic FEC method and device, computer terminal and computer readable storage medium

    CN109818714A

  • Data transmission method and device, computer equipment and storage medium

    CN114025389A