Image coding method and related equipment

By encoding only the changing areas in the cloud desktop and dynamically adjusting the capture frame rate, the problem of cloud desktop lag was solved, improving user experience and CPU utilization.

CN120956906APending Publication Date: 2025-11-14XIAN WANXIANG ELECTRONICS TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511162161.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-08-19
Publication Date
2025-11-14

AI Technical Summary

Technical Problem

In cloud desktop scenarios, users experience lag and unresponsiveness when performing simple operations on virtual machines, resulting in a poor user experience.

Method used

By setting the acquisition frame rate to be the same as the screen refresh rate, only the changing areas are encoded, the changing macroblocks are encoded using the minimum pre-coding bitstream, and the acquisition frame rate is reduced when the CPU load is too high, thus optimizing CPU utilization.

Benefits of technology

It improved the user experience of cloud desktops, optimized the CPU utilization of virtual machines, reduced the CPU consumption of the video encoding module, and improved response speed.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120956906A_ABST
    Figure CN120956906A_ABST
Patent Text Reader

Abstract

The invention provides an image coding method and related equipment, and relates to the field of image processing, and the method comprises the steps: setting a collection frame rate to be the same as a screen refresh rate, the collection frame rate being the number of picture frames corresponding to collection of a zero terminal per second, and the screen refresh rate being the number of times of picture updating of the zero terminal per second; determining whether the current frame and the previous frame are changed or not; and if yes, coding the current frame in combination with the position information of the change area corresponding to the current frame. According to the scheme, the current frame is coded by combining the position information of the change area corresponding to the current frame, the coding quantity can be reduced, the user experience of a cloud desktop is improved, and the occupancy rate of a system CPU is optimized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of image processing, and more particularly to an image encoding method and related equipment. Background Technology

[0002] Desktop virtualization refers to virtualizing the desktop on the terminal side so that the desktop can be accessed over the network from any device, any location, and any time.

[0003] Existing desktop virtualization systems mainly consist of zero terminals and servers connected via a network. The server can run one or more virtual machines, and the zero terminals connect to the virtual machines on the server to exchange data with them.

[0004] However, in cloud desktop scenarios, sometimes users experience lag and unresponsiveness when performing simple operations on virtual machines, resulting in a poor user experience. Summary of the Invention

[0005] This application provides an image encoding method and related equipment, which can improve the user experience of cloud desktops and optimize the CPU utilization of virtual machines. The technical solution is as follows:

[0006] According to a first aspect of the embodiments of this application, an image encoding method is provided, applied to a server connected to a zero-terminal device, the method comprising:

[0007] The capture frame rate is set to be the same as the screen refresh rate. The capture frame rate refers to the number of frame rates captured per second corresponding to the zero terminal, and the screen refresh rate refers to the number of times the zero terminal updates the screen per second.

[0008] Determine if there are any changes between the current frame and the previous frame;

[0009] If so, the current frame is encoded by combining the position information of the changing region corresponding to the current frame.

[0010] This application provides a zero-terminal image encoding method. Based on a zero-terminal system, when a user opens an application interface on a cloud desktop, the server uses an encoding tool with the lowest bitrate to encode only the changing areas, while rendering the unchanged areas using the data from the corresponding position in the previous frame. At the same time, the system CPU overhead is monitored, and when the CPU load is too high, the CPU overhead is reduced by lowering the acquisition frame rate. As a result, user operations can be responded to in a timely manner, improving the user experience of the cloud desktop and optimizing the CPU utilization of the virtual machine.

[0011] In one embodiment, determining whether there are changes between the current frame and the previous frame includes:

[0012] Based on a preset window size, the current frame is divided into multiple macroblocks;

[0013] By comparing with the previous frame, each macroblock is divided into a changed macroblock or an unchanged macroblock.

[0014] The changed or unchanged markers corresponding to each macroblock are stored in a preset order to generate the location information of the changed region corresponding to the current frame.

[0015] In one embodiment, encoding the current frame by combining the position information of the corresponding changed region in the current frame includes:

[0016] By combining the position information of the corresponding changed macroblock in the current frame, multiple encoding tools are used to pre-encode each of the changed macroblocks to determine the pre-coded bitstream;

[0017] For each of the aforementioned variable macroblocks, the coding tool corresponding to the minimum precoding bitstream is determined as the target coding tool;

[0018] Each of the aforementioned target encoding tools is used to encode each of the aforementioned variable macroblocks.

[0019] In one embodiment, the encoding tool is an encoding method supported by the protocol, including at least inter-frame encoding and intra-frame encoding.

[0020] In one embodiment, the method further includes:

[0021] If there is no change, the regions in the current frame that have not changed are encoded using inter-frame coding, with the previous frame as the reference frame and the motion vector as 0.

[0022] In one embodiment, the method further includes:

[0023] The system CPU utilization rate is checked at preset intervals.

[0024] The acquisition frame rate is adjusted within a preset range based on the system CPU utilization.

[0025] In one embodiment, adjusting the acquisition frame rate within a preset range based on the system CPU utilization includes:

[0026] When the system CPU utilization rate is determined to be above a certain threshold, the acquisition frame rate is reduced.

[0027] When the system CPU utilization rate is determined to be below the second utilization rate, the acquisition frame rate is increased, wherein the second utilization rate is less than the first utilization rate.

[0028] In one embodiment, reducing the acquisition frame rate includes: reducing the acquisition frame rate to a first percentage of the current acquisition frame rate, wherein the first percentage is the same as the first occupancy rate;

[0029] The step of increasing the acquisition frame rate includes: increasing the acquisition frame rate to a second percentage of the current acquisition frame rate, wherein the second percentage is greater than the second occupancy rate, or the second percentage is greater than the first occupancy rate.

[0030] In one embodiment, the minimum value of the preset range is 0.2 times the screen refresh rate, and the maximum value is 1 times the screen refresh rate.

[0031] In a second aspect of the embodiments of this application, an electronic device is also provided, including a processor and a memory, wherein the memory stores at least one computer instruction, which is loaded and executed by the processor to perform the steps performed in the methods described in the first aspect and any one thereof.

[0032] In a third aspect of the embodiments of this application, a computer-readable storage medium is also provided, the storage medium storing at least one computer instruction, the instruction being loaded by a processor and executing the steps performed in the methods described in the first aspect and any one thereof.

[0033] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and do not limit this application. Attached Figure Description

[0034] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.

[0035] Figure 1 This is a schematic diagram of the structure of a zero-terminal system provided in an embodiment of this application;

[0036] Figure 2 This is a schematic diagram of a zero-terminal structure provided in an embodiment of this application;

[0037] Figure 3 This is a schematic diagram of a desktop displayed on a zero-terminal provided in an embodiment of this application;

[0038] Figure 4 This is a schematic diagram of a video stream flow provided in an embodiment of this application;

[0039] Figure 5 This is a schematic flowchart of an image encoding method provided in an embodiment of this application;

[0040] Figure 6This is a flowchart illustrating another image encoding method provided in an embodiment of this application. Detailed Implementation

[0041] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.

[0042] For example, Figure 1 This is a schematic diagram of the structure of a zero-terminal system provided in an embodiment of this application.

[0043] like Figure 1 As shown in the illustration, the image encoding method provided in this application can be applied to a zero-terminal system. The zero-terminal system may include a zero-terminal and a server, wherein one or more virtual machines may run on the server. The zero-terminal connects to one of the virtual machines on the server to transmit data with that virtual machine.

[0044] It should be understood that a server can be a single server or a server cluster, and this application embodiment does not limit this. In this application embodiment, the server can also be referred to as a cloud server.

[0045] For example, Figure 2 This is a schematic diagram of a zero-terminal structure provided in an embodiment of this application.

[0046] like Figure 2 As shown, a zero-terminal refers to a terminal that only needs a display screen, a simple CPU and memory, an image receiving and decoding module for image processing, and a reverse control processing module. This approach greatly simplifies the size and configuration of the zero-terminal. All programs on the zero-terminal run on a cloud server. The zero-terminal accesses the cloud server to use the corresponding applications and controls them through reverse control. The cloud server sends real-time processing images to the zero-terminal, making it appear to the zero-terminal as if it were operating locally.

[0047] However, in the cloud desktop scenarios mentioned above, sometimes users experience lag and unresponsiveness when performing very simple operations on the virtual machine, resulting in a poor user experience.

[0048] For example, when users perform operations such as playing local music or dragging the mouse on a virtual machine, these operations may experience lag or unresponsiveness, leading to user complaints.

[0049] For example, Figure 3 This is a schematic diagram of a desktop displayed on a zero terminal, provided as an embodiment of this application.

[0050] For music players, in response to a user's click on the "Switch Window" icon, a small window of the music player is displayed on the desktop of the zero-terminal device, such as... Figure 3 As shown, this small window is used to play local music. If the user does not perform any other operations, the playback may stutter and the CPU may experience extremely high load.

[0051] Next, in response to the user's click on the "minimize" icon, the music player is hidden, playback is normal, and the CPU load will decrease accordingly. If the player is displayed on the desktop again in response to the user's action, the problem of music playback stuttering and increased CPU load will reappear.

[0052] Combination Figure 3 Analysis shows that during the display process, a portion of the player window undergoes drastic changes, such as... Figure 3 The "changing area" shown refers to the area where the video encoding module encodes the entire frame, including the player, when the player is displayed on the desktop. When the player is hidden on the desktop, the desktop will not change, and the video encoding module will not encode, greatly reducing the computational overhead of encoding and thus lowering the CPU load.

[0053] It should be understood that dragging the mouse also causes the lag and unresponsiveness issues mentioned above, which will not be elaborated on here.

[0054] In view of this, based on the desktop virtualization architecture, this application provides a zero-terminal image encoding method, which can encode only locally changing areas when a user opens an application interface, while rendering areas that have not changed by using data from the corresponding position in the previous frame; at the same time, it monitors the system CPU overhead, and when the CPU load is too high, it reduces the CPU consumption of the video acquisition module and the video encoding module by reducing the acquisition frame rate; thereby, it can improve the user experience of cloud desktops and optimize the CPU utilization of virtual machines.

[0055] The following is combined with Figures 4 to 6 The image encoding method provided in the embodiments of this application will be described in detail.

[0056] Figure 4 This diagram illustrates a video stream flow according to an embodiment of this application.

[0057] like Figure 4 As shown, in the above zero-terminal system, a video acquisition module and a video encoding module can run on the virtual machine on the server side, and a video decoding module and a video rendering module can run on the zero-terminal side.

[0058] The video acquisition module is used to acquire video frames (such as desktop images) and send them to the video encoding module; the video encoding module is used to encode the video frames and send them to the video decoding module; correspondingly, the video decoding module is used to decode the received data and send it to the video rendering module; the video rendering module is used to render the received data and then send it to the display screen for display.

[0059] Figure 5 This illustration shows a flowchart of an image encoding method provided in an embodiment of this application, which can be applied to the above. Figure 4 The zero-terminal system shown includes servers such as... Figure 5 As shown, the image encoding method 100 includes the following steps S110 to S180, which will be described in detail below.

[0060] S110, the video capture module is set to capture frame rate that is the same as the screen refresh rate.

[0061] Optionally, before step S110, a connection is established between the zero terminal and the server.

[0062] Among them, zero terminal refers to having Figure 2 The structure shown is currently a zero-terminal response to user actions; the server refers to... Figure 1 The server shown.

[0063] Zero terminals can establish connections with servers via a local area network (LAN) or a wireless local area network (WLAN). When establishing a connection via a LAN, zero terminals can obtain each other's MAC addresses through the ARP protocol to establish a link-layer connection; when connecting via a WLAN, zero terminals can connect to the access point (AP) through Wi-Fi authentication and association procedures, and then obtain MAC addresses through ARP to establish a link-layer connection.

[0064] It should also be understood that when a zero terminal establishes a connection with the server, the server can obtain information about the zero terminal, such as the zero terminal's ID; it can also obtain the user's account information to determine whether it is the first login, etc.

[0065] It should be understood that the capture frame rate refers to the number of frames captured per second by the video capture module; the screen refresh rate refers to the number of times the display screen in the terminal updates the image per second.

[0066] Here, after the zero terminal establishes a connection with the server, the video capture module running on the virtual machine can automatically set the capture frame rate to be the same as the screen refresh rate.

[0067] For example, assuming the screen refresh rate is set to 60Hz, the video capture module can be set to capture frame rate of 60 times per second, that is, capture desktop images 60 times per second.

[0068] The desktop image refers to the desktop image of the current user's terminal; different users have different desktop images.

[0069] S120: The video acquisition module determines whether there is a change between the current frame and the previous frame; if not, it executes S130; if so, it executes S140.

[0070] S130, The video acquisition module does not send the current frame data to the video encoding module.

[0071] S140, The video acquisition module sends the location information of the changed area and the current frame data to the video encoding module.

[0072] It should be understood that, based on the video frames captured by the video capture module, the current frame can be compared with the adjacent previous frame in the capture order. If the image has not changed, the current frame data will not be sent to the video encoding module; if the image has changed, the current frame data will be sent to the video encoding module.

[0073] The current frame data refers to the image data of the current frame, such as the pixel value of each pixel.

[0074] Optionally, S140 may include the following steps:

[0075] S141. Based on the preset window size, divide the current frame into multiple macroblocks.

[0076] For example, assuming the desktop image resolution is 1920×1080 and the default window size is 64×64, the desktop image can be divided into 510 macroblocks.

[0077] It should be noted that 1080 divided by 64 and rounded up is 17, meaning the desktop image can be divided into 17 rows; 1920 divided by 64 equals 30, meaning the desktop image can be divided into 30 columns; therefore, the number of macroblocks is 510.

[0078] It should be noted that the preset window size can be modified and adjusted as needed, and this application embodiment does not limit this.

[0079] S142. Based on the previous frame, mark each macroblock as unchanged or changed.

[0080] Each macroblock is compared with the macroblock at the same location in the previous frame to determine whether the macroblock in the current frame has changed. If it has changed, it is marked as changed; otherwise, it is marked as unchanged.

[0081] For example, if 1 bit represents a macroblock, 0 indicates no change and 1 indicates a change, then each macroblock can be marked as 0 or 1.

[0082] S143. Store the tags corresponding to all macroblocks and generate the change region location information corresponding to the current frame.

[0083] Optionally, the tags of all macroblocks can be stored sequentially according to a row-first principle. Of course, other rules can also be used for storage, and this embodiment of the application does not limit this.

[0084] For example, the 510 macroblocks mentioned in S141 are marked one by one, with 1 bit representing one macroblock, where 0 indicates no change and 1 indicates a change. Then, for the 510 macroblocks included in the desktop image, 510 bits can be used to represent the marking information of the 510 macroblocks. This 510 marking information is the location information of the changed zone corresponding to the current desktop image.

[0085] For example, in 0110000, the first marker "0" indicates that the macroblock located in the first row and first column has not changed compared to the same position in the previous frame; the second marker "1" indicates that the macroblock located in the first row and second column has changed compared to the same position in the previous frame; the third marker "1" indicates that the macroblock located in the first row and third column has changed compared to the same position in the previous frame, and so on.

[0086] S150: The video encoding module determines whether each macroblock belongs to a variable region. If not, proceed to S160; if yes, proceed to S170.

[0087] It should be understood that after the video acquisition module sends the location information of the changed region to the video encoding module, the video encoding module can determine whether each macroblock belongs to the changed region based on the markers included in the changed region location information. For example, when a certain bit in the changed region location information is 0, it indicates that the corresponding macroblock has not changed, and the macroblock belongs to the unchanged region; this macroblock can also be called an unchanged macroblock. When it is 1, it indicates that the corresponding macroblock has changed, and the macroblock belongs to the changed region; this macroblock can also be called a changed macroblock.

[0088] S160. The video encoding module encodes macroblocks belonging to the unchanged region (i.e., unchanged macroblocks) using inter-frame coding, with the reference frame being the previous frame and the motion vector (MV) being 0.

[0089] It should be understood that in inter-frame prediction of video coding, motion vectors are used to describe the displacement information between the current macroblock and the corresponding matching block in the reference frame, including the offset in the horizontal and vertical directions. When MV equals 0, it means that the current macroblock is completely identical to the block at the same position in the reference frame (here, the previous frame), with no displacement. During encoding, the information of the reference frame can be directly reused, thereby significantly reducing the amount of data transmission and improving compression efficiency.

[0090] S170. The video encoding module pre-encodes macroblocks belonging to the changing region (i.e., changing macroblocks) and determines the encoding tool corresponding to the minimum bitstream as the target encoding tool.

[0091] S180. For the variable macroblock, encode it using its corresponding target encoding tool.

[0092] It should be understood that, theoretically, for a macroblock marked as belonging to a changing region, various encoding tools can eventually resolve it. However, some bitstreams are large, and some are small. Generally, to improve transmission efficiency, the encoding tool with the smallest bitstream is selected for encoding. Therefore, before formal encoding, the bitstream can be pre-judged. Multiple encoding tools can be used for pre-encoding first, and then the bitstream can be estimated to determine the encoding tool corresponding to the smallest bitstream.

[0093] The encoding tool refers to the encoding methods supported by the protocol, such as inter-frame coding and intra-frame coding. Intra-frame coding uses the prediction angle, while inter-frame coding uses motion vectors and reference frames. Different macroblocks may use different encoding tools, so it is necessary to select the appropriate encoding tool for the current macroblock.

[0094] Generally, for each macroblock marked as belonging to the change region, it is necessary to compare the bitstream size. However, it is also possible to skip certain encoding tools through other configuration methods, thereby saving computing power. This application does not limit this.

[0095] The subsequent video decoding and video rendering methods are no different from existing practices, and this application does not limit them.

[0096] In step S110 above, the server can also set the acquisition frame rate to a preset range, such as setting the minimum acquisition frame rate to 0.2 times the screen refresh rate and the maximum value to 1 times the screen refresh rate; based on this, the server can adjust the acquisition frame rate to be the same as the screen refresh rate when encoding.

[0097] Furthermore, to further improve the user experience, the image encoding method provided in this application embodiment can also monitor the system CPU overhead and dynamically adjust the acquisition frame rate.

[0098] Figure 6This illustration shows a flowchart of another image encoding method provided in an embodiment of this application, which is applied to... Figure 4 On the server in the zero-terminal system shown.

[0099] like Figure 6 As shown in the embodiments of this application, the above-mentioned S200 may include the following S210 to S260, which are described below in conjunction with Figure 6 Please provide a detailed explanation.

[0100] S210, The video acquisition module sets the acquisition frame rate to within a preset range.

[0101] For example, assuming the screen refresh rate is set to 60Hz, the video capture module can be set to capture frame rates of 60 times per second, that is, capture desktop images 60 times per second. In this case, step S210 is the same as step S110.

[0102] S220: The video acquisition module checks the system's CPU overhead at preset intervals.

[0103] The preset duration can be set and adjusted as needed, such as a preset duration of 1 second. This application embodiment does not limit this.

[0104] S230: The video acquisition module determines whether the system CPU utilization rate is above the first utilization rate. If yes, then execute S240; otherwise, execute S250.

[0105] The first occupancy rate can be set and adjusted as needed, such as 95%, but this application embodiment does not limit this.

[0106] S240, the video acquisition module reduces the acquisition frame rate.

[0107] Optionally, the video capture module can reduce the capture frame rate to a first percentage of the current capture frame rate, where the first percentage is the same as the first occupancy rate.

[0108] For example, if the first occupancy rate is 95%, the video capture module can reduce the capture frame rate to 95% of the current capture frame rate (i.e., the first occupancy rate).

[0109] S250. If it is determined that the system CPU utilization rate is below the first utilization rate, then it can be further determined whether the system CPU utilization rate is below the second utilization rate. If yes, then execute S260; if no, then continue to execute S220.

[0110] The second occupancy rate can be set and adjusted as needed, such as 80%, but this application embodiment does not limit this.

[0111] The S260 video capture module improves the capture frame rate.

[0112] Optionally, the video capture module can increase the capture frame rate to a second percentage of the current capture frame rate, where the second percentage is greater than the second occupancy rate, or the second percentage is greater than the first occupancy rate.

[0113] For example, if the first utilization rate is 95% and the second utilization rate is 80%, and the video capture module determines that the CPU utilization rate is less than 95% and less than 80%, it means that the CPU overhead is relatively small. The CPU overhead can be increased by increasing the capture frame rate. This has been processed, and the capture frame rate can be increased to 105% of the current capture frame rate (i.e., the second utilization rate, and the second utilization rate is greater than the first utilization rate).

[0114] It should also be noted that if the frame rate has been adjusted to the lower limit of the preset range, but the CPU utilization is still greater than 95%, the frame rate will remain at the lower limit and will not be adjusted further.

[0115] Similarly, if the capture frame rate has been adjusted to the upper limit of the preset range, and the CPU utilization is still less than 80%, the capture frame rate will remain at the upper limit and will not be adjusted further.

[0116] This application provides an image encoding method based on a zero-terminal system. When a user opens an application interface on a cloud desktop, the server uses an encoding tool with the lowest bitrate to encode only the changing areas, while rendering the unchanged areas using the data from the corresponding position in the previous frame. Simultaneously, the system monitors CPU overhead, and when the CPU load is too high, it reduces the acquisition frame rate to decrease the CPU overhead of the video acquisition module and the video encoding module. This allows for timely response to user operations, improves the user experience of the cloud desktop, and optimizes the CPU utilization of the virtual machine.

[0117] Based on the image encoding method described in the above embodiments, this application also provides an electronic device, including a processor and a memory, wherein the memory stores at least one computer instruction, which is loaded and executed by the processor to perform the steps performed by the server in the image encoding method described in any of the above embodiments.

[0118] Based on the image encoding method described in the above embodiments, this application also provides a computer-readable storage medium. For example, a non-transitory computer-readable storage medium may be a read-only memory (ROM), a random access memory (RAM), a CD-ROM, magnetic tape, a floppy disk, or an optical data storage device, etc. This storage medium stores computer instructions for executing the steps performed by the server in any of the image encoding methods described in the above embodiments, which will not be elaborated further here.

[0119] Based on the image encoding method described in the above embodiments, this application also provides a computer-readable storage medium. For example, a non-transitory computer-readable storage medium may be a read-only memory (ROM), a random access memory (RAM), a CD-ROM, magnetic tape, a floppy disk, or an optical data storage device, etc. This storage medium stores computer instructions for executing the steps performed by the zero terminal in any of the above embodiments of the image encoding method, which will not be elaborated further here.

[0120] Other embodiments of this application will readily occur to those skilled in the art upon consideration of the specification and practice of the disclosure herein. This application is intended to cover any variations, uses, or adaptations of this application that follow the general principles of this application and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this application are indicated by the following claims.

[0121] It should be understood that this application is not limited to the precise structure described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this application is limited only by the appended claims.

Claims

1. An image encoding method, characterized in that, The method, applied to a server connected to zero terminals, includes: The capture frame rate is set to be the same as the screen refresh rate. The capture frame rate refers to the number of frame rates captured per second corresponding to the zero terminal, and the screen refresh rate refers to the number of times the zero terminal updates the screen per second. Determine if there are any changes between the current frame and the previous frame; If so, the current frame is encoded by combining the position information of the changing region corresponding to the current frame.

2. The method according to claim 1, characterized in that, Determining whether there are changes between the current frame and the previous frame includes: Based on a preset window size, the current frame is divided into multiple macroblocks; By comparing with the previous frame, each macroblock is divided into a changed macroblock or an unchanged macroblock. The changed or unchanged markers corresponding to each macroblock are stored in a preset order to generate the location information of the changed region corresponding to the current frame.

3. The method according to claim 2, characterized in that, The step of encoding the current frame by combining the position information of the corresponding changed region in the current frame includes: By combining the position information of the corresponding changed macroblock in the current frame, multiple encoding tools are used to pre-encode each of the changed macroblocks to determine the pre-coded bitstream; For each of the aforementioned variable macroblocks, the coding tool corresponding to the minimum precoding bitstream is determined as the target coding tool; Each of the aforementioned target encoding tools is used to encode each of the aforementioned variable macroblocks.

4. The method according to claim 3, characterized in that, The encoding tools are encoding methods supported by the protocol, including at least inter-frame encoding and intra-frame encoding.

5. The method according to any one of claims 1 to 4, characterized in that, The method further includes: If there is no change, the regions in the current frame that have not changed are encoded using inter-frame coding, with the previous frame as the reference frame and the motion vector as 0.

6. The method according to claim 5, characterized in that, The method further includes: The system CPU utilization rate is checked at preset intervals. The acquisition frame rate is adjusted within a preset range based on the system CPU utilization.

7. The method according to claim 6, characterized in that, The step of adjusting the acquisition frame rate within a preset range based on the system CPU utilization includes: When the system CPU utilization rate is determined to be above a certain threshold, the acquisition frame rate is reduced. When the system CPU utilization rate is determined to be below the second utilization rate, the acquisition frame rate is increased, wherein the second utilization rate is less than the first utilization rate.

8. The method according to claim 6, characterized in that, The step of reducing the acquisition frame rate includes: reducing the acquisition frame rate to a first percentage of the current acquisition frame rate, wherein the first percentage is the same as the first occupancy rate; The step of increasing the acquisition frame rate includes: increasing the acquisition frame rate to a second percentage of the current acquisition frame rate, wherein the second percentage is greater than the second occupancy rate, or the second percentage is greater than the first occupancy rate.

9. The method according to any one of claims 6 to 8, characterized in that, The minimum value of the preset range is 0.2 times the screen refresh rate, and the maximum value is 1 times the screen refresh rate.

10. An electronic device, characterized in that, It includes a processor and a memory, the memory storing at least one computer instruction, which is loaded and executed by the processor to perform the steps performed in the method of any one of claims 1 to 9.

11. A computer-readable storage medium, characterized in that, The storage medium stores at least one computer instruction, which is loaded and executed by a processor to perform the steps in the method of any one of claims 1 to 9.