Data coding method, data transmission method, electronic equipment and storage medium
By real-time bandwidth detection and dynamic encoding bitrate adjustment, combined with an encoding token mechanism, the problem of unstable images in remote video transmission was solved, achieving a clear and smooth video transmission effect.
Patent Information
- Application Number
- CN202310826192.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-07-06
- Publication Date
- 2025-01-07
AI Technical Summary
In remote work scenarios, due to network bandwidth limitations, existing technologies struggle to achieve precise and stable control over video data, resulting in blurry or stuttering images that fail to meet user needs.
By detecting the available bandwidth in real time, dynamically selecting the target encoding bitrate, and obtaining the encoding token in a message-triggered manner, the encoding speed is controlled to adapt to the current network bandwidth transmission requirements, ensuring that the encoded data is clear and smooth.
It achieves stable transmission of video data even with changes in network bandwidth, improves image clarity and smoothness, reduces screen stuttering and glitches, and enhances user experience.
Smart Images

Figure CN119277133A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of video processing technology, and in particular to a data encoding method, a data transmission method, an electronic device and a storage medium. Background Art
[0002] At present, when using video devices to monitor remote work scenes, it is usually necessary to obtain video data in the remote work scenes. However, since remote devices are connected through communication networks, they are limited by the network connection bandwidth when transmitting video data, and cannot obtain stable and accurate video data. How to flexibly and accurately control the video data collected by remote devices has become an urgent problem to be solved. Summary of the invention
[0003] The present application provides a data encoding method, a data transmission method, an electronic device and a storage medium.
[0004] An embodiment of the present application provides a data encoding method, the method comprising: detecting the current available bandwidth in real time, and selecting a target encoding bit rate from a preset encoding gear list based on the current available bandwidth; obtaining a coding token in a message-triggered manner, the coding token representing the coding authority; and encoding the data to be encoded using the target coding bit rate when it is determined that the coding token has been obtained.
[0005] An embodiment of the present application provides a data transmission method, the method comprising: adopting any one of the data encoding methods in the embodiments of the present application to obtain encoded data, the encoded data being data obtained by encoding the data to be encoded using a target encoding bit rate; based on the transmission frame rate, transmitting the encoded data to a downlink transmission network, so that the downlink transmission network transmits the encoded data to a remote control device.
[0006] An embodiment of the present application provides an electronic device, including: one or more processors; a memory, on which one or more programs are stored. When the one or more programs are executed by the one or more processors, the one or more processors implement any one of the data encoding methods or data transmission methods in the embodiments of the present application.
[0007] An embodiment of the present application provides a readable storage medium, which stores a computer program. When the computer program is executed by a processor, any one of the data encoding methods or data transmission methods in the embodiments of the present application is implemented.
[0008] According to the data encoding method, electronic device and storage medium of the embodiments of the present application, the current available bandwidth is detected in real time to clarify the network bandwidth that can be used for data encoding, so as to facilitate dynamic encoding of data; as the current available bandwidth changes, the target encoding bit rate suitable for the current available bandwidth is dynamically selected from the preset encoding gear list, so as to facilitate real-time adjustment of the encoding bit rate and precise control of the encoding bit rate; the encoding token is obtained in a message-triggered manner, and the encoding token represents the encoding authority to reduce the impact of the delay generated during the encoding process; when it is determined that the encoding token is obtained, the target encoding bit rate is used to encode the data to be encoded, and the encoding speed is effectively controlled so that the encoded data can be suitable for the transmission requirements of the current available bandwidth, the encoded data can be clearer, and the fluency of the encoded image is maintained.
[0009] According to the data transmission method, electronic device and storage medium of the embodiments of the present application, by adopting any one of the data encoding methods in the embodiments of the present application, encoded data is obtained, and the encoded data is data obtained by encoding the data to be encoded using a target encoding bit rate, wherein the target encoding bit rate is a bit rate selected from a preset encoding gear list based on the current available bandwidth detected in real time, which can make the target encoding bit rate more matched with the current available bandwidth; based on the transmission frame rate, the encoded data is transmitted to a downlink transmission network, so that the downlink transmission network can stably transmit the encoded data to a remote control device, so that the remote control device can receive data encoded based on the precisely controlled target encoding bit rate, thereby improving the accuracy of the data and maintaining the smoothness of the image.
[0010] With regard to the above embodiments and other aspects of the present application and their implementation, further description is provided in the accompanying drawings, detailed description and claims. BRIEF DESCRIPTION OF THE DRAWINGS
[0011] Figure 1 A flow chart showing a data encoding method provided in an embodiment of the present application is shown.
[0012] Figure 2 A flow chart of a data transmission method provided in an embodiment of the present application is shown.
[0013] Figure 3 A schematic diagram showing the processing of data to be encoded by the data encoding system provided in an embodiment of the present application.
[0014] Figure 4 A flow chart showing a data encoding method provided in an embodiment of the present application is shown.
[0015] Figure 5 A schematic diagram showing the initial data displayed in the VMAF tool provided in an embodiment of the present application.
[0016] Figure 6 A schematic diagram showing further adjusted data displayed in the VMAF tool provided in an embodiment of the present application.
[0017] Figure 7 A schematic diagram showing multiple sets of experimental data displayed in the VMAF tool provided in an embodiment of the present application.
[0018] Figure 8 A block diagram showing the composition of a data encoding device provided in an embodiment of the present application is shown.
[0019] Fig. 9 A block diagram showing the composition of a data transmission device provided in an embodiment of the present application is shown.
[0020] Fig.10 An electronic device provided by an embodiment of the present application is shown. DETAILED DESCRIPTION
[0021] In order to make the purpose, technical solution and advantages of the present application more clear, the embodiments of the present application will be described in detail below with reference to the accompanying drawings. It should be noted that the embodiments and features in the embodiments of the present application can be combined with each other arbitrarily without conflict.
[0022] In the process of using video equipment to monitor remote work scenes, it is usually necessary to obtain video data in the remote work scenes. For example, in a certain smart port, remote video monitoring of the operation process of containers can be achieved by using the cooperation of video equipment and communication networks and other software and hardware. For example, multiple cameras are used to obtain image data from multiple angles, and the images from multiple angles are transmitted through a communication network. However, since the image data obtained by the camera device is unprocessed data and does not have the ability to transmit stably in low-bandwidth scenarios, in the case of poor network conditions (for example, the current network bandwidth is less than or equal to the minimum preset bandwidth), the clarity of the image obtained by the user cannot be guaranteed, and the image is often blurred or the image is stuck, which reduces the user's experience.
[0023] For example, in an important remote video conference, if the network conditions are poor (for example, the network bandwidth is reduced, or the network data transmission is unstable, etc.), the remote video conference will experience frequent and obvious screen freezes or even screen distortion, which will make it impossible for the key information in the remote video conference to be received by the participants, resulting in the risk of information loss.
[0024] Furthermore, in scenarios such as metallurgy, mining, and industrial production lines, there may be a phenomenon where stable and accurate video data cannot be obtained due to poor network conditions.
[0025] In the relevant encoding method, technicians can adjust the quality of the encoded image according to the encoding bit rate inside the encoder to meet the data transmission requirements under poor network conditions. However, the above method can only be implemented inside the encoder. Without restarting the encoder, the encoding bit rate inside the encoder cannot be matched with the current network bandwidth, which has certain limitations. In addition, this encoding method will also cause the problem of blurred encoded images when the encoding bit rate is low.
[0026] In another related processing method, the coding standard prescribed by the industry is adopted to adjust the coding bit rate within a certain range inside the encoder. However, the above-adjusted coding bit rate is the total bit rate, which cannot accurately control the coding bit rate for different data to be encoded. It cannot meet the user's needs for stable data transmission in low-bandwidth application scenarios, and the need to obtain stable and smooth image pictures, which reduces the user's experience.
[0027] The present application provides a data encoding method, a data transmission method, an electronic device and a storage medium, which can detect the current available bandwidth in real time, clearly define the network bandwidth that can be used for data encoding, and facilitate dynamic encoding of data; dynamically select a target encoding bit rate suitable for the current available bandwidth from a preset encoding gear list as the current available bandwidth changes, so as to facilitate real-time adjustment of the encoding bit rate and accurately control the encoding bit rate; obtain a coding token in a message-triggered manner, the coding token representing the coding authority to reduce the impact of the delay generated during the encoding process; when it is determined that the coding token has been obtained, use the target coding bit rate to encode the data to be encoded, and effectively control the encoding speed so that the encoded data can be suitable for the transmission requirements of the current available bandwidth, so that the encoded data can be clearer and the smoothness of the encoded image can be maintained, thereby ensuring the stability of the video stream data obtained in the actual industrial scene.
[0028] Figure 1 FIG. 1 is a flow chart of a data encoding method provided in an embodiment of the present application. The method can be applied to a data encoding device. Figure 1 As shown, the method in the embodiment of the present application includes but is not limited to the following steps.
[0029] Step S101 , detecting the current available bandwidth in real time, and selecting a target encoding bit rate from a preset encoding gear list based on the current available bandwidth.
[0030] Step S102, obtaining a coding token in a message-triggered manner.
[0031] Among them, the coding token represents the coding authority.
[0032] Step S103, when it is determined that a coding token is obtained, the target coding rate is used to encode the data to be encoded.
[0033] The data to be encoded includes a frame of image data, which is data collected by a video acquisition device and needs to be transmitted to a remote control device. The target encoding bit rate is used to encode the frame of image data.
[0034] In some exemplary embodiments, the data to be encoded may also include multiple frames of image data. For each frame of image data, before encoding each frame of image data, it is necessary to first obtain the target encoding bit rate corresponding to the frame of image data, and then use the target encoding bit rate to encode the frame of image data, so that different data to be encoded can obtain the corresponding target encoding bit rate to meet the encoding requirements.
[0035] In this embodiment, by real-time detection of the current available bandwidth, the network bandwidth that can be used for data encoding is clearly identified, so as to facilitate dynamic encoding of the data; as the current available bandwidth changes, the target encoding bit rate suitable for the current available bandwidth is dynamically selected from the preset encoding gear list, so as to facilitate real-time adjustment of the encoding bit rate and precise control of the encoding bit rate; the encoding token is obtained in a message-triggered manner, and the encoding token represents the encoding authority to reduce the impact of the delay generated during the encoding process; when it is determined that the encoding token is obtained, the target encoding bit rate is used to encode the data to be encoded, and the encoding speed is effectively controlled so that the encoded data can be suitable for the transmission requirements of the current available bandwidth, the encoded data can be clearer, and the fluency of the encoded image can be maintained.
[0036] In some exemplary embodiments, obtaining the coding token in a message-triggered manner in step S102 can be implemented in the following manner: determining the coding trigger frequency based on the sending frame rate of the uplink data stream; sending a token request message to the token management module based on the coding trigger frequency; and obtaining the coding token in response to the token request response fed back by the token management module.
[0037] The coding token is one of a plurality of coding tokens generated based on a transmission frame rate of data transmitted over a downlink transmission network.
[0038] Under normal circumstances, the transmission frame rate of the upstream data stream is greater than the transmission frame rate of the data transmitted to the downstream transmission network. Therefore, through interaction with the token management module, the encoding token can be obtained in time to obtain the encoding authority.
[0039] Furthermore, after receiving the token request response fed back by the token management module, the current device may also send a successful response of obtaining the coded token to the token management module, so that the token management module deletes the coded token.
[0040] Through the above-mentioned message interaction with the token management module, the coding token generated by the token management module can be obtained; and only when the coding token is obtained, the target coding bit rate will be used to encode the data to be encoded, and the processing delay of the data to be encoded can be adjusted in real time, thereby reducing the influence of network delay on the image quality corresponding to the encoded data.
[0041] In some exemplary embodiments, the real-time detection of the current available bandwidth in step S101 may be implemented in the following manner: real-time detection of the current network bandwidth; dividing the current available bandwidth from the current network bandwidth according to the preset bandwidth range determined by the maximum preset bandwidth and the minimum preset bandwidth;
[0042] Among them, the minimum preset bandwidth is a bandwidth determined based on the maximum preset bandwidth, the redundant bandwidth supported by the current network, and the network delay information that can be introduced by the current network. The maximum preset bandwidth is used to set the bitrate upper limit of the user experience quality (Quality of Experience, QoE), and the total encoding bitrate of the encoder is less than or equal to the bitrate corresponding to the maximum preset bandwidth. The minimum preset bandwidth is used to set the minimum encoding bitrate of the encoder to prevent the image quality corresponding to the encoded data from being too low. In other words, the minimum preset bandwidth is the bandwidth determined when it is determined that the image quality determined by the data to be encoded meets the preset usage requirements.
[0043] If the anti-packet loss ratio is set to 60%, the maximum preset bandwidth may be 5 times the minimum preset bandwidth. Table 1 shows the corresponding relationship between the packet loss rate, the encoding bit rate, and the introduced delay.
[0044] Table 1 Correspondence between packet loss rate, encoding bit rate, and introduced delay
[0045]
[0046] The round-trip time (RTT) refers to the total delay from the time the sender sends the encoded data to the time the sender receives the confirmation message from the receiver (after the receiver receives the encoded data, it immediately feeds back the confirmation message to the sender).
[0047] As shown in Table 1, if the maximum preset bandwidth is set to 2MB, then when the packet loss rate is 25%, the ratio of the encoding rate of redundant data to the original encoding rate is 1.5:1; at this time, the available bandwidth corresponding to the target encoding rate needs to be reduced to at least 2*1 / (1.5+1)=0.8MB; however, at the same time, network delay information (such as a delay of 0 to 70ms as shown in Table 1, or a delay of 50 to 200ms, etc.) will be introduced. A comprehensive evaluation is performed on the above network delay information and the available bandwidth corresponding to the target encoding rate, and it can be determined that the minimum preset bandwidth is set to 0.75MB, which can meet the data transmission requirements in weak network scenarios.
[0048] It should be noted that in different application scenarios, due to different requirements for the video quality of the encoded data, the target encoding bit rate can be adjusted in turn based on the following priority factors: delay factor, image clarity factor, video smoothness factor, and image color factor, etc.
[0049] Among them, the priority of the delay factor is higher than the priority of the image clarity factor, the priority of the image clarity factor is higher than the priority of the video smoothness factor, and the priority of the video smoothness factor is higher than the priority of the image color factor.
[0050] In some exemplary embodiments, the preset encoding gear list includes multiple preset encoding bit rates; the step S101 of selecting the target encoding bit rate from the preset encoding gear list based on the current available bandwidth may be implemented in the following manner:
[0051] When it is determined that the current available bandwidth is lower than the minimum preset bandwidth, a target encoding bit rate is selected from a plurality of preset encoding bit rates according to the influence of the current available bandwidth on the picture quality corresponding to the decoded data; or, according to the encoding bit rate change information, a target encoding bit rate is selected from a plurality of preset encoding bit rates;
[0052] The coding rate change information is the change information between the first coding rate corresponding to the current available bandwidth and the second coding rate corresponding to the available bandwidth obtained last time. For example, if the first coding rate is 1.8Mbps and the second coding rate is 1.9Mbps, the coding rate change information indicates that the current available bandwidth is lower than the available bandwidth obtained last time, indicating that the network condition has deteriorated. For another example, if the first coding rate is 1.5Mbps and the second coding rate is 1.7Mbps, the coding rate change information indicates that the current available bandwidth is higher than the available bandwidth obtained last time, indicating that the network condition has improved.
[0053] However, the network status changes in real time, and the available bandwidth obtained for multiple consecutive times may fluctuate. Therefore, based on the coding rate change information, the real-time change degree of the network bandwidth can be reflected. When it is determined that the current available bandwidth is lower than the minimum preset bandwidth, the target coding rate is selected from multiple preset coding rates based on the coding rate change information. This can make the target coding rate more in line with the data encoding (or data transmission) requirements corresponding to the current available bandwidth, and can dynamically and flexibly adjust the coding rate to achieve accurate encoding of the encoded data.
[0054] The decoded data is a coding rate determined based on the current available bandwidth. The coded data is encoded to obtain the coded data, and then the coded data is transmitted to the peer device so that the peer device decodes the received coded data to obtain the data.
[0055] Since users hope that you can obtain clear and complete images, however, when the current available bandwidth is lower than the minimum preset bandwidth, it is necessary to select a target encoding bit rate from multiple preset encoding bit rates based on the degree of influence of the current available bandwidth on the picture quality corresponding to the decoded data (such as the influence of causing the picture corresponding to the decoded data to appear stuck, or the influence of making the picture corresponding to the decoded data clear and smooth, etc.), so that the target encoding bit rate can match the current available bandwidth and maximize the picture quality corresponding to the encoded data.
[0056] In some exemplary embodiments, based on the degree of influence of the current available bandwidth on the picture quality corresponding to the decoded data, a target encoding bit rate is selected from multiple preset encoding bit rates, including: selecting a first preset encoding bit rate from the multiple preset encoding bit rates as the target encoding bit rate.
[0057] The first preset encoding bit rate is used to reduce the bit rate corresponding to the image brightness and / or image chrominance corresponding to the decoded data.
[0058] For example, a color encoding method (YUV) is used to characterize the decoded data, where "Y" represents the brightness (Luminance or Luma) of the image; "U" and "V" represent the chrominance (Chrominance or Chroma) of the image. The image color can be removed by removing the UV component in the image so that the decoded image is displayed in black and white. When the decoded image is sampled in the YUV420 format, the bandwidth used can be reduced by 20% to 30% compared with the bandwidth used in the prior art in the process of encoding the data to be encoded using the target encoding bit rate.
[0059] And / or, by reducing the proportion of the "Y" component (i.e., reducing the brightness of the decoded image), a first preset encoding rate is selected from multiple preset encoding rates, and the first preset encoding rate is used as the target encoding rate. The target encoding rate is used to encode the data to be encoded to obtain the encoded data, thereby reducing the transmission bandwidth for transmitting the encoded data, reserving more redundant bandwidth to combat the instability of the transmission channel, and improving the ability to resist weak networks.
[0060] Among them, in the YUV420 format, one pixel corresponds to one Y, and a small 2*2 square corresponds to one U and V. For all YUV420 format images, their Y value arrangement is exactly the same, because only the image with Y is a grayscale image.
[0061] In some exemplary embodiments, each preset encoding bit rate corresponds to a preset image resolution; based on the encoding bit rate change information, a target encoding bit rate is selected from multiple preset encoding bit rates to obtain the target encoding bit rate, including: comparing a first encoding bit rate corresponding to a current available bandwidth and a second encoding bit rate corresponding to a previously obtained available bandwidth with a preset encoding interval respectively; when it is determined that the second encoding bit rate is within the preset bit rate interval and the first encoding bit rate is outside the preset bit rate interval, adjusting the image resolution corresponding to the current available bandwidth to obtain an adjusted image resolution; based on the adjusted image resolution, selecting a second preset encoding bit rate from the multiple preset encoding bit rates as the target encoding bit rate, the second encoding bit rate being a bit rate corresponding to the adjusted image resolution.
[0062] The adjusting of the image resolution corresponding to the currently available bandwidth may be to reduce the image resolution corresponding to the currently available bandwidth.
[0063] For example, the image resolution corresponding to the current available bandwidth is reduced from the original 1080P (i.e., the number of pixels included in the horizontal direction is 1920, and the number of pixels included in the vertical direction is 1080) to 720P (i.e., the number of pixels included in the horizontal direction is 1280, and the number of pixels included in the vertical direction is 720), or the image resolution corresponding to the current available bandwidth is reduced from the original 720P (i.e., the number of pixels included in the horizontal direction is 1280, and the number of pixels included in the vertical direction is 720) to 480P (i.e., the number of pixels included in the horizontal direction is 480, and the number of pixels included in the vertical direction is 367), etc., which will not be repeated here.
[0064] By comparing the first encoding bit rate corresponding to the current available bandwidth and the second encoding bit rate corresponding to the available bandwidth obtained last time with the preset encoding interval, it is possible to obtain the change between the encoding bit rates corresponding to different available bandwidths and the preset encoding interval during the process of the available bandwidth of the network changing. When it is determined that the second encoding bit rate is within the preset bit rate interval and the first encoding bit rate is outside the preset bit rate interval, the adjusted image resolution is obtained by reducing the image resolution corresponding to the current available bandwidth, so that the adjusted image resolution can match the current available bandwidth. Furthermore, from multiple preset encoding bit rates, the second preset encoding bit rate corresponding to the adjusted image resolution is selected as the target encoding bit rate, so that the target encoding bit rate can not only be suitable for the current available bandwidth, but also can better meet the needs of the encoded data, and the encoding bit rate of the encoded data to be encoded can be dynamically adjusted to make the encoded data more in line with the transmission requirements.
[0065] In some embodiments, when it is determined that the current available bandwidth is greater than or equal to the minimum preset bandwidth and less than or equal to the maximum preset bandwidth, a third preset encoding bit rate from multiple preset encoding bit rates can be selected as the target encoding bit rate, and the third preset encoding bit rate is a bit rate that keeps the image quality corresponding to the decoded data unchanged.
[0066] For example, based on the third preset encoding bit rate, the data to be encoded is encoded without removing the UV component in the image, so as to keep the image quality corresponding to the decoded data unchanged.
[0067] In some exemplary embodiments, before encoding the data to be encoded using the target encoding bit rate in step S103, the method further includes: when it is determined that the current available bandwidth is lower than the minimum preset bandwidth, determining a variation range of the encoding frame rate according to the current available bandwidth; and adaptively updating the target encoding frame rate within the variation range of the encoding frame rate.
[0068] If the current available bandwidth is lower than 0.75MB, the encoding frame rate can be set to a range of 20fps to 30fps, where fps represents the number of frames transmitted per second. Furthermore, the target encoding bit rate is adaptively updated within 20fps to 30fps so that the updated target encoding bit rate meets the transmission requirements.
[0069] Theoretically, when the encoding frame rate reaches a minimum of 20fps, the encoding bandwidth corresponding to the updated target encoding bit rate is 0.5MB. When the updated target encoding bit rate is used to encode the data to be encoded, the image quality corresponding to the encoded data obtained is the same as the image quality when the encoding bandwidth is 0.75MB. Therefore, the theoretical minimum preset bandwidth can be set to 0.5MB.
[0070] By adaptively updating the target encoding frame rate within the range of the encoding frame rate, the target encoding frame rate can be controlled to switch smoothly. Compared with the existing method of simply using the encoder to adjust the internal encoding bit rate, the data encoding method in the present application can not only ensure the image clarity corresponding to the encoded data, but also greatly improve the ability to resist weak networks.
[0071] In some embodiments, a variable encoding bit rate may be obtained by adopting a variable bit rate (VBR), and then the data to be encoded may be encoded based on the changed encoding bit rate to meet the encoding requirements of images of different complexities.
[0072] For example, the encoding bit rate corresponding to the data to be encoded is adjusted according to the change information of the image content amplitude. If the image corresponding to the data to be encoded is rich in details or contains a lot of motion, the target encoding bit rate assigned to it is greater than the preset encoding threshold (which can be set according to actual conditions and will not be repeated here); if the image corresponding to the data to be encoded is relatively flat, the target encoding bit rate assigned to it can be less than or equal to the preset encoding threshold. In this way, the image quality of the encoded data is guaranteed while taking into account the limitation of the current available bandwidth.
[0073] It should be noted that an average encoding bitrate can be set as the preset encoding threshold, and the maximum value (maxBitrate) of the target encoding bitrate allocated to the data to be encoded is guaranteed to be less than the preset encoding threshold. In some embodiments, the average encoding bitrate can be the bitrate provided by the encoder.
[0074] In some exemplary embodiments, before encoding the data to be encoded using the target encoding rate in step S103 when it is determined that the encoding token is obtained, the method further includes: if the encoding token is not obtained in the current frame, requesting to obtain the encoding token again in the next frame.
[0075] The data to be encoded is data collected by the video acquisition device and needs to be transmitted to the remote control device.
[0076] For example, when the data encoding module needs to request the token management module to obtain a coding token in order to encode a frame of data to be encoded, if the current frame does not obtain the coding token, it is necessary to wait for the next frame to arrive and request the coding token again to determine whether the coding token can be obtained.
[0077] It should be noted that when it is determined that the current frame has not obtained the coding token, the message queue corresponding to the current frame needs to be cleared so that when the next frame arrives, there will be enough space to process the message sent again requesting to obtain the coding token, thereby improving the message processing efficiency.
[0078] Figure 2 The flowchart of the data transmission method provided by the embodiment of the present application is shown. The method can be applied to a data transmission device. Figure 2 As shown, the data transmission method in the embodiment of the present application includes but is not limited to the following steps.
[0079] Step S201, using any one of the data encoding methods in the embodiments of the present application to obtain encoded data.
[0080] The encoded data is data obtained by encoding the data to be encoded using a target encoding bit rate.
[0081] Step S202: based on the transmission frame rate, transmit the encoded data to a downlink transmission network, so that the downlink transmission network transmits the encoded data to the remote control device.
[0082] In this embodiment, by adopting any one of the data encoding methods in the embodiments of the present application, encoded data is obtained, and the encoded data is data obtained by encoding the data to be encoded using a target encoding bit rate, wherein the target encoding bit rate is a bit rate selected from a preset encoding gear list based on the current available bandwidth detected in real time, which can make the target encoding bit rate more matched with the current available bandwidth; based on the transmission frame rate, the encoded data is transmitted to a downlink transmission network, so that the downlink transmission network can stably transmit the encoded data to the remote control device, so that the remote control device can receive the data encoded based on the precisely controlled target encoding bit rate, thereby improving the accuracy of the data and maintaining the smoothness of the image.
[0083] Figure 3 A schematic diagram showing the processing of data to be encoded by the data encoding system provided in an embodiment of the present application is shown. Figure 3 As shown, the data encoding system includes a communication connection detection module 31, a network processing unit (Network Process Unit, NPU) 32, a video processing unit (Video Process Unit, VPU) 33, and a data encoding module 34.
[0084] The method for the data coding system to process the coded data includes but is not limited to the following steps:
[0085] Step S301 : the detection module 31 detects the current available bandwidth in real time.
[0086] For example, for each downlink data flow, the QoE is queried to obtain the current network bandwidth. Further, the current available bandwidth is divided from the current network bandwidth according to the preset bandwidth range determined by the maximum preset bandwidth and the minimum preset bandwidth.
[0087] The minimum preset bandwidth is a bandwidth determined based on the maximum preset bandwidth, the redundant bandwidth supported by the current network, and the network delay information that can be introduced by the current network. The minimum preset bandwidth can be a bandwidth determined when it is determined that the image quality determined by the data to be encoded meets the preset usage requirements. For example, the minimum preset bandwidth is set to 0.75MB.
[0088] It should be noted that the current network bandwidth obtained by the detection module 31 in the process of real-time detection of the current network bandwidth can be simply divided into two parts: the current available bandwidth (i.e., the bandwidth that can be used for data encoding) and the redundant bandwidth (i.e., the bandwidth provided for redundant data). When it is determined that the current network bandwidth is greater than the maximum preset bandwidth (for example, the maximum preset bandwidth is set to 2MB), it indicates that the network condition at this time is good, and the proportion of the current available bandwidth can be increased to use more bandwidth resources to encode the data to be encoded, thereby improving the output image quality; and when it is determined that the current network bandwidth is less than or equal to the minimum preset bandwidth (for example, the minimum preset bandwidth is set to 0.75MB), it indicates that the network condition at this time is poor, and the proportion of the current available bandwidth needs to be reduced, which will cause the output image quality to deteriorate.
[0089] In case of poor network conditions, a preset bit rate range can be set, and by comparing the encoding bit rate corresponding to the acquired current available bandwidth with the preset bit rate range, it is determined whether the image resolution needs to be adjusted.
[0090] For example, if the encoding bit rate corresponding to the current available bandwidth is lower than the encoding bit rate corresponding to the minimum preset bandwidth (i.e., 0.75MB), the first encoding bit rate corresponding to the current available bandwidth and the second encoding bit rate corresponding to the available bandwidth obtained last time may be compared with the preset encoding interval respectively; when it is determined that the second encoding bit rate is within the preset bit rate interval and the first encoding bit rate is outside the preset bit rate interval, the image resolution corresponding to the current available bandwidth is adjusted to obtain the adjusted image resolution; multiple preset encoding bit rates are screened according to the adjusted image resolution, and the obtained bit rate corresponding to the adjusted image resolution is used as the target encoding bit rate,
[0091] Among them, adjusting the image resolution corresponding to the current available bandwidth may be to reduce the image resolution corresponding to the current available bandwidth, for example, reducing the image resolution corresponding to the current available bandwidth from the original 1080P (i.e., the number of pixels included in the horizontal direction is 1920, and the number of pixels included in the vertical direction is 1080) to 720P (i.e., the number of pixels included in the horizontal direction is 1280, and the number of pixels included in the vertical direction is 720).
[0092] The image resolution may include but is not limited to at least one of the following modes: high quality (HQ) mode, high performance (HP) mode, low latency high quality mode (Low Latency HQ), low latency high performance mode (Low Latency HP), lossless mode (Lossless), and default mode (Default). The image resolutions corresponding to the above modes decrease in sequence.
[0093] For another example, when it is determined that the second encoding bit rate is outside the preset bit rate range and the first encoding bit rate is within the preset bit rate range, the image resolution corresponding to the current available bandwidth may not be adjusted; or, when it is determined that both the first encoding bit rate and the second encoding bit rate are within the preset bit rate range, the image resolution corresponding to the current available bandwidth may not be adjusted, so as to reduce the proportion of unstable image quality caused by frequent adjustment of image resolution due to small disturbances in the encoding bit rate, thereby improving the user experience.
[0094] In step S302, the network processing unit 32 sends the acquired current available bandwidth to the video processing unit 33 through a reverse Real-time Transport Control Protocol (RTCP) channel.
[0095] In step S303, after receiving the current available bandwidth, the video processing unit 33 selects a target encoding bit rate from a preset encoding gear list according to the current available bandwidth, and sends the target encoding bit rate to the data encoding module 34, so that the data encoding module 34 can use the target encoding bit rate to encode the data to be encoded when determining that the encoding token is obtained.
[0096] For example, the data to be encoded includes a frame of image data, which is data collected by a video acquisition device and needs to be transmitted to a remote control device. The target encoding bit rate is used to encode the frame of image data.
[0097] For another example, the data to be encoded may also include multiple frames of image data. For each frame of image data, the video processing unit 33 will update the target encoding bit rate corresponding to the frame of image data before encoding each frame of image data to adapt to the encoding requirements of different data to be encoded.
[0098] In some embodiments, the encoding token can be obtained in the following manner: determining the encoding trigger frequency according to the transmission frame rate of the uplink data stream; sending a token request message to the token management module according to the encoding trigger frequency; and obtaining the encoding token in response to the token request response fed back by the token management module. The encoding token is one of a plurality of encoding tokens generated based on the transmission frame rate of the data transmitted to the downlink transmission network.
[0099] For example, Figure 4 The following is a flow chart showing a data encoding method provided by an embodiment of the present application. Figure 4 As shown, the token management module 410, the data encoding module 420 and the downlink transmission network 430 are connected in communication. The data encoding module 420 may be Figure 3 The data encoding module 34 in.
[0100] The token management module 410 generates a coding token every X milliseconds (ms), and the coding token is used to represent the coding authority; and the token management module 410 also receives a token request message sent by the data coding module 420 every M milliseconds, and issues a coding token to the data coding module 420.
[0101] Wherein, X is a duration determined based on a transmission frame rate of data transmitted to a downlink transmission network, M represents a coding trigger frequency, and both X and M are positive numbers, and X>M.
[0102] When the transmission frame rate of the upstream data stream is greater than the transmission frame rate of the data transmitted to the downstream transmission network, the acquired data to be encoded is processed by means of timed frame loss. In other words, if the encoding token is not obtained in the current frame, the encoding token is requested again in the next frame.
[0103] For example, if the transmission frame rate of the upstream data stream is set to 30fps and the transmission frame rate of the data transmitted to the downstream transmission network is set to 20fps, then X can be set to 50ms, that is, the token management module 410 generates a coding token every 50ms. Correspondingly, M can be set to 33ms, that is, the data encoding module 420 sends a token request message to the token management module 410 every 33ms to obtain a coding token.
[0104] It should be noted that when the data encoding module 420 needs to request the token management module 410 to obtain a coding token in order to encode a frame of data to be encoded, if the current frame does not obtain the coding token, the message queue corresponding to the current frame is cleared so that when the next frame arrives, the token management module 410 is requested to obtain the coding token again, so that there is enough space to process the message sent again requesting to obtain the coding token, thereby improving the message processing efficiency.
[0105] When the data encoding module 420 completes a data encoding, it will transmit the encoded data to the downlink transmission network 430, so that the encoded data can be transmitted to the remote control device (not shown in the figure) through the downlink transmission network 430, so that the remote control device can receive the data encoded based on the precisely controlled target encoding bit rate, improve the accuracy of the data, and maintain the smoothness of the image.
[0106] In some embodiments, a Video Multi-method Assessment Fusion (VMAF) tool may be used to evaluate the encoding bitrate based on a variety of different parameters, thereby obtaining an encoding bitrate that matches the current available bandwidth.
[0107] The VMAF tool is a tool built based on machine learning. For example, the average bit rate of the reference bit stream is set to 8Mbps, the upper limit of the encoding bit rate corresponding to each test sample data is 2Mbps, and the average encoding bit rate is 1.5Mbps. Based on the above set parameters, the VMAF tool is used to evaluate the encoding bit rate, and the following can be obtained: Figure 5 Initial data shown.
[0108] Figure 5 A schematic diagram showing the initial data displayed in the VMAF tool provided in the embodiment of the present application is shown. Figure 5 As shown, Rcmode indicates the rate control mode; GopLength indicates the length of the group of pictures (Group Of Picture, GOP); EncodePreset indicates the encoding preset mode; MaxBitrate indicates the maximum bit rate; and Target Quality indicates the target quality.
[0109] ConstQpI is a keyword representing the Quality Performance Indicator (QPI); ConstQpP is a keyword representing the Quality Program Provision (QpP); and ConstQpB is a keyword representing the Quality Program Baseline (QpB).
[0110] EnableMaxQp indicates the maximum quality assurance value that can be achieved; MaxQpI indicates the maximum value of QpI; MaxQpP indicates the maximum value of QpP; MaxQpB indicates the maximum value of QpB.
[0111] EnableMinQp indicates the minimum quality assurance value that can be achieved; MinQpI indicates the minimum value of QpI; MinQpP indicates the minimum value of QpP; MinQpB indicates the minimum value of QpB.
[0112] Among them, in the process of processing and analyzing the encoded data by the VMAF tool, the VMAF average score value calculated by the VMAF tool based on the above-mentioned various parameters can be obtained, as well as the VMAF harmonic average score obtained after adjustment by the VMAF tool.
[0113] The VMAF average score value can reflect the demand score in different usage scenarios, so as to determine the encoding bitrate that needs to be set in different usage scenarios based on different VMAF average score values, and the encoding bitrate in different scenarios is calculated based on the "difference between the maximum bitrate and the bitrate upper limit" in Table 5.
[0114] In some embodiments, data with a VMAF average score greater than 60 points indicates that the current network is in good condition and can provide sufficient bandwidth for encoding the data to be encoded; while data with a VMAF average score less than 60 points indicates that the current network is in poor condition and the encoding bit rate needs to be adjusted to adapt to the transmission requirements in weak network scenarios.
[0115] Figure 6 A schematic diagram showing further adjusted data displayed in the VMAF tool provided in an embodiment of the present application is shown. Figure 6 As shown, Figure 6 The last line of data in (i.e., data in bold and italic font) can support data transmission in a weak network scenario.
[0116] Furthermore, the VMAF tool is continued to be used to adjust various parameters in different dimensions, so that adjustment parameters corresponding to different image sharpness can be obtained. Figure 7 A schematic diagram showing multiple sets of experimental data displayed in the VMAF tool provided in the embodiment of the present application. Figure 7 As shown, “subjective clarity” refers to the clarity of an image corresponding to encoded data obtained by encoding the data to be encoded using a target encoding bit rate.
[0117] The first three rows are the "control group", that is, when bandwidth resources are sufficient, the theoretical encoding bit rate (that is, BitRate is 2Mbps, and the theoretical maximum encoding bit rate (MaxBitRate) is 3Mbps) is used for evaluation, and the actual maximum encoding bit rate is 2.4303Mbps, while the actual encoding bit rate is 1.6900Mbps. At this time, it is determined that the user's "subjective clarity" is clear and definite.
[0118] When the theoretical encoding bit rate changes (that is, the BitRate is 2Mbps, and the theoretical maximum encoding bit rate is 2Mbps), the VMAF tool is used for evaluation again, and the actual maximum encoding bit rate is 2.4918Mbps, while the actual encoding bit rate is 1.6756Mbps. At this time, the user's "subjective clarity" is determined to be "clear".
[0119] By analogy, we continue to calculate the theoretical encoding rate (i.e., Figure 7 By adjusting the BitRate and MaxBitRate shown in the figure, the actual encoding bit rate (i.e., Figure 7 The “actual BitRate” and “actual MaxBitRate” shown in the figure), as well as the user’s “subjective clarity” corresponding to each different actual encoding bit rate.
[0120] Figure 7 The data in bold and italic are the test data corresponding to the best encoding bit rate in different test scenarios.
[0121] Depend on Figure 7 It can be seen that if only the encoder's own adjustment mechanism is used, the picture clarity cannot be guaranteed when the encoding bit rate is lower than 0.75Mbps, and the measured VMAF average score will drop below 60 (e.g. Figure 7 The VMAF average score shown is 58.415668). At this time, the encoder's own adjustment mechanism can no longer be used to adjust the encoding bit rate. It is necessary to detect the current available bandwidth in real time based on the actual application scenario, select a target encoding bit rate suitable for the current available bandwidth from the preset encoding gear list, and further, compare the first encoding bit rate corresponding to the current available bandwidth and the second encoding bit rate corresponding to the available bandwidth obtained last time with the preset encoding interval respectively; when it is determined that the second encoding bit rate is within the preset bit rate interval and the first encoding bit rate is outside the preset bit rate interval, adjust the image resolution corresponding to the current available bandwidth to obtain the adjusted image resolution; according to the adjusted image resolution, select a second preset encoding bit rate from multiple preset encoding bit rates as the target encoding bit rate, wherein the second encoding bit rate is the bit rate corresponding to the adjusted image resolution.
[0122] Due to the environmental complexity of different application scenarios, the first encoding bit rate corresponding to the current available bandwidth and the second encoding bit rate corresponding to the available bandwidth obtained last time are compared with the preset encoding interval. In the process of changes in the available bandwidth of the network, the changes between the encoding bit rates corresponding to different available bandwidths and the preset encoding interval can be known, so as to adjust the resolution of the image, and select the second preset encoding bit rate corresponding to the adjusted image resolution from multiple preset encoding bit rates based on the image resolution as the target encoding bit rate, so that the target encoding bit rate can better meet the encoding requirements of the image and improve the clarity of the image corresponding to the encoded data.
[0123] For example, when the current available bandwidth is less than 0.75MB, the encoding bitrate can be switched from 1.2Mbps to 1Mbps; further, according to the current available bandwidth determined by the actual network status fed back by QoE, the encoding bitrate can be reduced to 0.88MBbps. This ensures that the adjusted encoding bitrate is suitable for the current data to be encoded and minimizes the degradation of the image quality of the encoded data caused by network jitter.
[0124] Through the above-mentioned different data encoding methods in the embodiments of the present application, the encoding bit rate can be controlled more accurately, flexible control of the encoded data and its corresponding picture quality can be achieved, and the final image quality can be improved to meet the user's usage needs.
[0125] Moreover, the above-mentioned different data encoding methods and data transmission methods in the embodiments of the present application can dynamically adjust the encoding bit rate for the image data collected in a smart port, which can not only dynamically adapt to different network available bandwidths, but also ensure the clarity of the image corresponding to the encoded data, thereby enabling the video images collected in real time in the smart port to be clearly and smoothly displayed to users, thereby improving the user experience.
[0126] For an important remote video conference conducted in a weak network environment, it can also make the video stream data in the remote video conference clear and smooth, reducing the occurrence of screen freezes or even screen distortion.
[0127] Figure 8 FIG. 1 is a block diagram showing the composition of a data encoding device provided in an embodiment of the present application. Figure 8 As shown, the data encoding device 500 includes but is not limited to the following modules.
[0128] The detection module 801 is configured to detect the current available bandwidth in real time, and select a target encoding bit rate from a preset encoding gear list based on the current available bandwidth.
[0129] The first acquisition module 802 is configured to acquire a coding token in a message-triggered manner, where the coding token represents the coding authority.
[0130] The encoding module 803 is configured to encode the data to be encoded using a target encoding bit rate when it is determined that a coding token is obtained.
[0131] It should be noted that the data encoding device 800 in this embodiment can implement any data encoding method in the embodiments of the present application.
[0132] According to the data encoding device of the embodiment of the present application, the current available bandwidth is detected in real time through the detection module, and the network bandwidth that can be used for data encoding is clearly determined, so as to facilitate dynamic encoding of data; as the current available bandwidth changes, the target encoding bit rate suitable for the current available bandwidth is dynamically selected from the preset encoding gear list, so as to facilitate real-time adjustment of the encoding bit rate and accurately control the encoding bit rate; the first acquisition module is used to obtain the encoding token in a message-triggered manner, and the encoding token represents the encoding authority to reduce the impact of the delay generated during the encoding process; the encoding module is used to encode the data to be encoded using the target encoding bit rate when it is determined that the encoding token has been obtained, so as to effectively control the encoding speed so that the encoded data can be suitable for the transmission requirements of the current available bandwidth, so that the encoded data can be clearer and the fluency of the encoded image can be maintained.
[0133] Fig. 9 FIG. 1 is a block diagram showing the composition of a data transmission device provided in an embodiment of the present application. Fig. 9 As shown, the data transmission device 600 includes but is not limited to the following modules.
[0134] The second acquisition module 901 is configured to adopt any data encoding method in the embodiments of the present application to obtain encoded data.
[0135] The encoded data is data obtained by encoding the data to be encoded using a target encoding bit rate.
[0136] The transmission module 902 is configured to transmit the encoded data to the downlink transmission network based on the transmission frame rate, so that the downlink transmission network transmits the encoded data to the remote control device.
[0137] It should be noted that the data transmission device 900 in this embodiment can implement any data transmission method in the embodiments of the present application.
[0138] According to the data transmission device of the embodiment of the present application, any one of the data encoding methods in the embodiment of the present application is adopted through the second acquisition module to obtain encoded data, and the encoded data is data obtained by encoding the data to be encoded using a target encoding code rate, wherein the target encoding code rate is a code rate selected from a preset encoding gear list based on the current available bandwidth detected in real time, which can make the target encoding code rate more matched with the current available bandwidth; the transmission module is used to transmit the encoded data to a downlink transmission network based on the transmission frame rate, so that the downlink transmission network can stably transmit the encoded data to the remote control device, so that the remote control device can receive the data encoded based on the precisely controlled target encoding code rate, thereby improving the accuracy of the data and maintaining the smoothness of the image.
[0139] It should be clear that the present application is not limited to the specific configurations and processes described in the above embodiments and shown in the figures. For the convenience and brevity of description, a detailed description of the known methods is omitted here, and the specific working processes of the systems, modules and units described above can refer to the corresponding processes in the aforementioned method embodiments, which will not be repeated here.
[0140] Fig.10 The electronic device provided by the embodiment of the present application is shown. Fig.10 As shown, the electronic device 1000 includes an input device 1001, an input interface 1002, a central processing unit 1003, a memory 1004, an output interface 1005, and an output device 1006. The input interface 1002, the central processing unit 1003, the memory 1004, and the output interface 1005 are connected to each other via a bus 1007, and the input device 1001 and the output device 1006 are connected to the bus 1007 via the input interface 1002 and the output interface 1005, respectively, and then connected to other components of the electronic device 1000.
[0141] Specifically, the input device 1001 receives input information from the outside and transmits the input information to the central processing unit 1003 through the input interface 1002; the central processing unit 1003 processes the input information based on the computer executable instructions stored in the memory 1004 to generate output information, temporarily or permanently stores the output information in the memory 1004, and then transmits the output information to the output device 1006 through the output interface 1005; the output device 1006 outputs the output information to the outside of the electronic device 1000 for user use.
[0142] In one embodiment, Fig.10 The electronic device shown may include: a memory configured to store a program; and a processor configured to run the program stored in the memory to execute the data encoding method or the data transmission method described in the above embodiments.
[0143] In one embodiment, Fig.10 The electronic device shown can be implemented as a data processing system, which may include: a memory configured to store a program; a processor configured to run the program stored in the memory to execute the data encoding method or data transmission method described in the above embodiments.
[0144] The above is only an exemplary embodiment of the present application and is not intended to limit the scope of protection of the present application. In general, various embodiments of the present application can be implemented in hardware or special circuits, software, logic or any combination thereof. For example, some aspects can be implemented in hardware, while other aspects can be implemented in firmware or software that can be executed by a controller, a microprocessor or other computing device, although the present application is not limited thereto.
[0145] Embodiments of the present application may be implemented by a processor executing computer program instructions, such as in a processor entity, or by hardware, or by a combination of software and hardware. The computer program instructions may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-dependent instructions, microcode, firmware instructions, state setting data, or source code or object code written in any combination of one or more programming languages.
[0146] The block diagram of any logic flow in the accompanying drawings of the present application can represent program steps, or can represent interconnected logic circuits, modules and functions, or can represent a combination of program steps and logic circuits, modules and functions. The computer program can be stored on a memory. The memory can have any type suitable for the local technical environment and can be implemented using any suitable data storage technology, such as but not limited to read-only memory (ROM), random access memory (RAM), optical memory device and system (digital versatile disc DVD or CD disc), etc. Computer-readable media may include non-transient storage media. The processor can be any type suitable for the local technical environment, such as but not limited to a general-purpose computer, a special-purpose computer, a microprocessor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a programmable logic device (FGPA) and a processor based on a multi-core processor architecture.
[0147] By way of exemplary and non-limiting examples, a detailed description of exemplary embodiments of the present application has been provided above. However, various modifications and adjustments to the above embodiments will be apparent to those skilled in the art when considered in conjunction with the accompanying drawings and claims, but will not depart from the scope of the present application. Therefore, the proper scope of the present application will be determined according to the claims.
Claims
1. A data encoding method, characterized in that: The method comprises: Detecting the current available bandwidth in real time, and selecting a target encoding bit rate from a preset encoding gear list based on the current available bandwidth; Obtaining a coding token in a message-triggered manner, wherein the coding token indicates that the user has coding authority; When it is determined that the encoding token is obtained, the target encoding code rate is used to encode the data to be encoded.
2. The method according to claim 1, characterized in that The method of obtaining the encoding token in a message-triggered manner includes: Determine the encoding trigger frequency according to the transmission frame rate of the uplink data stream; Sending a token request message to a token management module according to the coding trigger frequency; In response to the token request response fed back by the token management module, the encoding token is acquired, where the encoding token is one of a plurality of encoding tokens generated based on a transmission frame rate of data transmitted over a downlink transmission network.
3. The method according to claim 1, characterized in that The real-time detection of the current available bandwidth includes: Real-time detection of current network bandwidth; According to the preset bandwidth range determined by the maximum preset bandwidth and the minimum preset bandwidth, dividing the current available bandwidth from the current network bandwidth; The minimum preset bandwidth is a bandwidth determined based on the maximum preset bandwidth, the redundant bandwidth supported by the current network, and the network delay information that can be introduced by the current network.
4. The method according to claim 3, characterized in that The preset encoding gear list includes a plurality of preset encoding bit rates; and selecting a target encoding bit rate from the preset encoding gear list based on the current available bandwidth includes: When it is determined that the current available bandwidth is lower than the minimum preset bandwidth, the target encoding bit rate is obtained by selecting from the multiple preset encoding bit rates according to the influence degree of the current available bandwidth on the picture quality corresponding to the decoded data; or, according to the encoding bit rate change information, the target encoding bit rate is obtained by selecting from the multiple preset encoding bit rates; The encoding bit rate change information is change information between the first encoding bit rate corresponding to the current available bandwidth and the second encoding bit rate corresponding to the available bandwidth obtained last time.
5. The method according to claim 4, characterized in that The step of selecting the target encoding bit rate from the plurality of preset encoding bit rates according to the degree of influence of the current available bandwidth on the picture quality corresponding to the decoded data comprises: A first preset encoding bit rate among the multiple preset encoding bit rates is selected as the target encoding bit rate, wherein the first preset encoding bit rate is used to reduce a bit rate corresponding to image brightness and / or image chrominance corresponding to the decoded data.
6. The method according to claim 4, characterized in that Each of the preset encoding bit rates corresponds to a preset image resolution; The step of selecting the target encoding rate from the plurality of preset encoding rates according to the encoding rate change information includes: Comparing respectively the first encoding bit rate corresponding to the current available bandwidth and the second encoding bit rate corresponding to the available bandwidth obtained last time with the preset encoding interval; When it is determined that the second encoding bit rate is within a preset bit rate range and the first encoding bit rate is outside the preset bit rate range, adjusting the image resolution corresponding to the current available bandwidth to obtain an adjusted image resolution; According to the adjusted image resolution, a second preset encoding bit rate among the plurality of preset encoding bit rates is selected as the target encoding bit rate, and the second encoding bit rate is a bit rate corresponding to the adjusted image resolution.
7. The method according to claim 3, characterized in that Before encoding the data to be encoded using the target encoding bit rate, the method further includes: In a case where it is determined that the current available bandwidth is lower than the minimum preset bandwidth, determining a variation range of the encoding frame rate according to the current available bandwidth; The target encoding frame rate is adaptively updated within a variation range of the encoding frame rate.
8. The method according to any one of claims 1 to 7, characterized in that The data to be encoded includes a frame of image data, which is data collected by a video acquisition device and needs to be transmitted to a remote control device. The target encoding bit rate is used to encode the frame of image data.
9. The method according to any one of claims 1 to 7, characterized in that In the case of determining that the encoding token is obtained, before encoding the data to be encoded using the target encoding rate, the method further includes: If the encoding token is not obtained in the current frame, request to obtain the encoding token again in the next frame; The data to be encoded is data collected by a video acquisition device and needs to be transmitted to a remote control device.
10. A data transmission method, characterized in that: The method comprises: Using the data encoding method according to any one of claims 1 to 9 to obtain encoded data, wherein the encoded data is data obtained by encoding the data to be encoded using a target encoding bit rate; Based on the transmission frame rate, the encoded data is transmitted to a downlink transmission network, so that the downlink transmission network transmits the encoded data to a remote control device.
11. An electronic device, characterized in that: include: one or more processors; A memory having one or more programs stored thereon, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the data encoding method as described in any one of claims 1 to 9, or the data transmission method as described in claim 10.
12. A readable storage medium, characterized in that: The readable storage medium stores a computer program, and when the computer program is executed by a processor, the data encoding method according to any one of claims 1 to 9, or the data transmission method according to claim 10 is implemented.