A screen projection data processing method and device, electronic equipment and storage medium
Patent Information
- Application Number
- CN202211022209.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-22
- Publication Date
- 2026-10-30
- Estimated Expiration
- 2042-08-22
AI Technical Summary
[0004]但上述方式,为了保证投屏效果,终端设备的缓存区通过设置固定大小,由于投屏所使用的终端设备不同,并且受网络环境的干扰和影响,可能会使得两个终端设备之间的投屏的实时性不高,影响到投屏的效果,进而影响到用户的使用体验
[0042]本发明实施例提供的投屏数据处理方法,包括:接收第二设备发送的第一帧图像至目标缓存区;当根据第一帧图像确定满足第一预设条件时,更新目标缓存区对应的预设缓存大小;按照预设规则对更新后的预设缓存大小进行处理;在第一预设时长阈值内,根据处理后的预设缓存大小,接收第二设备按照时序序列发送的多个第二帧图像至目标缓存区;确定每个第二帧图像中的花屏子块的第一个数;当根据多个第一个数确定满足第二预设条件时,停止执行按照预设规则对更新后的预设缓存大小进行处理步骤。通过上述方式,本发明实施例通过所接收到的帧图像对应的缓存大小调节缓存区的缓存大小,在保证花屏概率的前提下,提高了设备之间投屏的实时性,进而保证了投屏的效果,提高了用户的使用体验。
Smart Images

Figure CN115826892B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of communication technology, and in particular to a screen projection data processing method, apparatus, electronic device and storage medium. Background Technology
[0002] Screen mirroring technology has been widely used in all aspects of life. By casting the content played on one terminal device to another terminal device for playback, content sharing can be improved.
[0003] Currently, when casting content between two terminal devices, one terminal device typically sends frames of images to the buffer of the other terminal device in a time sequence for caching. The other terminal device then renders the cached frames, thus enabling content casting between the two terminal devices.
[0004] However, in order to ensure the screen mirroring effect, the buffer area of the terminal device is set to a fixed size. Since the terminal devices used for screen mirroring are different and affected by network environment interference, the real-time performance of screen mirroring between the two terminal devices may be low, affecting the screen mirroring effect and thus affecting the user experience. Summary of the Invention
[0005] In view of this, in order to solve the above-mentioned technical problems or some of the technical problems, the present invention provides a screen projection data processing method, apparatus, electronic device and storage medium.
[0006] In a first aspect, embodiments of the present invention provide a screen projection data processing method, applied to a first device, the method comprising:
[0007] Receive the first frame image sent by the second device to the target buffer;
[0008] When it is determined from the first frame image that the first preset condition is met, the preset cache size corresponding to the target cache area is updated;
[0009] The updated preset cache size is processed according to preset rules;
[0010] Within a first preset duration threshold, based on the processed preset buffer size, multiple second frame images sent by the second device in a time sequence are received to the target buffer area;
[0011] Determine the first number of the garbled sub-block in each of the second frame images;
[0012] When it is determined that the second preset condition is met based on multiple first numbers, the step of processing the updated preset cache size according to preset rules is stopped.
[0013] In one possible implementation, updating the preset cache size corresponding to the target cache area when it is determined from the first frame image that the first preset condition is met includes:
[0014] Determine the target buffer size corresponding to the first frame image;
[0015] When the target cache size is greater than the preset cache size, the target cache size is determined to be the preset cache size, so as to complete the update of the preset cache size.
[0016] In one possible implementation, processing the updated preset cache size according to preset rules includes:
[0017] At each second preset time threshold interval, an adjustment operation is performed on the updated preset cache size to obtain the processed preset cache size;
[0018] The operation of adjusting the updated preset cache size includes:
[0019] The updated preset cache size is reduced by a first size threshold.
[0020] In one possible implementation, determining whether the second preset condition is satisfied based on a plurality of the first numbers includes:
[0021] Determine the second number of all sub-blocks in the multiple second frame images;
[0022] Based on the first number and the second number, determine the first screen flicker probability within the first preset duration threshold;
[0023] When the probability of the first screen flickering is less than the first probability threshold, it is determined that the second preset condition is met.
[0024] In one possible implementation, before performing the step of updating the preset cache size corresponding to the target cache area when it is determined from the first frame image that the first preset condition is met, the method further includes:
[0025] Determine the third number of the flowery sub-block in the first frame image and the fourth number of all sub-blocks in the first frame image;
[0026] The probability of the second screen distortion corresponding to the first frame image is determined based on the third and fourth numbers;
[0027] After determining that the second probability of screen distortion is greater than the first probability threshold, the step of updating the preset cache size corresponding to the target cache area when it is determined that the first preset condition is met based on the first frame image is executed.
[0028] In one possible implementation, updating the preset cache size corresponding to the target cache area when it is determined from the first frame image that the first preset condition is met includes:
[0029] When it is determined from the first frame image that the first preset condition is met, a target pop-up window interface is generated, the target pop-up window interface including a first control;
[0030] When a trigger operation is detected on the first control in the target pop-up interface, the preset cache size corresponding to the target cache area is updated.
[0031] In one possible implementation, before performing the step of receiving the first frame image sent by the second device to the target buffer, the method further includes:
[0032] A wireless communication channel is established between the first device and the second device using a preset protocol.
[0033] Secondly, embodiments of the present invention provide a screen projection data processing device, comprising:
[0034] The receiving module is used to receive the first frame image sent by the second device to the target buffer.
[0035] The update module is used to update the preset cache size corresponding to the target cache area when it is determined from the first frame image that the first preset condition is met.
[0036] The processing module is used to process the updated preset cache size according to preset rules;
[0037] The receiving module is further configured to receive, within a first preset duration threshold, multiple second frame images sent by the second device in a time sequence to the target buffer area according to the processed preset buffer size;
[0038] A determining module is used to determine the first number of the distorted sub-blocks in each of the second frame images;
[0039] The stop module is used to stop executing the processing module when it is determined that the second preset condition is met based on multiple first numbers.
[0040] Thirdly, embodiments of the present invention provide an electronic device, including: a processor and a memory, wherein the processor is configured to execute a screen projection data processing program stored in the memory to implement the screen projection data processing method as described above.
[0041] Fourthly, embodiments of the present invention provide a storage medium storing one or more programs, which can be executed by one or more processors to implement the screen projection data processing method described above.
[0042] The screen projection data processing method provided in this embodiment of the invention includes: receiving a first frame image sent by a second device to a target buffer; updating a preset buffer size corresponding to the target buffer when a first preset condition is met based on the first frame image; processing the updated preset buffer size according to a preset rule; within a first preset time threshold, receiving multiple second frame images sent by the second device in a time sequence to the target buffer based on the processed preset buffer size; determining the first number of the distorted sub-blocks in each second frame image; and stopping the step of processing the updated preset buffer size according to the preset rule when a second preset condition is met based on multiple first numbers. Through the above method, this embodiment of the invention adjusts the buffer size of the buffer area by adjusting the buffer size corresponding to the received frame image, thereby improving the real-time performance of screen projection between devices while ensuring the probability of distorted screens, thus guaranteeing the projection effect and improving the user experience. Attached Figure Description
[0043] Figure 1 This is a schematic diagram of the structure of a screen projection system provided in an embodiment of the present invention;
[0044] Figure 2 A flowchart illustrating a screen projection data processing method provided in an embodiment of the present invention;
[0045] Figure 3 This is a schematic diagram of the structure of a screen projection data processing device provided in an embodiment of the present invention;
[0046] Figure 4 A schematic diagram of the structure of an electronic device provided in an embodiment of the present invention;
[0047] In the attached diagrams above:
[0048] 10. Receiving module; 20. Update module; 30. Processing module; 40. Confirmation module; 50. Stop module;
[0049] 100. First equipment; 200. Second equipment;
[0050] 400. Electronic device; 401. Processor; 402. Memory; 4021. Operating system; 4022. Application program; 403. User interface; 404. Network interface; 405. Bus system. Detailed Implementation
[0051] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0052] To facilitate understanding of the embodiments of the present invention, further explanations and descriptions will be provided below with reference to the accompanying drawings and specific embodiments. These embodiments do not constitute a limitation on the embodiments of the present invention.
[0053] refer to Figure 1 , Figure 1 This is a schematic diagram of a screen mirroring system provided in an embodiment of the present invention. The screen mirroring system provided in this embodiment includes a first device 100 and a second device 200, wherein the first device 100 and the second device 200 are located in the same local area network (LAN), which can be a WiFi LAN, a Bluetooth LAN, etc., and the specific form of the LAN can be selected according to actual needs. In this embodiment, the first device 100 can be a smart TV, etc., and the second device 200 can be a mobile phone, a tablet computer, etc. The first device 100 and the second device 200 can be selected according to actual needs. The second device 200 is the screen mirroring party, and the first device 100 is the screen being mirrored to; that is, the second device 200 mirrors its content to the first device 100 for playback. During the screen mirroring process, the second device 200 sends a first frame image to the first device 100. After receiving the first frame image, the first device 100 performs the following steps: receiving the first frame image sent by the second device to the target buffer; when it is determined that the first preset condition is met based on the first frame image, updating the preset buffer size corresponding to the target buffer; processing the updated preset buffer size according to preset rules; within a first preset time threshold, receiving multiple second frame images sent by the second device in a time sequence to the target buffer based on the processed preset buffer size; determining the first number of the screen distortion sub-blocks in each second frame image; when it is determined that the second preset condition is met based on multiple first numbers, stopping the step of processing the updated preset buffer size according to preset rules.
[0054] refer to Figure 2 , Figure 2 This is a flowchart illustrating a screen projection data processing method provided in an embodiment of the present invention. The screen projection data processing method provided in this embodiment of the present invention includes the following steps:
[0055] S101: Receive the first frame image sent by the second device to the target buffer.
[0056] In this embodiment, the execution entity is the first device. When the second device is playing content (wherein, the target content can be target video content or target game content), if the user wants to cast the content played on the second device to the first device for playback, firstly, based on the interface of the content played on the second device, the user clicks the casting control on the interface. After the first device detects the user's operation, it scans the local area network to which the second device is connected, identifies the first device connected in the local area network, and displays the control corresponding to the device information of the first device on the interface of the second device. After the user clicks the control corresponding to the device information of the first device to establish a communication connection between the first device and the second device, the second device sends frame by frame of the played content to the first device for display in real time. In this embodiment, the frame image sent by the second device is compressed frame image data, which can be compressed using H.264 hard encoding. When the first device receives a compressed frame image, it caches the frame image in its target buffer area. The frame image in the target buffer is then decompressed, and after rendering, the content played by the second device can be projected onto the first device for playback. In this embodiment, the target buffer area is pre-allocated by the first device. To facilitate determining the optimal size of the target buffer area, its size can be set relatively small, i.e., a preset buffer size. The preset buffer size can be set according to actual needs; this embodiment does not specify a particular value for the preset buffer size.
[0057] Specifically, before performing the step of receiving the first frame image sent by the second device to the target buffer, a communication connection between the first device and the second device can be established in the following manner:
[0058] A wireless communication channel is established between the first device and the second device using a preset protocol.
[0059] More specifically, the default protocol can be WiFi Protected Setup (WPS) protocol, etc., and the specific protocol can be selected according to actual needs.
[0060] In this embodiment, in order to determine the preset cache size corresponding to the target cache area as quickly as possible, after executing step S101, the screen projection data processing method provided in this embodiment further includes the following steps:
[0061] Determine the third number of the patterned sub-block in the first frame image and the fourth number of all sub-blocks in the first frame image;
[0062] The probability of the second screen distortion corresponding to the first frame image is determined based on the third and fourth numbers;
[0063] After determining that the probability of the second screen distortion is greater than the first probability threshold, step S102 is executed;
[0064] Once it is determined that the probability of the second screen flickering is less than or equal to the first probability threshold, the preset cache size corresponding to the pre-set target cache area can be used as the final preset cache size. At this time, there is no need to execute the subsequent S102 step.
[0065] In this embodiment, the first probability threshold can be set according to actual needs. For example, the first probability threshold can be 5%. The specific value of the first probability threshold is not specifically limited in this embodiment. In the specific implementation process, each frame image can be divided into multiple sub-blocks, for example, it can be divided into 100 sub-blocks. The fourth number represents all the sub-blocks in the first frame image, i.e., 100 sub-blocks.
[0066] S102: When it is determined from the first frame image that the first preset condition is met, update the preset cache size corresponding to the target cache area.
[0067] In this embodiment, setting the preset buffer size to a small value may improve the real-time performance of screen mirroring between the first and second devices, but it cannot guarantee the quality of the content played on the second device. To optimize the preset buffer size corresponding to the target buffer area—that is, to improve both the real-time performance of screen mirroring between the first and second devices and the quality of the content played on the first device—the preset buffer size can be adjusted when the first preset condition is met based on the received first frame image, resulting in a more optimal preset buffer size.
[0068] In this embodiment, when it is determined from the first frame image that the first preset condition is met, updating the preset cache size corresponding to the target cache area includes:
[0069] Determine the target buffer size corresponding to the first frame image;
[0070] When the target cache size is greater than the preset cache size, the target cache size is set to the preset cache size to complete the update of the preset cache size.
[0071] Specifically, the target cache size corresponding to the first frame image is the same as the target cache size corresponding to the compressed first frame image. When the target cache size is less than or equal to the preset cache size, no further steps are required; only the compressed first frame image in the target cache area needs to be decompressed and rendered. When the target cache size is greater than the preset cache size, failure to process the preset cache size corresponding to the target cache area may affect the quality of the content played on the first device. To ensure the quality of the content played on the first device and improve the real-time performance of screen mirroring between the first and second devices, the target cache size is used as the preset cache size to update the preset cache size, and adjustments are made to the updated preset cache size.
[0072] In this embodiment, it should be noted that the first frame image is not necessarily the first frame image of the content played by the second device. The first frame image is the image corresponding to the first preset condition.
[0073] In this embodiment, to improve the user's interactive experience, when it is determined that the first frame image meets the first preset condition, updating the preset cache size corresponding to the target cache area further includes:
[0074] When it is determined that the first frame image meets the first preset condition, a target pop-up interface is generated, and the target interface includes a first control.
[0075] When a trigger operation is detected targeting the first control in the target pop-up interface, the preset cache size corresponding to the target cache area is updated according to the first preset condition.
[0076] Specifically, when the first frame image is determined to meet the first preset condition, it indicates that the preset cache size corresponding to the target cache area needs to be adjusted. To improve the user's interactive experience and determine whether the user needs to process the screen projection, when the first frame image is determined to meet the first preset condition, a target pop-up interface is generated, including a first control and a second control. The first control is for accepting screen projection processing, and the second control is for rejecting screen projection processing. When the user selects the first control, it indicates that the user is not satisfied with the current screen projection result and needs to process the screen projection; when the user selects the second control, it indicates that the user is satisfied with the current screen projection result and does not need to process the screen projection.
[0077] S103: Process the updated preset cache size according to preset rules.
[0078] In this embodiment, after the preset cache size is updated according to the target cache size, the updated preset cache size can be continuously adjusted according to the preset rules until the condition for stopping the adjustment of the updated preset cache size is met, thus achieving a better preset cache size setting.
[0079] Specifically, the updated preset cache size is processed according to preset rules, including:
[0080] At each second preset time threshold interval, an adjustment operation is performed on the updated preset cache size to obtain the processed preset cache size;
[0081] The adjustment process for the updated preset cache size includes:
[0082] Reduce the updated preset cache size by the first size threshold.
[0083] In this embodiment, the second preset duration threshold can be set according to actual needs. For example, the second preset duration threshold can be 4S, 5S, etc. The specific value of the second preset duration threshold is not specifically limited in this embodiment. Similarly, the first size threshold can also be set according to actual needs. For example, the first size threshold can be 0.1M, 0.15M, etc. The specific value of the first size threshold is not specifically limited in this embodiment. For example, if the updated preset cache size is 4M, the second preset duration threshold is 5S, and the first size threshold is 0.1M, after an interval of 5S, the updated preset cache size is processed according to the preset rules. At this time, the preset cache size is 3.9M. After another 5S interval, the updated preset cache size is processed according to the preset rules. At this time, the preset cache size is 3.8M. This process is repeated to obtain the processed preset cache size.
[0084] S104: Within the first preset duration threshold, according to the processed preset buffer size, receive multiple second frame images sent by the second device in a time sequence to the target buffer area.
[0085] In this embodiment, the first preset duration threshold is greater than the second preset duration threshold. The first preset duration threshold can be set according to actual needs, for example, it can be 30 seconds, 1 minute, etc. The specific value of the first preset duration threshold is not specifically limited in this embodiment. It should be noted that in this embodiment, step S104 is executed simultaneously with step S103. That is, when the preset buffer size is updated after the second preset duration threshold is reduced, timing is also performed simultaneously. Specifically, timing can be performed by setting a timer. More specifically, the second frame image is the image after the first frame image. The first frame image and multiple second frames image are all content played by the second device, and the first frame image and multiple second frames image are arranged in a chronological sequence. It should be noted that in this embodiment, in order to more accurately determine the preset buffer size corresponding to the final target buffer area, the preset buffer size is determined by receiving multiple second frames image within the first preset threshold.
[0086] S105: Determine the first number of the garbled sub-blocks in each second frame image.
[0087] In this embodiment, since there may be multiple processed preset buffer sizes within the first preset duration threshold, the screen tearing sub-blocks in each second frame image are not necessarily completely identical when each second frame image is cached to the target buffer area. By counting the number of screen tearing sub-blocks in all second frame images received within the first preset duration threshold, and determining a better preset buffer size based on the screen tearing sub-blocks, the effect of the content played by the first device can be guaranteed, and the real-time performance of screen projection between the first device and the second device can be improved.
[0088] S106: When it is determined that the second preset condition is met based on multiple first numbers, stop executing the step of processing the updated cache size according to the preset rules.
[0089] In this embodiment, when the first number of the distorted sub-blocks in the multiple second frame images received within the first preset time threshold is obtained, the overall distorted probability is determined to determine a better preset buffer size.
[0090] Specifically, the second preset condition is determined based on multiple first numbers, including:
[0091] Determine the second number of all sub-blocks in multiple second-frame images;
[0092] Based on multiple first and second numbers, determine the first probability of screen flickering within a first preset duration threshold;
[0093] When the probability of the first screen flickering is less than the first probability threshold, the second preset condition is determined to be met.
[0094] In this embodiment, the first probability threshold can be set according to actual needs. For example, the first probability threshold can be 5%. In this embodiment, the specific data of the first probability threshold is not specifically limited. In the specific implementation process, each frame image can be divided into multiple sub-blocks, for example, it can be divided into 100 sub-blocks. The second number can be the sum of the number of sub-blocks of each second frame image. After determining multiple first numbers, the sum of multiple first numbers is calculated. The ratio of the sum of multiple first numbers to the second number is the first screen distortion probability. When the first screen distortion probability is less than the first probability threshold, the corresponding preset buffer size can ensure the effect of the content played by the first device and improve the real-time performance of screen projection between the first device and the second device. Then, the step of processing the updated buffer size according to the preset rules (step S103) can be stopped.
[0095] In this embodiment, it should be noted that when the first screen distortion probability is greater than or equal to the first probability threshold, the execution of step S104 is returned until the final obtained first screen distortion probability is less than the first probability threshold, at which point the execution of step S103 is stopped.
[0096] This embodiment provides a screen projection data processing method that adjusts the buffer size of the buffer area according to the buffer size corresponding to the received frame image. While ensuring the probability of screen distortion, it improves the real-time performance of screen projection between devices, thereby ensuring the screen projection effect and improving the user experience.
[0097] refer to Figure 3 , Figure 3 This is a schematic diagram of a screen projection data processing device provided in an embodiment of the present invention. The screen projection data processing device provided in this embodiment includes: a receiving module 10, an updating module 20, a processing module 30, a determining module 40, and a stopping module 50. The receiving module 10 is used to receive a first frame image sent by a second device to a target buffer. The updating module 20 is used to update a preset buffer size corresponding to the target buffer when a first preset condition is met based on the first frame image. The processing module 30 is used to process the updated preset buffer size according to preset rules. The receiving module 10 is also used to receive multiple second frame images sent by the second device in a time sequence to the target buffer within a first preset time threshold, based on the processed preset buffer size. The determining module 40 is used to determine the first number of the garbled sub-blocks in each second frame image. The stopping module 50 is used to stop executing the processing module 30 when a second preset condition is met based on multiple first numbers.
[0098] In this embodiment, the update module 20 is also used for:
[0099] Determine the target buffer size corresponding to the first frame image;
[0100] When the target cache size is greater than the preset cache size, the target cache size is determined to be the preset cache size, so as to complete the update of the preset cache size.
[0101] In this embodiment, the processing module 30 is further configured to:
[0102] At each second preset time threshold interval, an adjustment operation is performed on the updated preset cache size to obtain the processed preset cache size;
[0103] The operation of adjusting the updated preset cache size includes:
[0104] The updated preset cache size is reduced by a first size threshold.
[0105] In this embodiment, the determining module 40 is further configured to:
[0106] Determine the second number of all sub-blocks in the multiple second frame images;
[0107] Based on the first number and the second number, determine the first screen flicker probability within the first preset duration threshold;
[0108] When the probability of the first screen flickering is less than the first probability threshold, it is determined that the second preset condition is met.
[0109] In this embodiment, the determining module 40 is further configured to:
[0110] Determine the third number of the distorted sub-block in the first frame image and the fourth number of all sub-blocks in the first frame image;
[0111] The probability of the second screen distortion corresponding to the first frame image is determined based on the third and fourth numbers.
[0112] In this embodiment, the update module 20 is also used for:
[0113] After determining that the second screen distortion probability is greater than the first probability threshold, when determining that the first frame image meets the first preset condition, the preset cache size corresponding to the target cache area is updated.
[0114] In this embodiment, the update module 20 is also used for:
[0115] When it is determined from the first frame image that the first preset condition is met, a target pop-up window interface is generated, the target pop-up window interface including a first control;
[0116] When a trigger operation is detected on the first control in the target pop-up interface, the preset cache size corresponding to the target cache area is updated.
[0117] The screen projection data processing device provided in this embodiment further includes: an establishment module, which is used for:
[0118] A wireless communication channel is established between the first device and the second device using a preset protocol.
[0119] This embodiment provides a screen projection data processing device that adjusts the buffer size of the buffer area according to the buffer size corresponding to the received frame image. While ensuring the probability of screen distortion, it improves the real-time performance of screen projection between devices, thereby ensuring the screen projection effect and improving the user experience.
[0120] Figure 4 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention. Figure 4 The illustrated electronic device 400 includes at least one processor 401, a memory 402, at least one network interface 404, and other user interfaces 403. The various components in the electronic device 400 are coupled together via a bus system 405. It is understood that the bus system 405 is used to implement communication between these components. In addition to a data bus, the bus system 405 also includes a power bus, a control bus, and a status signal bus. However, for clarity, in… Figure 4 The general designated all buses as Bus System 405.
[0121] The user interface 403 may include a display, keyboard, or clicking device (e.g., mouse, trackball, touchpad, or touchscreen).
[0122] It is understood that the memory 402 in the embodiments of the present invention can be volatile memory or non-volatile memory, or may include both volatile and non-volatile memory. The non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. The volatile memory can be random access memory (RAM), which is used as an external cache. By way of example, but not limitation, many forms of RAM are available, such as Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDRSDRAM), Enhanced Synchronous DRAM (ESDRAM), Synchronous Link DRAM (SLDRAM), and Direct Rambus RAM (DRRAM). The memory 402 described herein is intended to include, but is not limited to, these and any other suitable types of memory.
[0123] In some implementations, memory 402 stores elements, executable units or data structures, or subsets thereof, or extended sets thereof: operating system 4021 and application program 4022.
[0124] The operating system 4021 includes various system programs, such as the framework layer, core library layer, and driver layer, used to implement various basic business functions and handle hardware-based tasks. The application program 4022 includes various applications, such as a media player and a browser, used to implement various application functions. The program implementing the method of this embodiment can be included in the application program 4022.
[0125] In this embodiment of the invention, by calling the program or instructions stored in memory 402, specifically the program or instructions stored in application program 4022, processor 401 is used to execute the method steps provided in each method embodiment, such as: receiving a first frame image sent by a second device to a target buffer; when it is determined that a first preset condition is met based on the first frame image, updating the preset buffer size corresponding to the target buffer; processing the updated preset buffer size according to a preset rule; within a first preset time threshold, receiving multiple second frame images sent by the second device in a time sequence to the target buffer based on the processed preset buffer size; determining the first number of the distorted sub-blocks in each second frame image; when it is determined that a second preset condition is met based on multiple first numbers, stopping the step of processing the updated preset buffer size according to the preset rule.
[0126] The methods disclosed in the above embodiments of the present invention can be applied to processor 401, or implemented by processor 401. Processor 401 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the integrated logic circuit of the hardware in processor 401 or by instructions in the form of software. The processor 401 may be a general-purpose processor, 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 the present invention. The general-purpose processor may be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of the present invention can be directly embodied in the execution of a hardware decoding processor, or executed by a combination of hardware and software units in the decoding processor. The software units may be located in random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, or other mature storage media in the art. The storage medium is located in memory 402. Processor 401 reads the information in memory 402 and, in conjunction with its hardware, completes the steps of the above method.
[0127] It is understood that the embodiments described herein can be implemented in hardware, software, firmware, middleware, microcode, or a combination thereof. For hardware implementation, the processing unit can be implemented in one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field-programmable gate arrays (FPGAs), general-purpose processors, controllers, microcontrollers, microprocessors, other electronic units for performing the functions described herein, or combinations thereof.
[0128] For software implementation, the techniques described herein can be implemented by units that perform the functions described herein. The software code can be stored in memory and executed by a processor. The memory can be implemented in the processor or external to the processor.
[0129] The electronic device provided in this embodiment may be as follows: Figure 4 The electronic device shown can perform the following: Figure 2 All steps of the projection screen data processing method, thereby achieving... Figure 2 For details on the technical effects of the screen projection data processing method shown, please refer to [link / reference]. Figure 2 The relevant descriptions are presented concisely and will not be elaborated upon here.
[0130] This invention also provides a storage medium (computer-readable storage medium). This storage medium stores one or more programs. The storage medium may include volatile memory, such as random access memory; the memory may also include non-volatile memory, such as read-only memory, flash memory, hard disk, or solid-state drive; the memory may also include combinations of the above types of memory.
[0131] When one or more programs in the storage medium can be executed by one or more processors to implement the above-mentioned screen projection data processing method executed on the screen projection data processing device side.
[0132] The processor is used to execute the screen projection data processing program stored in the memory to implement the following steps of the screen projection data processing method executed on the screen projection data processing device side: receiving a first frame image sent by the second device to the target buffer; when it is determined that a first preset condition is met based on the first frame image, updating the preset buffer size corresponding to the target buffer; processing the updated preset buffer size according to preset rules; within a first preset time threshold, receiving multiple second frame images sent by the second device in a time sequence to the target buffer based on the processed preset buffer size; determining the first number of the screen distortion sub-block in each second frame image; when it is determined that a second preset condition is met based on multiple first numbers, stopping the step of processing the updated preset buffer size according to preset rules.
[0133] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.
[0134] The steps of the methods or algorithms described in conjunction with the embodiments disclosed herein can be implemented in hardware, a software module executed by a processor, or a combination of both. The software module can be located in random access memory (RAM), main memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or any other form of storage medium known in the art.
[0135] The specific embodiments described above further illustrate the purpose, technical solution, and beneficial effects of the present invention. It should be understood that the above description is only a specific embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. A method for processing screen projection data, characterized in that, Applied to a first device, the method includes: Receive the first frame image sent by the second device to the target buffer; Determine the third number of the patterned sub-block in the first frame image and the fourth number of all sub-blocks in the first frame image; The probability of the second screen distortion corresponding to the first frame image is determined based on the third and fourth numbers; After determining that the second probability of screen distortion is greater than the first probability threshold, when it is determined that the first preset condition is met based on the first frame image, the preset cache size corresponding to the target cache area is updated; The updated preset cache size is processed according to preset rules; Within a first preset duration threshold, based on the processed preset buffer size, multiple second frame images sent by the second device in a time sequence are received to the target buffer area; Determine the first number of the garbled sub-block in each of the second frame images; Determine the second number of all sub-blocks in the multiple second frame images; Based on the first number and the second number, determine the first screen flicker probability within the first preset duration threshold; When the probability of the first screen flickering is less than the first probability threshold, the step of processing the updated preset cache size according to the preset rules is stopped.
2. The method according to claim 1, characterized in that, The step of updating the preset cache size corresponding to the target cache area when it is determined that the first preset condition is met based on the first frame image includes: Determine the target buffer size corresponding to the first frame image; When the target cache size is greater than the preset cache size, the target cache size is determined to be the preset cache size, so as to complete the update of the preset cache size.
3. The method according to claim 1, characterized in that, The step of processing the updated preset cache size according to preset rules includes: At each second preset time threshold interval, an adjustment operation is performed on the updated preset cache size to obtain the processed preset cache size; The operation of adjusting the updated preset cache size includes: The updated preset cache size is reduced by a first size threshold.
4. The method according to claim 1, characterized in that, The step of updating the preset cache size corresponding to the target cache area when it is determined that the first preset condition is met based on the first frame image includes: When it is determined from the first frame image that the first preset condition is met, a target pop-up window interface is generated, the target pop-up window interface including a first control; When a trigger operation is detected on the first control in the target pop-up interface, the preset cache size corresponding to the target cache area is updated.
5. The method according to claim 1, characterized in that, Before performing the step of receiving the first frame image sent by the second device to the target buffer, the method further includes: A wireless communication channel is established between the first device and the second device using a preset protocol.
6. A screen projection data processing device, characterized in that, include: The receiving module is used to receive the first frame image sent by the second device to the target buffer. The update module is used to determine the third number of the distorted sub-blocks in the first frame image and the fourth number of all sub-blocks in the first frame image; determine the second distorted probability corresponding to the first frame image based on the third number and the fourth number; after determining that the second distorted probability is greater than the first probability threshold, when it is determined based on the first frame image that the first preset condition is met, update the preset cache size corresponding to the target cache area; The processing module is used to process the updated preset cache size according to preset rules; The receiving module is further configured to receive, within a first preset duration threshold, multiple second frame images sent by the second device in a time sequence to the target buffer area according to the processed preset buffer size; A determining module is used to determine the first number of the distorted sub-blocks in each of the second frame images; The stopping module is used to determine the second number of all sub-blocks in the plurality of second frame images; determine the first screen distortion probability within the first preset duration threshold based on the plurality of first numbers and the second number; and stop the execution of the processing module when the first screen distortion probability is less than the first probability threshold.
7. An electronic device, characterized in that, include: A processor and a memory, wherein the processor is configured to execute a screen projection data processing program stored in the memory to implement the screen projection data processing method according to any one of claims 1 to 5.
8. A storage medium, characterized in that, The storage medium stores one or more programs, which can be executed by one or more processors to implement the screen projection data processing method according to any one of claims 1 to 5.
Citation Information
Patent Citations
Screen projection method and device, electronic equipment and storage medium
CN113778364A
Wireless screen projection data processing method, intelligent terminal and readable storage medium
CN114338624A
