Data coding method and system, electronic equipment and computer program product
Patent Information
- Application Number
- CN202511603182.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-04
- Publication Date
- 2025-12-09
AI Technical Summary
Under high-load scenarios, existing video encoding technologies suffer from insufficient computing power at the encoding end, leading to frame rate drops and a surge in latency, which cannot meet the quality and reliability requirements of real-time interaction. Furthermore, existing adaptive bitrate and computation offloading schemes suffer from resource waste and synchronization delay issues.
Based on the status parameters of the encoding terminal, the task sharing requirements are determined, and the encoding tasks are divided into local and remote tasks. Cloud resources are used for collaborative encoding processing to optimize the encoding effect. In this way, data is combined to optimize resource waste and synchronization delay.
It reduces network resource waste and synchronization delay, meets the low latency requirements of real-time communication, and is suitable for a variety of complex and ever-changing application scenarios.
Smart Images

Figure CN121099042A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data processing technology, and more specifically, to a data encoding method, system, electronic device, and computer program product. Background Technology
[0002] With the widespread adoption of 4K / 8K ultra-high-definition video, high frame rates, and immersive audio-visual applications, efficient video coding technologies (HEVC, AV1, VVC) have become indispensable. However, the pursuit of high compression rates in coding algorithms has led to an exponential increase in computational complexity. At the same time, mobile smart terminals and IoT devices, as the main audio-visual acquisition ends, have inherent bottlenecks in computing power, heat dissipation, and battery capacity. This contradiction results in edge devices being prone to frame rate drops and latency spikes under high-load coding scenarios due to computing power exhaustion or overheating, severely damaging the quality and reliability of real-time interactive experiences.
[0003] Currently, existing technologies have made numerous attempts to solve the above problems, but all have significant limitations. The mainstream Adaptive Bitrate (ABR) technology only focuses on dynamically adjusting video parameters, such as resolution and bitrate, based on network bandwidth fluctuations. This is a passive, externally driven adaptive mechanism, and its fundamental flaw lies in completely ignoring the internal state of the encoding end itself. When network bandwidth is sufficient but terminal computing power is exhausted, it cannot output high-quality video that matches the bandwidth, resulting in idle and wasted network resources. On the other hand, existing computational offloading schemes mostly adopt coarse-grained task partitioning, such as offloading the encoding task of an entire frame or GOP (group of images) to the cloud. Although this scheme reduces the load on the end side, it generates huge network transmission overhead (requiring the uploading of raw pixel data) and synchronization latency, which cannot meet the low-latency requirements of real-time communication. Therefore, under the complex and ever-changing network environment and the stringent constraints of end-side computing resources, some video encoding processing methods have poor processing effects and cannot meet the application requirements of various scenarios. Summary of the Invention
[0004] In view of this, the purpose of this application is to provide a data encoding method, system, electronic device and computer program product to improve the problem of poor encoding processing effect in the prior art.
[0005] To address the aforementioned problems, in a first aspect, embodiments of this application provide a data encoding method, which is applied to an encoding terminal, and the method includes: Based on the status parameters of the encoding terminal, determine whether the encoding terminal has a task sharing requirement; If it is determined that the encoding terminal has the task sharing requirement, then the encoding tasks of the encoding terminal are classified into local tasks and remote tasks. Based on the local task, local data is obtained through encoding processing. Send the remote task to the cloud connected to the encoding terminal and receive remote data sent by the cloud based on the remote task; The local data and the remote data are assembled to obtain encoded data.
[0006] In the above implementation process, the actual load status of the encoding terminal can be determined based on its status parameters. This allows for assessment of whether task sharing is required. When task sharing is necessary, the encoding terminal can classify the encoding tasks to be executed into local tasks executed by the terminal itself and remote tasks executed by the cloud (which communicates with the terminal). The remote tasks are sent to the cloud, where the encoding terminal executes its local tasks to obtain local data, while the cloud executes the remote tasks to obtain remote data. The encoding terminal then assembles and processes the local and received remote data to obtain the final encoded data. This method allows for the classification and processing of encoding tasks based on the actual situation of the encoding terminal, optimizing data encoding performance, reducing network resource waste, network transmission overhead, and synchronization latency, meeting the low-latency requirements of real-time communication, and is suitable for various complex and ever-changing application scenarios.
[0007] Optionally, determining whether the encoding terminal has a task sharing requirement based on the status parameters of the encoding terminal includes: Determine the status parameters of the encoding terminal; wherein the status parameters include device status parameters and network status parameters; Based on the device status parameters and the network status parameters, determine whether the encoding terminal has the task sharing requirement.
[0008] In the above implementation process, device status parameters characterizing the state of the encoding terminal equipment and network status parameters characterizing the current actual network situation of the encoding terminal can be determined. From both device and network status perspectives, the actual load status of the encoding terminal can be determined based on these status parameters. This allows for assessment of whether the encoding terminal has a corresponding task-sharing requirement for the currently pending encoding task, i.e., whether the encoding terminal can independently complete high-quality encoding work. The ability to determine whether the encoding terminal has a task-sharing requirement based on its device and network conditions improves the accuracy and effectiveness of the judgment, thereby improving the encoding effect of executing the encoding task based on the judgment result.
[0009] Optionally, determining the state parameters of the encoding terminal includes: The hardware status of the encoding terminal is monitored to obtain the device status parameters; wherein, the device status parameters include at least one of processor utilization, temperature, and power consumption current; The network status of the encoding terminal is monitored to obtain the network status parameters; wherein, the network status parameters include: available bandwidth.
[0010] In the above implementation process, the encoding terminal can detect its own hardware status, obtaining device status parameters such as processor utilization, temperature, power consumption, and current, which characterize the device's condition. The encoding terminal can also detect the current network status, obtaining network status parameters such as available bandwidth, which characterize network communication. The encoding terminal's ability to self-test multiple types of status parameters effectively improves the accuracy of these parameters, thereby enhancing the accuracy of determining whether task sharing requirements exist.
[0011] Optionally, determining whether the encoding terminal has the task sharing requirement based on the device status parameters and the network status parameters includes: Based on preset parameter thresholds and time thresholds, and in conjunction with the device status parameters, determine whether the encoding terminal has the task sharing requirement; Based on the device status parameters, the encoding output bitrate of the encoding terminal is determined, and based on the encoding output bitrate and the network status parameters, it is determined whether the encoding terminal has the task sharing requirement. If the first duration of any device status parameter being greater than or equal to the corresponding parameter threshold is greater than or equal to the time threshold, or if the ratio of the available bandwidth to the encoded output bitrate in the network status parameters is greater than or equal to a preset ratio, then it is determined that the encoding terminal has the task sharing requirement.
[0012] In the above implementation process, to determine whether a task-sharing requirement exists, corresponding parameter thresholds and time thresholds can be preset based on the historical data of the device terminal. These thresholds, combined with device status parameters, allow for a determination of whether the encoding terminal has a task-sharing requirement from the perspective of device status. Furthermore, the actual achievable encoding output bitrate of the encoding terminal can be determined based on the device status parameters. This allows for a determination of whether the encoding terminal has a task-sharing requirement from the perspective of network transmission based on the encoding output bitrate and network status parameters. If the duration for which any device status parameter is greater than or equal to its corresponding parameter threshold is greater than or equal to a time threshold, or if the ratio of available bandwidth to encoding output bitrate in the network status parameters is greater than or equal to a preset ratio, it indicates that the encoding terminal's current computing power is insufficient or there is a resource computing bottleneck, preventing full utilization of available bandwidth. In other words, the encoding terminal's current actual state is poor, resulting in poor encoding performance when completing the encoding task independently. Therefore, it is determined that the encoding terminal has the aforementioned task-sharing requirement. Determining the actual state of the encoding terminal based on the actual status parameters effectively improves the accuracy of determining whether a task-sharing requirement exists.
[0013] Optionally, classifying the encoding tasks of the encoding terminal into local tasks and remote tasks includes: Based on the benefit evaluation function of task execution, the benefit value of each coded task is determined; If the benefit value is determined to be greater than the preset benefit threshold, then the coding task is determined to be the remote task; If the benefit value is determined to be less than or equal to the benefit threshold, then the encoding task is determined to be the local task.
[0014] In the above implementation process, the encoding terminal can determine the benefit value of executing the encoding task based on the benefit evaluation function. If the benefit value is greater than a preset benefit threshold, it indicates that the encoding terminal's encoding effect for the task is poor and the benefit is low. In this case, the encoding task can be classified as a remote task and processed by the cloud. If the benefit value is less than or equal to the preset benefit threshold, it indicates that the encoding terminal's encoding effect for the task is good and the benefit is high. In this case, the encoding task can be classified as a local task and processed by the encoding terminal itself. This allows encoding tasks to be classified according to their actual benefit, thus determining two types of tasks to be processed by different terminal devices. By having other devices share the remote tasks of the encoding terminal, the encoding effect is effectively improved.
[0015] Optionally, the benefit evaluation function is: ; in, The benefit value is... The first computational resource cost consumed by the encoding task in the encoding terminal. The second computational resource cost consumed by executing the encoding task in the cloud. The amount of input data uploaded from the encoding terminal to the cloud to perform the encoding task. The output data returned from the cloud to the encoding terminal after the encoding task is completed, B is the current available bandwidth, and R is the network round-trip latency.
[0016] In the above implementation process, the benefit evaluation function can be formed by combining various data such as the cost of computing resources consumed in the encoding terminal and the cloud during task execution, the amount of data transmitted, available bandwidth, and network round-trip latency. It can calculate the corresponding benefit value based on the benefit evaluation function, so as to effectively classify the encoding task.
[0017] Optionally, the encoding process based on the local task to obtain local data includes: Reference data is extracted from the local cache, and the motion vector residual is calculated by combining it with the current pixel information of the local task to determine the compensation data; Based on the residual data of the compensated data and the original data, a change quantization operation is performed to obtain the arranged quantized value data; The quantized data and encoding control information are input into the encoder for compression encoding to obtain the local data.
[0018] In the above implementation process, when processing local tasks, the encoding terminal can extract the preceding frame of the local task from the local cache as reference data, calculate the motion vector residual by combining it with the current pixel information of the local task, determine the compensation data, and perform a transformation quantization operation based on the residual data of the compensation data and the original data to obtain the arranged quantized value data. The quantized value data and encoding control information are then input into the encoder set in the encoding terminal for compression encoding processing to obtain the corresponding local data. This allows for motion compensation, transformation quantization, and encoding processing to be performed in the encoding terminal, effectively improving the encoding quality of the local data.
[0019] Optionally, sending the remote task to the cloud connected to the encoding terminal includes: The first identity information of the remote task is determined; wherein the first identity information includes a first local timestamp and / or first identification information; Send the remote task and the first identity information associated with the remote task to the cloud.
[0020] In the above implementation process, considering that the encoding terminal may send multiple remote tasks to the cloud connected to the communication connection, in order to differentiate and process each remote task and reduce the adverse effects of subsequent assembly errors, the encoding terminal can determine the corresponding first local timestamp and / or first identification information as the first identity information of the remote task, and then send the remote task and the first identity information associated with the remote task to the cloud. This allows for the identification of each remote task through the first identity information, thus distinguishing multiple remote tasks and effectively improving the targeting of the processing flow for each remote task.
[0021] Optionally, the assembly process of the local data and the remote data to obtain coded data includes: Determine the second identity information of the local data; wherein the second identity information includes a second local timestamp and / or second identification information; Based on the first identity information and the second identity information associated with the remote data, the local data and the remote data are assembled to obtain the encoded data.
[0022] In the above implementation process, when assembling local and remote data, the encoding terminal can determine the second local timestamp and / or second identifier information of the local data as the second identity information of the local data. Using the second identity information of the local data and the first identity information associated with the remote data, the local and remote data are interleaved and assembled to obtain complete encoded data. This ability to assemble data encoded by different devices based on identity information effectively improves the integrity of the encoded data and reduces the adverse effects of abnormal data splicing.
[0023] Secondly, embodiments of this application also provide a data encoding system, the system comprising: an encoding terminal and a cloud; The encoding terminal is connected to the cloud for communication. The encoding terminal is used to: determine whether the encoding terminal has a task sharing requirement based on the status parameters of the encoding terminal; if it is determined that the encoding terminal has a task sharing requirement, classify the encoding task of the encoding terminal into local tasks and remote tasks; perform encoding processing based on the local tasks to obtain local data; and send the remote tasks to the cloud. The cloud is used to: receive the remote task sent by the encoding terminal, perform encoding processing based on the remote task to obtain remote data, and send the remote data to the encoding terminal; The encoding terminal is also used to: receive the remote data sent from the cloud; and assemble the local data and the remote data to obtain encoded data.
[0024] In the above implementation process, the encoding terminal can determine its actual load status based on its own status parameters, and then determine whether there is a need for task sharing based on the actual load status. When task sharing is required, the encoding terminal can classify the encoding tasks to be executed into local tasks executed by the encoding terminal and remote tasks executed by the cloud that communicates with the encoding terminal. The remote tasks are sent to the cloud, so that the encoding terminal itself executes the local tasks and obtains the corresponding local data, and the cloud executes the remote tasks and obtains the corresponding remote data. The encoding terminal assembles and processes the local data and the received remote data to obtain the final encoded data.
[0025] Thirdly, embodiments of this application also provide an electronic device, which includes a memory and a processor. The memory stores program instructions, and when the processor executes the program instructions, it performs the steps of any of the above-described data encoding methods.
[0026] Fourthly, embodiments of this application also provide a computer program product, the computer program product including a computer program / instruction, which, when executed by a processor, implements the steps of any of the above-described data encoding methods.
[0027] In summary, the embodiments of this application provide a data encoding method, system, electronic device, and computer program product, which can classify and process encoding tasks according to the actual situation of the encoding terminal, optimize the encoding effect of data, reduce network resource waste, network transmission overhead and synchronization delay, meet the low latency requirements of real-time communication, and are suitable for a variety of complex and ever-changing application scenarios. Attached Figure Description
[0028] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments of this application will be briefly introduced below. It should be understood that the following drawings only show some embodiments of this application and should not be regarded as a limitation of the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0029] Figure 1 A block diagram illustrating an electronic device provided in an embodiment of this application; Figure 2 A flowchart illustrating a data encoding method provided in an embodiment of this application; Figure 3 A detailed flowchart of step S200 provided for an embodiment of this application; Figure 4 A detailed flowchart of step S210 provided for an embodiment of this application; Figure 5 A detailed flowchart of step S220 provided for an embodiment of this application; Figure 6 A detailed flowchart of step S300 provided for an embodiment of this application; Figure 7 A detailed flowchart of step S400 provided for an embodiment of this application; Figure 8 A detailed flowchart of step S500 provided for an embodiment of this application; Figure 9 A detailed flowchart of step S600 provided for an embodiment of this application; Figure 10 This is a schematic diagram illustrating the operation of a data encoding system provided in an embodiment of this application.
[0030] Icons: 100 - Electronic device; 111 - Memory; 112 - Memory controller; 113 - Processor; 114 - Peripheral interface; 115 - Input / output unit; 116 - Display unit; 710 - Encoding terminal; 720 - Cloud. Detailed Implementation
[0031] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of them. All other embodiments obtained by those skilled in the art based on the embodiments of this application without creative effort are within the scope of protection of the embodiments of this application.
[0032] Existing technologies have made numerous attempts to address issues such as decreased encoding frame rates and surging latency on edge devices, but all have significant limitations. For example, the mainstream Adaptive Bitrate (ABR) technology focuses solely on dynamically adjusting video parameters, such as resolution and bitrate, based on network bandwidth fluctuations. This is a passive, externally driven adaptive mechanism, and its fundamental flaw lies in completely ignoring the encoding end's own internal state. When network bandwidth is sufficient but terminal computing power is exhausted, it cannot output high-quality video that matches the bandwidth, resulting in idle and wasted network resources. On the other hand, existing computational offloading schemes often employ coarse-grained task partitioning, such as offloading the encoding task of an entire frame or GOP (Group of Pictures) to the cloud. While this approach reduces the load on the edge, it generates significant network transmission overhead (requiring the uploading of raw pixel data) and synchronization latency, failing to meet the low-latency requirements of real-time communication. Therefore, under complex and ever-changing network environments and stringent edge computing resource constraints, some video encoding methods produce poor processing results and cannot meet the application needs of various scenarios.
[0033] To address the aforementioned issues, this application provides a data encoding method applied to an encoding terminal. The encoding terminal can be an electronic device with logical computing capabilities, such as a server, personal computer (PC), tablet computer, smartphone, personal digital assistant (PDA), or monitoring equipment. The electronic device is an end-side device capable of encoding processing. It can classify and process encoding tasks according to the actual situation of the encoding terminal, optimize the data encoding effect, reduce network resource waste, network transmission overhead and synchronization delay, meet the low latency requirements of real-time communication, and is suitable for various complex and ever-changing application scenarios.
[0034] Optionally, please refer to Figure 1 , Figure 1 This is a block diagram illustrating an electronic device according to an embodiment of this application. The electronic device 100 may include a memory 111, a memory controller 112, a processor 113, a peripheral interface 114, an input / output unit 115, and a display unit 116. Those skilled in the art will understand that... Figure 1 The structure shown is for illustrative purposes only and does not limit the structure of the electronic device 100. For example, the electronic device 100 may also include components that are more... Figure 1 The more or fewer components shown, or having the same Figure 1 The different configurations shown.
[0035] The aforementioned memory 111, memory controller 112, processor 113, peripheral interface 114, input / output unit 115, and display unit 116 are electrically connected directly or indirectly to each other to achieve data transmission or interaction. For example, these components can be electrically connected to each other through one or more communication buses or signal lines. The aforementioned processor 113 is used to execute executable modules stored in the memory.
[0036] The memory 111 can be, but is not limited to, Random Access Memory (RAM), Read Only Memory (ROM), Programmable Read-Only Memory (PROM), Erasable Programmable Read-Only Memory (EPROM), Electrically Erasable Programmable Read-Only Memory (EEPROM), etc. The memory 111 stores programs. After receiving execution instructions, the processor 113 executes the programs. The methods executed by the electronic device 100 as defined in any embodiment of this application can be applied to the processor 113, or implemented by the processor 113.
[0037] The aforementioned processor 113 may be an integrated circuit chip with signal processing capabilities. The processor 113 may be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), etc.; it may also be a digital signal processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor may be a microprocessor or any conventional processor.
[0038] The peripheral interface 114 described above couples various input / output devices to the processor 113 and the memory 111. In some embodiments, the peripheral interface 114, the processor 113, and the memory controller 112 can be implemented on a single chip. In other instances, they can be implemented on separate chips.
[0039] The input / output unit 115 described above is used to provide user input data. The input / output unit 115 can be, but is not limited to, a mouse and a keyboard.
[0040] The aforementioned display unit 116 provides an interactive interface (e.g., a user interface) between the electronic device 100 and the user, or displays image data for the user's reference. In this embodiment, the display unit can be a liquid crystal display (LCD) or a touch display. If it is a touch display, it can be a capacitive touchscreen or a resistive touchscreen that supports single-point and multi-point touch operations. Supporting single-point and multi-point touch operations means that the touch display can sense touch operations generated simultaneously from one or more locations on the touch display and pass the sensed touch operations to the processor for calculation and processing. In this embodiment, the display unit 116 can display various information such as the execution progress of the encoding task, the status parameters of the encoding terminal, and the finally obtained encoding data.
[0041] The electronic device in this embodiment can be used to execute the various steps in the data encoding methods provided in the embodiments of this application. The implementation process of the data encoding methods is described in detail below through several embodiments.
[0042] Please see Figure 2 , Figure 2 This is a flowchart illustrating a data encoding method provided in an embodiment of this application. The method may include steps S200-S600.
[0043] Step S200: Determine whether the encoding terminal has a task sharing requirement based on the status parameters of the encoding terminal.
[0044] Among them, it is possible to determine the actual load status of the encoding terminal based on the status parameters of the encoding terminal, and thus determine whether the encoding terminal has a task sharing requirement based on the actual load status.
[0045] It should be noted that when it is determined that the encoding terminal has a task sharing requirement, it means that the encoding effect is poor when the encoding terminal processes the encoding task alone. Other terminal devices need to interact with the encoding terminal to share the encoding task and optimize the encoding effect.
[0046] In step S300, if it is determined that the encoding terminal has a task sharing requirement, the encoding tasks of the encoding terminal are classified into local tasks and remote tasks.
[0047] When determining that there is a need for task sharing in the encoding terminal, considering the diversity of the current encoding tasks in the encoding terminal, the encoding tasks to be executed can be classified into local tasks executed by the encoding terminal and remote tasks executed by the cloud that communicates with the encoding terminal.
[0048] Optionally, the specific person responsible for executing the encoding task can be categorized based on the actual task situation, the actual status of the encoding terminal, and the actual status of the cloud.
[0049] Step S400: Encode the data based on the local task to obtain local data.
[0050] The encoding terminal is capable of encoding local tasks to obtain corresponding local data.
[0051] Optionally, the encoding terminal may be equipped with a corresponding encoder, such as an entropy encoder, to perform local tasks and obtain corresponding local data.
[0052] Step S500: Send remote tasks to the cloud connected to the encoding terminal communication connection, and receive remote data sent by the cloud based on the remote tasks.
[0053] The encoding terminal is connected to the corresponding cloud, which provides task sharing for the encoding terminal. The encoding terminal sends the classified remote tasks to the cloud, which encodes the remote tasks to obtain the corresponding remote data and sends it to the encoding terminal for processing.
[0054] Optionally, a corresponding encoder, such as an entropy encoder, can also be set up in the cloud to perform remote tasks and obtain corresponding remote data.
[0055] Step S600: Assemble the local data and remote data to obtain coded data.
[0056] The encoding task can be a related task that encodes audio or video data. Since multiple encoding tasks are related, for example, when encoding a large video, the video can be split into multiple encoding tasks, or multiple consecutive small videos can be combined into a complete video. Therefore, the encoding terminal can assemble local data and received remote data to obtain the final encoded data.
[0057] exist Figure 2 In the illustrated embodiment, encoding tasks can be classified and processed at different ends according to the actual situation of the encoding terminal, thereby optimizing the encoding effect of the data, improving the quality and efficiency of audio and video transmission encoding, reducing network resource waste, network transmission overhead and synchronization delay, meeting the low latency requirements of real-time communication, and being suitable for a variety of complex and ever-changing application scenarios.
[0058] Optionally, please refer to Figure 3 , Figure 3 The following is a detailed flowchart of step S200 provided in an embodiment of this application. Step S200 may include steps S210-S220.
[0059] Step S210: Determine the status parameters of the encoding terminal.
[0060] The status parameters may include device status parameters that characterize the status of the encoding terminal device, and network status parameters that characterize the current actual network situation of the encoding terminal. The encoding terminal can detect its own status to obtain the corresponding status parameters.
[0061] Step S220: Determine whether the encoding terminal has a task sharing requirement based on the device status parameters and network status parameters.
[0062] One approach is to determine the actual load status of the encoding terminal based on status parameters, considering both device status and network status. This helps determine whether the encoding terminal has a corresponding task-sharing requirement for the current encoding task, i.e., whether the encoding terminal can complete high-quality encoding work independently.
[0063] exist Figure 3 In the illustrated embodiment, it is possible to determine whether the encoding terminal has a task sharing requirement based on the device and network conditions of the encoding terminal, thereby improving the accuracy and effectiveness of the judgment and thus improving the encoding effect of executing the encoding task based on the judgment result.
[0064] Optionally, please refer to Figure 4 , Figure 4 The following is a detailed flowchart of step S210 provided in an embodiment of this application. Step S210 may include steps S211-S212.
[0065] Step S211: Monitor the hardware status of the encoding terminal to obtain device status parameters.
[0066] The device status parameters can include one or more parameters that characterize the device status, such as processor utilization, temperature, power consumption, and current. Processor utilization can be CPU utilization, GPU utilization, etc., and the corresponding device status parameters can be determined according to multiple hardware interfaces of the encoding terminal. For example, CPU utilization can be obtained through the process management interface provided by the operating system, reflecting the proportion of CPU currently used by each process. GPU utilization is collected through the interface provided by the graphics card driver, reflecting the load of the graphics processor. Temperature can be the temperature of the processor chip, which is obtained through the temperature sensor built into the encoding terminal. Different types of chips have their own suitable operating temperature range. Power consumption and current can be collected through the power management module and are directly related to the terminal's battery consumption.
[0067] Step S212: Monitor the network status of the encoding terminal to obtain network status parameters.
[0068] Network status parameters can include data that characterizes network communication, such as available bandwidth, network latency, and packet loss rate. Available bandwidth is the maximum data rate that can be transmitted from the encoding terminal to other connected terminals within the network path, assuming an increasing packet loss rate. Network latency is the time required for a data packet to travel from the encoding terminal to another connected terminal and back, usually measured in milliseconds. Packet loss rate is the percentage of data packets lost during data transmission. Network status parameters can be determined through network interfaces. For example, network latency can be detected using the ping command, packet loss rate can be determined through long-term ping tests or using mtr / pathping tests, and available bandwidth can be determined using testing software such as iperf3 installed on the encoding terminal. Available bandwidth can be calculated by measuring the actual amount of data transmitted within a certain time period. Network latency can be measured by sending probe packets and recording the round-trip time, including transmission latency and processing latency. Packet loss rate can be calculated by statistically analyzing the difference between the number of sent data packets and the number of received acknowledgment data packets, reflecting the proportion of data lost during network transmission. All types of status parameters collected can be recorded and stored chronologically for later use.
[0069] exist Figure 4 In the illustrated embodiment, the encoding terminal can perform self-testing on various types of status parameters, effectively improving the accuracy of the status parameters and thus improving the accuracy of judging whether task sharing requirements exist.
[0070] It should be noted that multiple decision-making strategies can be set based on device status parameters and network status parameters to determine whether the encoding terminal has a task-sharing requirement. Optionally, please refer to [link to relevant documentation]. Figure 5 , Figure 5 The following is a detailed flowchart of step S220 provided in an embodiment of this application. Step S220 may include steps S221-S222.
[0071] Step S221: Based on the preset parameter threshold and time threshold, and combined with the device status parameters, determine whether the encoding terminal has a task sharing requirement.
[0072] In order to determine whether there is a need for task sharing, corresponding parameter thresholds and time thresholds can be preset based on the historical data of the device terminal. Combined with the device status parameters, the issue of whether the encoding terminal has a need for task sharing can be determined from the perspective of device status.
[0073] For example, parameter thresholds may include processor utilization thresholds (which may include multiple processor-related thresholds such as CPU utilization threshold and GPU utilization threshold), chip temperature threshold, power consumption current threshold, and other parameter thresholds related to device status parameters. The actual value of the parameter threshold can be set according to the actual situation and needs of the encoding terminal. For example, the processor utilization threshold can be set to 86%. The device status parameters can be compared with the corresponding parameter thresholds to determine whether there is a computing bottleneck in the encoding terminal.
[0074] Step S222: Determine the encoding output bitrate of the encoding terminal based on the device status parameters, and determine whether the encoding terminal has a task sharing requirement based on the encoding output bitrate and network status parameters.
[0075] Furthermore, the actual encoding output bitrate that the encoding terminal can currently achieve can be determined based on the device status parameters. Based on the encoding output bitrate and network status parameters, it can be determined from the perspective of network transmission whether the encoding terminal has a task sharing requirement.
[0076] For example, the encoding terminal can determine the current hardware performance of the encoding terminal based on the device status parameters, thereby calculating the maximum local encoding output bitrate. The encoding output bitrate is then compared with the network status parameters to determine whether there is a resource computing bottleneck and whether the available bandwidth cannot be reused.
[0077] Optionally, if the duration for which any device status parameter is greater than or equal to the corresponding parameter threshold is greater than or equal to the time threshold, it indicates that the current device computing power of the encoding terminal is insufficient. Alternatively, if the ratio of available bandwidth to encoding output bitrate in the network status parameters is greater than or equal to a preset ratio, it indicates that the encoding terminal has a resource computing bottleneck and cannot fully utilize the available bandwidth. If any of the above determination strategies are met, the current actual state of the encoding terminal is poor, and the encoding effect of completing the encoding task alone is poor, that is, it is determined that the encoding terminal has the task sharing requirement.
[0078] Optionally, in order to reduce the misjudgment caused by normal situations where the device status parameters are greater than or equal to the parameter threshold within a very short period of time, an appropriate time threshold can be set according to the actual situation and needs of the encoding terminal, such as 2-5 seconds, so as to detect the situation of the device working under overload for a long time through the time threshold. The preset ratio can also be set according to the actual situation and needs of the encoding terminal, for example, it can be set to 120%.
[0079] For example, if the CPU utilization rate remains above 86% for two consecutive seconds, it indicates that the CPU load is too high and cannot process the encoding task in time. Similarly, if any parameter among GPU utilization rate, chip temperature, or power consumption current continuously exceeds the corresponding threshold for a preset time, it will be determined that there is a computing bottleneck. When the available bandwidth is continuously greater than the encoding output bitrate, and the ratio of available bandwidth to encoding output bitrate is greater than or equal to 120%, it indicates that the computing power of the encoding terminal cannot fully utilize the existing network resources, and there is a resource computing bottleneck.
[0080] It should be noted that if it is determined that the encoding terminal does not currently have a task sharing requirement, then the encoding terminal itself will perform the encoding processing for the currently pending encoding task.
[0081] exist Figure 5 In the illustrated embodiment, the actual state of the encoding terminal can be determined based on the actual state parameters, effectively improving the accuracy of determining whether there is a task sharing requirement.
[0082] Optionally, please refer to Figure 6 , Figure 6 This is a detailed flowchart of step S300 provided in an embodiment of the present application. Step S300 may include steps S310-S330.
[0083] Step S310: Determine the benefit value of each coding task based on the benefit evaluation function of task execution.
[0084] The coding terminal can determine the benefit value of executing the coding task based on the benefit evaluation function of the task execution. The benefit value can characterize the benefit of the coding terminal in executing the coding task, that is, whether the coding terminal can complete the coding task efficiently.
[0085] Step S320: If the benefit value is greater than the preset benefit threshold, then the coding task is determined to be a remote task.
[0086] If the benefit value is greater than the preset benefit threshold, it indicates that the encoding terminal performs poorly in the encoding task and the benefit is low. In this case, the encoding task can be classified as a remote task and processed by the cloud.
[0087] Step S330: If the benefit value is less than or equal to the benefit threshold, then the coding task is determined to be a local task.
[0088] If the benefit value is less than or equal to the preset benefit threshold, it indicates that the encoding terminal performs the encoding task well and the benefit is high. The encoding task can be classified as a local task and processed by the encoding terminal itself.
[0089] It should be noted that the benefit evaluation function can be: ; in, For benefit value, The first computational resource cost consumed by executing the encoding task in the encoding terminal. The second computational resource cost incurred for executing coding tasks in the cloud. The amount of input data uploaded from the encoding terminal to the cloud to perform the encoding task. Let B be the amount of output data returned from the cloud to the encoding terminal after the encoding task is completed, B be the current available bandwidth, and R be the network round-trip latency. The benefit evaluation function can be formed based on a combination of various data, such as the cost of computing resources consumed in the encoding terminal and the cloud during task execution, the amount of data transmitted, available bandwidth, and network round-trip latency. It can calculate the corresponding benefit value based on the benefit evaluation function to effectively classify encoding tasks.
[0090] Optionally, since similar coding tasks exhibit certain regularities in computational resource consumption, the computational resource cost of coding tasks can be accurately estimated through historical data statistics. The first computational resource cost can be estimated by recording the number of CPU cycles consumed in each execution of similar coding tasks running historically on the coding terminal, statistically analyzing this data, and calculating the average value as the estimated first computational resource cost. Correspondingly, since the cloud is usually configured with devices possessing stronger computing capabilities, its second computational resource cost is relatively stable and can be estimated using the cloud's performance parameters and the task's computational complexity. The input data volume can include the total amount of various data, including the original coding data and context parameters necessary for task execution. The output data volume can include the amount of remote data, where B represents the current available bandwidth, i.e., the currently available network bandwidth, which determines the data transmission speed and can be obtained from network device parameters, and R represents the network round-trip latency, affecting the data upload and result return time.
[0091] Optionally, the benefit threshold can be preset according to the actual situation and needs of the encoding terminal, denoted as . ,when When the efficiency of the encoding terminal performing the encoding task is deemed negative, it is classified as a remote task; when When the efficiency of the encoding terminal in performing the encoding task is determined to be positive, it is identified as a local task. Through this decision-making process, the encoding task is reasonably allocated between the local terminal and other terminal device computing nodes, which can make full use of the computing resources of the cloud node and avoid the additional overhead caused by data transmission.
[0092] exist Figure 6In the illustrated embodiment, coding tasks can be classified according to their actual effectiveness, thereby determining two types of tasks to be processed by different terminal devices. Other devices can share the remote tasks of the coding terminal, effectively improving the coding effect.
[0093] Optionally, please refer to Figure 7 , Figure 7 The following is a detailed flowchart of step S400 provided in an embodiment of this application. Step S400 may include steps S410-S430.
[0094] Step S410: Extract reference data from the local cache, calculate the motion vector residual by combining it with the current pixel information of the local task, and determine the compensation data.
[0095] When processing local tasks, the encoding terminal can extract the preceding frame of the local task from the local cache as reference data, calculate the motion vector residual by combining it with the current pixel information of the local task, and determine the compensation data.
[0096] Optionally, during motion compensation, reference data from the preceding frame can be retrieved from the local cache. This reference data, stored during the previous encoding process, contains pixel information and motion vectors of the image. Combined with the pixel information of the current frame in the encoding task, the motion vector residual is calculated. The motion vector residual is the difference between the current frame and the reference frame. Calculating the residual can reduce redundant information in the image. Based on the motion vector residual, a compensated prediction frame is generated as compensation data. The prediction frame can better approximate the image content of the current frame, laying the foundation for subsequent residual calculations.
[0097] Step S420: Perform change quantization operation on the residual data of the compensated data and the original data to obtain the arranged quantized value data.
[0098] Among them, the residual data of the compensated data and the original data can be subjected to change quantization operation to obtain the arranged quantized value data.
[0099] Optionally, after motion compensation is completed, a transform quantization operation can be performed on the predicted frame in the compensated data and the original data, i.e., the residual data in the original frame. The transform operation converts the residual data in the spatial domain to the frequency domain, making the energy of the data more concentrated and easier to compress. The residual coefficients after the transform need to be quantized. The local encoding execution module uses a preset quantization matrix to convert the residual coefficients into quantized values. The quantization process will lose some information, but it can significantly reduce the amount of data. The choice of quantization matrix will affect the encoding quality and compression efficiency. The quantized coefficients can be arranged in an ordered manner by zig-zag scanning. Zig-zag scanning reads the quantized coefficients in a set order, converting the two-dimensional coefficient matrix into a one-dimensional sequence to obtain the arranged quantized value data for subsequent entropy coding.
[0100] Step S430: Input the quantization value data and encoding control information into the encoder for compression encoding processing to obtain local data.
[0101] Specifically, quantized data and encoding control information can be input into the encoder set in the encoding terminal for compression encoding processing to obtain the corresponding local data.
[0102] Optionally, the quantized value data obtained after quantization and the control information in the encoding task can be input into the entropy encoder, and a compressed bit stream segment can be generated using context-adaptive binary arithmetic coding as the output local data. Context-adaptive binary arithmetic coding can dynamically adjust the encoding parameters according to the encoded data, thereby improving the encoding efficiency. The generated compressed bit stream segment contains the effective information after local task processing.
[0103] exist Figure 7 In the illustrated embodiment, dynamic compensation, transform quantization, and encoding processing can be performed at the encoding terminal, effectively improving the encoding quality of local data.
[0104] Optionally, please refer to Figure 8 , Figure 8 This is a detailed flowchart of step S500 provided in an embodiment of the present application. Step S500 may include steps S510-S520.
[0105] Step S510: Determine the primary identity information for the remote mission.
[0106] In order to differentiate and process each remote task and reduce the adverse effects of subsequent assembly errors, the encoding terminal may determine the corresponding first local timestamp and / or first identification information as the first identity information of the remote task in order to reduce the adverse effects of subsequent assembly errors.
[0107] Optionally, the first local timestamp can be the timestamp information of the remote task's generation, determined by the clock of the encoding terminal, and the first marker information can be unique identification information such as a globally unique task sequence number for the remote task. The first local timestamp can mark the generation time of the remote task, and the first marker information can accurately identify and match each remote task in the subsequent data assembly process.
[0108] It should be noted that when multiple remote tasks are generated simultaneously, considering the possibility that multiple first local timestamps may be identical, the first identity information may include both the first local timestamp and the first tag information to separately mark the multiple remote tasks generated at the same time. When multiple remote tasks are generated sequentially, the first identity information may include only the first local timestamp or the first tag information.
[0109] Step S520: Send the remote task and the first identity information associated with the remote task to the cloud.
[0110] In addition, when sending remote tasks to the cloud, the primary identity information associated with the primary task can also be sent to the cloud together, so that the remote data sent back by the cloud contains the corresponding primary identity information.
[0111] Optionally, during the data transmission of remote tasks and primary identity information, the communication module in the encoding terminal can adjust the transmission strategy according to the network status, such as appropriately reducing the transmission rate when the network is congested, to avoid data loss and ensure reliable data transmission.
[0112] It should be noted that after receiving the remote task and primary identity information, the cloud can process the remote task in its simulated lightweight video encoder environment compatible with the encoding terminal version. The remote task package contains the raw encoding data and the context parameters necessary for executing the remote task. The context parameters include relevant information of the preceding frame, the initial settings of the encoding mode, etc. These parameters ensure that the cloud can correctly understand and execute the remote task. Based on the context parameters, the cloud can perform rate-distortion optimization decision calculation and motion search calculation on the raw encoding data. Rate-distortion optimization decision selection selects the optimal encoding parameters to minimize the amount of encoded data while ensuring a certain encoding quality. Motion search calculation finds the motion vector between the current frame and the reference frame to provide a basis for subsequent encoding. After completing the calculation, the cloud generates remote data. The content of the remote data is the calculated encoding decision information, including mode index, motion vector coordinates, auxiliary decision parameters, etc. In order to reduce the amount of data transmission, the remote data and the corresponding primary identity information can be compressed and packaged to keep the amount of remote data below 30% of the original input data, and then transmitted back to the encoding terminal for processing. Before transmission, remote data can be encrypted to ensure its security during transmission and prevent it from being stolen or tampered with.
[0113] exist Figure 8 In the illustrated embodiment, each remote task can be identified using the first identity information to distinguish between multiple remote tasks, effectively improving the targeting of each remote task processing flow.
[0114] Optionally, please refer to Figure 9 , Figure 9 The following is a detailed flowchart of step S600 provided in an embodiment of this application. Step S600 may include steps S610-S620.
[0115] Step S610: Determine the second identity information of the local data.
[0116] When assembling local and remote data, the encoding terminal can determine the second local timestamp and / or second identification information of the local data as the second identity information of the local data.
[0117] Optionally, the second local timestamp can be the timestamp information of the local task generation time determined based on the clock of the encoding terminal, and the second tagging information can be unique identification information such as a globally unique task sequence number for the local task. The second local timestamp can mark the generation time of the local task, and the second tagging information can accurately identify and match each local task in the subsequent data assembly process.
[0118] It should be noted that when multiple local tasks are generated simultaneously, considering the possibility that multiple second local timestamps may be identical, the second identity information may include both the second local timestamp and the second tag information to separately mark the multiple local tasks generated at the same time. When multiple local tasks are generated sequentially, the second identity information may include only the second local timestamp or the second tag information.
[0119] Step S620: Based on the first and second identity information associated with the remote data, assemble the local data and the remote data to obtain coded data.
[0120] In this process, local data and remote data can be interwoven and assembled using the second identity information of local data and the first identity information associated with remote data to obtain complete coded data.
[0121] For example, during assembly, the original encoded frame context can be matched based on the task sequence number in the first identity information associated with the remote data. The uniqueness of the task sequence number ensures that each piece of remote data can be accurately matched to its corresponding encoded frame, avoiding matching errors. At the same time, time alignment can be performed based on the first local timestamp and the second local timestamp. After completing the sequence number matching and time alignment, the remote data and local data can be interleaved and inserted into the corresponding positions in the encoded frame queue. The encoded frame queue is arranged according to the display time order of the encoded frames, ensuring that the data can be assembled in the correct order to generate a standard bitstream as encoded data. The standard bitstream conforms to the audio and video transmission specifications and can be correctly decoded and played by the receiving end, ensuring the quality and real-time performance of audio and video transmission.
[0122] exist Figure 9 In the illustrated embodiment, data encoded by different end devices can be assembled and processed according to identity information, which effectively improves the integrity of encoded data and reduces the adverse effects of abnormal data splicing.
[0123] Please see Figure 10 , Figure 10 This is a schematic diagram of the operation of a data encoding system provided in an embodiment of this application. The system may include: an encoding terminal 710 and a cloud 720; The encoding terminal 710 and the cloud 720 are connected for communication. The encoding terminal 710 is used to: determine whether the encoding terminal 710 has a task sharing requirement based on the status parameters of the encoding terminal 710; if it is determined that the encoding terminal 710 has a task sharing requirement, classify the encoding task of the encoding terminal 710 into local tasks and remote tasks; perform encoding processing based on local tasks to obtain local data; and send remote tasks to the cloud 720. The cloud terminal 720 is used to: receive remote tasks sent by the encoding terminal 710, perform encoding processing based on the remote tasks, obtain remote data, and send the remote data back to the encoding terminal 710. The encoding terminal 710 is also used to: receive remote data sent by the cloud 720; and assemble and process local and remote data to obtain encoded data.
[0124] Optionally, the cloud 720 and the encoding terminal 710 can communicate and connect via network, Bluetooth, or other means. The cloud 720 can be set up as a large processing platform such as a server. The cloud 720 can connect to multiple encoding terminals 710 to provide task sharing for multiple encoding terminals 710. The cloud 720 can also be set up as other encoding terminals 710, which can improve the encoding effect through mutual sharing among multiple encoding terminals 710.
[0125] In an optional implementation, the encoding terminal 710 is specifically used to: determine the status parameters of the encoding terminal 710; wherein the status parameters include device status parameters and network status parameters; and determine whether the encoding terminal 710 has a task sharing requirement based on the device status parameters and network status parameters.
[0126] In an optional implementation, the encoding terminal 710 is specifically used to: monitor the hardware status of the encoding terminal 710 to obtain device status parameters; wherein the device status parameters include at least one of processor utilization, temperature, and power consumption current; and monitor the network status of the encoding terminal 710 to obtain network status parameters; wherein the network status parameters include available bandwidth.
[0127] In an optional implementation, the encoding terminal 710 is specifically used to: determine whether the encoding terminal 710 has a task sharing requirement based on preset parameter thresholds and time thresholds, combined with device status parameters; determine the encoding output bitrate of the encoding terminal 710 based on the device status parameters; and determine whether the encoding terminal 710 has a task sharing requirement based on the encoding output bitrate and network status parameters; wherein, if it is determined that the duration for which any device status parameter is greater than or equal to the corresponding parameter threshold is greater than or equal to the time threshold, or if the ratio of available bandwidth to encoding output bitrate in the network status parameters is greater than or equal to a preset ratio, then it is determined that the encoding terminal 710 has a task sharing requirement.
[0128] In an optional implementation, the encoding terminal 710 is specifically used to: determine the benefit value of each encoding task based on the benefit evaluation function of task execution; if the benefit value is determined to be greater than a preset benefit threshold, then the encoding task is determined to be a remote task; if the benefit value is determined to be less than or equal to the benefit threshold, then the encoding task is determined to be a local task.
[0129] In an optional implementation, the benefit evaluation function is: ; in, For benefit value, The first computational resource cost consumed by executing the encoding task in the encoding terminal 710. The second computational resource cost incurred for executing coding tasks in the cloud (720). The amount of input data uploaded from the encoding terminal 710 to the cloud 720 to perform the encoding task. B represents the amount of output data returned from the cloud 720 to the encoding terminal 710 after the encoding task is completed. B is the current available bandwidth, and R is the network round-trip latency.
[0130] In an optional implementation, the encoding terminal 710 is specifically used to: extract reference data from the local cache, calculate the motion vector residual by combining the current pixel information of the local task, and determine the compensation data; perform a change quantization operation based on the residual data of the compensation data and the original data to obtain the arranged quantized value data; and input the quantized value data and encoding control information into the encoder for compression encoding processing to obtain local data.
[0131] In an optional implementation, the encoding terminal 710 is specifically used to: determine the first identity information of the remote task; wherein the first identity information includes a first local timestamp and / or first identification information; and send the remote task and the first identity information associated with the remote task to the cloud 720.
[0132] In an optional implementation, the encoding terminal 710 is specifically used to: determine the second identity information of the local data; wherein the second identity information includes a second local timestamp and / or second identification information; and assemble the local data and the remote data according to the first identity information and the second identity information associated with the remote data to obtain encoded data.
[0133] Since the principle of the system in this embodiment is similar to that of the aforementioned data encoding method, the implementation of the system in this embodiment can refer to the description in the above-mentioned data encoding method embodiment, and the repeated parts will not be repeated.
[0134] In summary, this application enables real-time monitoring of the encoding terminal's status. Combined with multiple decision-making strategies, it accurately identifies whether the encoding terminal requires task sharing. Based on a benefit evaluation function, it quantitatively analyzes the execution cost and network transmission cost of encoding tasks on the encoding terminal and in the cloud, achieving dynamic partitioning of local and remote tasks. Local tasks are handled by the encoding terminal through a pipelined process of motion compensation, transform quantization, and entropy coding to ensure the core encoding flow. Remote tasks are executed in the cloud and then return remote data. Data is assembled using timestamps and sequence numbers to form a complete bitstream, achieving elastic allocation of computing resources and efficient collaboration of the encoding process. While reducing the terminal's computing load, it also reduces the amount of data transmitted over the network, avoiding bandwidth waste. This mechanism leverages the computing power advantages of the cloud while ensuring encoding continuity and efficiency through context parameter passing and data simplification strategies.
[0135] This application also provides a computer program product, which includes a computer program / instruction. When the computer program / instruction is executed by a processor, it implements the steps of any of the above-described data encoding methods.
[0136] In the several embodiments provided in this application, it should be understood that the disclosed device can also be implemented in other ways. The device embodiments described above are merely illustrative; for example, the block diagrams in the accompanying drawings illustrate the possible architecture, functions, and operations of the device according to various embodiments of this application. In this regard, each block in the block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order than those marked in the drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagram, and combinations of block diagrams, can be implemented using a dedicated hardware-based system that performs the specified function or action, or using a combination of dedicated hardware and computer instructions.
[0137] In addition, the functional modules in the various embodiments of this application can be integrated together to form an independent part, or each module can exist independently, or two or more modules can be integrated to form an independent part.
[0138] If the aforementioned functions are implemented as software functional modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0139] The above description is merely an embodiment of this application and is not intended to limit the scope of protection of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of protection of this application. It should be noted that similar reference numerals and letters in the following figures indicate similar items; therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures.
[0140] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any changes or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application.
[0141] It should be noted that, in this document, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising..." does not exclude the presence of additional identical elements in the process, method, article, or apparatus that includes said element.
Claims
1. A data encoding method, characterized in that, The method is applied to an encoding terminal, and the method includes: Based on the status parameters of the encoding terminal, determine whether the encoding terminal has a task sharing requirement; If it is determined that the encoding terminal has the task sharing requirement, then the encoding tasks of the encoding terminal are classified into local tasks and remote tasks. Based on the local task, local data is obtained through encoding processing. Send the remote task to the cloud connected to the encoding terminal and receive remote data sent by the cloud based on the remote task; The local data and the remote data are assembled to obtain encoded data.
2. The method according to claim 1, characterized in that, The step of determining whether the encoding terminal has a task sharing requirement based on the status parameters of the encoding terminal includes: Determine the status parameters of the encoding terminal; wherein the status parameters include device status parameters and network status parameters; Based on the device status parameters and the network status parameters, determine whether the encoding terminal has the task sharing requirement.
3. The method according to claim 2, characterized in that, Determining the state parameters of the encoding terminal includes: The hardware status of the encoding terminal is monitored to obtain the device status parameters; wherein, the device status parameters include at least one of processor utilization, temperature, and power consumption current; The network status of the encoding terminal is monitored to obtain the network status parameters; wherein, the network status parameters include: available bandwidth.
4. The method according to claim 3, characterized in that, The step of determining whether the encoding terminal has the task sharing requirement based on the device status parameters and the network status parameters includes: Based on preset parameter thresholds and time thresholds, and in conjunction with the device status parameters, determine whether the encoding terminal has the task sharing requirement; Based on the device status parameters, the encoding output bitrate of the encoding terminal is determined, and based on the encoding output bitrate and the network status parameters, it is determined whether the encoding terminal has the task sharing requirement. If the duration for which any of the device status parameters is greater than or equal to the corresponding parameter threshold is greater than or equal to the time threshold, or if the ratio of the available bandwidth to the encoded output bitrate in the network status parameters is greater than or equal to a preset ratio, then it is determined that the encoding terminal has the task sharing requirement.
5. The method according to claim 1, characterized in that, The step of classifying the encoding tasks of the encoding terminal into local tasks and remote tasks includes: Based on the benefit evaluation function of task execution, the benefit value of each coded task is determined; If the benefit value is determined to be greater than the preset benefit threshold, then the coding task is determined to be the remote task; If the benefit value is determined to be less than or equal to the benefit threshold, then the encoding task is determined to be the local task.
6. The method according to claim 5, characterized in that, in, The benefit evaluation function is: ; in, The benefit value is... The first computational resource cost consumed by the encoding task in the encoding terminal. The second computational resource cost consumed by executing the encoding task in the cloud. The amount of input data uploaded from the encoding terminal to the cloud to perform the encoding task. The output data returned from the cloud to the encoding terminal after the encoding task is completed, B is the current available bandwidth, and R is the network round-trip latency.
7. The method according to any one of claims 1-6, characterized in that, The encoding process based on the local task to obtain local data includes: Reference data is extracted from the local cache, and the motion vector residual is calculated by combining it with the current pixel information of the local task to determine the compensation data; Based on the residual data of the compensated data and the original data, a change quantization operation is performed to obtain the arranged quantized value data; The quantized data and encoding control information are input into the encoder for compression encoding to obtain the local data.
8. The method according to any one of claims 1-6, characterized in that, Sending the remote task to the cloud connected to the encoding terminal includes: The first identity information of the remote task is determined; wherein the first identity information includes a first local timestamp and / or first identification information; Send the remote task and the first identity information associated with the remote task to the cloud.
9. The method according to claim 8, characterized in that, The assembly process of the local data and the remote data to obtain coded data includes: Determine the second identity information of the local data; wherein the second identity information includes a second local timestamp and / or second identification information; Based on the first identity information and the second identity information associated with the remote data, the local data and the remote data are assembled to obtain the encoded data.
10. A data encoding system, characterized in that, The system includes: an encoding terminal and a cloud platform; The encoding terminal is connected to the cloud for communication. The encoding terminal is used to: determine whether the encoding terminal has a task sharing requirement based on the status parameters of the encoding terminal; if it is determined that the encoding terminal has a task sharing requirement, classify the encoding task of the encoding terminal into local tasks and remote tasks; perform encoding processing based on the local tasks to obtain local data; and send the remote tasks to the cloud. The cloud is used to: receive the remote task sent by the encoding terminal, perform encoding processing based on the remote task to obtain remote data, and send the remote data to the encoding terminal; The encoding terminal is also used to: receive the remote data sent from the cloud; and assemble the local data and the remote data to obtain encoded data.
11. An electronic device, characterized in that, The electronic device includes a memory and a processor. The memory stores program instructions, and when the processor executes the program instructions, it performs the steps of the method according to any one of claims 1-9.
12. A computer program product, characterized in that, The computer program product includes a computer program / instruction that, when executed by a processor, implements the steps of the method according to any one of claims 1-9.