CN115529382A - Method for calculating optical proximity parameter and related electronic equipment - Google Patents

Method for calculating optical proximity parameter and related electronic equipment Download PDF

Info

Publication number
CN115529382A
CN115529382A CN202210193511.4A CN202210193511A CN115529382A CN 115529382 A CN115529382 A CN 115529382A CN 202210193511 A CN202210193511 A CN 202210193511A CN 115529382 A CN115529382 A CN 115529382A
Authority
CN
China
Prior art keywords
proximity
light
parameter
pulse
optical
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202210193511.4A
Other languages
Chinese (zh)
Other versions
CN115529382B (en
Inventor
张佳祥
李辰龙
张文礼
苏俊峰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Honor Device Co Ltd
Original Assignee
Honor Device Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Honor Device Co Ltd filed Critical Honor Device Co Ltd
Priority to CN202310674425.XA priority Critical patent/CN116962569A/en
Priority to CN202210193511.4A priority patent/CN115529382B/en
Publication of CN115529382A publication Critical patent/CN115529382A/en
Application granted granted Critical
Publication of CN115529382B publication Critical patent/CN115529382B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04MTELEPHONIC COMMUNICATION
    • H04M1/00Substation equipment, e.g. for use by subscribers
    • H04M1/72Mobile telephones; Cordless telephones, i.e. devices for establishing wireless links to base stations without route selection
    • H04M1/724User interfaces specially adapted for cordless or mobile telephones
    • H04M1/72448User interfaces specially adapted for cordless or mobile telephones with means for adapting the functionality of the device according to specific conditions
    • H04M1/72454User interfaces specially adapted for cordless or mobile telephones with means for adapting the functionality of the device according to specific conditions according to context-related or environment-related conditions
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04MTELEPHONIC COMMUNICATION
    • H04M1/00Substation equipment, e.g. for use by subscribers
    • H04M1/02Constructional features of telephone sets
    • H04M1/0202Portable telephone sets, e.g. cordless phones, mobile phones or bar type handsets
    • H04M1/026Details of the structure or mounting of specific components
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04MTELEPHONIC COMMUNICATION
    • H04M1/00Substation equipment, e.g. for use by subscribers
    • H04M1/72Mobile telephones; Cordless telephones, i.e. devices for establishing wireless links to base stations without route selection
    • H04M1/724User interfaces specially adapted for cordless or mobile telephones
    • H04M1/72484User interfaces specially adapted for cordless or mobile telephones wherein functions are triggered by incoming communication events
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/70Reducing energy consumption in communication networks in wireless communication networks

Landscapes

  • Engineering & Computer Science (AREA)
  • Signal Processing (AREA)
  • Human Computer Interaction (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Environmental & Geological Engineering (AREA)
  • Electronic Switches (AREA)

Abstract

The application provides a method for calculating a proximity optical parameter and a related electronic device, wherein the method comprises the following steps: the method comprises the following steps that a proximity optical device determines proximity optical state information in a single-pulse working mode, wherein the proximity optical state information is used for representing the state that an object is close to or far away from; when the state information of the proximity light changes, switching the working mode of the proximity light device into a multi-pulse working mode; the single-pulse working mode is a working mode which determines that the light state information is close to in one pulse period, and in the single working period, the single working period comprises one pulse period, and one pulse period comprises a first duration of working in a high level state and a first duration of working in a low level state; the multi-pulse operating mode is an operating mode for determining the state information of the proximity light in a plurality of continuous pulse periods, and comprises a plurality of pulse periods in a single operating period of the proximity light device, wherein one pulse period comprises a second time length of operating in a high level state and a second time length of operating in a low level state, and the second time length is less than the first time length.

Description

Method for calculating optical proximity parameter and related electronic equipment
Technical Field
The present disclosure relates to the field of calculating an optical proximity parameter, and more particularly, to a method for calculating an optical proximity parameter and a related electronic device.
Background
During the conversation using the electronic device, the following results are found: after the electronic equipment receives an incoming call, the distance between the electronic equipment and the user is smaller and smaller in the process that the user clicks the call control on the screen of the electronic equipment and the user brings the electronic equipment close to the ear to call with other people. When the distance between the electronic device and the user is reduced to a certain threshold value, the electronic device can extinguish the screen. When the distance between the user and the electronic equipment is increased to a certain threshold value, the electronic equipment wakes up the screen again and displays the interface. When a user uses the electronic equipment to communicate with other people, if the distance between the electronic equipment and the user is closer and closer, when the distance between the electronic equipment and the user is reduced to a certain threshold value, the electronic equipment can extinguish the screen of the electronic equipment, and when the electronic equipment is far away from the user to a certain distance, the screen of the electronic equipment is awakened again to display a user interface. Or when the screen of the electronic device is in a working state and an object is close to the upper part of the screen of the electronic device by a certain distance, the brightness of the screen of the electronic device is automatically increased. When the object is far away from the upper part of the screen of the electronic equipment by a certain distance, the brightness of the screen of the electronic equipment is automatically reduced.
In the above two close-up light scenes, the electronic device adjusts the screen mainly by the close-up light. Common proximity optics include proximity light sensors. The electronic device adjusts the screen based on the proximity light parameter calculated by the proximity light device. However, in some cases where a flicker light source is present, the flicker light source may affect the accuracy of the proximity light device in calculating the proximity light parameter. Therefore, how to reduce the influence of the flicker light source on the calculation of the proximity light parameter of the proximity light device is an increasing concern of technicians.
Disclosure of Invention
The embodiment of the application provides a method for calculating an approaching light parameter, and solves the problem that the approaching light state information is inaccurate due to large hopping amplitude of the approaching light parameter under a flicker light source caused by the influence of the flicker light source on the approaching light parameter calculated by an approaching light sensor.
In a first aspect, an embodiment of the present application provides a method for calculating a proximity optical parameter, which is applied to an electronic device, where the electronic device includes a proximity optical device, and the method includes: the method comprises the steps that the approaching light device determines approaching light state information in a single-pulse working mode, and the approaching light state information is used for representing the approaching or departing state of an object; when the approaching light state information changes, switching the working mode of the approaching optical device into a multi-pulse working mode; the single-pulse working mode is a working mode for determining the near light state information in a pulse period, and comprises a pulse period in a single working period of the proximity optical device, wherein the pulse period comprises a first time length for the proximity optical device to work in a high level state and the first time length for the proximity optical device to work in a low level state; the multi-pulse operating mode is an operating mode for determining the proximity light state information in a plurality of continuous pulse periods, and comprises a plurality of continuous pulse periods in a single operating period of the proximity light device, wherein one pulse period comprises a second time length for operating the proximity light device in a high level state and a second time length for operating the proximity light device in a low level state, and the second time length is less than the first time length.
In the above embodiment, in the single pulse operation mode, the optical state information is changed if the light approaches. The electronic equipment switches the proximity optical device into a multi-pulse working mode to judge the accuracy of the determined proximity optical state information in the single-pulse working mode. By the method, the influence of the flicker light source on the near light parameter calculated by the near light sensor can be reduced, the jump amplitude of Pdata under the flicker light source is reduced, and the accuracy of the Proximity _ type is improved. The problem that the electronic equipment flickers due to the action of the flickering light source under the application scene that the electronic equipment controls screen parameters such as screen turn-off/screen turn-on based on the maximum _ type is solved.
With reference to the first aspect, in a possible implementation manner, the proximity light state information is a first identifier or a second identifier; the first mark is used for representing the object far state, and the second mark is used for representing the object close state.
With reference to the first aspect, in a possible implementation manner, if the working mode of the proximity optical device is a single-pulse working mode, the proximity optical state information is first proximity optical state information; and if the working mode of the proximity optical device is a multi-pulse working mode, the proximity optical state information is second proximity optical state information. Therefore, the accuracy of the determined Proximity light state information in the single-pulse working mode can be verified, and if the accuracy is not correct, the determined Proximity light state information in the multi-pulse working mode can be reported, so that the influence of the scintillation light source on the Proximity light parameters calculated by the Proximity light sensor is reduced, the jump amplitude of Pdata under the scintillation light source is reduced, and the accuracy of Proximaty _ type is improved. The problem that the electronic equipment flickers due to the action of the flickering light source under the application scene that the electronic equipment controls screen parameters such as screen turn-off/screen turn-on based on the maximum _ type is solved.
With reference to the first aspect, in a possible implementation manner, the changing of the proximity light state information specifically includes: the light state information is changed from the first identification to the second identification.
With reference to the first aspect, in one possible implementation manner, the determining, by the proximity light device, proximity light state information in a single-pulse operation mode includes: calculating a first proximity light parameter for a single pulse period; filtering the first approximate optical parameter to obtain a first target approximate optical parameter; and determining the approaching light state information according to the first target approaching light parameter and the first threshold value.
With reference to the first aspect, in a possible implementation manner, the determining the approaching light state information according to the first target approaching light parameter and the first threshold specifically includes: under the condition that the first approach light parameter is smaller than a first threshold value, determining that the approach light state information is a first identifier; determining that the approaching light state information is a second identifier when the first approaching light parameter is greater than or equal to a first threshold value; the first mark is used for representing the far state of the object, and the second mark is used for representing the near state of the object.
With reference to the first aspect, in one possible implementation manner, calculating a first proximity optical parameter of a single pulse period includes: integrating the infrared light response curve and the first integral waveform to obtain a first integral value; integrating the infrared light response curve and the second integral waveform to obtain a second integral value; calculating a module value of the difference between the first integral value and the second integral value to obtain a first approximate optical parameter; the infrared light response curve is a response curve obtained by photoelectric effect of the proximity optical device after receiving infrared light, the first integral waveform is an integral waveform corresponding to the proximity optical device in a high level state, and the second integral waveform is an integral waveform corresponding to the proximity optical device in a low level state.
With reference to the first aspect, in a possible implementation manner, the filtering the first proximity optical parameter to obtain a first target proximity optical parameter includes: performing median filtering processing on the first proximity optical parameter to obtain a filtered proximity optical parameter; and carrying out mean value filtering processing on the filtered approximate optical parameters to obtain first target approximate optical parameters.
With reference to the first aspect, in a possible implementation manner, after switching the operation mode of the proximity optical device to the multi-pulse operation mode, the method further includes: determining second proximity light status information; the second proximity optical state information is determined proximity optical state information of the proximity optical device in a multi-pulse working mode; reporting the second proximity light status information to a first application, the first application being an application associated with the proximity light device.
With reference to the first aspect, in a possible implementation manner, after determining the second proximity light state information, the method further includes: and switching the working mode of the proximity optical device into a single-pulse working mode. Therefore, the problem of bright spots of the screen when the multi-pulse working mode is frequently used can be prevented.
With reference to the first aspect, in a possible implementation manner, the determining second proximity light state information specifically includes: calculating the approximate optical parameters corresponding to the N pulse periods; the N continuous pulse periods are all pulse periods included in a single working period of the proximity optical device; carrying out mean value calculation on the proximity optical parameters corresponding to the N pulse periods to obtain a second proximity optical parameter; carrying out range conversion processing on the second approximate optical parameter to obtain a second target approximate optical parameter; and determining the second proximity light state information according to the second target proximity light parameter and the first threshold value. Therefore, the range of the second target approaching optical parameter can be matched with the corresponding range direction in the single-pulse working mode, and the problem that the second target approaching optical parameter is inaccurate compared with the first threshold value, so that the second approaching optical state information is inaccurate is solved.
With reference to the first aspect, in a possible implementation manner, determining second proximity light state information according to a second target proximity light parameter and a first threshold specifically includes: determining that the second proximity light state information is a first identifier under the condition that the second target proximity light parameter is smaller than the first threshold value; determining that the second proximity light state information is a second identifier under the condition that the second target proximity light parameter is greater than or equal to the first threshold value; the first mark is used for representing the far state of the object, and the second mark is used for representing the close state of the object.
With reference to the first aspect, in a possible implementation manner, performing range conversion processing on the second proximity optical parameter to obtain a second target proximity optical parameter specifically includes: calculating according to a formula Pdata' = (Pdata + offset × L2)/L1-offset × L2 to obtain a second target proximity optical parameter; wherein Pdata' is a second target proximity optical parameter, pdata is a second proximity optical parameter, L1 is a first parameter, L2 is a second parameter, and offset is a random number.
With reference to the first aspect, in a possible implementation manner, the electronic device further includes a first application, before the proximity optical device determines the proximity optical state information in the single-pulse operating mode, the method further includes: starting a first application; the first application starts the proximity optical device, and the working mode of the proximity optical device is a single-pulse working mode.
With reference to the first aspect, in one possible implementation manner, after the proximity light device determines the proximity light state information in the single-pulse operation mode, the proximity light device includes: when the approach light state information does not change, reporting the approach light state information to the first application; the first application is an application related to the proximity light device. In this way, the first application can adjust the screen parameters according to the proximity light status information.
With reference to the first aspect, in a possible implementation manner, the electronic device includes a filtering processing module and a proximity/far determination module, and the determining, by the proximity optical device, proximity optical state information in a single-pulse operating mode specifically includes: the method comprises the following steps that a first proximity optical parameter is calculated by a proximity optical device in a single-pulse working mode; the filtering processing module acquires a first proximity optical parameter; the filtering processing module carries out filtering processing on the first approaching optical parameter to obtain a first target approaching optical parameter; the filtering processing module sends the first target approaching optical parameter to the approaching and departing judgment module; the approaching and departing judgment module determines approaching light state information according to the first target approaching light parameter.
With reference to the first aspect, in a possible implementation manner, the electronic device further includes a single pulse processing module, and before the filtering processing module acquires the first proximity optical parameter, the method further includes: the proximity optical device writes the first proximity optical parameter into the register; the single pulse processing module reads the first proximity light parameter from the register.
With reference to the first aspect, in a possible implementation manner, the obtaining, by a filtering processing module, a first proximity light parameter includes: and the single-pulse processing module sends the first proximity optical parameter to the filtering processing module.
With reference to the first aspect, in a possible implementation manner, the performing, by a filtering processing module, filtering the first proximity optical parameter to obtain a first target proximity optical parameter includes: the filtering processing module performs median filtering on the first proximity optical parameter to obtain a filtered proximity optical parameter; and the filtering processing module performs mean filtering on the filtered approximate optical parameters to obtain first target approximate optical parameters.
With reference to the first aspect, in a possible implementation manner, the approaching and departing determining module determines the approaching light state information according to the first target approaching light parameter, specifically including: under the condition that the first target approaching light parameter is smaller than a first threshold value, the approaching and departing judgment module determines that the approaching light state information is a first identifier; under the condition that the first target approaching light parameter is larger than or equal to a first threshold value, the approaching and departing judgment module determines that the approaching light state information is a second identifier; the first mark is used for representing the far state of the object, and the second mark is used for representing the near state of the object.
With reference to the first aspect, in a possible implementation manner, the electronic device further includes a proximity light far determination module and a proximity light operation mode control module, and when the proximity light state information changes, the operation mode of the proximity light device is switched to a multi-pulse operation mode, which specifically includes: when the state information of the approach light changes, the approach light far-away judging module sends first indication information to the approach light working mode control module, and the first indication information is used for indicating the approach light working mode control module to switch the working mode of the approach light device; the close-beam working mode control module switches the working mode of the close-beam device into a multi-pulse working mode.
With reference to the first aspect, in a possible implementation manner, the electronic device further includes a multi-pulse processing module, a range conversion module, and a proximity/distance determination module, and determines second proximity optical state information, which specifically includes: the approach light device calculates a second approach light parameter; the range conversion module acquires a second approximate optical parameter; the range conversion module performs range conversion on the second approximate optical parameter to obtain a second target approximate optical parameter; the range conversion module sends the second target approach optical parameter to the approach and distance judgment module; and the approaching and departing judgment module determines approaching light state information according to the second target approaching light parameter.
With reference to the first aspect, in a possible implementation manner, the electronic device further includes a multi-pulse processing module, and before the range conversion module acquires the second proximity optical parameter, the method further includes: the access optical device writes the second access optical parameter into the register; the multi-pulse processing module reads the first proximity light parameter from the register.
With reference to the first aspect, in one possible implementation manner, the obtaining, by the range conversion module, a second proximity optical parameter includes: the multi-pulse processing module sends the first proximity optical parameter to the range conversion module.
With reference to the first aspect, in a possible implementation manner, the range conversion module performs range conversion on the second proximity optical parameter to obtain a second target proximity optical parameter, and specifically includes: the range conversion module calculates according to a formula Pdata' = (Pdata + offset × L2)/L1-offset × L2 to obtain a second target proximity optical parameter; wherein Pdata' is a second target proximity optical parameter, pdata is a second proximity optical parameter, L1 is a first parameter, L2 is a second parameter, and offset is a random number.
With reference to the first aspect, in a possible implementation manner, the approaching and departing determining module determines the approaching light state information according to the second target approaching light parameter, specifically including: under the condition that the second target approaching light parameter is smaller than a first threshold value, the approaching and departing judgment module determines that the approaching light state information is a first identifier; under the condition that the second target approaching light parameter is greater than or equal to the first threshold value, the approaching and departing judgment module determines that the approaching light state information is a second identifier; the first mark is used for representing the far state of the object, and the second mark is used for representing the near state of the object.
In a second aspect, an embodiment of the present application provides an electronic device, including: one or more processors and memory; the memory coupled with the one or more processors, the memory to store computer program code, the computer program code including computer instructions, the one or more processors to invoke the computer instructions to cause the electronic device to perform: determining approaching light state information in the single-pulse working mode, wherein the approaching light state information is used for representing the approaching or departing state of an object; when the state information of the proximity light changes, switching the working mode of the proximity light device into a multi-pulse working mode; the single-pulse working mode is a working mode for determining the near light state information in a pulse period, and comprises a pulse period in a single working period of the proximity optical device, wherein the pulse period comprises a first time length for the proximity optical device to work in a high level state and the first time length for the proximity optical device to work in a low level state; the multi-pulse operating mode is an operating mode for determining the proximity light state information in a plurality of continuous pulse periods, and comprises a plurality of continuous pulse periods in a single operating period of the proximity light device, wherein one pulse period comprises a second time length for operating the proximity light device in a high level state and a second time length for operating the proximity light device in a low level state, and the second time length is less than the first time length.
In combination with the second aspect, in one possible implementation manner, the one or more processors invoke the computer instructions to cause the electronic device to perform: calculating a first proximity light parameter for a single pulse period; filtering the first approximate optical parameter to obtain a first target approximate optical parameter; and determining the approaching light state information according to the first target approaching light parameter and the first threshold value.
In combination with the second aspect, in one possible implementation manner, the one or more processors invoke the computer instructions to cause the electronic device to perform: under the condition that the first approach light parameter is smaller than a first threshold value, determining that the approach light state information is a first identifier; determining that the approaching light state information is a second identifier when the first approaching light parameter is greater than or equal to a first threshold value; the first mark is used for representing the far state of the object, and the second mark is used for representing the near state of the object.
In combination with the second aspect, in one possible implementation manner, the one or more processors invoke the computer instructions to cause the electronic device to perform: integrating the infrared light response curve and the first integral waveform to obtain a first integral value; integrating the infrared light response curve and the second integral waveform to obtain a second integral value; calculating a module value of the difference between the first integral value and the second integral value to obtain a first approximate optical parameter; the infrared light response curve is a response curve obtained by photoelectric effect of the proximity optical device after receiving infrared light, the first integral waveform is an integral waveform corresponding to the proximity optical device in a high level state, and the second integral waveform is an integral waveform corresponding to the proximity optical device in a low level state.
In combination with the second aspect, in one possible implementation manner, the one or more processors invoke the computer instructions to cause the electronic device to perform: performing median filtering processing on the first proximity optical parameter to obtain a filtered proximity optical parameter; and carrying out mean value filtering processing on the filtered approximate optical parameters to obtain first target approximate optical parameters.
With reference to the second aspect, in one possible implementation manner, the one or more processors invoke the computer instructions to cause the electronic device to perform: determining second proximity light status information; the second proximity optical state information is determined proximity optical state information of the proximity optical device in a multi-pulse working mode; reporting the second proximity light status information to a first application, the first application being an application associated with the proximity light device.
With reference to the second aspect, in one possible implementation manner, the one or more processors invoke the computer instructions to cause the electronic device to perform: and switching the working mode of the proximity optical device into a single-pulse working mode.
In combination with the second aspect, in one possible implementation manner, the one or more processors invoke the computer instructions to cause the electronic device to perform: calculating the approximate optical parameters corresponding to the N pulse periods; the N continuous pulse periods are all pulse periods included in a single working period of the proximity optical device; carrying out mean value calculation on the proximity optical parameters corresponding to the N pulse periods to obtain a second proximity optical parameter; carrying out range conversion processing on the second approximate optical parameter to obtain a second target approximate optical parameter; and determining the second proximity light state information according to the second target proximity light parameter and the first threshold value.
In combination with the second aspect, in one possible implementation manner, the one or more processors invoke the computer instructions to cause the electronic device to perform: determining that the second proximity light state information is a first identifier under the condition that the second target proximity light parameter is smaller than the first threshold value; determining that the second proximity light state information is a second identifier under the condition that the second target proximity light parameter is greater than or equal to the first threshold value; the first mark is used for representing the far state of the object, and the second mark is used for representing the near state of the object.
In combination with the second aspect, in one possible implementation manner, the one or more processors invoke the computer instructions to cause the electronic device to perform: calculating according to a formula Pdata' = (Pdata + offset × L2)/L1-offset × L2 to obtain a second target proximity optical parameter; wherein Pdata' is a second target proximity optical parameter, pdata is a second proximity optical parameter, L1 is a first parameter, L2 is a second parameter, and offset is a random number.
With reference to the second aspect, in one possible implementation manner, the one or more processors invoke the computer instructions to cause the electronic device to perform: starting a first application; the proximity optics is activated by a first application, the mode of operation of the proximity optics being a single pulse mode of operation.
In combination with the second aspect, in one possible implementation manner, the one or more processors invoke the computer instructions to cause the electronic device to perform: when the approach light state information does not change, reporting the approach light state information to the first application; the first application is an application related to the proximity light device.
In combination with the second aspect, in one possible implementation manner, the one or more processors invoke the computer instructions to cause the electronic device to perform: acquiring a first proximity optical parameter through a filtering processing module; filtering the first approximate optical parameter through a filtering processing module to obtain a first target approximate optical parameter; sending the first target approaching optical parameter to an approaching and departing judgment module through a filtering processing module; and determining the approaching light state information according to the first target approaching light parameter through the approaching and departing judgment module.
In combination with the second aspect, in one possible implementation manner, the one or more processors invoke the computer instructions to cause the electronic device to perform: the first proximity light parameter is read from the register by the single pulse processing module.
In combination with the second aspect, in one possible implementation manner, the one or more processors invoke the computer instructions to cause the electronic device to perform: performing median filtering on the first proximity optical parameter through a filtering processing module to obtain a filtered proximity optical parameter; and performing mean filtering on the filtered approximate optical parameters through a filtering processing module to obtain first target approximate optical parameters.
With reference to the second aspect, in one possible implementation manner, the one or more processors invoke the computer instructions to cause the electronic device to perform: under the condition that the first target approach light parameter is smaller than a first threshold value, determining approach light state information as a first identifier through an approach and departure judging module; under the condition that the first target approaching light parameter is larger than or equal to a first threshold value, the approaching light state information is determined to be a second identifier through the approaching and departing judgment module; the first mark is used for representing the far state of the object, and the second mark is used for representing the near state of the object.
With reference to the second aspect, in one possible implementation manner, the one or more processors invoke the computer instructions to cause the electronic device to perform: when the information of the state of the approaching light changes, first indication information is sent to the approaching light working mode control module through the approaching light far-away judging module, and the first indication information is used for indicating the approaching light working mode control module to switch the working mode of the approaching light device; the working mode of the near light device is switched into a multi-pulse working mode through the near light working mode control module.
In combination with the second aspect, in one possible implementation manner, the one or more processors invoke the computer instructions to cause the electronic device to perform: acquiring a second approaching optical parameter through a range conversion module; performing range conversion on the second approximate optical parameter through a range conversion module to obtain a second target approximate optical parameter; sending the second target approaching optical parameter to the approaching and departing judgment module through the range conversion module; and determining the approaching light state information according to the second target approaching light parameter through the approaching and departing judgment module.
In combination with the second aspect, in one possible implementation manner, the one or more processors invoke the computer instructions to cause the electronic device to perform: the first proximity light parameter is read from the register by the multi-pulse processing module.
In combination with the second aspect, in one possible implementation manner, the one or more processors invoke the computer instructions to cause the electronic device to perform: and sending the first proximity optical parameter to the range conversion module through the multi-pulse processing module.
In combination with the second aspect, in one possible implementation manner, the one or more processors invoke the computer instructions to cause the electronic device to perform: calculating according to a formula Pdata' = (Pdata + offset) L2)/L1-offset L2 through a range conversion module to obtain a second target proximity optical parameter; wherein Pdata' is a second target proximity optical parameter, pdata is a second proximity optical parameter, L1 is a first parameter, L2 is a second parameter, and offset is a random number.
With reference to the second aspect, in one possible implementation manner, the one or more processors invoke the computer instructions to cause the electronic device to perform: under the condition that the second target approaching light parameter is smaller than a first threshold value, the approaching light state information is determined to be a first identifier through the approaching and departing judgment module; under the condition that the second target approaching light parameter is greater than or equal to the first threshold value, the approaching light state information is determined to be a second identifier through the approaching and departing judgment module; the first mark is used for representing the far state of the object, and the second mark is used for representing the close state of the object.
In a third aspect, an embodiment of the present application provides an electronic device, including: the system comprises a touch screen, a camera, one or more processors and one or more memories; the one or more processors are coupled to the touch screen, the camera, the one or more memories for storing computer program code comprising computer instructions that, when executed by the one or more processors, cause the electronic device to perform the method as set forth in the first aspect or any one of the possible implementations of the first aspect.
In a fourth aspect, the present application provides a chip system, which is applied to an electronic device, and the chip system includes one or more processors, and the processor is configured to invoke computer instructions to cause the electronic device to perform the method according to the first aspect or any one of the possible implementation manners of the first aspect.
In a fifth aspect, embodiments of the present application provide a computer program product containing instructions, which when run on an electronic device, cause the electronic device to perform the method according to the first aspect or any one of the possible implementation manners of the first aspect.
In a sixth aspect, an embodiment of the present application provides a computer-readable storage medium, which includes instructions that, when executed on an electronic device, cause the electronic device to perform the method as set forth in the first aspect or any one of the possible implementation manners of the first aspect.
Drawings
Fig. 1A is a schematic diagram illustrating operation of a proximity optical sensor in a case of turning on a VSCEL according to an embodiment of the present disclosure;
fig. 1B is a schematic diagram illustrating operation of a proximity optical sensor in a case where VSCEL is turned off according to an embodiment of the present application;
fig. 1C is a schematic diagram of an operation mode of a proximity light sensor according to an embodiment of the present disclosure;
FIG. 2A is a diagram illustrating an exemplary operation of a proximity light sensor in the absence of a flicker light source according to an embodiment of the present disclosure;
FIG. 2B is a diagram illustrating an exemplary operation of a proximity light sensor in the presence of a flicker light source according to an embodiment of the present disclosure;
FIG. 3 is a schematic diagram of Pdata calculated by a proximity light sensor according to an embodiment of the present disclosure;
fig. 4A to fig. 4C are schematic diagrams illustrating an application scenario of a method for calculating a proximity optical parameter according to an embodiment of the present application;
fig. 5 is a schematic hardware structure diagram of an electronic device 100 provided in an embodiment of the present application;
fig. 6 is a flowchart illustrating a proximity light sensor switching operation mode according to an embodiment of the present application;
FIG. 7 is a flowchart of a method for calculating a proximity light parameter according to an embodiment of the present disclosure;
FIG. 8 is a schematic diagram of an operating mode of 32us-1pulse according to an embodiment of the present application;
FIG. 9 is a schematic diagram of a 4us-48pulse operation mode provided by an embodiment of the present application;
fig. 10 is a software architecture diagram of an electronic device 100 according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application. It should be apparent that the described embodiments are only a few embodiments of the present application, and not all embodiments. Reference herein to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment can be included in at least one embodiment of the present application. The appearances of the phrase in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. Those skilled in the art will explicitly and implicitly appreciate that the embodiments described herein may be combined with other embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
The terms "first," "second," "third," and the like in the description and claims of this application and in the accompanying drawings are used for distinguishing between different objects and not necessarily for describing a particular order. Furthermore, the terms "comprising" and "having," as well as any variations thereof, are intended to cover non-exclusive inclusions. For example, a process may comprise a sequence of steps or elements, or may alternatively comprise steps or elements not listed, or may alternatively comprise other steps or elements inherent to such process, method, article, or apparatus.
Only some, but not all, of the material relevant to the present application is shown in the drawings. Before discussing exemplary embodiments in more detail, it should be noted that some exemplary embodiments are described as processes or methods depicted as flowcharts. Although a flowchart may describe the operations (or steps) as a sequential process, many of the operations can be performed in parallel, concurrently or simultaneously. In addition, the order of the operations may be re-arranged. The process may be terminated when its operations are completed, but could have additional steps not included in the figure. The processes may correspond to methods, functions, procedures, subroutines, and the like.
As used in this specification, the terms "component," "module," "system," "unit," and the like are intended to refer to a computer-related entity, either hardware, firmware, a combination of hardware and software, or software in execution. For example, a unit may be, but is not limited to being, a process running on a processor, an object, an executable, a thread of execution, a program, and/or a distribution between two or more computers. In addition, these units may execute from various computer readable media having various data structures stored thereon. The units may communicate by way of local and/or remote processes such as in accordance with a signal having one or more data packets (e.g., from a second unit of data interacting with another unit in a local system, distributed system, and/or across a network.
During the use of the electronic device, it is found that: when the electronic equipment receives an incoming call, the distance between the electronic equipment and a user is smaller and smaller when the user clicks the call control on the screen and the user brings the electronic equipment close to the ear for calling. When the distance between the electronic device and the user is reduced to a certain threshold value, the electronic device can extinguish the screen. When the distance between the user and the electronic equipment is increased to a certain threshold value, the electronic equipment wakes up the screen again to display the interface. Or when the screen of the electronic device is in a working state and an object is close to the upper part of the screen of the electronic device by a certain distance, the brightness of the screen of the electronic device is automatically increased. When the object is far away from the upper part of the screen of the electronic equipment by a certain distance, the brightness of the screen of the electronic equipment is automatically reduced. The above two application scenarios are exemplary illustrations of a near light scenario: an infrared lamp of a proximity light sensor (in the embodiment of the present application, the proximity light sensor is built in a lower portion of a screen of an electronic device for example, and is described as an example) emits infrared light to the outside through the screen. The proximity light sensor then receives the infrared light from the infrared lamp and the infrared light from the environment of the light source that are reflected from the surface of the object. When the proximity light sensor is closer to the object, the more infrared light of the infrared lamp reflected by the object is received by the proximity light sensor, the greater the intensity of the infrared light received by the proximity light sensor. When the proximity light sensor is farther away from the object, the proximity light sensor receives less infrared light of the infrared lamp reflected by the object, and the intensity of the infrared light received by the proximity light sensor is smaller. Therefore, the electronic device can judge the distance to the object by judging the intensity of the infrared light received by the proximity light sensor, so as to adjust the screen parameters.
To illustrate the scenario of a user performing a voice call, generally, when the user performs a voice call, the user may keep the electronic device as close as possible to the ear in order to hear the voice of the contact in order to ensure the call quality. The user call interface generally includes a plurality of function controls, for example, an end control, and when the end control is clicked, the electronic device ends the call in response to the clicking operation. During a call, the electronic device is typically close to the ear of the user. This makes it possible for the user to mistakenly touch the end control on the screen during the call, thereby causing a call interruption. This brings great inconvenience to the user and reduces the user experience.
In general, a proximity light sensor is mounted in an electronic device, and a photoelectric response is generated based on received infrared light, thereby generating a proximity light parameter. The call application program can determine the distance between the electronic device and the user according to the proximity light parameter. When the electronic device determines that it is close to the user (e.g., the electronic device is close to the ear), the electronic device may adjust its screen state to a screen-off state. At this time, the screen of the electronic device is in a dormant state, and the user interface is no longer displayed, and no response is made to the input operation of the user. And when the electronic equipment judges that the electronic equipment is far away from the user, the electronic equipment adjusts the screen state to be a working state and displays a user interface. The electronic equipment enables the screen to be turned off/on by approaching the optical parameter adjusting screen, so that the user can be prevented from mistakenly touching the functional control on the screen in the mistaken touch preventing scene such as user conversation, and the use experience of the user is reduced.
The operation of the proximity light sensor will be described with reference to fig. 1A to 1C. A proximity light sensor is a sensor that is capable of sensing ambient infrared light. After infrared light irradiates on the proximity optical sensor, the proximity optical sensor generates a photoelectric effect to convert an infrared light signal into an electric signal. After the proximity light sensor is activated, the electrical signal of the infrared light is current integrated during each pulse period. After each pulse period is finished, a near optical parameter Pdata is calculated. Wherein, in each pulse period, the proximity photosensor has two integration states: first, the proximity light sensor will turn on a built-in infrared lamp (VCSEL) within half a pulse period, which will emit infrared light outward through the screen, which will be reflected off the surface of the shading object. Thus, during this half of the pulse period, the received infrared light near the light sensor may include ambient infrared light in addition to some of the infrared light reflected back from the light-blocking object. During this half pulse period, the proximity photosensor may also perform current integration on the electrical signal of the reflected VCSEL IR light to obtain an integrated value (A) 1 ). As the proximity light sensor is closer to the light-shielding object, the more VCSEL infrared light is reflected back to the proximity light sensor, the greater the infrared light response value the proximity light sensor receives. The larger the response value of the infrared light, the stronger the electric signal of the infrared light generated near the photosensor. Therefore, the proximity photosensor current-integrates the electric signal of the infrared light received by the proximity photosensor, and the integrated value a is obtained 1 The larger. The closer the proximity light sensor is from the light blocking object, the less VCSEL infrared light is reflected back to the proximity light sensor and the smaller the infrared light response value the proximity light sensor receives. The smaller the response value of the infrared light, the weaker the electric signal of the infrared light generated near the photosensor. Therefore, the proximity photosensor current-integrates the electric signal of the infrared light it receives, and the resultant integrated value A1 becomes smaller.
Second, the proximity photosensor will be on the other half of the pulse periodThe VCSEL is turned off internally. Therefore, in this half pulse period, the infrared light received by the proximity photosensor does not include the infrared light of the VCSEL, and the proximity photosensor current-integrates only the electric signal of the infrared light in the environment to obtain the integrated value (a) 2 ). After one pulse period is over, the proximity light sensor calculates A 1 And A 2 Obtaining a near optical parameter Pdata, and writing Pdata into the memory. The larger Pdata is when the proximity photosensor is closer to the object. The further away the proximity photosensor is from the object, the smaller Pdata. In this way, the electronic device may read Pdata and determine to switch to the low light state Proximity _ type according to the value of Pdata (e.g., proximity _ type is far indicating that the electronic device is far away from the object, proximity _ type is near indicating that the electronic device is near the object), and the electronic device may adjust the screen according to Proximity _ type (e.g., control screen display/off, adjust screen brightness, etc.).
The operation of the proximity light sensor will be described below with reference to fig. 1A to 1C.
As shown in fig. 1A, in the case where the proximity light sensor turns on the VSCEL, the VSCEL emits infrared light to the environment. A part of infrared light emitted by the VSCEL is incident on the light-shielding object, the light-shielding object reflects the part of infrared light, and a part of the reflected infrared light is received by the proximity light sensor. In addition, the proximity light sensor may also receive infrared light from a portion of the ambient light source, such that, when the VSCEL is turned on, the infrared light received by the proximity light sensor includes infrared light from the environment and a portion of the infrared light reflected back from the object by the infrared light emitted by the VSCEL.
As shown in fig. 1B, VSCEL does not emit infrared light to the environment in the event that the proximity light sensor turns off VSCEL. Thus, with the VSCEL turned off, the infrared light received by the proximity light sensor includes only infrared light in the environment.
Fig. 1C is an exemplary diagram of an operation mode of the proximity light sensor. As shown in fig. 1C, the proximity photosensor operates periodically, and the operation period of the proximity photosensor may be 50ms. One duty cycle next to the light sensor may include one pulse cycle including a period during which the proximity light sensor operates in a high state and a period during which the proximity light sensor operates in a low state. In fig. 1C, the proximity light sensor operates in a high state for a period of time of 32us and operates in a low state for a period of time of 32us. The high state of the proximity photosensor corresponds to the state of the proximity photosensor turning on VSCEL in fig. 1A described above. During the duration of the high level state, the proximity light sensor performs current integration on the part of infrared light reflected by the object and received infrared light in the environment, which is received by the proximity light sensor and emitted by the VSCEL, to obtain an integrated value A1. During the duration of the low level state, the proximity photosensor performs current integration on the infrared light in the environment received by the proximity photosensor, and an integrated value A2 is obtained. The proximity photosensor can obtain Pdata corresponding to a single pulse period (64 us) by calculating the mode value of the difference between A1 and A2. The value of Pdata may reflect the distance between the electronic device and the object, and Pdata is larger when the electronic device is closer to the object. The farther the electronic device is from the object, the smaller Pdata. Accordingly, the electronic device may adjust screen parameters (e.g., control to turn off or turn on) according to the Pdata.
However, in the case where a flicker light source is present, it is a light source that switches between a bright/dark state at a specific frequency. When the flashing light source is on, infrared light is emitted. When the flicker light source is dark, no infrared light is emitted. This may cause Pdata calculated by the Proximity photosensor in a plurality of pulse periods or large fluctuation even if the distance between the electronic device and the object is not changed under the action of the flash light source, and thus the accuracy of the Proximity _ type is not high, and the Proximity _ type may jump. For example, in a scene where the electronic device uses the Proximity _ type to adjust screen display/off (for example, the Proximity _ type is near, the control screen is in an off-screen state, the Proximity _ type is far, and the control screen is in an on-screen state), a problem of screen flashing may occur, thereby increasing power consumption of the system.
For convenience of understanding, the embodiment of the present application takes the electronic device to adjust the scene of screen display/blanking using Proximity _ type as an example, and exemplifies the principle that the flickering light source has an influence on Pdata, so that the electronic device has a flickering screen problem.
Fig. 2A is an exemplary diagram of the operating principle of a proximity light sensor in the absence of a flicker light source. As shown in fig. 2A, in the absence of a blinking light source, the proximity photosensor periodically calculates Pdata. Each duty cycle of the proximity photosensor includes a pulse period, and the proximity photosensor obtains Pdata by integrating the infrared light it receives during each pulse period. Wherein, t 1 Time t 3 Time t 4 Time t 6 Time of day, t 7 Time t 9 Time t 10 Time t 12 Time t 13 Time t 15 Time t 16 Time t 18 The instants are 6 pulse periods each. It is assumed that the distance from the proximity light sensor to the light-shielding object does not change. Each pulse period corresponds to one of Pdata (Pdata _11 to Pdata _ 16), and the Pdata _11 to Pdata _16 are shown in FIG. 3. Wherein the proximity light sensor is at t 1 Time t 2 Time t 4 Time t 5 Time t 7 Time t 8 Time of day, t 10 Time t 11 Time t 13 Time t 14 Time t 16 Time t 17 The operating state in the 6 time periods is the high level state at the moment, and the proximity photosensor turns on the VCSEL in the time period. Close to the optical sensor at t 2 Time t 3 Time t 5 Time t 6 Time t 8 Time t 9 Time t 11 Time t 12 Time t 14 Time t 15 Time t 17 Time t 18 The operating state during the 6 time periods is the low state at the moment, and the proximity photosensor turns off the VCSEL during the time periods.
If at t 1 Time t 2 Time t 2 Time t 3 Time t 4 Time t 5 Time t 5 Time t 6 Time of day, t 7 Time t 8 Time t 8 Time t 9 Time t 10 Time t 11 Time of day, t 11 Time t 12 Time t 13 Time t 14 Time t 14 Time t 15 Time t 16 Time t 17 Time t 17 Time t 18 The integral values corresponding to the 12 time periods at the time are respectively M 101 、M 102 、M 103 、M 104 、M 105 、M 106 、M 107 、M 108 、M 109 、M 110 、M 111 、M 112 . Thus, pdata _11 to Pdata _16 are: | M 101 -M 102 |、|M 103 -M 104 |、|M 105 -M 106 |、|M 107 -M 108 |、|M 109 -M 110 |、|M 111 -M 112 |。
Fig. 2B is an exemplary diagram of the operating principle of a proximity light sensor in the presence of a flickering light source. As shown in fig. 2B, in the presence of a blinking light source, the proximity photosensor periodically calculates Pdata. Wherein, t 1 Time t 3 Time t 4 Time t 6 Time t 7 Time t 9 Time t 10 Time t 12 Time t 13 Time t 15 Time t 16 Time t 18 The instants are 6 pulse periods each. It is assumed that the distance from the proximity light sensor to the light-shielding object does not change. Each pulse period corresponds to one Pdata (Pdata _21 to Pdata _ 26), and Pdata _21 to Pdata _26 are shown in fig. 3. At t 1 Time t 01 Time t 51 Time t 61 Time t 71 Time t 8 Time of day, t 111 Time t 12 Time t 131 Time t 14 Time t 171 Time t 18 In the 6 time periods, the flicker light source is bright, and in other time periods, the flicker light source is dark. When the flicker light source is on, the flicker light source emits infrared light. When the flicker light source is dark, no infrared light is emitted. If at t 1 Time t 2 Time t 2 Time t 3 Time of day, t 4 Time t 5 Time t 5 Time t 6 Time of day, t 7 Time t 8 Time t 8 Time t 9 Time t 10 Time t 11 Time t 11 Time t 12 Time t 13 Time t 14 Time t 14 Time t 15 Time of day, t 16 Time t 17 Time t 17 Time t 18 The integral values corresponding to the 12 time periods at the time are respectively M 201 、M 202 、M 203 、M 204 、M 205 、M 206 、M 207 、M 208 、M 209 、M 210 、M 211 、M 212 . Thus, pdata _21 to Pdata _26 are: | M 201 -M 202 |、|M 203 -M 204 |、|M 205 -M 206 |、|M 207 -M 208 |、|M 209 -M 210 |、|M 211 -M 212 |。
When the flicker light source is on, the flicker light source can emit infrared light. Thus, M 201 Greater than M 101 、M 204 Greater than M 104 、M 205 Greater than M 105 、M 208 Greater than M 108 、M 209 Greater than M 109 、M 212 Greater than M 112 。M 102 And M 202 Is close to the value of M 103 And M 203 Is close to the value of M 106 And M 206 Is close to the value of M 107 And M 207 Is close to the value of M 110 And M 210 Is close to the value of M 111 And M 211 The values of (a) and (b) are close. This results in: | M 201 -M 202 | is greater than | M 101 -M 102 |,|M 203 -M 204 | is less than | M 103 -M 104 |,|M 205 -M 206 | is greater than | M 105 -M 106 |,|M 207 -M 208 | is less than | M 107 -M 108 |,|M 209 -M 210 | is greater than | M 109 -M 110 |,|M 211 -M 212 | is less than | M 111 -M 112 L. Therefore, pdata _21 is greater than Pdata _11, pdata _22is less than Pdata _12, pdata _23is greater than Pdata _13, pdata _24is less than Pdata _14, pdata _25is greater than Pdata _15, pdata _26is less than Pdata _16. Therefore, in the presence of a flicker light source, the Proximity light parameter Pdata calculated by the Proximity light sensor greatly jumps due to the influence of the flicker light source, so that the judgment of the Proximity _ type is inaccurate.
As shown in fig. 3, in the absence of the flicker light source, pdata _11 to Pdata _16 are all greater than the threshold value a, assuming that when Pdata is greater than or equal to a, proximity _ type is near (at this time, the electronic device is turned off), and when Pdata is less than a, proximity _ type is far (at this time, the electronic device is on). Therefore, in the absence of a flickering light source, the electronic device will remain bright during these 6 pulse periods. However, in the presence of a flicker light source, due to the influence of the flicker light source, pdata for some pulse periods is greater than or equal to a, and Pdata for some pulse periods is less than a, which results in Proximity _ type for some pulse periods being near and Proximity _ type for some pulse periods being far. When the electronic device controls the screen on/off based on the Proximity _ type, a problem of screen flickers is likely to occur.
In order to solve the above problem, an embodiment of the present application provides a method for calculating a proximity optical parameter, where the method includes: and the near light sensor performs current integration on the received infrared light in a single-pulse working mode, so that a near light parameter Pdata is obtained. Then, the electronic apparatus determines the current Proximity light state information Proximity _ type based on Pdata. If the Proximity _ type is far, the electronic device adjusts the screen state to be a bright screen state. If the Proximity _ type is near, the electronic device switches the operating mode to a multi-pulse operating mode, and performs current integration on the received infrared light to obtain new Pdata. The electronic device then determines the current Proximity light status information Proximity _ type based on the new Pdata and adjusts the screen status according to the Proximity _ type. By the method, the influence of the flicker light source on the near light parameter calculated by the near light sensor can be reduced, the jump amplitude of Pdata under the flicker light source is reduced, and the accuracy of the Proximity _ type is improved. The problem that the electronic equipment flickers due to the action of the flickering light source under the application scene that the electronic equipment controls screen parameters such as screen turn-off/screen turn-on based on the maximum _ type is solved.
Next, an application scenario of the method for calculating a proximity optical parameter according to the embodiment of the present application is exemplarily described with reference to fig. 4A to 4C.
As shown in FIG. 4A, the application scenario includes a user and an electronic device 100, the electronic device 100 including a proximity light sensor 101, at t 1 At that time, the shortest straight-line distance d between the proximity optical sensor 101 and the user 1 The electronic device 100 currently displays the user interface 41, where the user interface 41 is a call interface and includes an answering control 411, a hang-up control 412, and a caller id display area 413. The caller id display area 413 includes a contact "XXX" to which the phone is dialed and a phone number "111222333" of the contact. At t 2 At that time, a single-click operation for the listen control 411 is detected, and in response to the single-click operation, the electronic device 100 displays the user interface 42 shown in fig. 4B.
As shown in fig. 4B, the user interface 42 is an answering interface, the answering interface includes a call duration display area 421, the call duration display area 421 is used for displaying the call duration between the user and the contact, the user interface 42 further includes an ending control 422, and the ending control 422 is used for responding to the click operation of the user to end the current call. As can be seen from FIG. 4B, at t 2 At that time, the shortest straight-line distance d between the proximity optical sensor 101 and the user 2 And d is d 2 Is less than d 1
As the user continues to talk with the contact, the distance between the electronic device 100 and the user changes, as shown in FIG. 4C, at t 3 At that time, the shortest straight-line distance d between the proximity optical sensor 101 and the user 3 At this time, the screen state of the electronic device 100 is the off-screen state, that is: the electronic apparatus 100 runs the voice call program at this time, but does not display any interface on the screen.
As can be seen from the above application scenarios, during a call, a distance between the electronic device 100 and a user is continuously reduced, when the distance between the electronic device 100 and the user is smaller than a certain threshold value, the electronic device 100 may adjust a screen state of the electronic device to be an off-screen state, at this time, a screen of the electronic device 100 may not display any interface, and when the user performs an input operation (e.g., clicks) on the screen, the electronic device 100 may not respond.
The structure of the electronic device 100 will be described below. Referring to fig. 5, fig. 5 is a schematic hardware structure diagram of an electronic device 100 according to an embodiment of the present disclosure.
The electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a Universal Serial Bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, a Subscriber Identity Module (SIM) card interface 195, and the like. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, a proximity light sensor 180L, a bone conduction sensor 180M, and the like.
It is to be understood that the illustrated structure of the embodiment of the present invention does not specifically limit the electronic device 100. In other embodiments of the present application, electronic device 100 may include more or fewer components than shown, or some components may be combined, some components may be split, or a different arrangement of components. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
Processor 110 may include one or more processing units, such as: the processor 110 may include an Application Processor (AP), a modem processor, a Graphics Processor (GPU), an Image Signal Processor (ISP), a controller, a memory, a video codec, a Digital Signal Processor (DSP), a baseband processor, and/or a neural-Network Processing Unit (NPU), among others. The different processing units may be separate devices or may be integrated into one or more processors.
The wireless communication function of the electronic device 100 may be implemented by the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, a modem processor, a baseband processor, and the like.
The antennas 1 and 2 are used for transmitting and receiving electromagnetic wave signals. Each antenna in the electronic device 100 may be used to cover a single or multiple communication bands. Different antennas can also be multiplexed to improve the utilization of the antennas. For example: the antenna 1 may be multiplexed as a diversity antenna of a wireless local area network. In other embodiments, the antenna may be used in conjunction with a tuning switch.
The mobile communication module 150 may provide a solution including 2G/3G/4G/5G wireless communication applied to the electronic device 100. The mobile communication module 150 may include at least one filter, a switch, a power amplifier, a Low Noise Amplifier (LNA), and the like. The mobile communication module 150 may receive the electromagnetic wave from the antenna 1, filter, amplify, etc. the received electromagnetic wave, and transmit the electromagnetic wave to the modem processor for demodulation. The mobile communication module 150 may also amplify the signal modulated by the modem processor, and convert the signal into electromagnetic wave through the antenna 1 to radiate the electromagnetic wave. In some embodiments, at least some of the functional modules of the mobile communication module 150 may be disposed in the processor 110. In some embodiments, at least some of the functional modules of the mobile communication module 150 may be disposed in the same device as at least some of the modules of the processor 110.
The wireless communication module 160 may provide a solution for wireless communication applied to the electronic device 100, including Wireless Local Area Networks (WLANs) such as Wi-Fi networks, blueTooth (BT), BLE broadcasting, global Navigation Satellite System (GNSS), frequency Modulation (FM), near Field Communication (NFC), infrared (IR), and the like. The wireless communication module 160 may be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, performs frequency modulation and filtering processing on electromagnetic wave signals, and transmits the processed signals to the processor 110. The wireless communication module 160 may also receive a signal to be transmitted from the processor 110, perform frequency modulation and amplification on the signal, and convert the signal into electromagnetic waves through the antenna 2 to radiate the electromagnetic waves.
The electronic device 100 implements display functions via the GPU, the display screen 194, and the application processor. The GPU is a microprocessor for image processing, and is connected to the display screen 194 and an application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs that execute program instructions to generate or alter display information.
The display screen 194 is used to display images, video, and the like. The display screen 194 includes a display panel. The display panel may be a Liquid Crystal Display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (active-matrix organic light-emitting diode, AMOLED), a flexible light-emitting diode (FLED), a miniature, a Micro-oeld, a quantum dot light-emitting diode (QLED), or the like. In some embodiments, the electronic device 100 may include 1 or N display screens 194, N being a positive integer greater than 1.
The electronic device 100 may implement a shooting function through the ISP, the camera 193, the video codec, the GPU, the display 194, the application processor, and the like.
The ISP is used to process the data fed back by the camera 193. For example, when a photo is taken, the shutter is opened, light is transmitted to the camera photosensitive element through the lens, the optical signal is converted into an electrical signal, and the camera photosensitive element transmits the electrical signal to the ISP for processing and converting into an image visible to naked eyes. The ISP can also carry out algorithm optimization on the noise, brightness and skin color of the image. The ISP can also optimize parameters such as exposure, color temperature and the like of a shooting scene. In some embodiments, the ISP may be provided in camera 193.
The digital signal processor is used for processing digital signals, and can process digital image signals and other digital signals. For example, when the electronic device 100 selects a frequency bin, the digital signal processor is used to perform fourier transform or the like on the frequency bin energy.
The NPU is a neural-network (NN) computing processor that processes input information quickly by using a biological neural network structure, for example, by using a transfer mode between neurons of a human brain, and can also learn by itself continuously. Applications such as intelligent recognition of the electronic device 100 can be realized through the NPU, for example: image recognition, face recognition, speech recognition, text understanding, and the like.
The electronic device 100 may implement audio functions via the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone interface 170D, and the application processor. Such as music playing, recording, etc.
The audio module 170 is used to convert digital audio information into an analog audio signal output and also to convert an analog audio input into a digital audio signal. The audio module 170 may also be used to encode and decode audio signals. In some embodiments, the audio module 170 may be disposed in the processor 110, or some functional modules of the audio module 170 may be disposed in the processor 110.
The speaker 170A, also called a "horn", is used to convert the audio electrical signal into a sound signal. The electronic apparatus 100 can listen to music through the speaker 170A or listen to a handsfree call.
The receiver 170B, also called "earpiece", is used to convert the electrical audio signal into an acoustic signal. When the electronic apparatus 100 receives a call or voice information, it can receive voice by placing the receiver 170B close to the ear of the person.
The microphone 170C, also referred to as a "microphone," is used to convert sound signals into electrical signals. When making a call or transmitting voice information, the user can input a voice signal to the microphone 170C by speaking near the microphone 170C through the mouth. The electronic device 100 may be provided with at least one microphone 170C. In other embodiments, the electronic device 100 may be provided with two microphones 170C to achieve a noise reduction function in addition to collecting sound signals. In other embodiments, the electronic device 100 may further include three, four or more microphones 170C to collect sound signals, reduce noise, identify sound sources, perform directional recording, and so on.
The pressure sensor 180A is used for sensing a pressure signal, and can convert the pressure signal into an electrical signal. In some embodiments, the pressure sensor 180A may be disposed on the display screen 194.
The touch sensor 180K is also referred to as a "touch panel". The touch sensor 180K may be disposed on the display screen 194, and the touch sensor 180K and the display screen 194 form a touch screen, which is also called a "touch screen". The touch sensor 180K is used to detect a touch operation applied thereto or nearby. The touch sensor can communicate the detected touch operation to the application processor to determine the touch event type. Visual output associated with the touch operation may be provided through the display screen 194. In other embodiments, the touch sensor 180K may be disposed on a surface of the electronic device 100, different from the position of the display screen 194.
The proximity light sensor 180L is a sensor capable of sensing ambient infrared light, and when infrared light is irradiated onto the proximity light sensor, the proximity light sensor generates a photoelectric effect to convert an infrared light signal into an electrical signal. After the proximity light sensor is started, current integration is carried out on the electric signal of the infrared light in each pulse period, and after each pulse period is finished, a proximity light parameter Pdata is obtained through calculation.
Next, an application scenario in which the proximity light sensor switches the operation mode is exemplarily described with reference to fig. 6. Referring to fig. 6, fig. 6 is a flowchart illustrating a switching operation mode of a proximity optical sensor according to an embodiment of the present application, where the specific process is as follows:
step S601: the first application is started.
Step S602: the first application activates the proximity light sensor.
Step S603: and determining that the first proximity light state information is far away according to the calculated first Pdata when the proximity light sensor is in the single-pulse working mode, and reporting the first proximity light state information to a first application.
Step S604: the first approaching light state information determined for N times continuously represents that the position state of the electronic equipment and the target object is far away, and after the first approaching light state information is determined each time, the first approaching light state information is reported to the first application.
Specifically, in the single-pulse working mode, the determined first proximity light state information represents that the electronic device and the target object are far away from each other, and the first proximity light state information is reported to the first application, so that the first application can adjust the screen (for example, control to turn off or turn on the screen) according to the first proximity light state information.
For example, N =3 is taken as an example to explain. When the electronic equipment determines that the first proximity light state information is far away according to Pdata calculated by the proximity light sensor for the first time, the electronic equipment reports the first proximity light state information to the first application. And when the electronic equipment determines that the first proximity light state information is far away according to the Pdata calculated by the proximity light sensor for the second time, reporting the first proximity light state information to the first application. And when the electronic equipment determines that the first proximity light state information is far away according to the Pdata calculated by the proximity light sensor for the third time, reporting the first proximity light state information to the first application.
Step S605: the first approaching light state information determined at the (N + 1) th time represents that the electronic equipment is close to the position state of the target object.
Specifically, after the first proximity light state information determined N times continuously represents that the position state of the electronic device and the target object is far away, the first proximity light state information is reported to the first application. When the first proximity light state information determined at the (N + 1) th time represents that the position states of the electronic device and the target object are close to each other, the corresponding application scenario may be: the distance between the electronic equipment and the target object in the environment is continuously reduced, and the distance between the electronic equipment and the target object is larger than a first threshold value N times in the previous step. At the N +1 th time, the distance between the electronic device and the target object is less than or equal to the first threshold. Therefore, at time N +1, the first proximity light state information indicates that the electronic device is in proximity to the positional state of the target object.
Step S606: the working mode of the switching proximity optical sensor is a multi-pulse working mode.
Step S607: and calculating a second Pdata according to the proximity light sensor in the multi-pulse mode, and determining second proximity light state information.
Specifically, the operation mode of the proximity light sensor is switched to a multi-pulse operation mode, so as to verify whether the first proximity light state information determined at the N +1 th time is correct in the single-pulse operation mode. Therefore, there are two cases of the second proximity light state information determined in the multi-pulse operation mode:
in the first case: the second proximity light state information represents that the electronic equipment is in proximity to the target object.
In the second case: the second proximity light state information represents that the electronic device is far away from the target object.
The first case will be described with reference to steps S608 to S614:
step S608: and the determined second proximity light state information represents that the position state of the electronic equipment and the target object is proximity, and the second proximity light state information is reported to the first application.
Step S609: the working mode of switching the near light sensor is a single-pulse working mode.
Step S610: and calculating a first Pdata according to the proximity light sensor in a single pulse mode, determining that the first proximity light state information is proximity, and reporting the first proximity light state information to a first application.
Step S611: and the first approaching light state information determined for N1 times continuously represents that the position states of the electronic equipment and the target object are approaching, and the first approaching light state information is reported to the first application after the first approaching light state information is determined every time.
Step S612: and the first approaching light state information determined at the (N1 + 1) th time represents that the position state of the electronic equipment and the target object is far away, and the first approaching light state information is reported to the first application.
Step S613: the first approaching light state information determined for N2 times continuously represents that the position state of the electronic equipment and the target object is far away, and the first approaching light state information is reported to the first application after the first approaching light state information is determined each time.
Step S614: the first proximity light state information determined at the N2+1 th time represents that the electronic device and the target object are in proximity in position, and step S606 is executed.
In steps S608 to S614, when the determined second proximity light state information indicates that the electronic device and the target object are in proximity to each other (i.e., step S608), it is described that the N +1 th determined first proximity light state information is correct in the single pulse operation mode. Thus, in the single-pulse mode of operation, the confidence of the determined first proximity light state information is higher. Therefore, when the current position state of the electronic device and the target object is the proximity state, the operation mode of the proximity optical sensor is switched back to the single pulse operation mode (i.e., step S609). As long as any one of three conditions that the first proximity light state information always represents proximity, or the first proximity light state information always represents distance, or the first proximity light state information represents proximity first and then represents distance later (i.e., step S611 to step S613) is satisfied, the first proximity light state information may be directly reported to the first application without switching to the multi-pulse operating mode to verify the correctness of the first proximity light state information.
However, for the third case (S611 to S613), after step S613, if the first proximity light state information indicates proximity again (step S614), the proximity light sensor needs to be switched to the multi-pulse operating mode, and the correctness of the first proximity light state information is verified by the second proximity light state information. Therefore, step S606 needs to be performed again.
Next, the second case will be described with reference to step S615 to step S619:
step S615: and the determined second proximity light state information represents that the position state of the electronic equipment and the target object is far away, and the second proximity light state information is reported to the first application.
Step S616: the working mode of switching the near light sensor is a single-pulse working mode.
Step S617: and calculating a first Pdata according to the single-pulse working mode of the proximity light sensor, and determining first proximity light state information.
Step S618: when the determined first proximity light state information represents that the electronic device and the target object are in proximity, step S606 is executed.
Step S619: when the determined first proximity light state information represents that the position state of the electronic device and the target object is far away, the first proximity light state information is reported to the first application, and step S617 is executed.
In steps S615 to S619, when the determined second proximity light state information indicates that the position state of the electronic device and the target object is far away (i.e., step S615), it indicates that the first proximity light state information determined at the N +1 th time is incorrect in the single pulse operating mode. Therefore, after the proximity light sensor switches back to the single pulse operation mode again (i.e., step S606), in the case where the first proximity light state information indicates a distant (step S619), the first proximity light state information is reported to the first application. In the case where the first proximity light state information represents proximity (step S618), step S606 is performed to verify the correctness of the first proximity light state information.
Next, a specific flow of a method for calculating an optical proximity parameter according to an embodiment of the present application will be described with reference to fig. 7. Referring to fig. 7, fig. 7 is a flowchart of a method for calculating an optical proximity parameter according to an embodiment of the present application, and the specific flow is as follows:
step S701: the first application is started.
Specifically, the first application may be an application that can call a proximity optical parameter, for example, the first application may be a call application in the embodiments of fig. 4A to 4C, and the embodiment of the present application takes the first application as a call application as an example for description.
For example, the first application may be initiated by the electronic device 100 displaying the user interface 41 after the contact is placed in the phone call in the embodiment of fig. 4A.
Step S702: the first application activates the proximity light sensor.
Specifically, the first application starts the proximity light sensor: the first application may transmit first information indicating that the proximity optical sensor operates to the SensorService, and then, the SensorService transmits second information indicating that the proximity optical sensor operates to the Sensorhal. And then, the Sensorhal sends a first notification message to the proximity optical sensor work driving module, and the proximity optical sensor work driving module drives the proximity optical sensor to work after receiving the first notification message.
Step S703: the proximity light sensor periodically calculates a first proximity light parameter in a single pulse operating mode and writes the first proximity light parameter into a register.
Specifically, the single-pulse operating mode is an operating mode in which after each pulse period of the proximity photosensor, the proximity optical parameter Pdata is calculated, and Pdata is written into a register of the proximity photosensor. Common single-pulse operating modes are 32us-1pulse and 4us-1pulse, wherein 32us-1pulse represents that the length of a single pulse is 32us. In the embodiment of the present application, a single-pulse operation mode of the proximity optical sensor is 32us-1pulse as an example, and the description is given.
Next, referring to fig. 8, a detailed description is given of an operation mode of the 32us-1plus, and as shown in fig. 8, a schematic diagram of the operation mode of the 32us-1plus provided in the embodiment of the present application is shown. As shown in fig. 8, pdata is periodically calculated by the proximity photosensor, and one duty cycle (in fig. 8, the length of one duty cycle is 50 ms) of the proximity photosensor includes one pulse period. As can be seen from the schematic diagram of the operation mode of the proximity light sensor in fig. 8, the proximity light sensor includes two operation states in one pulse period. One is that the proximity light sensor operates in a high state (the proximity light sensor turns on the VCSEL), and the other is that the proximity light sensor operates in a low state (the proximity light sensor turns off the VCSEL), and both of these operating states have a length of 32us. As can be seen from the schematic diagram of the integration mode of the proximity light sensor, the proximity light sensor conducts infrared photocurrent in a high level state and a low level stateThe integrated waveform of the integration is different. In the high level state, the current integral waveform of the proximity photosensor is integral waveform 1, and the integral value is the area S of the area 1 formed by the integral waveform 1 and the infrared light response curve (curve 1) of the scintillation light source 1 . In the low state, the current integral waveform of the proximity photosensor is integral waveform 2, and the integral value is area S of area 2 formed by integral waveform 2 and the infrared light response curve (curve 1) of the flicker light source 2 。S 1 And S 2 And the module value of the difference value is Pdata corresponding to the pulse period, and after the Pdata is calculated, the proximity light sensor writes the Pdata into a register.
Step S704: the single pulse processing module reads the first proximity light parameter from the register.
Specifically, the single-pulse processing module is triggered by a timer according to a preset reporting frequency, and the single-pulse processing module reads the written first proximity optical parameter from the register at a fixed time. For example, the reporting frequency is 200 us/time, and then every 200us, the timer triggers the single pulse processing module to read the first proximity optical parameter from the register. The reporting frequency may be obtained based on historical data, may also be obtained based on empirical values, and may also be obtained based on experimental data, which is not limited in the embodiments of the present application.
In a possible implementation manner, after the proximity optical sensor calculates a first proximity optical parameter in each pulse period and writes the first proximity optical parameter into the register, a trigger signal is sent to the single-pulse processing module, where the trigger signal is used to trigger the single-pulse processing module to read the first proximity optical parameter corresponding to the pulse period from the register.
Step S705: and the single-pulse processing module sends the first proximity optical parameter to the filtering processing module.
Step S706: the filtering processing module carries out filtering processing on the first approximate optical parameter to obtain a first target approximate optical parameter.
Specifically, the first proximity light parameter calculated by the proximity light sensor may contain noise due to device characteristics and physical characteristics of the proximity light sensor. For example, when the electronic device is placed on a desk, if all objects in the environment remain still and the light source of the environment is unchanged, the first proximity light parameter calculated in the first pulse period is 50, and the proximity light parameter calculated in the next pulse period is 51, the proximity light parameters corresponding to the two pulse periods generate a jump, and the jump is noise of the proximity light parameters, and the noise is determined by the physical characteristics of the proximity light sensor and is unavoidable.
Therefore, in order to reduce noise of the first proximity optical parameter and improve accuracy of the first proximity optical parameter, the first proximity optical parameter needs to be filtered by the filtering processing module to obtain a filtered first proximity optical parameter, and the filtered first proximity optical parameter is a first target proximity optical parameter. The filtering processing module may filter the first proximity optical parameter through a median filtering unit and a mean filtering unit, and the specific process is as follows:
the filtering processing module may use N (N is an odd number) first proximity optical parameters as an input of the median filtering unit, and the median filtering unit selects a median from the N first proximity optical parameters as an output to obtain the target proximity optical parameter. For example, assuming that N is 5, after the median filtering unit sequentially receives 5 first proximity optical parameters (Pdata 1 to Pdata5, pdata1 to Pdata5 are 50, 51, 52, 53, 54, respectively), the filtered proximity optical parameter is the median 52 of the five Pdata. When a new first proximity light parameter (e.g., pdata6, and Pdata6 is 55) is received, the median filtering unit may reject the earliest received first proximity light parameter (Pdata 1). Then, the median (Pdata 4) of Pdata2 to Pdata6 is output, and the median is the approximate optical parameter filtered by the median filtering unit. N may be obtained based on historical data, may also be obtained based on empirical values, and may also be obtained based on experimental data, which is not limited in the embodiments of the present application.
After the median filtering unit outputs the filtered near light parameter through the first near light parameter, the filtering processing module may perform the mean filtering on the filtered near light parameter through the mean filtering unit. And performing mean value calculation through the plurality of filtered approximate optical parameters to further reduce noise, thereby obtaining a first target approximate optical parameter with smaller noise. The mean value filtering unit can receive at most M target proximity optical parameters, and before the number of the target proximity optical parameters received by the mean value filtering unit is smaller than M, the mean value filtering unit performs mean value calculation on the basis of all the filtered proximity optical parameters received currently by the mean value filtering unit every time one filtered proximity optical parameter is received, so as to obtain and output a first target proximity optical parameter. Under the condition that the number of the filtered proximity optical parameters received by the mean filtering unit is equal to M, the mean filtering unit may perform mean calculation on the M filtered proximity optical parameters received by the mean filtering unit to obtain and output a first target proximity optical parameter. After that, every time the average filtering unit receives one filtered near optical parameter, the average filtering unit eliminates the filtered near optical parameter received first, so as to ensure that the number of the filtered near optical parameters received by the average filtering unit is always kept to be M. And when receiving one filtered near light parameter, the mean value filtering unit may perform mean value calculation on the M filtered near light parameters received by the mean value filtering unit, and calculate and output a first target near light parameter. The M may be obtained based on historical data, empirical values, or experimental data, and the embodiment of the present application is not limited.
For example, M is 3, when the mean filtering unit receives the first filtered proximity light parameter Pdata31, the mean filtering unit outputs a first target proximity light parameter Pdata11, when the mean filtering unit receives the second filtered proximity light parameter Pdata32, the mean filtering unit calculates a mean Pdata41 of Pdata31 and Pdata32, pdata41 is the first target proximity light parameter, when the mean filtering unit receives the third filtered proximity light parameter Pdata33, the mean filtering unit calculates a mean Pdata42 of Pdata31, pdata32, and Pdata33, pdata42 is the first target proximity light parameter, when the mean filtering unit receives the fourth filtered proximity light parameter Pdata34, the mean filtering unit rejects Pdata31, and then calculates a mean Pdata43 of Pdata32, pdata33, and Pdata34, and Pdata43 is the first target proximity light parameter. Similarly, when the mean filtering unit receives the fifth filtered near optical parameter Pdata35, the mean filtering unit obtains the first target near optical parameter by calculating the mean of Pdata33, pdata34, and Pdata 35.
Step S707: the filtering processing module sends the first target approaching optical parameter to the approaching and departing judgment module.
Specifically, the filtering processing module sends the first target approach optical parameter to the approach/distance determining module after filtering the first approach optical parameter to obtain the first target approach optical parameter each time.
Step S708: the approach and distance judgment module obtains first approach light state information Proximity _ type based on the first target approach light parameter.
Specifically, the approaching and departing judging module determines the Proximity _ type according to a magnitude relationship between a first threshold and a first target approaching optical parameter. When the first target approach light parameter is greater than or equal to the first threshold value, the approach judgment and distance judgment module determines that the Proximity _ type is far. When the first target approach light parameter is smaller than a first threshold value, the approach judgment and departure judgment module determines that the Proximity _ type is near. The first threshold value may be obtained based on historical data, may also be obtained based on empirical values, and may also be obtained based on experimental data, which is not limited in this application.
Wherein, when the Proximity _ type is near, the method is used for representing that the position state of the electronic equipment and the shading object is close. When the Proximity _ type is far, the method is used for representing that the electronic equipment is far away from the position state of the shading object.
When the first approaching light state information represents that the electronic equipment and the position state of the shading object are far away, the approaching and far judgment module sends the first approaching light state information to the approaching light application module. The first Proximity light state information is reported to the first application by the Proximity light application module, so that the first application can adjust the screen according to the first Proximity light state information (for example, if the Proximity _ type is far, the first application causes the screen to be in a bright screen state, and if the Proximity _ type is near, the first application causes the screen to be in a dark screen state).
When the first approaching light state information represents that the electronic device and the position state of the light-shielding object are approaching, the approaching and departing determining module executes step S709.
Step S709: when the first approaching light state information represents that the electronic equipment and the position state of the shading object are approaching, the approaching and departing judgment module sends first indication information to the approaching light working mode control module.
Specifically, the first indication information is used for indicating the proximity optical operating mode control module to adjust the operating mode of the proximity optical sensor, and switching the operating mode of the proximity optical sensor from the single-pulse operating mode to the multi-pulse operating mode.
Step S710: the proximity light working mode control module switches the working mode of the proximity light sensor into a multi-pulse working mode.
Specifically, in the multi-pulse working mode, after each pulse period of the proximity photosensor is finished, the proximity optical parameter Pdata is calculated, and after the average value of the Pdata in the L pulse periods is calculated, the calculated average value is written into a register or sent to the multi-pulse processing module. The calculated average value is a second approximate optical parameter, and L may be obtained based on historical data, an empirical value, or experimental data, which is not limited in the embodiments of the present application.
In step S710, in the multi-pulse operating mode, the proximity light sensor calculates an average value of Pdata corresponding to a plurality of consecutive pulse periods, and then writes the calculated average value (second proximity light parameter) of Pdata into the register. And the pulse period length of the multi-pulse working mode is shorter than that of the single-pulse working mode.
The embodiment of the present application will be described with an example in which the multi-pulse operation mode of the proximity optical sensor is a 4us-48pulse operation mode. 4us-48pulse denotes: each duty cycle (e.g., one duty cycle is 50ms in length) of the proximity light sensor includes 48pulse cycles. In each pulse period, the proximity photosensor is operated for 4us in the high state and in the low state. When the proximity light sensor calculates the Pdata of 48pulse periods in one working period, the mean value of the 48 Pdata is calculated to obtain a second proximity light parameter, and the second proximity light parameter is written into the register.
The operation mode of 4us-48Pulse will be described in an exemplary manner with reference to fig. 9. As shown in fig. 9, 48 consecutive pulse periods are included in one duty cycle. As can be seen from the schematic diagram of the operation mode of the proximity light sensor in fig. 9, the proximity light sensor includes two operation states in one pulse period. One is that the proximity light sensor operates in a high state (the proximity light sensor turns on the VCSEL), and the other is that the proximity light sensor operates in a low state (the proximity light sensor turns off the VCSEL), and the lengths of the two operating states are both 4us. As can be seen from the schematic diagram of the integration mode of the proximity photosensor, the integration waveforms of the infrared photocurrent integration performed by the proximity photosensor are different between the high level state and the low level state. In the high level state, the current integral waveform of the proximity light sensor is integral waveform 1, and the integral value is the area S of a region 3 consisting of the integral waveform 1 and the infrared light response curve of the scintillation light source 3 . In the low state, the current integral waveform of the proximity photosensor is integral waveform 2, and the integral value is the area S of the region 4 formed by the integral waveform 2 and the infrared light response curve (curve 1) of the flicker light source 4 。S 3 And S 4 And the module value of the difference value is Pdata corresponding to the single pulse period, and after the Pdata of 48pulse periods are continuously calculated, the average value of the 48 Pdata is calculated to obtain a second approximate optical parameter. The proximity light sensor then writes the second proximity light parameter into a register. In the 4us-48pulse mode of operation, pdata within a pulse period is the modulus of the difference between the areas of region 3 and region 4. Since the length of each pulse period is shorter in the 4us-48pulse mode of operation than in the 32us-1pulse mode of operation. Thus, the modulus of the difference in area of region 1 and region 2 is smaller than the modulus of the difference in area of region 3 and region 4 compared to the 32us-1pulse mode of operation, i.e.: the degree of hopping of Pdata can be reduced (noise of Pdata is reduced). Therefore, pdata calculated in the multi-pulse operation mode is less likely to be affected by the flicker light source than Pdata calculated in the single-pulse operation mode. Thus, pdat is calculated in the multi-pulse mode of operationa is lower in noise and more accurate in Pdata.
Step S711: the proximity light sensor calculates a second proximity light parameter in the multi-pulse mode of operation and writes the second proximity light parameter into the register.
Specifically, for the related description of the proximity light sensor calculating the second proximity light parameter in the multi-pulse operating mode, reference may be made to the above description in step S710, and the related description of the proximity light sensor calculating the second proximity light parameter in the 4us-48pulse operating mode is not repeated herein.
Step S712: the multi-pulse processing module reads the second proximity light parameter from the register.
Specifically, the second proximity optical parameter is used to determine the second proximity optical state, and since the second proximity optical parameter is obtained by calculation in the multi-pulse operating mode, the possible ranges corresponding to the single-pulse operating mode and the multi-pulse operating mode are inconsistent, and the single-pulse operating mode corresponding to the first threshold value is used. Therefore, the second proximity optical parameter is directly compared with the first threshold value, the obtained second proximity optical state may be inaccurate, and the second proximity optical parameter needs to be converted into the proximity optical parameter corresponding to the single-pulse working mode by the throughput conversion module. For the method for reading the second proximity optical parameter from the register by the multi-pulse processing module, reference may be made to the related description of "reading the first proximity optical parameter from the register by the single-pulse processing module" in step S704, which is not described herein again.
Step S713: and the multi-pulse processing module sends the second approach optical parameter to the range conversion module.
Step S714: and the range conversion module performs range conversion on the second approximate optical parameter to obtain a second target approximate optical parameter.
Specifically, the range conversion module may convert the second proximity optical parameter by using a formula (1) to obtain a second target proximity optical parameter, where the formula (1) is as follows:
Pdata′=(Pdata+offset*L2)/L1-offset*L2 (1)
pdata is a second target proximity optical parameter, pdata' is a second target proximity optical parameter, offset is a random number in the register, L1 is a first parameter, and L2 is a second parameter. The L1 and the L2 may be obtained based on empirical values, historical data, or experimental data, and the embodiments of the present application are not limited. Preferably, L1 may be 3.45 and L2 may be 10, through a large amount of experimental data.
Step S715: and the range conversion module sends the second target approaching optical parameter to the approaching and departing judgment module.
Step S716: the approaching and departing judgment module obtains second approaching light state information based on the second target approaching light parameter.
Specifically, the related description of step S716 refers to the related description of step S708, and is not repeated herein.
Step S717: and the approaching and departing judgment module sends second indication information to the approaching optical working mode control module.
Specifically, the second indication information is used for indicating the proximity light operation mode control module to switch the operation mode of the proximity light sensor from the multi-pulse operation mode to the single-pulse operation mode. After the present step is executed, step S618 is executed.
Step S718: the close-proximity light working mode control module switches the working mode of the close-proximity light sensor into a single-pulse working mode.
Step S719: and the approaching and departing judgment module sends the second approaching light state information to the first application.
Specifically, the approaching and departing determination module may send the second approaching light state information to the approaching light application module, and the approaching light application module may first send the second approaching light state information to the Sensorhal, and then the Sensorhal sends the second approaching light state information to the first application through the SensorService.
It should be understood that step S717 may be executed before step S719, step S717 may be executed after step S719, step S717 and step S719 may be executed simultaneously, and the order of execution of step S717 and step S719 is not limited in this embodiment of the application.
Step S720: the first application adjusts the screen based on the second proximity light status information.
For example, if the first application is a call application, when the second proximity light state information is near, the first application keeps the screen in a screen-off state, and at this time, the electronic device does not respond to any touch operation on the screen. When the second approach light state information is far, the first application keeps the screen in a bright screen state.
According to the embodiment of the application, the proximity light sensor performs current integration on the received infrared light in a single-pulse working mode, so that a proximity light parameter Pdata is obtained. Then, the approach and distance determination module obtains first approach light state information based on Pdata, and under the condition that the first approach light state information is the first identifier, the first approach light state information is reported to the first application, so that the first application adjusts screen parameters according to the first approach light state information (for example, the screen is kept in a screen-off state or a screen-off state). Under the condition that the first approaching optical state information is not the first mark, the approaching optical sensor is switched to be in a multi-pulse working mode, pdata with higher accuracy is obtained, the approaching and far-away judging module can obtain second approaching optical state information with higher accuracy based on the Pdata with higher accuracy, and the second approaching optical state information is reported to the first application, so that the screen parameters can be adjusted by the first application. By the method, the influence of the flicker light source on the near light parameter calculated by the near light sensor can be reduced, the jump amplitude of Pdata under the flicker light source is reduced, and the accuracy of the Proximity _ type is improved. The problem that the electronic equipment flickers due to the action of a flickering light source under the application scene that the electronic equipment controls screen parameters such as screen turn-off/screen turn-on based on the maximum _ type is solved.
In the embodiment of the present application, the software system of the electronic device 100 may adopt a layered architecture, an event-driven architecture, a micro-core architecture, a micro-service architecture, or a cloud architecture. The embodiment of the present application takes an Android system with a layered architecture as an example, and exemplarily illustrates a software structure of the electronic device 100.
As shown in fig. 10, the electronic device may include: an application layer, an application framework, a Hardware Abstraction Layer (HAL) layer, a co-application layer, a co-framework layer, a co-driver layer, and a co-hardware layer. Wherein:
the application layer may include a series of application packages. As shown in fig. 10, the application package may include applications such as a camera application, gallery, calendar, first application, map, navigation, WLAN, bluetooth, music, video, short message, etc.
The application framework layer provides an Application Programming Interface (API) and a programming framework for the application program of the application layer. The application framework layer includes a number of predefined functions. As shown in FIG. 10, the application framework layer may include a window manager, content provider, view system, telephony manager, resource manager, notification manager, sersorService, and the like. Wherein the SensorService is configured to implement communication with a first application and a Sensorhal, and to send information of the first application (e.g., information indicating operation of the proximity light sensor) to the Sensorhal and to send information sent by the Sensorhal (e.g., proximity light status information) to the first application.
The hardware abstraction layer may include: a plurality of functional modules. E.g., sensorHal, etc. SensorHal is used to implement communication between the application framework layer and the co-application layer, for example, sensorHa may send proximity light state information sent by a proximity light application module in the co-application layer to a SensorService in the application framework layer, or may send notification information sent by the SensorService for starting a proximity light sensor to a proximity light sensor working drive module in the co-drive layer.
The co-application layer comprises: and the proximity light application module is used for receiving the proximity light state information sent by the proximity and distance judgment module positioned on the co-framework layer, and also sending the received proximity light state information to a SensorHal positioned on the HAL layer.
The auxiliary frame layer includes: the device comprises a filtering processing module, a proximity and distance judging module, a range conversion module and other functional modules. The filtering processing module is used for filtering the first proximity optical parameter sent by the co-driving layer so as to obtain a second proximity optical parameter, and sending the second proximity optical parameter to the proximity and distance judging module. The range conversion module is used for performing range conversion on a third approximate optical parameter sent by the multi-pulse processing module based on the first approximate optical parameter sent by the multi-pulse processing module in the co-drive layer to obtain a fourth approximate optical parameter corresponding to the range of the single-pulse working mode. The approaching and departing judgment module is used for determining first approaching light state information based on the second approaching light parameter sent by the filtering processing module, sending the first approaching light state information to the approaching light application module based on the first approaching light state information, or sending first indication information to the approaching light working mode control module located on the co-driving layer, wherein the first indication information is used for indicating the approaching light working mode control module to switch the working mode of the approaching light sensor into the multi-pulse working mode. Or the approaching and departing judgment module sends the fourth approaching optical parameter to the approaching optical application module.
The co-driver layer includes: the device comprises a single-pulse processing module, a multi-pulse processing module, a proximity optical sensor working driving module and a proximity optical working mode control module. The single pulse processing module is used for reading the first proximity optical parameter in the register and sending the first proximity optical parameter to the filtering processing module for filtering processing. The multi-pulse processing module is used for reading the first approximate optical parameter and the third approximate optical parameter in the register and taking the third approximate optical parameter and the first approximate optical parameter as the input of the range conversion module. The proximity light sensor work driving module is used for triggering the proximity light sensor to work. The proximity light operation mode control module is used for controlling the operation mode of the proximity light sensor.
The hardware layer comprises: and the proximity light sensor is used for calculating a proximity light parameter.
In the above embodiments, the implementation may be wholly or partially realized by software, hardware, firmware, or any combination thereof. When implemented in software, it may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the processes or functions described in the present application are generated in whole or in part. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another computer readable storage medium, for example, the computer instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center by wire (e.g., coaxial cable, fiber optic, digital subscriber line) or wirelessly (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device, such as a server, a data center, etc., that incorporates one or more of the available media. The usable medium may be a magnetic medium (e.g., floppy Disk, hard Disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid State Disk), among others.
It will be understood by those skilled in the art that all or part of the processes of the methods of the above embodiments may be implemented by hardware related to instructions of a computer program, which may be stored in a computer-readable storage medium, and when executed, may include the processes of the above method embodiments. And the aforementioned storage medium includes: various media capable of storing program codes, such as ROM or RAM, magnetic or optical disks, etc.
In short, the above description is only an example of the technical solution of the present invention, and is not intended to limit the scope of the present invention. Any modifications, equivalents, improvements and the like made in accordance with the disclosure of the present invention are intended to be included within the scope of the present invention.

Claims (25)

1. A proximity optical parameter calculation method applied to an electronic device including a proximity optical device, the method comprising:
the close-distance light device determines close-distance light state information in a single-pulse working mode, and the close-distance light state information is used for representing the state that an object is close to or far away from;
when the access light state information changes, switching the working mode of the access light device into a multi-pulse working mode, wherein the single-pulse working mode is a working mode for determining the access light state information in one pulse period, and comprises one pulse period in a single working period of the access light device, and the one pulse period comprises a first time length for working the access light device in a high level state and a first time length for working the access light device in a low level state; the multi-pulse operating mode is an operating mode in which the proximity optical device determines the information on the state of the proximity optical device in a plurality of consecutive pulse periods, and in a single operating period of the proximity optical device, includes a plurality of consecutive pulse periods, one pulse period includes a second period in which the proximity optical device operates in a high level state and the second period in which the proximity optical device operates in a low level state, and the second period is shorter than the first period.
2. The method of claim 1, comprising:
if the working mode of the proximity optical device is a single-pulse working mode, the proximity optical state information is first proximity optical state information;
and if the working mode of the proximity optical device is a multi-pulse working mode, the proximity optical state information is second proximity optical state information.
3. The method as claimed in claim 2, wherein said changing of the light status information comprises: the approaching light state information changes from the distant state to the approaching state.
4. The method of any of claims 1-3, wherein the determining of the access light state information by the access light device in the single pulse mode of operation comprises:
calculating a first proximity light parameter for a single pulse period;
filtering the first approximate optical parameter to obtain a first target approximate optical parameter;
and determining the approaching light state information according to the first target approaching light parameter and a first threshold value.
5. The method as claimed in claim 4, wherein said determining said proximity light status information based on said first target proximity light parameter and a first threshold value comprises:
determining that the proximity light state information is a far state under the condition that the first proximity light parameter is smaller than the first threshold value;
determining that the approaching light state information is an approaching state if the first approaching light parameter is greater than or equal to the first threshold value.
6. The method of any of claims 4-5, wherein said calculating a first proximity light parameter for a single pulse period comprises:
integrating the infrared light response curve and the first integral waveform to obtain a first integral value;
integrating the infrared light response curve and a second integral waveform to obtain a second integral value;
calculating a module value of the difference between the first integral value and the second integral value to obtain the first approximate optical parameter;
the infrared light response curve is a response curve obtained by photoelectric effect of the proximity optical device after receiving infrared light, the first integral waveform is an integral waveform corresponding to the proximity optical device in a high level state, and the second integral waveform is an integral waveform corresponding to the proximity optical device in a low level state.
7. The method of any one of claims 4-6, wherein said filtering said first target proximity light parameter to obtain a first target proximity light parameter comprises:
performing median filtering processing on the first proximity optical parameter to obtain a filtered proximity optical parameter;
and carrying out mean value filtering processing on the filtered approximate optical parameters to obtain the first target approximate optical parameters.
8. The method of any of claims 1-7, wherein after switching the operating mode of the proximity optical device to a multi-pulse operating mode, further comprising:
determining the second proximity light status information; the second approaching light state information is determined approaching light state information of the approaching light device in a multi-pulse working mode;
reporting the second proximity light status information to a first application, the first application being an application related to the proximity light device.
9. The method of claim 8, wherein after determining the second proximity light status information, further comprising: and switching the working mode of the proximity optical device into a single-pulse working mode.
10. The method of any one of claims 8-9, wherein the determining the second proximity light status information specifically comprises:
calculating the approximate optical parameters corresponding to the N pulse periods; the N continuous pulse periods are all pulse periods included in a single working period of the proximity optical device;
carrying out mean value calculation on the proximity optical parameters corresponding to the N pulse periods to obtain a second proximity optical parameter;
carrying out range conversion processing on the second approximate optical parameter to obtain a second target approximate optical parameter;
and determining the second proximity light state information according to the second target proximity light parameter and a first threshold value.
11. The method of claim 10, wherein the determining the second proximity light status information according to the second target proximity light parameter and the first threshold value specifically comprises:
determining that the second proximity light state information is a far state under the condition that the second target proximity light parameter is smaller than the first threshold value;
and determining that the second approaching light state information is in an approaching state under the condition that the second target approaching light parameter is greater than or equal to the first threshold value.
12. The method of any of claims 1-11, wherein the electronic device further comprises a first application, and prior to the proximity light device determining the proximity light status information in the single-pulse mode of operation, further comprising:
starting the first application;
the first application starts the proximity optical device, and the working mode of the proximity optical device is a single-pulse working mode.
13. The method of any of claims 1-12, wherein after the access light device determines access light status information in the single pulse mode of operation, comprising:
when the approaching light state information does not change, reporting the approaching light state information to a first application; the first application is an application related to the proximity light device.
14. The method as claimed in claim 1, wherein the electronic device includes a filtering processing module and a proximity/far determination module, and the determining of the proximity light state information by the proximity light device in the single-pulse operation mode specifically includes:
the proximity optical device calculates a first proximity optical parameter in a single-pulse working mode;
the filtering processing module acquires a first proximity optical parameter;
the filtering processing module is used for filtering the first approaching optical parameter to obtain a first target approaching optical parameter;
the filtering processing module sends the first target approaching optical parameter to the approaching and departing judgment module;
and the approaching and departing judgment module determines the approaching light state information according to the first target approaching light parameter.
15. The method of claim 14, wherein the electronic device further comprises a single pulse processing module, and before the filtering processing module obtains the first proximity light parameter, further comprising:
the proximity light device writes the first proximity light parameter into a register;
the single pulse processing module reads the first proximity light parameter from the register.
16. The method of claim 15, wherein the filter processing module obtains a first proximity light parameter comprising:
and the single-pulse processing module sends the first proximity optical parameter to the filtering processing module.
17. The method according to any one of claims 14-16, wherein the filtering module performs filtering processing on the first proximity light parameter to obtain a first target proximity light parameter, and comprises:
the filtering processing module performs median filtering on the first proximity optical parameter to obtain a filtered proximity optical parameter;
and the filtering processing module performs mean filtering on the filtered proximity optical parameters to obtain the first target proximity optical parameters.
18. The method according to any one of claims 14 to 17, wherein the determining, by the proximity and distance determining module, the proximity light status information according to the first target proximity light parameter specifically includes:
when the first target approach light parameter is smaller than the first threshold value, the approach and distance judgment module determines that the approach light state information is in a distance state;
and when the first target approach light parameter is greater than or equal to the first threshold value, the approach/departure judging module determines that the approach light state information is in an approach state.
19. The method as claimed in claim 1, wherein the electronic device further includes a proximity light far determination module and a proximity light operation mode control module, and the switching the operation mode of the proximity light device to a multi-pulse operation mode when the proximity light state information changes includes:
when the close light state information changes, the close light far judgment module sends first indication information to the close light working mode control module, wherein the first indication information is used for indicating the close light working mode control module to switch the working mode of the close light device;
the low beam working mode control module switches the working mode of the low beam device into a multi-pulse working mode.
20. The method of claim 8, wherein the electronic device further comprises a multi-pulse processing module, a range conversion module, and a near-far determination module, and wherein the determining the second near-light status information specifically comprises:
the proximity light device calculates a second proximity light parameter;
the range conversion module acquires the second approximate optical parameter;
the range conversion module performs range conversion on the second approximate optical parameter to obtain a second target approximate optical parameter;
the range conversion module sends the second target approach optical parameter to the approach and distance judgment module;
and the approaching and departing judgment module determines the approaching light state information according to the second target approaching light parameter.
21. The method of claim 20 wherein the electronic device further comprises a multi-pulse processing module, and wherein before the span conversion module acquires the second proximity optical parameter, further comprising:
the proximity optical device writes the second proximity optical parameter into a register;
the multi-pulse processing module reads the first proximity light parameter from the register.
22. The method of claim 21 wherein said span conversion module obtaining said second proximity optical parameter comprises:
and the multi-pulse processing module sends the first approximate optical parameter to the range conversion module.
23. The method according to any one of claims 20 to 22, wherein the determining, by the proximity and distance determining module, the proximity light status information according to the second target proximity light parameter specifically includes:
when the second target approaching optical parameter is smaller than the first threshold value, the approaching and departing judgment module determines that the approaching optical state information is in a departing state;
and when the second target approach light parameter is greater than or equal to the first threshold value, the approach and departure judgment module determines that the approach light state information is in an approach state.
24. An electronic device, comprising: the device comprises a memory, a processor and a touch screen; wherein:
the touch screen is used for displaying content;
the memory for storing a computer program, the computer program comprising program instructions;
the processor is configured to invoke the program instructions to cause the electronic device to perform the method of any of claims 1-23.
25. A computer-readable storage medium, characterized in that the computer-readable storage medium stores a computer program which, when executed by a processor, implements the method of any one of claims 1-23.
CN202210193511.4A 2022-02-28 2022-02-28 Approach light parameter calculation method and related electronic equipment Active CN115529382B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202310674425.XA CN116962569A (en) 2022-02-28 2022-02-28 Method for switching working modes of approaching optical device and related electronic equipment
CN202210193511.4A CN115529382B (en) 2022-02-28 2022-02-28 Approach light parameter calculation method and related electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210193511.4A CN115529382B (en) 2022-02-28 2022-02-28 Approach light parameter calculation method and related electronic equipment

Related Child Applications (1)

Application Number Title Priority Date Filing Date
CN202310674425.XA Division CN116962569A (en) 2022-02-28 2022-02-28 Method for switching working modes of approaching optical device and related electronic equipment

Publications (2)

Publication Number Publication Date
CN115529382A true CN115529382A (en) 2022-12-27
CN115529382B CN115529382B (en) 2023-06-16

Family

ID=84693481

Family Applications (2)

Application Number Title Priority Date Filing Date
CN202310674425.XA Pending CN116962569A (en) 2022-02-28 2022-02-28 Method for switching working modes of approaching optical device and related electronic equipment
CN202210193511.4A Active CN115529382B (en) 2022-02-28 2022-02-28 Approach light parameter calculation method and related electronic equipment

Family Applications Before (1)

Application Number Title Priority Date Filing Date
CN202310674425.XA Pending CN116962569A (en) 2022-02-28 2022-02-28 Method for switching working modes of approaching optical device and related electronic equipment

Country Status (1)

Country Link
CN (2) CN116962569A (en)

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007323781A (en) * 2006-06-02 2007-12-13 Taiyo Yuden Co Ltd Optical information recording method and device, signal processing circuit, recording and reproduction program, and information recording medium
CN102353395A (en) * 2011-06-26 2012-02-15 西安电子科技大学 Infrared proximity transducer capable of inhibiting environmental noise
CN103227869A (en) * 2013-04-28 2013-07-31 广东欧珀移动通信有限公司 Mobile terminal and method for opening camera of mobile terminal
DE102013107899A1 (en) * 2013-07-24 2015-01-29 Osram Opto Semiconductors Gmbh Method for operating an optoelectronic proximity sensor
CN104865563A (en) * 2015-06-05 2015-08-26 杭州士兰微电子股份有限公司 Integrating circuit and approaching detection chip
CN105959492A (en) * 2016-07-06 2016-09-21 广东欧珀移动通信有限公司 Control method and device for infrared proximity sensor and mobile terminal
CN108873005A (en) * 2018-06-01 2018-11-23 Oppo广东移动通信有限公司 Proximity test method and device, electronic device, storage medium and equipment
CN109088961A (en) * 2018-06-15 2018-12-25 Oppo广东移动通信有限公司 sensor control circuit and electronic device
CN111552533A (en) * 2020-04-24 2020-08-18 北京小米移动软件有限公司 Distance detection method and device and intelligent equipment

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007323781A (en) * 2006-06-02 2007-12-13 Taiyo Yuden Co Ltd Optical information recording method and device, signal processing circuit, recording and reproduction program, and information recording medium
CN102353395A (en) * 2011-06-26 2012-02-15 西安电子科技大学 Infrared proximity transducer capable of inhibiting environmental noise
CN103227869A (en) * 2013-04-28 2013-07-31 广东欧珀移动通信有限公司 Mobile terminal and method for opening camera of mobile terminal
DE102013107899A1 (en) * 2013-07-24 2015-01-29 Osram Opto Semiconductors Gmbh Method for operating an optoelectronic proximity sensor
CN104865563A (en) * 2015-06-05 2015-08-26 杭州士兰微电子股份有限公司 Integrating circuit and approaching detection chip
CN105959492A (en) * 2016-07-06 2016-09-21 广东欧珀移动通信有限公司 Control method and device for infrared proximity sensor and mobile terminal
CN108873005A (en) * 2018-06-01 2018-11-23 Oppo广东移动通信有限公司 Proximity test method and device, electronic device, storage medium and equipment
CN109088961A (en) * 2018-06-15 2018-12-25 Oppo广东移动通信有限公司 sensor control circuit and electronic device
CN111552533A (en) * 2020-04-24 2020-08-18 北京小米移动软件有限公司 Distance detection method and device and intelligent equipment

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
史凌峰;刘玉芳;何惠森;赵永瑞;: "环境噪声抑制的红外接近传感器设计" *

Also Published As

Publication number Publication date
CN115529382B (en) 2023-06-16
CN116962569A (en) 2023-10-27

Similar Documents

Publication Publication Date Title
US20220342074A1 (en) Electronic Device and Sensor Control Method
US20230041696A1 (en) Image Syntheis Method, Electronic Device, and Non-Transitory Computer-Readable Storage Medium
EP4220392A1 (en) Display method, electronic device and computer storage medium
CN112492193B (en) Method and equipment for processing callback stream
CN113810601A (en) Terminal image processing method and device and terminal equipment
CN114466107A (en) Sound effect control method and device, electronic equipment and computer readable storage medium
CN112150778A (en) Environmental sound processing method and related device
CN114863494A (en) Screen brightness adjusting method and device and terminal equipment
CN113141483B (en) Screen sharing method based on video call and mobile device
CN111399659A (en) Interface display method and related device
CN113438364B (en) Vibration adjustment method, electronic device, and storage medium
CN115514844A (en) Volume adjusting method, electronic equipment and system
CN116668892B (en) Audio signal processing method, electronic device and readable storage medium
CN115529382B (en) Approach light parameter calculation method and related electronic equipment
CN115641867A (en) Voice processing method and terminal equipment
CN115695640A (en) Shutdown prevention protection method and electronic equipment
CN114255763A (en) Voice processing method, medium, electronic device and system based on multiple devices
CN117093182B (en) Audio playing method, electronic equipment and computer readable storage medium
CN116708661B (en) Audio call processing method, electronic equipment and storage medium
CN116069222B (en) Method and device for identifying focus view and wearable device
WO2024066933A1 (en) Loudspeaker control method and device
CN114915682B (en) Voice processing method, device, storage medium and chip
CN116723410B (en) Method and device for adjusting frame interval
WO2024001735A1 (en) Network connection method, electronic device, and storage medium
CN115513571B (en) Control method of battery temperature and terminal equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant