Method and device for adjusting pulse width modulation (PWM) frequency and electronic equipment

By adjusting the number and width of electromagnetic pulses when modulating the PWM frequency of the mobile phone screen pulse width, the screen flash problem caused by single-frame transient switching is solved, and smoother brightness adjustment is achieved.

CN119766937AActive Publication Date: 2025-04-04VIVO MOBILE COMM CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202411862625.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-17
Publication Date
2025-04-04
Estimated Expiration
2044-12-17

AI Technical Summary

Technical Problem

When the brightness of the mobile phone screen is adjusted, the brightness changes caused by single-frame transient switching cause screen flash problems.

Method used

When adjusting the pulse width modulation PWM frequency, the number of the first electromagnetic pulses is first adjusted from M to N, and the width of N electromagnetic pulses is gradually adjusted to form a combined electromagnetic pulse and optimize the switching process.

Benefits of technology

By gradually adjusting the width of the electromagnetic pulse and increasing the intermediate state of non-equidistant electromagnetic pulses, the transient screen flash problem during PWM frequency switching is optimized, making the frequency switching smoother.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119766937A_ABST
    Figure CN119766937A_ABST
Patent Text Reader

Abstract

The invention discloses a pulse width modulation (PWM) frequency adjusting method and device and electronic equipment, and belongs to the technical field of image processing. The method comprises the following steps: obtaining a first frame image based on M first electromagnetic pulses corresponding to a first PWM frequency; determining N second electromagnetic pulses corresponding to a second PWM frequency after PWM frequency adjustment under the condition that a preset condition is met; according to the M first electromagnetic pulses and the N second electromagnetic pulses, the M first electromagnetic pulses are adjusted to be combined electromagnetic pulses of P third electromagnetic pulses and Q fourth electromagnetic pulses to obtain a second frame image, the widths of the first electromagnetic pulses and the widths of the third electromagnetic pulses are first widths, and the widths of the fourth electromagnetic pulses are second widths; the width of the second electromagnetic pulse and the width of the fourth electromagnetic pulse are both second width, and under the condition that the second frame image is obtained, the P third electromagnetic pulses in the combined electromagnetic pulse are adjusted from the first width to the second width to obtain a third frame image.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of image processing technology, and specifically relates to a method, device and electronic equipment for adjusting pulse width modulation (PWM) frequency. Background Art

[0002] The Organic Light-Emitting Diode (OLED) screen controls the pulse width modulation (PWM) frequency by controlling the number of switching times of the electromagnetic pulse EM Pulse. For example, in the direct current (DC) 18Pulse mode, the EM Pulse switches 18 times per frame. If the screen refresh rate is 120Hz, the number of EM Pulse switches per second is 18 times 120, which is equal to 2160 times, that is, the PWM frequency is 2160Hz. Therefore, controlling the number of EM Pulse switches can control different PWM frequencies.

[0003] In PWM dimming (multi-pulse) mode, using the camera to adjust the exposure time can show multiple black lines in one frame of the display screen. In DC 18Pulse mode, if the EM Pulse is switched on and off 8 times in one frame, there will be 8 black lines. The width of the black line is the EM Pulse width. The larger the width, the more rows of screen pixels are turned off (or not displayed), the more black lines there are (that is, the more EM Pulse switches are turned on and off), the more total rows of pixels are not displayed in one frame, and the lower the brightness of the display screen.

[0004] The existing solutions have the following shortcomings:

[0005] At present, mobile phone screens use high-frequency PWM dimming at low brightness (such as below 90nit), and will switch to lower frequency PWM dimming in the high brightness range to achieve power saving. However, when the display screen adjusts the brightness and switches to different PWM frequencies, the duty cycle of the screen display will not be completely consistent within a frame, and there will be differences in brightness. Switching directly to the target PWM frequency within a frame will cause transient screen flicker. For example: when switching from DC 18Pulse mode to DC 6Pulse mode, the display screen changes from 18 black lines of equal width to 6 black lines of equal width. Since the width of each EM Pulse in different modes is inconsistent, the single-frame transient switching causes the screen flicker problem of brightness change. Summary of the invention

[0006] The purpose of the embodiments of the present application is to provide a method, device and electronic device for adjusting the pulse width modulation (PWM) frequency, which can solve the problem of screen flickering caused by brightness changes due to single-frame transient switching.

[0007] In a first aspect, an embodiment of the present application provides a method for adjusting a pulse width modulation (PWM) frequency, comprising:

[0008] Obtaining a first frame of image based on M first electromagnetic pulses corresponding to the first PWM frequency;

[0009] Under the condition that a preset condition is met, determining N second electromagnetic pulses corresponding to a second PWM frequency after the PWM frequency is adjusted;

[0010] According to the M first electromagnetic pulses and the N second electromagnetic pulses, the M first electromagnetic pulses are adjusted to electromagnetic pulses composed of P third electromagnetic pulses and Q fourth electromagnetic pulses to obtain a second frame image, wherein the width of the first electromagnetic pulse and the width of the third electromagnetic pulse are both the first width, the width of the second electromagnetic pulse and the width of the fourth electromagnetic pulse are both the second width, and the sum of P and Q is N;

[0011] When the second frame of image is obtained, the P third electromagnetic pulses in the combined electromagnetic pulses are adjusted from the first width to the second width to obtain a third frame of image;

[0012] Among them, M, N, P, and Q are all positive integers.

[0013] In a second aspect, an embodiment of the present application provides a pulse width modulation (PWM) frequency adjustment device, comprising:

[0014] An acquisition module, configured to obtain a first frame of image based on M first electromagnetic pulses corresponding to a first PWM frequency;

[0015] A determination module, used for determining N second electromagnetic pulses corresponding to a second PWM frequency after the PWM frequency is adjusted, when a preset condition is met;

[0016] a first adjustment module, configured to adjust the M first electromagnetic pulses into a combination of P third electromagnetic pulses and Q fourth electromagnetic pulses according to the M first electromagnetic pulses and the N second electromagnetic pulses, so as to obtain a second frame image, wherein the width of the first electromagnetic pulse and the width of the third electromagnetic pulse are both the first width, the width of the second electromagnetic pulse and the width of the fourth electromagnetic pulse are both the second width, and the sum of P and Q is N;

[0017] A second adjustment module is used for adjusting the P third electromagnetic pulses in the combined electromagnetic pulses from the first width to the second width to obtain a third frame of image when the second frame of image is obtained;

[0018] Among them, M, N, P, and Q are all positive integers.

[0019] In a third aspect, an embodiment of the present application provides an electronic device, which includes a processor and a memory, wherein the memory stores programs or instructions that can be run on the processor, and when the program or instructions are executed by the processor, the steps of the method described in the first aspect are implemented.

[0020] In a fourth aspect, an embodiment of the present application provides a readable storage medium, on which a program or instruction is stored, and when the program or instruction is executed by a processor, the steps of the method described in the first aspect are implemented.

[0021] In a fifth aspect, an embodiment of the present application provides a chip, comprising a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run a program or instruction to implement the method described in the first aspect.

[0022] In a sixth aspect, an embodiment of the present application provides a computer program product, which is stored in a storage medium and is executed by at least one processor to implement the method described in the first aspect.

[0023] In the embodiment of the present application, the first frame image is first obtained based on the M first electromagnetic pulses corresponding to the first PWM frequency, and if the preset condition is met, the N second electromagnetic pulses corresponding to the second PWM frequency after the PWM frequency adjustment are determined. Then, based on the M first electromagnetic pulses and the N second electromagnetic pulses, the M first electromagnetic pulses are adjusted to a combination of P third electromagnetic pulses and Q fourth electromagnetic pulses to obtain a second frame image. Since the width of the first electromagnetic pulse and the width of the third electromagnetic pulse are both the first width, the width of the second electromagnetic pulse and the width of the fourth electromagnetic pulse are both the second width, that is, the number of first electromagnetic pulses is first adjusted from M to N, and the width of the first electromagnetic pulse of a part of the N first electromagnetic pulses is adjusted to obtain the second frame image. When the second frame image is obtained, the first width of the P third electromagnetic pulses in the combined electromagnetic pulses is adjusted to the second width to obtain the third frame image, that is, after adjusting the width of a part of the N first electromagnetic pulses to obtain the second frame image, the width of another part of the N first electromagnetic pulses is adjusted. By gradually adjusting the width of the electromagnetic pulses, one or more frames of intermediate states of electromagnetic pulses with non-equal widths are added, and the transient screen flicker problem caused by the direct change in the width of the electromagnetic pulse within a single frame when switching the PWM frequency is optimized, so that the PWM frequency switching can be smoother. BRIEF DESCRIPTION OF THE DRAWINGS

[0024] Figure 1 It is a flow chart of a pulse width modulation (PWM) frequency adjustment method provided in an embodiment of the present application;

[0025] Figure 2 This is one of the schematic diagrams for adjusting the width of an electromagnetic pulse provided in an embodiment of the present application;

[0026] Figure 3 This is the second schematic diagram of adjusting the width of the electromagnetic pulse provided in the embodiment of the present application;

[0027] Figure 4 This is the third schematic diagram of adjusting the width of the electromagnetic pulse provided in the embodiment of the present application;

[0028] Figure 5 This is the fourth schematic diagram of adjusting the width of the electromagnetic pulse provided in the embodiment of the present application;

[0029] Figure 6 This is the fifth schematic diagram of adjusting the width of the electromagnetic pulse provided in the embodiment of the present application;

[0030] Figure 7 It is a structural schematic diagram of a pulse width modulation (PWM) frequency adjustment device provided in an embodiment of the present application;

[0031] Figure 8 is a structural block diagram of an electronic device provided in an embodiment of the present application;

[0032] Fig. 9 It is a structural block diagram of another electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0033] The following will be combined with the drawings in the embodiments of the present application to clearly describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments in the present application belong to the scope of protection of this application.

[0034] The terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the terms used in this way are interchangeable where appropriate, so that the embodiments of the present application can be implemented in an order other than those illustrated or described herein, and the objects distinguished by "first", "second", etc. are generally of one type, and the number of objects is not limited. For example, the first object can be one or more. In addition, "and / or" in the specification and claims represents at least one of the connected objects, and the character " / " generally indicates that the objects associated with each other are in an "or" relationship.

[0035] The pulse width modulation (PWM) frequency adjustment method provided in the embodiment of the present application is described below through specific embodiments and application scenarios in conjunction with the accompanying drawings.

[0036] like Figure 1 As shown, the embodiment of the present application provides a method for adjusting the pulse width modulation (PWM) frequency, which may specifically include the following steps:

[0037] Step 101 : obtaining a first frame image based on M first electromagnetic pulses corresponding to a first PWM frequency, where M is a positive integer.

[0038] The electronic device obtains a first frame image of the display screen based on the first PWM frequency. The number of first electromagnetic pulses corresponding to the first PWM frequency is M. The widths of the M first electromagnetic pulses are the same, which is the first width, that is, the electromagnetic pulse of the first width is the first electromagnetic pulse.

[0039] Step 102: Under the condition that a preset condition is met, N second electromagnetic pulses corresponding to the second PWM frequency after the PWM frequency is adjusted are determined, where N is a positive integer.

[0040] Specifically, PWM dimming changes the brightness of the display screen by controlling the duty cycle of the display screen's alternating on and off. When the PWM dimming display screen is lit, it does not emit light continuously, but is constantly lighting up and off the display screen. When the speed of alternating on and off is fast, the user's perception of the display screen is that the display screen is always in the on-screen state. During the process of the display screen turning on and off, the longer the off-screen state lasts, the user's perception of the display screen is that the brightness is lower. The longer the display screen is lit, the shorter the off-screen time is, and the user's perception of the display screen is that the display screen is brighter. Therefore, the brightness of the display screen can be adjusted by adjusting the PWM frequency.

[0041] The preset conditions include, but are not limited to: the user's input for adjusting the brightness of the display screen, and the brightness of the environment in which the current electronic device is located meeting the conditions for PWM frequency adjustment.

[0042] If the electronic device meets the above preset conditions, the second PWM frequency after the PWM frequency adjustment can be determined, the number of second electromagnetic pulses corresponding to the second PWM frequency is N, the widths of the N second electromagnetic pulses are the same, all of which are the second width, that is, the electromagnetic pulses of the second width are the second electromagnetic pulses. Thus, the electronic device adjusts the brightness of the display screen by adjusting the PWM frequency. In other words, the PWM frequency is switched when the display screen is adjusted from one brightness range to another brightness range.

[0043] It should be noted that the first width and the second width are different widths.

[0044] Step 103, based on the M first electromagnetic pulses and the N second electromagnetic pulses, adjust the M first electromagnetic pulses to a combination of P third electromagnetic pulses and Q fourth electromagnetic pulses to obtain a second frame image, wherein the width of the first electromagnetic pulse and the width of the third electromagnetic pulse are both the first width, the width of the second electromagnetic pulse and the width of the fourth electromagnetic pulse are both the second width, the sum of P and Q is N, and P and Q are both positive integers.

[0045] Specifically, after determining the number M of first electromagnetic pulses of the first PWM frequency before the PWM frequency is adjusted and the number N of second electromagnetic pulses of the second PWM frequency after the PWM frequency is adjusted, the number of electromagnetic pulses is adjusted from M to N, and the width of a part of the adjusted N electromagnetic pulses is kept unchanged at the first width, and the width of another part of the electromagnetic pulses is adjusted from the first width to the second width. In other words, the number of electromagnetic pulses is directly adjusted from M to N, and the width of a part of the electromagnetic pulses is first adjusted, and the other part remains unchanged, thereby forming a combined electromagnetic pulse composed of P third electromagnetic pulses of the first width and Q fourth electromagnetic pulses of the second width. A second frame image of the display screen is obtained based on the combined electromagnetic pulse.

[0046] Step 104 , when the second frame image is obtained, adjusting the P third electromagnetic pulses in the combined electromagnetic pulses from the first width to the second width to obtain a third frame image.

[0047] Specifically, when obtaining the second frame image of the display screen, in the combined electromagnetic pulse formed by combining the P third electromagnetic pulses of the first width and the Q fourth electromagnetic pulses of the second width, the first width of the P third electromagnetic pulses of the first width is adjusted to the second width, thereby adjusting the P third electromagnetic pulses of the first width in the combined electromagnetic pulse to P third electromagnetic pulses of the second width, thereby obtaining N electromagnetic pulses of the second width. The third frame image of the display screen is obtained based on the N electromagnetic pulses of the second width.

[0048] It should be noted that the second frame image is an intermediate frame image between the first frame image and the third frame image, and the number is one or more. The width of the electromagnetic pulse is gradually adjusted by the intermediate frame image, that is, one or more intermediate states of electromagnetic pulses with non-equal widths are added, which can make the PWM frequency switching smoother.

[0049] In the embodiment of the present application, the first frame image is first obtained based on the M first electromagnetic pulses corresponding to the first PWM frequency, and if the preset condition is met, the N second electromagnetic pulses corresponding to the second PWM frequency after the PWM frequency adjustment are determined. Then, based on the M first electromagnetic pulses and the N second electromagnetic pulses, the M first electromagnetic pulses are adjusted to a combination of P third electromagnetic pulses and Q fourth electromagnetic pulses to obtain a second frame image. Since the width of the first electromagnetic pulse and the width of the third electromagnetic pulse are both the first width, the width of the second electromagnetic pulse and the width of the fourth electromagnetic pulse are both the second width, that is, the number of first electromagnetic pulses is first adjusted from M to N, and the width of the first electromagnetic pulse of a part of the N first electromagnetic pulses is adjusted to obtain the second frame image. When the second frame image is obtained, the first width of the P third electromagnetic pulses in the combined electromagnetic pulses is adjusted to the second width to obtain the third frame image, that is, after adjusting the width of a part of the N first electromagnetic pulses to obtain the second frame image, the width of another part of the N first electromagnetic pulses is adjusted. By gradually adjusting the width of the electromagnetic pulses, one or more frames of intermediate states of electromagnetic pulses with non-equal widths are added, and the transient screen flicker problem caused by the direct change in the width of the electromagnetic pulse within a single frame when switching the PWM frequency is optimized, so that the PWM frequency switching can be smoother.

[0050] In an optional specific embodiment, the step 103 adjusts the M first electromagnetic pulses to a combination of P third electromagnetic pulses and Q fourth electromagnetic pulses according to the M first electromagnetic pulses and the N second electromagnetic pulses to obtain a second frame image, specifically including steps 1031 to 1034:

[0051] Step 1031: According to the M first electromagnetic pulses and the N second electromagnetic pulses, the M first electromagnetic pulses are adjusted to N third electromagnetic pulses.

[0052] Specifically, after determining the number M of first electromagnetic pulses of the first PWM frequency before the PWM frequency adjustment and the number N of second electromagnetic pulses of the second PWM frequency after the PWM frequency adjustment, the number of electromagnetic pulses is directly adjusted from M to N, that is, M first electromagnetic pulses of the first width are adjusted to N third electromagnetic pulses of the first width.

[0053] Step 1032: Obtain an index corresponding to each of the N third electromagnetic pulses.

[0054] Specifically, the N third electromagnetic pulses are sequentially provided with N corresponding indexes, that is, each of the N third electromagnetic pulses corresponds to an index.

[0055] Step 1033: According to the indexes corresponding to the N third electromagnetic pulses, the first widths of P third electromagnetic pulses among the N third electromagnetic pulses are kept unchanged, and Q third electromagnetic pulses among the N third electromagnetic pulses except the P third electromagnetic pulses are adjusted to Q fourth electromagnetic pulses to obtain a combined electromagnetic pulse of the P third electromagnetic pulses and the Q fourth electromagnetic pulses.

[0056] Specifically, when the N indexes corresponding to the N third electromagnetic pulses are known, the N third electromagnetic pulses are divided into two categories, the first category is P third electromagnetic pulses whose widths remain unchanged, and the second category is Q third electromagnetic pulses whose widths need to be adjusted. In other words, the first widths of P third electromagnetic pulses of the first width among the N third electromagnetic pulses of the first width are kept unchanged, and Q third electromagnetic pulses of the first width among the N third electromagnetic pulses of the first width are adjusted to Q fourth electromagnetic pulses of the second width, thereby forming a combined electromagnetic pulse composed of P third electromagnetic pulses of the first width and Q fourth electromagnetic pulses of the second width.

[0057] It should be noted that in the process of classifying N third electromagnetic pulses, if the indexes of P third electromagnetic pulses or Q third electromagnetic pulses are continuous, the brightness of the display screen portion corresponding to the P third electromagnetic pulses and the display screen portion corresponding to the Q third electromagnetic pulses will be obviously inconsistent. Therefore, the N third electromagnetic pulses can be classified in an alternating manner to ensure that the brightness of the entire display screen remains consistent during the PWM frequency adjustment process.

[0058] Step 1034: Obtain the second frame image based on the combined electromagnetic pulse.

[0059] Specifically, a second frame image of the display screen is obtained based on a combined electromagnetic pulse of P third electromagnetic pulses and Q fourth electromagnetic pulses.

[0060] The adjustment process of the electromagnetic pulse width is described in detail below through a specific embodiment:

[0061] Embodiment 1

[0062] Step 1033, according to the indexes corresponding to the N third electromagnetic pulses, keeps the first widths of P third electromagnetic pulses among the N third electromagnetic pulses unchanged, and adjusts Q third electromagnetic pulses other than the P third electromagnetic pulses among the N third electromagnetic pulses to Q fourth electromagnetic pulses, to obtain a combined electromagnetic pulse of the P third electromagnetic pulses and the Q fourth electromagnetic pulses, specifically including:

[0063] According to the odd and even numbers of the indexes corresponding to the N third electromagnetic pulses, the first widths of P third electromagnetic pulses with odd indexes among the N third electromagnetic pulses remain unchanged, and Q third electromagnetic pulses with even indexes among the N third electromagnetic pulses are adjusted to Q fourth electromagnetic pulses, so as to obtain a combined electromagnetic pulse of the P third electromagnetic pulses and the Q fourth electromagnetic pulses; or,

[0064] According to the odd and even numbers of the indexes corresponding to the N third electromagnetic pulses, the first widths of P third electromagnetic pulses with even indexes among the N third electromagnetic pulses are kept unchanged, and Q third electromagnetic pulses with odd indexes among the N third electromagnetic pulses are adjusted to Q fourth electromagnetic pulses, so as to obtain a combined electromagnetic pulse of the P third electromagnetic pulses and the Q fourth electromagnetic pulses.

[0065] Specifically, when the N indexes corresponding to the N third electromagnetic pulses are known, the N third electromagnetic pulses are divided into two categories according to the odd and even numbers of the indexes, the third electromagnetic pulses corresponding to the odd indexes are one category, and the third electromagnetic pulses corresponding to the even indexes are the other category. If the odd indexes are P third electromagnetic pulses, the first width of the third electromagnetic pulses with odd indexes in the N third electromagnetic pulses remains unchanged, and the first width of the third electromagnetic pulses with even indexes in the N third electromagnetic pulses is adjusted to the second width, that is, the width of the electromagnetic pulses with odd indexes in the combined electromagnetic pulse is the first width, and the width of the electromagnetic pulses with even indexes is the second width.

[0066] If there are P third electromagnetic pulses with even indexes, the first width of the third electromagnetic pulses with even indexes among the N third electromagnetic pulses remains unchanged, and the first width of the third electromagnetic pulses with odd indexes among the N third electromagnetic pulses is adjusted to the second width, that is, the width of the electromagnetic pulses with even indexes in the combined electromagnetic pulse is the first width, and the width of the electromagnetic pulses with odd indexes is the second width. Specifically, the parity of the index can be determined by the following formula:

[0067] z=2*i-1

[0068] Wherein, i is a positive integer, z is an index, and z is a positive integer less than or equal to N.

[0069] Example: Figure 2 and Figure 3As shown, M takes a value of 18, N takes a value of 6, 18 first electromagnetic pulses of a first width (the indexes of the 18 first electromagnetic pulses of a first width are 1 to 18 respectively) are adjusted to 6 third electromagnetic pulses of a first width (the indexes of the 6 third electromagnetic pulses of a first width are 1 to 6 respectively), and the first width of the third electromagnetic pulses with an odd index among the 6 third electromagnetic pulses is adjusted to the second width, and the first width of the third electromagnetic pulses with an even index remains unchanged, that is, according to the above formula, the index that meets the above formula is an odd index, and the first width needs to be adjusted to the second width, the index that does not meet the above formula is an even index, and the first width remains unchanged. The specific calculation process is as follows:

[0070] When i is 1, the index z calculated by the above formula is 1; when i is 2, the index z calculated by the above formula is 3; when i is 3, the index z calculated by the above formula is 5, that is, indexes 1, 3, and 5 meet the above formula, and the P third electromagnetic pulses are the three third electromagnetic pulses corresponding to indexes 1, 3, and 5; indexes 2, 4, and 6 do not meet the above formula, and the Q third electromagnetic pulses are the three third electromagnetic pulses corresponding to indexes 2, 4, and 6.

[0071] The first width of the third electromagnetic pulses with indexes 1, 3, and 5 is adjusted to the second width, and the first width of the third electromagnetic pulses with even indexes remains unchanged, that is, the first width of the third electromagnetic pulses with indexes 2, 4, and 6 remains unchanged, Figure 2 The left picture is a schematic diagram of 18 first electromagnetic pulses of the first width. Figure 2 The right picture is a schematic diagram of the combined electromagnetic pulse after width adjustment, and the second frame image of the display screen is obtained based on the combined electromagnetic pulse.

[0072] When the second frame image of the display screen is obtained, the first width of the third electromagnetic pulse with indexes 2, 4, and 6 in the above-mentioned combined electromagnetic pulse is adjusted to the second width, Figure 3 The left picture is a schematic diagram of the combined electromagnetic pulse obtained after the first width adjustment. Figure 3 The right picture is a schematic diagram of six fourth electromagnetic pulses of the second width obtained after the second width adjustment, and the third frame image of the display screen is obtained based on the six fourth electromagnetic pulses of the second width.

[0073] In the above embodiment, the widths of the N third electromagnetic pulses are gradually adjusted in an alternating manner of odd and even numbers, which can not only ensure that the brightness of the entire display screen remains consistent during the PWM frequency adjustment process, but also optimize the transient screen flicker problem caused by the direct change in the width of the electromagnetic pulse within a single frame when switching the PWM frequency, making the PWM frequency switching smoother.

[0074] Embodiment 2

[0075] Step 1033, according to the indexes corresponding to the N third electromagnetic pulses, keeps the first widths of P third electromagnetic pulses among the N third electromagnetic pulses unchanged, and adjusts Q third electromagnetic pulses other than the P third electromagnetic pulses among the N third electromagnetic pulses to Q fourth electromagnetic pulses, to obtain a combined electromagnetic pulse of the P third electromagnetic pulses and the Q fourth electromagnetic pulses, specifically including:

[0076] The first widths of P third electromagnetic pulses corresponding to the indexes that do not satisfy the first formula among the indexes corresponding to the N third electromagnetic pulses remain unchanged, and the Q third electromagnetic pulses corresponding to the indexes that satisfy the first formula among the indexes corresponding to the N third electromagnetic pulses are adjusted to Q fourth electromagnetic pulses, so as to obtain a combined electromagnetic pulse of the P third electromagnetic pulses and the Q fourth electromagnetic pulses;

[0077] Among them, the first formula is:

[0078] m=3*i+1

[0079] Wherein, i is a natural number, m is an index, and m is a positive integer less than or equal to N.

[0080] Specifically, when the N indexes corresponding to the N third electromagnetic pulses are known, the N third electromagnetic pulses are divided into two categories according to the first formula, the third electromagnetic pulses corresponding to the indexes that meet the first formula are one category, and the third electromagnetic pulses corresponding to the indexes that do not meet the first formula are the other category. If the indexes that do not meet the first formula are P third electromagnetic pulses, the first width of the third electromagnetic pulses that do not meet the index of the first formula among the N third electromagnetic pulses remains unchanged, and the first width of the third electromagnetic pulses that meet the index obtained by the first formula among the N third electromagnetic pulses is adjusted to the second width, that is, the width of the electromagnetic pulses that do not meet the index of the first formula in the combined electromagnetic pulse is the first width, and the width of the electromagnetic pulses that meet the index of the first formula is the second width.

[0081] Example: Figure 4 As shown, M takes a value of 18, N takes a value of 6, 18 first electromagnetic pulses of first width (the indexes of the 18 first electromagnetic pulses of first width are 1 to 18 respectively) are adjusted to 6 third electromagnetic pulses of first width (the indexes of the 6 third electromagnetic pulses of first width are 1 to 6 respectively), and the first width of the third electromagnetic pulses of the 6 third electromagnetic pulses that meet the index of the first formula is adjusted to the second width, and the first width of the third electromagnetic pulses that do not meet the index of the first formula remains unchanged. The specific calculation process is as follows:

[0082] When i is 0, the index m calculated by the above first formula is 1; when i is 1, the index m calculated by the above first formula is 4, that is, indexes 1 and 4 conform to the above first formula, and the Q third electromagnetic pulses are the two third electromagnetic pulses corresponding to indexes 1 and 4; indexes 2, 3, 5, and 6 do not conform to the above first formula, and the P third electromagnetic pulses are the four third electromagnetic pulses corresponding to indexes 2, 3, 5, and 6.

[0083] The first width of the third electromagnetic pulses with indexes 1 and 4 is adjusted to the second width, and the first width of the third electromagnetic pulses with indexes 2, 3, 5, and 6 remains unchanged, Figure 4 The left picture is a schematic diagram of the combined electromagnetic pulse after width adjustment, and the second frame image of the display screen is obtained based on the combined electromagnetic pulse.

[0084] When the second frame image of the display screen is obtained, the first width of the third electromagnetic pulse indexed as 2, 3, 5, and 6 in the above-mentioned combined electromagnetic pulse is adjusted to the second width, Figure 4 The right picture is a schematic diagram of six fourth electromagnetic pulses of the second width obtained after the second width adjustment, and the third frame image of the display screen is obtained based on the six fourth electromagnetic pulses of the second width.

[0085] In the above embodiment, the widths of N third electromagnetic pulses are gradually adjusted in an alternating manner, which can not only ensure that the brightness of the entire display screen remains consistent during the PWM frequency adjustment process, but also optimize the transient screen flicker problem caused by the direct change in the width of the electromagnetic pulse within a single frame when switching the PWM frequency, thereby making the PWM frequency switching smoother.

[0086] Embodiment three:

[0087] Step 1033, according to the indexes corresponding to the N third electromagnetic pulses, keeps the first widths of P third electromagnetic pulses among the N third electromagnetic pulses unchanged, and adjusts Q third electromagnetic pulses other than the P third electromagnetic pulses among the N third electromagnetic pulses to Q fourth electromagnetic pulses, to obtain a combined electromagnetic pulse of the P third electromagnetic pulses and the Q fourth electromagnetic pulses, specifically including:

[0088] The first widths of P third electromagnetic pulses corresponding to the indexes that do not satisfy the first formula among the indexes corresponding to the N third electromagnetic pulses remain unchanged, and the Q third electromagnetic pulses corresponding to the indexes that satisfy the first formula among the indexes corresponding to the N third electromagnetic pulses are adjusted to Q fourth electromagnetic pulses, so as to obtain a combined electromagnetic pulse of the P third electromagnetic pulses and the Q fourth electromagnetic pulses;

[0089] Among them, the first formula is:

[0090] m=3*i+1

[0091] Wherein, i is a natural number, m is an index, and m is a positive integer less than or equal to N.

[0092] The step 104, when the second frame image is obtained, adjusts the P third electromagnetic pulses in the combined electromagnetic pulses from the first width to the second width to obtain a third frame image, specifically comprising:

[0093] When the second frame image is obtained, the first widths of the K third electromagnetic pulses corresponding to the indexes that do not satisfy the second formula among the indexes corresponding to the P third electromagnetic pulses in the combined electromagnetic pulses remain unchanged, and the S third electromagnetic pulses corresponding to the indexes that satisfy the second formula among the indexes corresponding to the P third electromagnetic pulses are adjusted to S fourth electromagnetic pulses, so as to obtain an adjusted combined electromagnetic pulse;

[0094] Obtaining a fourth frame of image based on the adjusted combined electromagnetic pulse;

[0095] When the fourth frame of image is obtained, K third electromagnetic pulses in the adjusted combined electromagnetic pulses are adjusted to K fourth electromagnetic pulses to obtain a third frame of image;

[0096] Wherein, the second formula is:

[0097] n=3*i+2

[0098] Among them, i is a natural number, n is an index, n is a positive integer less than or equal to P, the sum of K and S is P, and K and S are both positive integers.

[0099] Specifically, when the N indexes corresponding to the N third electromagnetic pulses are known, the N third electromagnetic pulses are divided into two categories according to the first formula, the third electromagnetic pulses corresponding to the indexes that meet the first formula are one category, and the third electromagnetic pulses corresponding to the indexes that do not meet the first formula are the other category. If the indexes that do not meet the first formula are P third electromagnetic pulses, the first width of the third electromagnetic pulses that do not meet the index of the first formula among the N third electromagnetic pulses remains unchanged, and the first width of the third electromagnetic pulses that meet the index obtained by the first formula among the N third electromagnetic pulses is adjusted to the second width, that is, the width of the electromagnetic pulses that do not meet the index of the first formula in the combined electromagnetic pulse is the first width, and the width of the electromagnetic pulses that meet the index of the first formula is the second width.

[0100] When the second frame image is obtained, the first widths of the K third electromagnetic pulses corresponding to the indexes that do not satisfy the second formula among the indexes corresponding to the P third electromagnetic pulses in the combined electromagnetic pulses remain unchanged, and the first widths of the S third electromagnetic pulses corresponding to the indexes that satisfy the second formula among the indexes corresponding to the P third electromagnetic pulses are adjusted to the second width, thereby obtaining an adjusted combined electromagnetic pulse composed of K third electromagnetic pulses of the first width and Q+S fourth electromagnetic pulses of the second width. A fourth frame image of the display screen is obtained based on the K third electromagnetic pulses of the first width and the Q+S fourth electromagnetic pulses of the second width.

[0101] When obtaining the fourth frame image of the display screen, the first width of K third electromagnetic pulses of the first width in the adjusted combined electromagnetic pulses is adjusted to the second width, thereby obtaining N fourth electromagnetic pulses of the second width, and the third frame image is obtained based on the N fourth electromagnetic pulses of the second width.

[0102] It should be noted that the second frame image and the fourth frame image are both intermediate frame images between the first frame image and the third frame image. The width of the electromagnetic pulse is gradually adjusted through the two intermediate frame images, that is, the intermediate state of two frames of electromagnetic pulses with non-equal widths is added, which can make the PWM frequency switching smoother.

[0103] Example: Figure 5 and Figure 6 As shown, M takes a value of 18, N takes a value of 6, 18 first electromagnetic pulses of first width (the indexes of the 18 first electromagnetic pulses of first width are 1 to 18 respectively) are adjusted to 6 third electromagnetic pulses of first width (the indexes of the 6 third electromagnetic pulses of first width are 1 to 6 respectively), and the first width of the third electromagnetic pulses of the 6 third electromagnetic pulses that meet the index of the first formula is adjusted to the second width, and the first width of the third electromagnetic pulses that do not meet the index of the first formula remains unchanged. The specific calculation process is as follows:

[0104] When i is 0, the index m calculated by the above first formula is 1; when i is 1, the index m calculated by the above first formula is 4, that is, indexes 1 and 4 conform to the above first formula, and the Q third electromagnetic pulses are the two third electromagnetic pulses corresponding to indexes 1 and 4; indexes 2, 3, 5, and 6 do not conform to the above first formula, and the P third electromagnetic pulses are the four third electromagnetic pulses corresponding to indexes 2, 3, 5, and 6.

[0105] The first width of the third electromagnetic pulses with indexes 1 and 4 is adjusted to the second width, and the first width of the third electromagnetic pulses with indexes 2, 3, 5, and 6 remains unchanged, Figure 5 The left picture is a schematic diagram of the combined electromagnetic pulse after the first width adjustment, and the second frame image of the display screen is obtained based on the combined electromagnetic pulse.

[0106] When the second frame image of the display screen is obtained, the first width of the third electromagnetic pulses with indexes of 2, 3, 5, and 6 that meet the index of the second formula is adjusted to the second width, and the first width of the third electromagnetic pulses that do not meet the index of the second formula remains unchanged. The specific calculation process is as follows:

[0107] When i is 0, the index n calculated by the second formula is 2; when i is 1, the index n calculated by the second formula is 5, that is, indexes 2 and 5 conform to the second formula, and the S third electromagnetic pulses are the two third electromagnetic pulses corresponding to indexes 2 and 5; indexes 3 and 6 do not conform to the second formula, and the K third electromagnetic pulses are the two third electromagnetic pulses corresponding to indexes 3 and 6.

[0108] The first width of the third electromagnetic pulse with indexes 2 and 5 is adjusted to the second width, and the first width of the third electromagnetic pulse with indexes 3 and 6 remains unchanged. Figure 5 The right picture is a schematic diagram of the combined electromagnetic pulse after the second width adjustment, and the fourth frame image of the display screen is obtained based on the adjusted combined electromagnetic pulse.

[0109] When the fourth frame image of the display screen is obtained, the first width of the third electromagnetic pulse with indexes 3 and 6 in the above-adjusted combined electromagnetic pulse is adjusted to the second width, Figure 6 The left picture is a schematic diagram of the combined electromagnetic pulse after the second width adjustment. Figure 6 The right picture is a schematic diagram of six fourth electromagnetic pulses of the second width obtained after the third width adjustment, and the third frame image of the display screen is obtained based on the six fourth electromagnetic pulses of the second width.

[0110] In the above embodiment, the widths of N third electromagnetic pulses are gradually adjusted in an alternating manner, which can not only ensure that the brightness of the entire display screen remains consistent during the PWM frequency adjustment process, but also optimize the transient screen flicker problem caused by the direct change in the width of the electromagnetic pulse within a single frame when switching the PWM frequency, thereby making the PWM frequency switching smoother.

[0111] In summary, in the embodiment of the present application, when adjusting the PWM frequency, the number of the first electromagnetic pulses is first adjusted from the number of electromagnetic pulses corresponding to the first PWM frequency to the number of electromagnetic pulses corresponding to the second PWM frequency, and then the width of the electromagnetic pulses of one part is adjusted to obtain the second frame image, and then the width of the electromagnetic pulses of the other part is adjusted. By gradually adjusting the width of the electromagnetic pulses, the intermediate state of one or more frames of electromagnetic pulses with non-equal widths is added, and the transient screen flicker problem caused by the direct change of the width of the electromagnetic pulses in a single frame when switching the PWM frequency is optimized, which can make the PWM frequency switching smoother. In addition, by gradually adjusting the width of the electromagnetic pulses in an alternating manner, the brightness of the entire display screen can be kept consistent during the PWM frequency adjustment process.

[0112] The pulse width modulation PWM frequency adjustment method provided in the embodiment of the present application can be executed by a pulse width modulation PWM frequency adjustment device. In the embodiment of the present application, the pulse width modulation PWM frequency adjustment method performed by the pulse width modulation PWM frequency adjustment device is taken as an example to illustrate the pulse width modulation PWM frequency adjustment device provided in the embodiment of the present application.

[0113] like Figure 7 As shown, the embodiment of the present application further provides a pulse width modulation (PWM) frequency adjustment device 700, which specifically includes:

[0114] An acquisition module 701 is used to obtain a first frame image based on M first electromagnetic pulses corresponding to a first PWM frequency;

[0115] A determination module 702 is used to determine N second electromagnetic pulses corresponding to a second PWM frequency after the PWM frequency is adjusted if a preset condition is met;

[0116] A first adjustment module 703 is used to adjust the M first electromagnetic pulses into a combination of P third electromagnetic pulses and Q fourth electromagnetic pulses according to the M first electromagnetic pulses and the N second electromagnetic pulses, so as to obtain a second frame image, wherein the width of the first electromagnetic pulse and the width of the third electromagnetic pulse are both the first width, the width of the second electromagnetic pulse and the width of the fourth electromagnetic pulse are both the second width, and the sum of P and Q is N;

[0117] A second adjustment module 704 is configured to adjust the P third electromagnetic pulses in the combined electromagnetic pulses from the first width to the second width to obtain a third frame of image when the second frame of image is obtained;

[0118] Among them, M, N, P, and Q are all positive integers.

[0119] Optionally, the first adjustment module 703 is specifically configured to:

[0120] According to the M first electromagnetic pulses and the N second electromagnetic pulses, adjusting the M first electromagnetic pulses into N third electromagnetic pulses;

[0121] Obtaining an index corresponding to each third electromagnetic pulse of the N third electromagnetic pulses;

[0122] According to the indexes corresponding to the N third electromagnetic pulses, the first widths of P third electromagnetic pulses among the N third electromagnetic pulses remain unchanged, and Q third electromagnetic pulses among the N third electromagnetic pulses except the P third electromagnetic pulses are adjusted to Q fourth electromagnetic pulses, so as to obtain a combined electromagnetic pulse of the P third electromagnetic pulses and the Q fourth electromagnetic pulses;

[0123] The second frame image is obtained based on the combined electromagnetic pulse.

[0124] Optionally, when the first adjustment module 703 keeps the first widths of P third electromagnetic pulses among the N third electromagnetic pulses unchanged according to the indexes corresponding to the N third electromagnetic pulses, and adjusts Q third electromagnetic pulses among the N third electromagnetic pulses except the P third electromagnetic pulses to Q fourth electromagnetic pulses to obtain a combined electromagnetic pulse of the P third electromagnetic pulses and the Q fourth electromagnetic pulses, the first adjustment module 703 is specifically used to:

[0125] According to the odd and even numbers of the indexes corresponding to the N third electromagnetic pulses, the first widths of P third electromagnetic pulses with odd indexes among the N third electromagnetic pulses remain unchanged, and Q third electromagnetic pulses with even indexes among the N third electromagnetic pulses are adjusted to Q fourth electromagnetic pulses, so as to obtain a combined electromagnetic pulse of the P third electromagnetic pulses and the Q fourth electromagnetic pulses; or,

[0126] According to the odd and even numbers of the indexes corresponding to the N third electromagnetic pulses, the first widths of P third electromagnetic pulses with even indexes among the N third electromagnetic pulses are kept unchanged, and Q third electromagnetic pulses with odd indexes among the N third electromagnetic pulses are adjusted to Q fourth electromagnetic pulses, so as to obtain a combined electromagnetic pulse of the P third electromagnetic pulses and the Q fourth electromagnetic pulses.

[0127] Optionally, when the first adjustment module 703 keeps the first widths of P third electromagnetic pulses among the N third electromagnetic pulses unchanged according to the indexes corresponding to the N third electromagnetic pulses, and adjusts Q third electromagnetic pulses among the N third electromagnetic pulses except the P third electromagnetic pulses to Q fourth electromagnetic pulses to obtain a combined electromagnetic pulse of the P third electromagnetic pulses and the Q fourth electromagnetic pulses, the first adjustment module 703 is specifically used to:

[0128] The first widths of P third electromagnetic pulses corresponding to the indexes that do not satisfy the first formula among the indexes corresponding to the N third electromagnetic pulses remain unchanged, and the Q third electromagnetic pulses corresponding to the indexes that satisfy the first formula among the indexes corresponding to the N third electromagnetic pulses are adjusted to Q fourth electromagnetic pulses, so as to obtain a combined electromagnetic pulse of the P third electromagnetic pulses and the Q fourth electromagnetic pulses;

[0129] Among them, the first formula is:

[0130] m=3*i+1

[0131] Wherein, i is a natural number, m is an index, and m is a positive integer less than or equal to N.

[0132] Optionally, the second adjustment module 704 is specifically configured to:

[0133] When the second frame image is obtained, the first widths of the K third electromagnetic pulses corresponding to the indexes that do not satisfy the second formula among the indexes corresponding to the P third electromagnetic pulses in the combined electromagnetic pulses remain unchanged, and the S third electromagnetic pulses corresponding to the indexes that satisfy the second formula among the indexes corresponding to the P third electromagnetic pulses are adjusted to S fourth electromagnetic pulses, so as to obtain an adjusted combined electromagnetic pulse;

[0134] Obtaining a fourth frame of image based on the adjusted combined electromagnetic pulse;

[0135] When the fourth frame of image is obtained, K third electromagnetic pulses in the adjusted combined electromagnetic pulses are adjusted to K fourth electromagnetic pulses to obtain a third frame of image;

[0136] Wherein, the second formula is:

[0137] n=3*i+2

[0138] Among them, i is a natural number, n is an index, n is a positive integer less than or equal to P, the sum of K and S is P, and K and S are both positive integers.

[0139] In summary, in the embodiment of the present application, when adjusting the PWM frequency, the number of the first electromagnetic pulses is first adjusted from the number of electromagnetic pulses corresponding to the first PWM frequency to the number of electromagnetic pulses corresponding to the second PWM frequency, and then the width of the electromagnetic pulses of one part is adjusted to obtain the second frame image, and then the width of the electromagnetic pulses of the other part is adjusted. By gradually adjusting the width of the electromagnetic pulses, the intermediate state of one or more frames of electromagnetic pulses with non-equal widths is added, and the transient screen flicker problem caused by the direct change of the width of the electromagnetic pulses in a single frame when switching the PWM frequency is optimized, which can make the PWM frequency switching smoother. In addition, by gradually adjusting the width of the electromagnetic pulses in an alternating manner, the brightness of the entire display screen can be kept consistent during the PWM frequency adjustment process.

[0140] The pulse width modulation PWM frequency adjustment device in the embodiment of the present application can be an electronic device, or a component in the electronic device, such as an integrated circuit or a chip. The electronic device can be a terminal, or other devices other than a terminal. Exemplarily, the electronic device can be a mobile phone, a tablet computer, a laptop computer, a PDA, a vehicle-mounted electronic device, a mobile Internet device (Mobile Internet Device, MID), an augmented reality (augmented reality, AR) / virtual reality (virtual reality, VR) device, a robot, a wearable device, an ultra-mobile personal computer (ultra-mobile personal computer, UMPC), a netbook or a personal digital assistant (personal digital assistant, PDA), etc. It can also be a server, a network attached storage (Network Attached Storage, NAS), a personal computer (personal computer, PC), a television (television, TV), a teller machine or a self-service machine, etc., and the embodiment of the present application does not make specific limitations.

[0141] The pulse width modulation (PWM) frequency adjustment device in the embodiment of the present application may be a device having an operating system. The operating system may be an Android operating system, an iOS operating system, or other possible operating systems, which are not specifically limited in the embodiment of the present application.

[0142] The pulse width modulation (PWM) frequency adjustment device provided in the embodiment of the present application can achieve Figures 1 to 6 To avoid repetition, the various processes implemented by the method embodiment are not described here.

[0143] Alternatively, if Figure 8As shown, an embodiment of the present application further provides an electronic device 800, including a processor 801 and a memory 802, wherein the memory 802 stores a program or instruction that can be executed on the processor 801, and when the program or instruction is executed by the processor 801, each step of the pulse width modulation PWM frequency adjustment method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.

[0144] It should be noted that the electronic devices in the embodiments of the present application include the mobile electronic devices and non-mobile electronic devices mentioned above.

[0145] Fig. 9 A schematic diagram of the hardware structure of an electronic device to implement an embodiment of the present application.

[0146] The electronic device 1000 includes but is not limited to: a radio frequency unit 1001, a network module 1002, an audio output unit 1003, an input unit 1004, a sensor 1005, a display unit 1006, a user input unit 1007, an interface unit 1008, a memory 1009, and a processor 1010 and other components.

[0147] Those skilled in the art will appreciate that the electronic device 1000 may also include a power source (such as a battery) for supplying power to each component, and the power source may be logically connected to the processor 1010 through a power management system, thereby implementing functions such as managing charging, discharging, and power consumption management through the power management system. Fig. 9 The electronic device structure shown in the figure does not constitute a limitation on the electronic device. The electronic device may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently, which will not be described in detail here.

[0148] Wherein, the processor 1010 is used to obtain a first frame image based on M first electromagnetic pulses corresponding to a first PWM frequency;

[0149] Under the condition that a preset condition is met, determining N second electromagnetic pulses corresponding to a second PWM frequency after the PWM frequency is adjusted;

[0150] According to the M first electromagnetic pulses and the N second electromagnetic pulses, the M first electromagnetic pulses are adjusted to electromagnetic pulses composed of P third electromagnetic pulses and Q fourth electromagnetic pulses to obtain a second frame image, wherein the width of the first electromagnetic pulse and the width of the third electromagnetic pulse are both the first width, the width of the second electromagnetic pulse and the width of the fourth electromagnetic pulse are both the second width, and the sum of P and Q is N;

[0151] When the second frame of image is obtained, the P third electromagnetic pulses in the combined electromagnetic pulses are adjusted from the first width to the second width to obtain a third frame of image;

[0152] Among them, M, N, P, and Q are all positive integers.

[0153] Optionally, when the processor 1010 adjusts the M first electromagnetic pulses into a combination of P third electromagnetic pulses and Q fourth electromagnetic pulses according to the M first electromagnetic pulses and the N second electromagnetic pulses to obtain a second frame of image, it is specifically configured to:

[0154] According to the M first electromagnetic pulses and the N second electromagnetic pulses, adjusting the M first electromagnetic pulses into N third electromagnetic pulses;

[0155] Obtaining an index corresponding to each third electromagnetic pulse of the N third electromagnetic pulses;

[0156] According to the indexes corresponding to the N third electromagnetic pulses, the first widths of P third electromagnetic pulses among the N third electromagnetic pulses remain unchanged, and Q third electromagnetic pulses among the N third electromagnetic pulses except the P third electromagnetic pulses are adjusted to Q fourth electromagnetic pulses, so as to obtain a combined electromagnetic pulse of the P third electromagnetic pulses and the Q fourth electromagnetic pulses;

[0157] The second frame image is obtained based on the combined electromagnetic pulse.

[0158] Optionally, when the processor 1010 keeps the first widths of P third electromagnetic pulses among the N third electromagnetic pulses unchanged according to the indexes corresponding to the N third electromagnetic pulses, and adjusts Q third electromagnetic pulses among the N third electromagnetic pulses except the P third electromagnetic pulses to Q fourth electromagnetic pulses, to obtain a combined electromagnetic pulse of the P third electromagnetic pulses and the Q fourth electromagnetic pulses, the processor 1010 is specifically configured to:

[0159] According to the odd and even numbers of the indexes corresponding to the N third electromagnetic pulses, the first widths of P third electromagnetic pulses with odd indexes among the N third electromagnetic pulses remain unchanged, and Q third electromagnetic pulses with even indexes among the N third electromagnetic pulses are adjusted to Q fourth electromagnetic pulses, so as to obtain a combined electromagnetic pulse of the P third electromagnetic pulses and the Q fourth electromagnetic pulses; or,

[0160] According to the odd and even numbers of the indexes corresponding to the N third electromagnetic pulses, the first widths of P third electromagnetic pulses with even indexes among the N third electromagnetic pulses are kept unchanged, and Q third electromagnetic pulses with odd indexes among the N third electromagnetic pulses are adjusted to Q fourth electromagnetic pulses, so as to obtain a combined electromagnetic pulse of the P third electromagnetic pulses and the Q fourth electromagnetic pulses.

[0161] Optionally, when the processor 1010 keeps the first widths of P third electromagnetic pulses among the N third electromagnetic pulses unchanged according to the indexes corresponding to the N third electromagnetic pulses, and adjusts Q third electromagnetic pulses among the N third electromagnetic pulses except the P third electromagnetic pulses to Q fourth electromagnetic pulses, to obtain a combined electromagnetic pulse of the P third electromagnetic pulses and the Q fourth electromagnetic pulses, the processor 1010 is specifically configured to:

[0162] The first widths of P third electromagnetic pulses corresponding to the indexes that do not satisfy the first formula among the indexes corresponding to the N third electromagnetic pulses remain unchanged, and the Q third electromagnetic pulses corresponding to the indexes that satisfy the first formula among the indexes corresponding to the N third electromagnetic pulses are adjusted to Q fourth electromagnetic pulses, so as to obtain a combined electromagnetic pulse of the P third electromagnetic pulses and the Q fourth electromagnetic pulses;

[0163] Among them, the first formula is:

[0164] m=3*i+1

[0165] Wherein, i is a natural number, m is an index, and m is a positive integer less than or equal to N.

[0166] Optionally, when the processor 1010 obtains the second frame image, when adjusting the P third electromagnetic pulses in the combined electromagnetic pulses from the first width to the second width to obtain a third frame image, is specifically configured to:

[0167] When the second frame image is obtained, the first widths of the K third electromagnetic pulses corresponding to the indexes that do not satisfy the second formula among the indexes corresponding to the P third electromagnetic pulses in the combined electromagnetic pulses remain unchanged, and the S third electromagnetic pulses corresponding to the indexes that satisfy the second formula among the indexes corresponding to the P third electromagnetic pulses are adjusted to S fourth electromagnetic pulses, so as to obtain an adjusted combined electromagnetic pulse;

[0168] Obtaining a fourth frame of image based on the adjusted combined electromagnetic pulse;

[0169] When the fourth frame of image is obtained, K third electromagnetic pulses in the adjusted combined electromagnetic pulses are adjusted to K fourth electromagnetic pulses to obtain a third frame of image;

[0170] Wherein, the second formula is:

[0171] n=3*i+2

[0172] Among them, i is a natural number, n is an index, n is a positive integer less than or equal to P, the sum of K and S is P, and K and S are both positive integers.

[0173] It should be understood that in the embodiment of the present application, the input unit 1004 may include a graphics processor (Graphics Processing Unit, GPU) 10041 and a microphone 10042, and the graphics processor 10041 processes the image data of the static picture or video obtained by the image capture device (such as a camera) in the video capture mode or the image capture mode. The display unit 1006 may include a display panel 10061, and the display panel 10061 may be configured in the form of a liquid crystal display, an organic light emitting diode, etc. The user input unit 1007 includes a touch panel 10071 and at least one of other input devices 10072. The touch panel 10071 is also called a touch screen. The touch panel 10071 may include two parts: a touch detection device and a touch controller. Other input devices 10072 may include, but are not limited to, a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, and a joystick, which will not be repeated here.

[0174] The memory 1009 can be used to store software programs and various data. The memory 1009 may mainly include a first storage area for storing programs or instructions and a second storage area for storing data, wherein the first storage area may store an operating system, an application program or instructions required for at least one function (such as a sound playback function, an image playback function, etc.), etc. In addition, the memory 1009 may include a volatile memory or a non-volatile memory, or the memory 1009 may include both volatile and non-volatile memories. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), a static random access memory (SRAM), a dynamic random access memory (DRAM), a synchronous dynamic random access memory (SDRAM), a double data rate synchronous dynamic random access memory (DDRSDRAM), an enhanced synchronous dynamic random access memory (ESDRAM), a synchronous link dynamic random access memory (SLDRAM) and a direct memory bus random access memory (DRRAM). The memory 1009 in the embodiment of the present application includes but is not limited to these and any other suitable types of memory.

[0175] The processor 1010 may include one or more processing units; optionally, the processor 1010 integrates an application processor and a modem processor, wherein the application processor mainly processes operations related to an operating system, a user interface, and application programs, and the modem processor mainly processes wireless communication signals, such as a baseband processor. It is understandable that the modem processor may not be integrated into the processor 1010.

[0176] An embodiment of the present application also provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, each process of the above-mentioned pulse width modulation PWM frequency adjustment method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.

[0177] The processor is the processor in the electronic device described in the above embodiment. The readable storage medium includes a computer readable storage medium, such as a computer read-only memory ROM, a random access memory RAM, a magnetic disk or an optical disk.

[0178] An embodiment of the present application further provides a chip, which includes a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run programs or instructions to implement the various processes of the above-mentioned pulse width modulation PWM frequency adjustment method embodiment, and can achieve the same technical effect. To avoid repetition, it will not be repeated here.

[0179] It should be understood that the chip mentioned in the embodiments of the present application can also be called a system-level chip, a system chip, a chip system or a system-on-chip chip, etc.

[0180] An embodiment of the present application provides a computer program product, which is stored in a storage medium. The program product is executed by at least one processor to implement the various processes of the pulse width modulation PWM frequency adjustment method embodiment as described above, and can achieve the same technical effect. To avoid repetition, it will not be repeated here.

[0181] It should be noted that, in this article, the terms "comprise", "include" or any other variant thereof are intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise one..." do not exclude the presence of other identical elements in the process, method, article or device including the element. In addition, it should be pointed out that the scope of the methods and devices in the embodiments of the present application is not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in reverse order according to the functions involved, for example, the described method may be performed in an order different from that described, and various steps may also be added, omitted, or combined. In addition, the features described with reference to certain examples may be combined in other examples.

[0182] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a computer software product, which is stored in a storage medium (such as ROM / RAM, a disk, or an optical disk), and includes a number of instructions for a terminal (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present application.

[0183] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present application, ordinary technicians in this field can also make many forms without departing from the purpose of the present application and the scope of protection of the claims, all of which are within the protection of the present application.

Claims

1. A method for adjusting the frequency of pulse width modulation (PWM), characterized in that: include: Obtaining a first frame of image based on M first electromagnetic pulses corresponding to the first PWM frequency; Under the condition that a preset condition is met, determining N second electromagnetic pulses corresponding to a second PWM frequency after the PWM frequency is adjusted; According to the M first electromagnetic pulses and the N second electromagnetic pulses, the M first electromagnetic pulses are adjusted to electromagnetic pulses composed of P third electromagnetic pulses and Q fourth electromagnetic pulses to obtain a second frame image, wherein the width of the first electromagnetic pulse and the width of the third electromagnetic pulse are both the first width, the width of the second electromagnetic pulse and the width of the fourth electromagnetic pulse are both the second width, and the sum of P and Q is N; When the second frame of image is obtained, the P third electromagnetic pulses in the combined electromagnetic pulses are adjusted from the first width to the second width to obtain a third frame of image; Among them, M, N, P, and Q are all positive integers.

2. The method according to claim 1, characterized in that: The adjusting, according to the M first electromagnetic pulses and the N second electromagnetic pulses, the M first electromagnetic pulses into electromagnetic pulses composed of P third electromagnetic pulses and Q fourth electromagnetic pulses to obtain a second frame of image includes: According to the M first electromagnetic pulses and the N second electromagnetic pulses, adjusting the M first electromagnetic pulses into N third electromagnetic pulses; Obtaining an index corresponding to each third electromagnetic pulse of the N third electromagnetic pulses; According to the indexes corresponding to the N third electromagnetic pulses, the first widths of P third electromagnetic pulses among the N third electromagnetic pulses remain unchanged, and Q third electromagnetic pulses among the N third electromagnetic pulses except the P third electromagnetic pulses are adjusted to Q fourth electromagnetic pulses, so as to obtain a combined electromagnetic pulse of the P third electromagnetic pulses and the Q fourth electromagnetic pulses; The second frame image is obtained based on the combined electromagnetic pulse.

3. The method according to claim 2, characterized in that The method of maintaining the first widths of P third electromagnetic pulses among the N third electromagnetic pulses unchanged according to the indexes corresponding to the N third electromagnetic pulses, and adjusting Q third electromagnetic pulses among the N third electromagnetic pulses except the P third electromagnetic pulses to Q fourth electromagnetic pulses, to obtain a combined electromagnetic pulse of the P third electromagnetic pulses and the Q fourth electromagnetic pulses, comprises: According to the odd and even numbers of the indexes corresponding to the N third electromagnetic pulses, the first widths of P third electromagnetic pulses with odd indexes among the N third electromagnetic pulses remain unchanged, and Q third electromagnetic pulses with even indexes among the N third electromagnetic pulses are adjusted to Q fourth electromagnetic pulses, so as to obtain a combined electromagnetic pulse of the P third electromagnetic pulses and the Q fourth electromagnetic pulses; or, According to the odd and even numbers of the indexes corresponding to the N third electromagnetic pulses, the first widths of P third electromagnetic pulses with even indexes among the N third electromagnetic pulses are kept unchanged, and Q third electromagnetic pulses with odd indexes among the N third electromagnetic pulses are adjusted to Q fourth electromagnetic pulses, so as to obtain a combined electromagnetic pulse of the P third electromagnetic pulses and the Q fourth electromagnetic pulses.

4. The method according to claim 2, characterized in that: The method of maintaining the first widths of P third electromagnetic pulses among the N third electromagnetic pulses unchanged according to the indexes corresponding to the N third electromagnetic pulses, and adjusting Q third electromagnetic pulses among the N third electromagnetic pulses except the P third electromagnetic pulses to Q fourth electromagnetic pulses, to obtain a combined electromagnetic pulse of the P third electromagnetic pulses and the Q fourth electromagnetic pulses, comprises: The first widths of P third electromagnetic pulses corresponding to the indexes that do not satisfy the first formula among the indexes corresponding to the N third electromagnetic pulses remain unchanged, and the Q third electromagnetic pulses corresponding to the indexes that satisfy the first formula among the indexes corresponding to the N third electromagnetic pulses are adjusted to Q fourth electromagnetic pulses, so as to obtain a combined electromagnetic pulse of the P third electromagnetic pulses and the Q fourth electromagnetic pulses; Among them, the first formula is: m=3*i+1 Wherein, i is a natural number, m is an index, and m is a positive integer less than or equal to N.

5. The method according to claim 4, characterized in that In the case of obtaining the second frame of image, adjusting the P third electromagnetic pulses in the combined electromagnetic pulses from the first width to the second width to obtain a third frame of image, including: When the second frame image is obtained, the first widths of the K third electromagnetic pulses corresponding to the indexes that do not satisfy the second formula among the indexes corresponding to the P third electromagnetic pulses in the combined electromagnetic pulses remain unchanged, and the S third electromagnetic pulses corresponding to the indexes that satisfy the second formula among the indexes corresponding to the P third electromagnetic pulses are adjusted to S fourth electromagnetic pulses, so as to obtain an adjusted combined electromagnetic pulse; Obtaining a fourth frame of image based on the adjusted combined electromagnetic pulse; When the fourth frame of image is obtained, K third electromagnetic pulses in the adjusted combined electromagnetic pulses are adjusted to K fourth electromagnetic pulses to obtain a third frame of image; Wherein, the second formula is: n=3*i+2 Among them, i is a natural number, n is an index, n is a positive integer less than or equal to P, the sum of K and S is P, and K and S are both positive integers.

6. A pulse width modulation (PWM) frequency adjustment device, characterized in that: include: An acquisition module, configured to obtain a first frame of image based on M first electromagnetic pulses corresponding to a first PWM frequency; A determination module, used for determining N second electromagnetic pulses corresponding to a second PWM frequency after the PWM frequency is adjusted, when a preset condition is met; a first adjustment module, configured to adjust the M first electromagnetic pulses into a combination of P third electromagnetic pulses and Q fourth electromagnetic pulses according to the M first electromagnetic pulses and the N second electromagnetic pulses, so as to obtain a second frame image, wherein the width of the first electromagnetic pulse and the width of the third electromagnetic pulse are both the first width, the width of the second electromagnetic pulse and the width of the fourth electromagnetic pulse are both the second width, and the sum of P and Q is N; A second adjustment module is used for adjusting the P third electromagnetic pulses in the combined electromagnetic pulses from the first width to the second width to obtain a third frame of image when the second frame of image is obtained; Among them, M, N, P, and Q are all positive integers.

7. The device according to claim 6, characterized in that The first adjustment module is specifically used to: According to the M first electromagnetic pulses and the N second electromagnetic pulses, adjusting the M first electromagnetic pulses into N third electromagnetic pulses; Obtaining an index corresponding to each third electromagnetic pulse of the N third electromagnetic pulses; According to the indexes corresponding to the N third electromagnetic pulses, the first widths of P third electromagnetic pulses among the N third electromagnetic pulses remain unchanged, and Q third electromagnetic pulses among the N third electromagnetic pulses except the P third electromagnetic pulses are adjusted to Q fourth electromagnetic pulses, so as to obtain a combined electromagnetic pulse of the P third electromagnetic pulses and the Q fourth electromagnetic pulses; The second frame image is obtained based on the combined electromagnetic pulse.

8. The device according to claim 7, characterized in that The first adjustment module, when keeping the first widths of P third electromagnetic pulses among the N third electromagnetic pulses unchanged according to the indexes corresponding to the N third electromagnetic pulses, and adjusting Q third electromagnetic pulses among the N third electromagnetic pulses except the P third electromagnetic pulses to Q fourth electromagnetic pulses, to obtain a combined electromagnetic pulse of the P third electromagnetic pulses and the Q fourth electromagnetic pulses, is specifically used to: According to the odd and even numbers of the indexes corresponding to the N third electromagnetic pulses, the first widths of P third electromagnetic pulses with odd indexes among the N third electromagnetic pulses remain unchanged, and Q third electromagnetic pulses with even indexes among the N third electromagnetic pulses are adjusted to Q fourth electromagnetic pulses, so as to obtain a combined electromagnetic pulse of the P third electromagnetic pulses and the Q fourth electromagnetic pulses; or, According to the odd and even numbers of the indexes corresponding to the N third electromagnetic pulses, the first widths of P third electromagnetic pulses with even indexes among the N third electromagnetic pulses are kept unchanged, and Q third electromagnetic pulses with odd indexes among the N third electromagnetic pulses are adjusted to Q fourth electromagnetic pulses, so as to obtain a combined electromagnetic pulse of the P third electromagnetic pulses and the Q fourth electromagnetic pulses.

9. The device according to claim 7, characterized in that The first adjustment module, when keeping the first widths of P third electromagnetic pulses among the N third electromagnetic pulses unchanged according to the indexes corresponding to the N third electromagnetic pulses, and adjusting Q third electromagnetic pulses among the N third electromagnetic pulses except the P third electromagnetic pulses to Q fourth electromagnetic pulses, to obtain a combined electromagnetic pulse of the P third electromagnetic pulses and the Q fourth electromagnetic pulses, is specifically used to: The first widths of P third electromagnetic pulses corresponding to the indexes that do not satisfy the first formula among the indexes corresponding to the N third electromagnetic pulses remain unchanged, and the Q third electromagnetic pulses corresponding to the indexes that satisfy the first formula among the indexes corresponding to the N third electromagnetic pulses are adjusted to Q fourth electromagnetic pulses, so as to obtain a combined electromagnetic pulse of the P third electromagnetic pulses and the Q fourth electromagnetic pulses; Among them, the first formula is: m=3*i+1 Wherein, i is a natural number, m is an index, and m is a positive integer less than or equal to N.

10. The device according to claim 9, characterized in that The second adjustment module is specifically used for: When the second frame image is obtained, the first widths of the K third electromagnetic pulses corresponding to the indexes that do not satisfy the second formula among the indexes corresponding to the P third electromagnetic pulses in the combined electromagnetic pulses remain unchanged, and the S third electromagnetic pulses corresponding to the indexes that satisfy the second formula among the indexes corresponding to the P third electromagnetic pulses are adjusted to S fourth electromagnetic pulses, so as to obtain an adjusted combined electromagnetic pulse; Obtaining a fourth frame of image based on the adjusted combined electromagnetic pulse; When the fourth frame of image is obtained, K third electromagnetic pulses in the adjusted combined electromagnetic pulses are adjusted to K fourth electromagnetic pulses to obtain a third frame of image; Wherein, the second formula is: n=3*i+2 Among them, i is a natural number, n is an index, n is a positive integer less than or equal to P, the sum of K and S is P, and K and S are both positive integers.

11. An electronic device, characterized in that: It comprises a processor and a memory, wherein the memory stores a program or instruction that can be run on the processor, and when the program or instruction is executed by the processor, the steps of the pulse width modulation (PWM) frequency adjustment method as described in any one of claims 1 to 5 are implemented.

Citation Information

Patent Citations

  • Display equipment and setting method thereof

    CN111899680A

  • Display equipment and control method for eliminating water ripples displayed on screen

    CN112992028A

  • Method, device and equipment for adjusting dimming PWM (Pulse Width Modulation) wave, medium and display device

    CN117789631A

  • Apparatus and method for improving video quality of display device

    US20090322733A1