Video data coding optimization method for Spice protocol

By using particle swarm algorithm to optimize the encoding algorithm parameters in the Spice protocol, the problem of unsmooth video playback on virtual machines is solved, dynamic optimization of video data encoding is realized, and playback performance and bandwidth utilization are improved.

CN119922311APending Publication Date: 2025-05-02BEIJING JINGHANG COMPUTING & COMM RES INST
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510062302.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-15
Publication Date
2025-05-02

AI Technical Summary

Technical Problem

When the Spice protocol plays video on a virtual machine, the encoding algorithm cannot be dynamically adjusted, resulting in poor video playback.

Method used

The particle swarm algorithm is used to optimize the encoding algorithm parameters in the Spice protocol and dynamically adjust the encoding algorithm to adapt to changes in network conditions.

Benefits of technology

Dynamic optimization of video data encoding in Spice protocol is realized, reducing latency and frame skipping, improving frame rate stability, optimizing bandwidth utilization, and reducing server load.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119922311A_ABST
    Figure CN119922311A_ABST
Patent Text Reader

Abstract

The invention relates to a video data coding optimization method for a Spice protocol, belongs to the technical field of Spice protocol optimization, and solves the problem of unsmooth video playing caused by the fact that a coding algorithm cannot be dynamically adjusted when video playing is carried out on a virtual machine by the Spice protocol in the prior art. Comprising the following steps: acquiring video data processed by a Spice protocol in a current adjustment period and a parameter range of each coding algorithm in the Spice protocol, optimizing parameters of each coding algorithm in the Spice protocol by adopting a particle swarm algorithm to obtain an optimal parameter solution, and taking the obtained optimal parameter solution as parameters of a coding algorithm in a next adjustment period in the Spice protocol; detecting the network information, and if it is detected that the network information changes, updating the parameter range of each coding algorithm in the Spice protocol in the next adjustment period according to the change condition of the network information; and repeatedly executing the steps in the next adjustment period to realize dynamic optimization of video data coding in the Spice protocol.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of Spice protocol optimization, and in particular to a video data encoding optimization method for Spice protocol. Background Art

[0002] As an open source remote desktop protocol, the Spice protocol was originally designed to provide a high-performance, low-latency remote desktop experience in a virtualized environment. With the rapid development of cloud computing and virtualization technology, remote desktop technology has gradually become an important requirement for enterprises, educational institutions and individual users. Traditional remote desktop protocols may have deficiencies in performance, compatibility, security and other aspects, and it is difficult to meet users' needs for a high-quality remote desktop experience. The Spice protocol came into being in this context. It is optimized for virtualized environments and provides a more efficient, secure and flexible remote desktop solution. The Spice protocol has many significant technical features and advantages, which make it have broad application prospects in the field of remote desktops. First, the Spice protocol supports image compression, audio transmission, USB device sharing, clipboard sharing and other functions, and can provide remote desktop services close to the local computer experience. Secondly, the Spice protocol adopts a multi-layer architecture and dynamic adaptive technology, which can intelligently adjust the transmission strategy according to network conditions and user device performance to ensure the best user experience under any network conditions. In addition, the Spice protocol also focuses on security, supports TLS encryption and multiple authentication mechanisms, and protects the security and privacy of user data. As an open source project, the Spice protocol has received extensive community support and participation. The open source community provides the Spice protocol with rich technical resources and talent support, promoting the continuous improvement and innovation of the protocol. At the same time, the open source ecosystem also enables the Spice protocol to be seamlessly integrated with other open source projects, providing users with a more complete and powerful virtualization solution.

[0003] Although the Spice protocol has many advantages in the process of playing videos, such as supporting high-definition resolution, multimedia high-definition video playback and multi-screen display, it may still face some shortcomings in some cases. The Spice protocol is highly dependent on network bandwidth when playing videos. When the network bandwidth is insufficient or fluctuates greatly, it may cause delays, freezes or image quality degradation in video playback. Especially in cross-regional or cross-border remote desktop access, the limitation of network bandwidth is more obvious. Although the Spice protocol has adaptively adjusted algorithms for different types of display content (such as text, pictures, and videos), its transmission efficiency may still need to be improved in video playback scenarios with high bandwidth requirements. In the process of video playback, encoding is composed of a combination of multiple encoding algorithms. The encoding algorithms used are fixed modes and cannot be adjusted according to the network bandwidth situation and the advantages of each encoding algorithm. It may introduce certain delays and overheads, affecting the real-time and smoothness of video playback.

[0004] Therefore, there is an urgent need for a method that can dynamically adjust the encoding algorithm of video data when the Spice protocol is used to play the video on a virtual machine to achieve smooth video playback. Summary of the invention

[0005] In view of the above analysis, an embodiment of the present invention aims to provide a video data encoding optimization method for the Spice protocol, so as to solve the problem of unsmooth video playback caused by the inability to dynamically adjust the encoding algorithm when playing videos on a virtual machine using the existing Spice protocol.

[0006] The embodiment of the present invention provides a video data encoding optimization method for the Spice protocol, comprising the following steps:

[0007] S1. Obtaining the video data processed by the Spice protocol and the parameter range of each encoding algorithm in the Spice protocol in the current adjustment cycle; wherein the parameter of each encoding algorithm is the proportion of the video data to be processed by each encoding algorithm;

[0008] S2, based on the obtained video data of the current adjustment cycle and the parameter range of each encoding algorithm in the Spice protocol, the particle swarm algorithm is used to optimize the parameters of each encoding algorithm in the Spice protocol to obtain the optimal parameter solution, and the obtained optimal parameter solution is used as the parameter of the encoding algorithm in the next adjustment cycle in the Spice protocol;

[0009] S3, detecting the network information, and if it is detected that the network information has changed, updating the parameter range of each encoding algorithm in the Spice protocol in the next adjustment cycle according to the change of the network information;

[0010] S4. Repeat steps S1-S4 in the next adjustment cycle to achieve dynamic optimization of video data encoding in the Spice protocol.

[0011] Furthermore, the optimal solution of parameters is obtained by the following method:

[0012] S21, initializing the particle swarm algorithm configuration parameters based on the parameter range of each encoding algorithm in the Spice protocol of the current adjustment period, and generating an initial population based on the configuration parameters; wherein each particle represents a set of encoding algorithm parameters;

[0013] S22, based on the position of each particle in the current population, calculate the current fitness value of each particle, and then obtain the current individual optimal particle and the current global historical optimal particle;

[0014] S23, based on the current fitness value of each particle, the current individual optimal particle and the current global historical optimal particle, update the speed and position of the individual particle group to obtain a new population;

[0015] S24, judging whether the termination condition is met, if so, taking the specific values ​​of each parameter in the current global historical optimal particle as the optimal solution of the parameter; otherwise, taking the new population as the population of the next iteration, and repeating steps S22 to S24.

[0016] Furthermore, the particle swarm algorithm configuration parameters include the number of particles in the population, the range of each parameter in the particle, the maximum number of iterations of the particle, the initial position and initial speed of the particle; wherein the range of each parameter in the particle is set according to the parameter range of each encoding algorithm in the Spice protocol of the current adjustment cycle.

[0017] Furthermore, the initial position of each particle in the population is expressed as:

[0018] [a+(1-a)Z1,(1-a)Z2]

[0019] Among them, a+(1-a)Z1+(1-a)Z2=1;

[0020] Where a represents the minimum value of the parameter of the arithmetic encoding in the particle within its parameter range; Z1 and Z2 represent two independent random numbers uniformly distributed in the interval [0,1] converted into two independent standard normal distributed random numbers.

[0021] Furthermore, based on the position of each particle in the current population, the video data of the current adjustment period is encoded respectively to obtain the current fitness value of each particle; wherein the fitness is calculated according to the set encoding features.

[0022] Furthermore, the encoding features include compression time and compression ratio; the fitness value f of the particle is calculated in the following way:

[0023]

[0024] Where N represents the number of coding algorithms in the Spice protocol, R n Indicates the proportion of video data that needs to be processed by the nth encoding algorithm, AT n Indicates the compression time of the nth encoding algorithm, CR n Indicates the compression ratio of the nth encoding algorithm.

[0025] Furthermore, the current individual optimal particle and the current global historical optimal particle are obtained by the following method:

[0026] Compare the current fitness value of each particle with its corresponding historical optimal fitness value. If the current fitness value is better, update the corresponding particle's historical optimal fitness value to the particle's current fitness value, and update the corresponding particle's historical optimal position to the particle's current position.

[0027] Based on the current fitness value of each particle, the current optimal particle in the current population is obtained, and the fitness value of the current optimal particle is compared with the global optimal fitness value of the population history. If the fitness value of the current optimal particle is better, the global optimal fitness value of the population history is updated to the fitness value of the current optimal particle, and the global optimal position of the population history is updated to the current position of the current optimal particle.

[0028] Furthermore, the speed and position of each particle swarm individual are updated in the following way:

[0029] v i (t+1)=ωv i (t)+c1r1(p i (t)-x i (t))+c2r2(g i (t)-x i (t))

[0030] x i (t+1)=x i (t)+v i (t+1)

[0031] In the formula, v i (t+1), v i (t) represents the velocity of the i-th particle at the t+1 and t iterations, respectively, and p i (t) represents the position of the i-th particle in the historical optimal position at the tth iteration, g i(t) represents the position of the group in the global optimal position in the history of k iterations, x i (t+1), x i (t) represents the position of the i-th particle at the t+1 and t iterations respectively, ω represents the velocity inertia weight, c1 and c2 represent the first and second acceleration constants respectively, r1 and r2 represent the first and second random numbers respectively.

[0032] Further, the network information includes network bandwidth; the coding algorithm in the Spice protocol includes an arithmetic coding algorithm and a huffman coding algorithm; and the parameter range of each coding algorithm in the Spice protocol in the next adjustment cycle is updated in the following manner:

[0033] Obtain the network bandwidths of the current adjustment period and the previous adjustment period, and divide the network bandwidth of the current adjustment period by the network bandwidth of the previous adjustment period to obtain a bandwidth change rate k;

[0034] If the bandwidth change rate k is greater than 1, the parameter range of each encoding algorithm in the Spice protocol remains unchanged;

[0035] Otherwise, the parameter range of the arithmetic coding algorithm in the Spice protocol is set to [0, k·BeY], and the parameter range of the Huffman coding algorithm is set to [1-k·BeY, 1]; where BeY represents the parameter of the arithmetic coding algorithm in the optimal solution of the current adjustment cycle parameters.

[0036] Furthermore, the adjustment period is set to 5s.

[0037] Compared with the prior art, the present invention can achieve at least one of the following beneficial effects:

[0038] The present invention provides a video data encoding optimization method for a Spice protocol. The method obtains video data processed by the Spice protocol in a current adjustment cycle and parameter ranges of various encoding algorithms in the Spice protocol, and then optimizes the parameters of various encoding algorithms in the Spice protocol using a particle swarm algorithm to obtain an optimal parameter solution. The optimal parameter solution is used as the parameter of the encoding algorithm in the next adjustment cycle of the Spice protocol, and then the network information is detected. If a change in the network information is detected, the parameter range of various encoding algorithms in the Spice protocol in the next adjustment cycle is updated according to the change of the network information. The above steps are repeatedly performed in the next adjustment cycle to realize dynamic optimization of video data encoding in the Spice protocol. The method solves the problem that the existing Spice protocol cannot dynamically adjust the encoding algorithm when playing a video on a virtual machine, resulting in unsmooth video playback, reduces delay and frame skipping, improves frame rate stability, optimizes bandwidth utilization, reduces server load, promotes the improvement of the Spice protocol, and expands the application field.

[0039] In the present invention, the above-mentioned technical solutions can also be combined with each other to achieve more preferred combination solutions. Other features and advantages of the present invention will be described in the subsequent description, and some advantages can become obvious from the description, or can be understood by practicing the present invention. The purpose and other advantages of the present invention can be realized and obtained through the contents particularly pointed out in the description and the drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] The drawings are only for the purpose of illustrating particular embodiments and are not to be considered limiting of the present invention. Like reference symbols denote like components throughout the drawings.

[0041] Figure 1 A schematic flow chart of a video data encoding optimization method for the Spice protocol provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0042] The preferred embodiments of the present invention are described in detail below in conjunction with the accompanying drawings, wherein the accompanying drawings constitute a part of this application and are used together with the embodiments of the present invention to illustrate the principles of the present invention, but are not used to limit the scope of the present invention.

[0043] A specific embodiment of the present invention discloses a video data encoding optimization method for Spice protocol, such as Figure 1 As shown, including:

[0044] S1. Obtain video data processed by the Spice protocol in the current adjustment cycle and parameter ranges of each encoding algorithm in the Spice protocol; wherein the parameters of each encoding algorithm are the proportion of video data to be processed by each encoding algorithm.

[0045] Specifically, the coding algorithms in the Spice protocol include Huffman coding and arithmetic coding.

[0046] Specifically, the sum of the parameters of each encoding algorithm in the Spice protocol is 1. That is, the encoding process of all video data is completed by each encoding algorithm.

[0047] Specifically, the parameter range of each encoding algorithm in the Spice protocol is initialized to a random number between 0 and 1.

[0048] S2, based on the obtained video data of the current adjustment cycle and the parameter range of each encoding algorithm in the Spice protocol, the particle swarm algorithm is used to optimize the parameters of each encoding algorithm in the Spice protocol to obtain the optimal parameter solution, and the obtained optimal parameter solution is used as the parameter of the encoding algorithm in the next adjustment cycle in the Spice protocol;

[0049] During implementation, the optimal solution for parameters is obtained by:

[0050] S21, initializing the particle swarm algorithm configuration parameters based on the parameter range of each encoding algorithm in the Spice protocol of the current adjustment cycle, and generating an initial population based on the configuration parameters; wherein each particle represents a set of encoding algorithm parameters.

[0051] Specifically, the particle swarm algorithm configuration parameters include the number of particles in the population, the range of each parameter in the particle, the maximum number of iterations of the particle, the initial position and initial speed of the particle; wherein the range of each parameter in the particle is set according to the parameter range of each encoding algorithm in the Spice protocol of the current adjustment cycle.

[0052] More specifically, the number of particles in the population is 100 and the maximum number of iterations of particles is 100.

[0053] Specifically, the initial position of each particle in the population is expressed as:

[0054] [a+(1-a)Z1,(1-a)Z2]

[0055] Among them, a+(1-a)Z1+(1-a)Z2=1;

[0056] Where a represents the minimum value of the parameter of the arithmetic encoding in the particle within its parameter range; Z1 and Z2 represent two independent random numbers uniformly distributed in the interval [0,1] converted into two independent standard normal distributed random numbers.

[0057] It can be understood that by selecting the above initial position, the sampling noise can be reduced, and more particles can be randomly selected within the range where the optimal solution is more likely to exist, which can effectively improve the computational efficiency of the algorithm and accelerate the calculation of the optimal solution.

[0058] S22. Based on the position of each particle in the current population, the current fitness value of each particle is calculated, and then the current individual optimal particle and the current global historical optimal particle are obtained.

[0059] During implementation, in step S22, based on the position of each particle in the current population, the video data of the current adjustment period is encoded respectively to obtain the current fitness value of each particle; wherein the fitness is calculated according to the set encoding features.

[0060] In specific implementation, in step S22, the encoding features include compression time and compression ratio; the fitness value f of the particle is calculated in the following way:

[0061]

[0062] Where N represents the number of coding algorithms in the Spice protocol, R n Indicates the proportion of video data that needs to be processed by the nth encoding algorithm, AT n Indicates the compression time of the nth encoding algorithm, CR n Indicates the compression ratio of the nth encoding algorithm.

[0063] Specifically, the compression time AT of the nth encoding algorithm is n It is expressed as:

[0064] AT n =DT n -ST n

[0065] In the formula, ST n , DT n Indicates the start time and end time of the nth encoding algorithm.

[0066] It can be understood that the compression time can be calculated by using the time() function to return the number of seconds from January 1, 1970 (UTC) to the current time (i.e., timestamp) to record a timestamp (the start time is recorded as ST) before calling the compression algorithm; after the compression algorithm is completed, the time() function is again used to return the number of seconds from January 1, 1970 (UTC) to the current time to record a timestamp (end time DT); the difference AT between the two timestamps is calculated to obtain the compression time.

[0067] Specifically, the compression ratio CR of the nth coding algorithm is n It is expressed as:

[0068] CR n =SAA n / SBA n

[0069] Where SAA n 、SBA n Indicates the data size before and after compression of the video data processed by the nth encoding algorithm.

[0070] It is understandable that the data size of the video data before and after compression can be recorded by adding ftell functions before and after the encoding algorithm is used to record the size of the video data before and after the encoding algorithm.

[0071] During implementation, in step S22, the current individual optimal particle and the current global historical optimal particle are obtained by the following method:

[0072] Compare the current fitness value of each particle with its corresponding historical optimal fitness value. If the current fitness value is better, update the corresponding particle's historical optimal fitness value to the particle's current fitness value, and update the corresponding particle's historical optimal position to the particle's current position.

[0073] Based on the current fitness value of each particle, the current optimal particle in the current population is obtained, and the fitness value of the current optimal particle is compared with the global optimal fitness value of the population history. If the fitness value of the current optimal particle is better, the global optimal fitness value of the population history is updated to the fitness value of the current optimal particle, and the global optimal position of the population history is updated to the current position of the current optimal particle.

[0074] It should be noted that the combination of the specific values ​​of each parameter in the particle is called the position of the particle; and the smaller the fitness value, the better the fitness.

[0075] S23, based on the current fitness value of each particle, the current individual optimal particle and the current global historical optimal particle, update the speed and position of the individual particle swarm to obtain a new population.

[0076] During implementation, in step S23, the speed and position of each particle group individual are updated in the following manner:

[0077] v i (t+1)=ωv i (t)+c1r1(p i (t)-x i (t))+c2r2(g i (t)-x i (t))

[0078] x i (t+1)=x i (t)+v i (t+1)

[0079] In the formula, v i (t+1), v i (t) represents the velocity of the i-th particle at the t+1 and t iterations, respectively, and p i (t) represents the position of the i-th particle in the historical optimal position at the tth iteration, g i (t) represents the position in the global optimal position of the group history at the tth iteration, x i (t+1), x i(t) represents the position of the i-th particle at the t+1 and t iterations respectively, ω represents the velocity inertia weight, c1 and c2 represent the first and second acceleration constants respectively, r1 and r2 represent the first and second random numbers respectively; wherein, the first and second random numbers r1 and r2 are random numbers between (0,1).

[0080] It should be noted that, if a particle is composed of multiple parameters, the update of the position and velocity of each parameter is calculated respectively according to the above method.

[0081] S24, judging whether the termination condition is met, if so, taking the specific values ​​of each parameter in the current global historical optimal particle as the optimal solution of the parameter; otherwise, taking the new population as the population of the next iteration, and repeating steps S22 to S24.

[0082] Specifically, the termination condition is that the number of iterations reaches the maximum number of iterations or the fitness meets the theoretical optimal situation, the iteration is terminated and the parameters are recorded as the optimal solution.

[0083] More specifically, the theoretically optimal fitness value is less than or equal to 43. It can be understood that the best effect is achieved when the compression time is 3 seconds and the compression rate is 90%, and the fitness value is 43 at this time.

[0084] S3. Detect the network information. If it is detected that the network information has changed, update the parameter range of each encoding algorithm in the Spice protocol in the next adjustment cycle according to the change of the network information.

[0085] During implementation, the network information includes network bandwidth; and the parameter range of each encoding algorithm in the Spice protocol in the next adjustment cycle is updated in the following manner:

[0086] Obtain the network bandwidths of the current adjustment period and the previous adjustment period, and divide the network bandwidth of the current adjustment period by the network bandwidth of the previous adjustment period to obtain a bandwidth change rate k;

[0087] If the bandwidth change rate k is greater than 1, the parameter range of each encoding algorithm in the Spice protocol remains unchanged;

[0088] Otherwise, the parameter range of the arithmetic coding algorithm in the Spice protocol is set to [0, k·BeY], and the parameter range of the Huffman coding algorithm is set to [1-k·BeY, 1]; where BeY represents the parameter of the arithmetic coding algorithm in the optimal solution of the current adjustment cycle parameters.

[0089] It is understandable that if a change in the network environment is detected, the parameter range of each parameter is adjusted according to the network information, which can better adapt to the network environment and make the calculated parameter optimal solution, in line with the network change, more reliable and accurate. For example, the Huffman algorithm is more suitable for video file transmission under normal network conditions than arithmetic coding, so when the network bandwidth condition is detected to be better by using a network speed test tool or ping command, the parameter range of the proportion of arithmetic coding can be increased accordingly when initializing the parameters.

[0090] S4. Repeat steps S1-S4 in the next adjustment cycle to achieve dynamic optimization of video data encoding in the Spice protocol.

[0091] Specifically, the adjustment period is set according to the time required to execute the optimal solution of the parameters once; illustratively, the adjustment period is set to 5s.

[0092] Compared with the prior art, the present embodiment provides a video data encoding optimization method for the Spice protocol, by obtaining the video data processed by the Spice protocol in the current adjustment cycle and the parameter range of each encoding algorithm in the Spice protocol, and then using the particle swarm algorithm to optimize the parameters of each encoding algorithm in the Spice protocol to obtain the optimal parameter solution, and the obtained optimal parameter solution is used as the parameter of the encoding algorithm in the next adjustment cycle of the Spice protocol, and then the network information is detected. If it is detected that the network information changes, the parameter range of each encoding algorithm in the Spice protocol in the next adjustment cycle is updated according to the change of the network information, and the above steps are repeated in the next adjustment cycle to realize the dynamic optimization of video data encoding in the Spice protocol. The method solves the problem that the existing Spice protocol cannot dynamically adjust the encoding algorithm when playing the video on the virtual machine, resulting in unsmooth video playback, reduces delay and frame skipping, improves frame rate stability, optimizes bandwidth utilization, reduces server load, promotes the improvement of the Spice protocol and expands the application field.

[0093] Those skilled in the art will appreciate that all or part of the processes of the above-mentioned embodiments can be implemented by instructing related hardware through a computer program, and the program can be stored in a computer-readable storage medium, wherein the computer-readable storage medium is a disk, an optical disk, a read-only storage memory, or a random access memory, etc.

[0094] The above description is only a preferred specific implementation manner of the present invention, but the protection scope of the present invention is not limited thereto. Any changes or substitutions that can be easily conceived by any technician familiar with the technical field within the technical scope disclosed by the present invention should be covered within the protection scope of the present invention.

Claims

1. A video data encoding optimization method for Spice protocol, characterized in that: The following steps are involved: S1. Obtaining the video data processed by the Spice protocol and the parameter range of each encoding algorithm in the Spice protocol in the current adjustment cycle; wherein the parameter of each encoding algorithm is the proportion of the video data to be processed by each encoding algorithm; S2, based on the obtained video data of the current adjustment cycle and the parameter range of each encoding algorithm in the Spice protocol, the particle swarm algorithm is used to optimize the parameters of each encoding algorithm in the Spice protocol to obtain the optimal parameter solution, and the obtained optimal parameter solution is used as the parameter of the encoding algorithm in the next adjustment cycle in the Spice protocol; S3, detecting the network information, and if it is detected that the network information has changed, updating the parameter range of each encoding algorithm in the Spice protocol in the next adjustment cycle according to the change of the network information; S4. Repeat steps S1-S4 in the next adjustment cycle to achieve dynamic optimization of video data encoding in the Spice protocol.

2. The video data encoding optimization method for Spice protocol according to claim 1, characterized in that: The optimal solution of parameters is obtained by: S21, initializing the particle swarm algorithm configuration parameters based on the parameter range of each encoding algorithm in the Spice protocol of the current adjustment period, and generating an initial population based on the configuration parameters; wherein each particle represents a set of encoding algorithm parameters; S22, based on the position of each particle in the current population, calculate the current fitness value of each particle, and then obtain the current individual optimal particle and the current global historical optimal particle; S23, based on the current fitness value of each particle, the current individual optimal particle and the current global historical optimal particle, update the speed and position of the individual particle group to obtain a new population; S24, judging whether the termination condition is met, if so, taking the specific value of each parameter in the current global historical optimal particle as the optimal solution of the parameter; otherwise, taking the new population as the population of the next iteration, and repeating steps S22 to S24.

3. The video data encoding optimization method for Spice protocol according to claim 2, characterized in that: The particle swarm algorithm configuration parameters include the number of particles in the population, the range of each parameter in the particle, the maximum number of iterations of the particle, the initial position and initial speed of the particle; wherein the range of each parameter in the particle is set according to the parameter range of each encoding algorithm in the Spice protocol of the current adjustment cycle.

4. The video data encoding optimization method for Spice protocol according to claim 3, characterized in that: The initial position of each particle in the population is expressed as: [a+(1-a)Z1,(1-a)Z2] Among them, a+(1-a)Z1+(1-a)Z2=1; Where a represents the minimum value of the parameter of the arithmetic encoding in the particle within its parameter range; Z1 and Z2 represent two independent random numbers uniformly distributed in the interval [0,1] converted into two independent standard normal distributed random numbers.

5. The video data encoding optimization method for Spice protocol according to claim 2, characterized in that: Based on the position of each particle in the current population, the video data of the current adjustment period is encoded respectively to obtain the current fitness value of each particle; wherein the fitness is calculated according to the set encoding features.

6. The video data encoding optimization method for Spice protocol according to claim 5, characterized in that: The encoding features include compression time and compression ratio; the fitness value f of the particle is calculated in the following way: Where N represents the number of coding algorithms in the Spice protocol, R n Indicates the proportion of video data that needs to be processed by the nth encoding algorithm, AT n Indicates the compression time of the nth encoding algorithm, CR n Indicates the compression ratio of the nth encoding algorithm.

7. The video data encoding optimization method for Spice protocol according to claim 2, characterized in that: The current individual optimal particle and the current global historical optimal particle are obtained by the following method: Compare the current fitness value of each particle with its corresponding historical optimal fitness value. If the current fitness value is better, update the corresponding particle's historical optimal fitness value to the particle's current fitness value, and update the corresponding particle's historical optimal position to the particle's current position. Based on the current fitness value of each particle, the current optimal particle in the current population is obtained, and the fitness value of the current optimal particle is compared with the global optimal fitness value of the population history. If the fitness value of the current optimal particle is better, the global optimal fitness value of the population history is updated to the fitness value of the current optimal particle, and the global optimal position of the population history is updated to the current position of the current optimal particle.

8. The video data encoding optimization method for Spice protocol according to claim 2, characterized in that: Update the speed and position of each particle swarm individual in the following way: v i (t+1)=ωv i (t)+c1r1(p i (t)-x i (t))+c2r2(g i (t)-x i (t)) x i (t+1)=x i (t)+v i (t+1) In the formula, v i (t+1), v i (t) represents the velocity of the i-th particle at the t+1 and t iterations, respectively, and p i (t) represents the position of the i-th particle in the historical optimal position at the tth iteration, g i (t) represents the position of the group in the global optimal position in the history of k iterations, x i (t+1), x i (t) represents the position of the i-th particle at the t+1 and t iterations respectively, ω represents the velocity inertia weight, c1 and c2 represent the first and second acceleration constants respectively, r1 and r2 represent the first and second random numbers respectively.

9. The video data encoding optimization method for Spice protocol according to claim 1, characterized in that: The network information includes network bandwidth; the coding algorithm in the Spice protocol includes an arithmetic coding algorithm and a huffman coding algorithm; The parameter ranges of each encoding algorithm in the Spice protocol in the next adjustment cycle are updated in the following way: Obtain the network bandwidths of the current adjustment period and the previous adjustment period, and divide the network bandwidth of the current adjustment period by the network bandwidth of the previous adjustment period to obtain a bandwidth change rate k; If the bandwidth change rate k is greater than 1, the parameter range of each encoding algorithm in the Spice protocol remains unchanged; Otherwise, the parameter range of the arithmetic coding algorithm in the Spice protocol is set to [0, kBeY], and the parameter range of the huffman coding algorithm is set to [1-k·BeY, 1]; where BeY represents the parameter of the arithmetic coding algorithm in the optimal solution of the current adjustment cycle parameters.

10. The video data encoding optimization method for Spice protocol according to claim 1, characterized in that: The adjustment period is set to 5s.