WO2023124129A1 - 显示二维码的方法和电子设备 - Google Patents

显示二维码的方法和电子设备 Download PDF

Info

Publication number
WO2023124129A1
WO2023124129A1 PCT/CN2022/113601 CN2022113601W WO2023124129A1 WO 2023124129 A1 WO2023124129 A1 WO 2023124129A1 CN 2022113601 W CN2022113601 W CN 2022113601W WO 2023124129 A1 WO2023124129 A1 WO 2023124129A1
Authority
WO
WIPO (PCT)
Prior art keywords
action
data
electronic device
wrist
user
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.)
Ceased
Application number
PCT/CN2022/113601
Other languages
English (en)
French (fr)
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
Priority claimed from CN202210109243.3A external-priority patent/CN116415951B/zh
Application filed by Honor Device Co Ltd filed Critical Honor Device Co Ltd
Priority to EP22821834.3A priority Critical patent/EP4227876B1/en
Priority to US18/001,751 priority patent/US12481975B2/en
Publication of WO2023124129A1 publication Critical patent/WO2023124129A1/zh
Anticipated expiration legal-status Critical
Ceased legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/30Payment architectures, schemes or protocols characterised by the use of specific devices or networks
    • G06Q20/32Payment architectures, schemes or protocols characterised by the use of specific devices or networks using wireless devices
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F1/00Details not covered by groups G06F3/00 - G06F13/00 and G06F21/00
    • G06F1/16Constructional details or arrangements
    • G06F1/1613Constructional details or arrangements for portable computers
    • G06F1/1633Constructional details or arrangements of portable computers not specific to the type of enclosures covered by groups G06F1/1615 - G06F1/1626
    • G06F1/1684Constructional details or arrangements related to integrated I/O peripherals not covered by groups G06F1/1635 - G06F1/1675
    • G06F1/1694Constructional details or arrangements related to integrated I/O peripherals not covered by groups G06F1/1635 - G06F1/1675 the I/O peripheral being a single or a set of motion sensors for pointer control or gesture input obtained by sensing movements of the portable computer
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0487Interaction techniques based on graphical user interfaces [GUI] using specific features provided by the input device, e.g. functions controlled by the rotation of a mouse with dual sensing arrangements, or of the nature of the input device, e.g. tap gestures based on pressure sensed by a digitiser
    • G06F3/0488Interaction techniques based on graphical user interfaces [GUI] using specific features provided by the input device, e.g. functions controlled by the rotation of a mouse with dual sensing arrangements, or of the nature of the input device, e.g. tap gestures based on pressure sensed by a digitiser using a touch-screen or digitiser, e.g. input of commands through traced gestures
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06KGRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
    • G06K19/00Record carriers for use with machines and with at least a part designed to carry digital markings
    • G06K19/06Record carriers for use with machines and with at least a part designed to carry digital markings characterised by the kind of the digital marking, e.g. shape, nature, code
    • G06K19/06009Record carriers for use with machines and with at least a part designed to carry digital markings characterised by the kind of the digital marking, e.g. shape, nature, code with optically detectable marking
    • G06K19/06037Record carriers for use with machines and with at least a part designed to carry digital markings characterised by the kind of the digital marking, e.g. shape, nature, code with optically detectable marking multi-dimensional coding
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/30Payment architectures, schemes or protocols characterised by the use of specific devices or networks
    • G06Q20/32Payment architectures, schemes or protocols characterised by the use of specific devices or networks using wireless devices
    • G06Q20/322Aspects of commerce using mobile devices [M-devices]
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/30Payment architectures, schemes or protocols characterised by the use of specific devices or networks
    • G06Q20/32Payment architectures, schemes or protocols characterised by the use of specific devices or networks using wireless devices
    • G06Q20/326Payment applications installed on the mobile devices
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/30Payment architectures, schemes or protocols characterised by the use of specific devices or networks
    • G06Q20/32Payment architectures, schemes or protocols characterised by the use of specific devices or networks using wireless devices
    • G06Q20/327Short range or proximity payments by means of M-devices
    • G06Q20/3274Short range or proximity payments by means of M-devices using a pictured code, e.g. barcode or QR-code, being displayed on the M-device

Definitions

  • the present application relates to the field of electronic technology, in particular to a method and electronic equipment for displaying two-dimensional codes.
  • the present application provides a method and an electronic device for displaying a two-dimensional code, which can make the process of showing the two-dimensional code simple and efficient for the user.
  • the present application provides a method for displaying a two-dimensional code, which is executed by an electronic device, including: acquiring first sensor data, the first sensor data is collected at the first moment; if the second sensor data is determined according to the first sensor data If the first action of the user corresponding to a moment is a preset action, it is determined whether the user has a wrist turning action within the preset time range from the first moment; if the user has a wrist turning action within the preset time range, display The default QR code page.
  • the first sensor data may be data collected from at least one of a gyroscope sensor, an acceleration sensor or a pressure sensor, such as at least one of gyroscope signal data, acceleration signal data or pressure signal data.
  • the wrist turning action may include stretching out the wrist turning action
  • the stretching and back wrist turning action may include vertical screen wrist turning action, horizontal screen wrist turning action, inverted wrist turning action, wrist turning action with a certain angle, or Raise your hand and turn your wrist inward.
  • the first moment when the data is collected (that is, the first collection moment) can also be obtained.
  • the user's gesture action is a preset action at the first collection moment
  • the displayed QR code page can be a default QR code, such as The payment QR code; or, you can set your own QR code for the user, for example, set the payment QR code, then what is displayed at this time is payment QR code.
  • the electronic device when the electronic device recognizes that the user has a preset action based on the acquired sensor data, it monitors whether there is a wrist turning action within the preset time range, and determines to display the QR code when there is a wrist turning action, so as to reduce user
  • the operation steps of calling the two-dimensional code make the process of showing the two-dimensional code simple and efficient for the user; at the same time, combined with the user's preset action and wrist turning action to jointly determine the corresponding two-dimensional code to be displayed, it can also improve the electronic equipment's ability to display The accuracy of the two-dimensional code judgment result.
  • the above determination of whether the user has turned the wrist within the preset time range from the first moment includes: acquiring second sensor data, the second sensor data being the second The second moment is collected at any time, and the second moment is within the preset duration range after the first moment; according to the second sensor data, it is determined whether the second action of the user corresponding to the second moment is a wrist turning action.
  • the second sensor data may include gyroscope signal data and acceleration signal data, and the collection time of the second sensor data is recorded as the second time (that is, the second collection time).
  • the second collection time is within the preset time range after the first collection time, that is to say, the electronic device determines the time range by analyzing the sensor data within the preset time range after the first collection time Whether there is a user's wrist turning action.
  • the electronic device can display a two-dimensional code page, which improves the efficiency of the user in presenting the two-dimensional code.
  • the above-mentioned determination of whether the second action of the user corresponding to the second moment is a wrist turning action based on the second sensor data includes: preprocessing the second sensor data, Determine whether the second action is a suspected wrist turning action, and the probability of the suspected wrist turning action being a wrist turning action is greater than or equal to a preset probability threshold; in the case that the second action is a suspected wrist turning action, determine whether the second action is a wrist turning action wrist action.
  • the electronic device when the electronic device analyzes the above-mentioned second sensor data, it can first preprocess it to determine whether there is a suspected wrist turning action, and when there is a suspected wrist turning action, it can be further confirmed whether it is an extended wrist turning action. . Therefore, the electronic device first screens out suspected wrist turning movements with a relatively high possibility of wrist turning movements, and then determines whether the suspected wrist turning movements are real wrist turning movements, thereby improving the accuracy of the final recognition result.
  • the second sensor data includes gyroscope signal data and acceleration signal data
  • the above-mentioned second sensor data is preprocessed to determine whether the second action is a suspected wrist turning action, Including: obtaining the first sub-data from the gyroscope signal data, the first sub-data is the data of the continuous preset frame number in the gyroscope signal data; obtaining the second sub-data from the acceleration signal data, the second sub-data is the acceleration
  • the position of the first sub-data in the gyroscope signal data is the same as the position of the second sub-data in the acceleration signal data; if the first sub-data and the second sub-data meet the requirements of the first sub-data
  • a preset condition is used to determine that the second action is a suspected wrist turning action.
  • the electronic device may take the first frame signal of the above-mentioned second sensor data as a starting point, intercept 100 frame signals as the first sub-data, and then use the first frame signal of the above-mentioned third sensor data as a starting point, intercept 100 frame signals As the second sub-data, it is determined whether the first sub-data and the second sub-data meet the first preset condition, and if so, it is determined that the above-mentioned second action is a suspected wrist turning action.
  • the above-mentioned first preset condition includes at least one of the following conditions:
  • Condition 3 the z-axis acceleration value corresponding to the last frame signal of the second sub-data is in the third interval, or is smaller than the first threshold;
  • Condition 4 There is a main peak signal in the first sub-data
  • Condition 5 the main peak signal is located in the middle area of the first sub-data
  • Condition 6 The signal distribution before the main peak signal shows a monotonically increasing trend, and the signal distribution after the main peak shows a monotonically decreasing trend, or, the signal distribution before the main peak signal shows a monotonically decreasing trend, and the signal distribution after the main peak shows a monotonically increasing trend.
  • the first interval can be [N1, N2] interval, such as [0, 3]
  • the second interval can be [N3, N4] interval, such as [0.8, 1.2]
  • the third interval can be [N5, N6] interval, for example [-0.707, 0.707]
  • the first threshold may be -0.707.
  • the above-mentioned determination of whether the second action is a wrist turning action includes: identifying the first sub-data and the second sub-data through a preset first model, and obtaining the first sub-data A recognition result; if the first recognition result is the first preset result, determine that the second action is a wrist turning action.
  • the first model can be any one of a recurrent neural network model (recurrent neural network, RNN), a long short-term memory network model (long short-term memory, LSTM) and a gated recurrent unit network model (gated recurrent unit, GRU).
  • RNN recurrent neural network
  • LSTM long short-term memory network
  • GRU gated recurrent unit network model
  • the electronic device After the electronic device determines that the above-mentioned second action is a suspected wrist turning action, it can continue to process the first sub-data and the second sub-data, for example, it can perform feature extraction on it to obtain a feature set, and then input the feature set into the first sub-data. model to obtain the first recognition result.
  • the first recognition result may use 0 to indicate a non-wrist turning action, 1 to indicate a wrist turning action after stretching out, and 2 to indicate a wrist turning action after retracting. Then, when the first recognition result is 1, it can be determined that the second action is the action of stretching out and turning the wrist. Therefore, the electronic device first screens out the suspected wrist-turning action with a relatively high possibility of the wrist-turning action, and then determines whether the suspected wrist-turning action is a real wrist-turning action, thereby improving the accuracy of the final recognition result.
  • determining the first action of the user corresponding to the first moment as the preset action according to the first sensor data includes: The data is identified to obtain a second identification result; if the second identification result is the second preset result, the first action is determined as the preset action.
  • the preset action may include a double-tap action, a triple-tap action by the user on the back of the electronic device, or a shaking action of holding the electronic device.
  • the second model may be a decision tree model, and the first sensor data is identified through the second model to obtain a second identification result.
  • the second recognition result may use 0 to indicate a non-gesture action, 1 to indicate a double-tap action on the back of the electronic device, 2 to indicate a triple-tap action to the back of the electronic device, and 3 to indicate a shaking action of holding the electronic device. Then, when the second recognition result is 1 or 2 or 3, it can be determined that the first action is the preset action. Therefore, the accuracy of the recognition result can be improved by using the model to judge the first sensor data.
  • the displaying the preset two-dimensional code page includes: if the first action is a double-click action by the user on the back of the electronic device, displaying the first two-dimensional code page; Or, if the first action is the user's three-click action on the back of the electronic device, then display the second two-dimensional code page; or, if the first action is the user's shaking action of holding the electronic device, then display the third two-dimensional code page.
  • the above method further includes: displaying the first interface containing display setting controls, the display setting controls include a setting control for a double-click action, a setting control for a triple-click action and the setting control for the shaking action; receiving the first operation of the user acting on the display setting control on the first interface; in response to the first operation, setting that when the user performs a double-click action on the back of the electronic device, the first two-dimensional code page is displayed , when the user triple-clicks the back of the electronic device, the second two-dimensional code page is displayed, and when the user shakes the electronic device, the third two-dimensional code page is displayed.
  • the electronic device can provide the user with different gestures to display different two-dimensional code pages, so when the user wants to show a two-dimensional code page, he only needs to execute the corresponding gesture. For example, setting the double-click action on the back of the electronic device corresponds to The payment QR code and the three-click action on the back of the electronic device correspond to The payment QR code and the shaking action of holding the electronic device correspond to the health code and so on.
  • the electronic device can also provide the user with an operation interface for setting (that is, the first interface), so as to facilitate the user to perform corresponding setting operations according to different needs, thereby improving the user experience.
  • the above method further includes: acquiring third sensor data; processing the third sensor data to obtain a third recognition result ; In the case where the third recognition result indicates that the third action of the user corresponding to the third sensor data is the wrist turning action after retracting, display the first page, and the first page is the page displayed by the electronic device before displaying the QR code page .
  • the electronic device can obtain the data of the currently displayed screen on the display screen from the video memory. If the current display is a QR code page, the electronic device can close the QR code page and display the QR code page. Any other page before that (i.e. the first page). Therefore, when the user scans the code and takes back the electronic device, the electronic device can also automatically close the two-dimensional code page, which improves the simplicity of the process for the user to close the two-dimensional code.
  • the present application provides an apparatus, which is included in an electronic device, and has a function of realizing the behavior of the electronic device in the above first aspect and possible implementation manners of the above first aspect.
  • the functions may be implemented by hardware, or may be implemented by executing corresponding software through hardware.
  • Hardware or software includes one or more modules or units corresponding to the functions described above. For example, a receiving module or unit, a processing module or unit, and the like.
  • the present application provides an electronic device, the electronic device includes: a processor, a memory, and an interface; the processor, the memory, and the interface cooperate with each other, so that the electronic device executes any method in the technical solution of the first aspect.
  • the present application provides a chip, including a processor.
  • the processor is used to read and execute the computer program stored in the memory, so as to execute the method in the first aspect and any possible implementation manners thereof.
  • the chip further includes a memory, and the memory is connected to the processor through a circuit or wires.
  • the chip further includes a communication interface.
  • the present application provides a computer-readable storage medium, in which a computer program is stored, and when the computer program is executed by a processor, the processor is made to execute any one of the technical solutions of the first aspect method.
  • the present application provides a computer program product, the computer program product including: computer program code, when the computer program code is run on the electronic device, the electronic device is made to execute any one of the methods in the technical solution of the first aspect.
  • Fig. 1 is a schematic diagram of the process of producing a two-dimensional code page in the related art
  • Fig. 2 is a schematic structural diagram of an example of electronic equipment provided by the embodiment of the present application.
  • Fig. 3 is a software structural block diagram of the electronic device provided by the embodiment of the present application.
  • Fig. 4 is a schematic diagram of various wrist turning actions in an example of a code scanning scene provided by the embodiment of the present application.
  • Figure 5 (a) is a schematic diagram of an operation interface for enabling the smart perception function provided by the embodiment of the present application
  • Figure 5 (b) is a schematic diagram of another example of an operation interface for enabling the smart perception function provided by the embodiment of the present application.
  • FIG. 6 is a schematic flowchart of a method for displaying a two-dimensional code provided in an embodiment of the present application
  • FIG. 7 is a signal diagram of an example of gyroscope signal data and acceleration signal data provided by the embodiment of the present application.
  • Fig. 8 is a signal diagram of the modulus value of the triaxial angular velocity radian value and the modulus value of the triaxial acceleration value provided by the embodiment of the present application;
  • Fig. 9 is a schematic structural diagram of a GRU model provided by the embodiment of the present application.
  • FIG. 10 is a schematic flowchart of another example of a method for displaying a two-dimensional code provided in the embodiment of the present application.
  • FIG. 11 is a signal distribution diagram of acceleration signal data of an example of tapping on the back of an electronic device provided by the embodiment of the present application.
  • FIG. 12 is a schematic flowchart of another example of a method for displaying a two-dimensional code provided in the embodiment of the present application.
  • Fig. 13 is a schematic diagram of another example of an operation interface for enabling the intelligent perception function provided by the embodiment of the present application.
  • FIG. 14 is a schematic flowchart of another example of a method for displaying a two-dimensional code provided by an embodiment of the present application.
  • first”, “second”, and “third” are used for descriptive purposes only, and cannot be understood as indicating or implying relative importance or implicitly specifying the quantity of indicated technical features. Thus, a feature defined as “first”, “second” and “third” may explicitly or implicitly include one or more of these features.
  • APPs can be installed on the mobile phone, such as APP, APP and health code APP, etc.
  • the user can click the icon to enter the application interface, and then click the "Payment" option on the application interface, and the display interface of the mobile phone will display payment QR code.
  • the user can align the payment QR code with the scanning port provided by the merchant to scan the code for payment; after the payment is completed, the user also needs to close the payment QR code page or open the The APP is closed.
  • the user wants to use the QR code in it he also needs to perform similar operation steps. It can be seen from this that the current operation steps for the user to retrieve the QR code are relatively cumbersome and time-consuming.
  • the embodiment of the present application provides a method for displaying a two-dimensional code, which can determine whether the two-dimensional code needs to be displayed by recognizing the gestures of the user when operating the mobile phone, and display the corresponding The two-dimensional code page, thereby reducing the operation steps for users to call up two-dimensional codes, and making the process of users showing two-dimensional codes simple and efficient.
  • the method for displaying a two-dimensional code provided by the embodiment of this application can be applied to mobile phones, tablet computers, wearable devices and other electronic devices that can install APP or have corresponding two-dimensional code functions.
  • the specific type of equipment is not limited in any way.
  • FIG. 2 is a schematic structural diagram of an electronic device 100 provided in an embodiment of the present application.
  • the electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (universal serial bus, USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, and an antenna 2 , mobile communication module 150, wireless communication module 160, audio module 170, speaker 170A, receiver 170B, microphone 170C, earphone jack 170D, sensor module 180, button 190, motor 191, indicator 192, camera 193, display screen 194, and A subscriber identification module (subscriber identification module, SIM) card interface 195 and the like.
  • SIM subscriber identification module
  • 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, an ambient light sensor 180L, bone conduction sensor 180M, etc.
  • the processor 110 may include one or more processing units, for example: the processor 110 may include an application processor (application processor, AP), a modem processor, a graphics processing unit (graphics processing unit, GPU), an image signal processor (image signal processor, ISP), controller, memory, video codec, digital signal processor (digital signal processor, DSP), baseband processor, and/or neural network processor (neural-network processing unit, NPU) wait. Wherein, different processing units may be independent devices, or may be integrated in one or more processors.
  • application processor application processor, AP
  • modem processor graphics processing unit
  • GPU graphics processing unit
  • image signal processor image signal processor
  • ISP image signal processor
  • controller memory
  • video codec digital signal processor
  • DSP digital signal processor
  • baseband processor baseband processor
  • neural network processor neural-network processing unit, NPU
  • processor 110 may include one or more interfaces.
  • the interface may include an integrated circuit (inter-integrated circuit, I2C) interface, an integrated circuit built-in audio (inter-integrated circuit sound, I2S) interface, a pulse code modulation (pulse code modulation, PCM) interface, a universal asynchronous transmitter (universal asynchronous receiver/transmitter, UART) interface, mobile industry processor interface (mobile industry processor interface, MIPI), general-purpose input and output (general-purpose input/output, GPIO) interface, subscriber identity module (subscriber identity module, SIM) interface, and /or universal serial bus (universal serial bus, USB) interface, etc.
  • I2C integrated circuit
  • I2S integrated circuit built-in audio
  • PCM pulse code modulation
  • PCM pulse code modulation
  • UART universal asynchronous transmitter
  • MIPI mobile industry processor interface
  • GPIO general-purpose input and output
  • subscriber identity module subscriber identity module
  • SIM subscriber identity module
  • USB universal serial bus
  • the interface connection relationship between the modules shown in the embodiment of the present application is only a schematic illustration, and does not constitute a structural limitation of the electronic device 100 .
  • the electronic device 100 may also adopt different interface connection manners in the foregoing embodiments, or a combination of multiple interface connection manners.
  • the wireless communication function of the electronic device 100 can be realized 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.
  • Antenna 1 and Antenna 2 are used to transmit and receive electromagnetic wave signals.
  • the structures of antenna 1 and antenna 2 in FIG. 2 are just an example.
  • Each antenna in electronic device 100 may be used to cover single or multiple communication frequency bands. Different antennas can also be multiplexed to improve the utilization of the antennas.
  • Antenna 1 can be multiplexed as a diversity antenna of a wireless local area network.
  • the antenna may be used in conjunction with a tuning switch.
  • the electronic device 100 realizes the display function through 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 the application processor. GPUs are used to perform mathematical and geometric calculations for graphics rendering.
  • Processor 110 may include one or more GPUs that execute program instructions to generate or change display information.
  • the display screen 194 is used to display images, videos and the like.
  • the display screen 194 includes a display panel.
  • the display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active matrix organic light emitting diode or an active matrix organic light emitting diode (active-matrix organic light emitting diode, AMOLED), flexible light-emitting diode (flex light-emitting diode, FLED), Miniled, MicroLed, Micro-oLed, quantum dot light emitting diodes (quantum dot light emitting diodes, QLED), etc.
  • the electronic device 100 may include 1 or N display screens 194 , where N is a positive integer greater than 1.
  • the pressure sensor 180A is used to sense the pressure signal and convert the pressure signal into an electrical signal.
  • pressure sensor 180A may be disposed on display screen 194 .
  • pressure sensors 180A such as resistive pressure sensors, inductive pressure sensors, and capacitive pressure sensors.
  • a capacitive pressure sensor may be comprised of at least two parallel plates with conductive material.
  • the electronic device 100 determines the intensity of pressure according to the change in capacitance.
  • the electronic device 100 detects the intensity of the touch operation according to the pressure sensor 180A.
  • the electronic device 100 may also calculate the touched position according to the detection signal of the pressure sensor 180A.
  • touch operations acting on the same touch position but with different touch operation intensities may correspond to different operation instructions. For example: when a touch operation with a touch operation intensity less than the first pressure threshold acts on the short message application icon, an instruction to view short messages is executed. When a touch operation whose intensity is greater than or equal to the first pressure threshold acts on the icon of the short message application, the instruction of creating a new short message is executed.
  • the gyro sensor 180B can be used to determine the motion posture of the electronic device 100 .
  • the angular velocity of the electronic device 100 around three axes may be determined by the gyro sensor 180B.
  • the gyro sensor 180B can be used for image stabilization. Exemplarily, when the shutter is pressed, the gyro sensor 180B detects the shaking angle of the electronic device 100, calculates the distance that the lens module needs to compensate according to the angle, and allows the lens to counteract the shaking of the electronic device 100 through reverse movement to achieve anti-shake.
  • the gyro sensor 180B can also be used for navigation and somatosensory game scenes.
  • the acceleration sensor 180E can detect the acceleration of the electronic device 100 in various directions (generally three axes).
  • the magnitude and direction of gravity can be detected when the electronic device 100 is stationary. It can also be used to identify the posture of electronic devices, and can be used in applications such as horizontal and vertical screen switching, pedometers, etc.
  • Proximity light sensor 180G may include, for example, light emitting diodes (LEDs) and light detectors, such as photodiodes.
  • the light emitting diodes may be infrared light emitting diodes.
  • the electronic device 100 emits infrared light through the light emitting diode.
  • Electronic device 100 uses photodiodes to detect infrared reflected light from nearby objects. When sufficient reflected light is detected, it may be determined that there is an object near the electronic device 100 . When insufficient reflected light is detected, the electronic device 100 may determine that there is no object near the electronic device 100 .
  • the electronic device 100 can use the proximity light sensor 180G to detect that the user is holding the electronic device 100 close to the ear to make a call, so as to automatically turn off the screen to save power.
  • the proximity light sensor 180G can also be used in leather case mode, automatic unlock and lock screen in pocket mode.
  • the above-mentioned electronic device 100 further includes a sensor hub (Sensor Hub), or referred to as a sensor hub or a sensor coprocessor, which is mainly connected and processes data from the sensor module 180 with low power consumption.
  • the Sensor Hub may include, but is not limited to, low-power processing modules or processing circuits such as application processors, coprocessors (Coprocessors), and microprocessors (micro-programmed control units, MCUs).
  • the Sensor Hub can handle such as the above-mentioned pressure sensor 180A, gyro sensor 180B, air pressure sensor 180C, magnetic sensor 180D, acceleration sensor 180E, distance sensor 180F, proximity light sensor 180G, fingerprint sensor 180H, temperature sensor 180J, touch sensor 180K, The data of the ambient light sensor 180L, the bone conduction sensor 180M and other sensors, and the fusion processing of each sensor data.
  • the current Sensor Hub is mainly divided into three types: one is to place the Sensor Hub as a separate chip between the application processor and various sensors; the other is to use the Sensor Hub
  • the Hub integrates with various sensors, receives data from various sensors for fusion, and then provides the fused data to the application processor; the other is to integrate the Sensor Hub with the application processor, and various sensors provide data To the Sensor Hub inside the application processor, the Sensor Hub fuses and processes the data and then provides the data to the application processor.
  • the structure illustrated in the embodiment of the present application does not constitute a specific limitation on the electronic device 100 .
  • the electronic device 100 may include more or fewer components than shown in the figure, or combine certain components, or separate certain components, or arrange different components.
  • the illustrated components can be realized in hardware, software or a combination of software and hardware.
  • FIG. 3 is a block diagram of the software structure of the electronic device 100 according to the embodiment of the present application.
  • the layered architecture divides the software into several layers, and each layer has a clear role and division of labor. Layers communicate through software interfaces.
  • the Android system can be divided into several layers, which are application program layer, framework layer, Sensor Hub layer, system layer and hardware layer from top to bottom.
  • the application program layer may include various application programs installed in the electronic device 100, such as APP, APP and health code APP, etc.
  • the framework layer may include a decision-making module, which is used to make instruction decisions according to the data transmitted by the upper layer or the lower layer, and instruct the upper layer or the lower layer to execute corresponding instruction actions.
  • the algorithm module in the Sensor Hub layer is used to call the Sensor algorithm (SensorAlg) to process the sensor data of the hardware layer sensor, and hand over the processing results to the decision-making module for decision-making.
  • the display driver at the system layer can receive the display data transmitted by the upper layer and hand it over to the display screen for display.
  • the hardware layer may include various hardware modules in the electronic device 100, such as a gyroscope sensor, an acceleration sensor, and a display screen.
  • the direction of the scanning port provided by the merchant can be vertically forward or horizontally upward Or tilt upward, etc.
  • the user needs to align the display screen of the electronic device vertically, horizontally, upside down or obliquely with the code scanning port. Therefore, in the embodiment of the present application, based on the gesture action of the user operating the mobile phone when scanning the code, the sensor data of the gyroscope sensor and the acceleration sensor in the electronic device are analyzed to determine whether the user has a wrist turning action corresponding to the code scanning.
  • the electronic device when the electronic device determines that the user has the above-mentioned wrist turning action, the electronic device can automatically pop up the display corresponding QR code.
  • the action of turning the wrist when the user holds the electronic device is called the wrist turning action.
  • retracting the back and turning the wrist In order to stretch out and turn back the wrist, the action of retracting the wrist after extending the back and turning the wrist is called retracting the back and turning the wrist.
  • these actions can also be referred to as stretching out and then turning the wrist; the following embodiment uses the stretching and turning the wrist as an example to illustrate the method for displaying a two-dimensional code.
  • the function of the electronic device to automatically pop up and display the QR code can be customized by the user. If the user wants to use this function, he can turn on the switch of the function by setting the path. As shown in Figure 5, there is a "smart perception" option on the setting page. After the user clicks this option, he can jump to the switch page of the smart perception function (that is, the function that the electronic device automatically pops up and displays the QR code); On this page, users can turn on the smart perception function by clicking the switch control.
  • Figure 5 (a) when the user opens this function, there is a default QR code corresponding to, for example, corresponding to payment QR code, then the subsequent electronic device will automatically pop up and display payment QR code.
  • FIG. 6 is a schematic flowchart of a method for displaying a two-dimensional code provided in an embodiment of the present application. The method is executed by an electronic device, including:
  • the sensor data may include sensor data A and sensor data B.
  • sensor data A may be data collected by a gyroscope sensor, such as gyroscope signal data
  • sensor data B may be data collected by an acceleration sensor, such as acceleration signal data.
  • the gyroscope signal data is usually the angular velocity of the three axes (ie, x, y and z axes) when the electronic device moves, where the three axes are the coordinate axes of the gyroscope sensor's own coordinate system;
  • the acceleration signal data is usually the electronic device
  • the signal distribution diagram of the gyroscope signal data and the acceleration signal data obtained by the electronic device can be referred to FIG. 7.
  • FIG. 7 In the schematic diagram of the gyroscope signal data in FIG.
  • the horizontal axis represents the number of signal frames
  • the vertical axis represents the amplitude of the x, y, and z-axis acceleration corresponding to each frame signal.
  • the electronic device continuously acquires the above sensor data at a certain frequency, and continuously executes the following steps when the sensor data is acquired.
  • the electronic device can obtain sensor data A and sensor data B when the electronic device is in the state of unlocking and brightening the screen.
  • the suspected wrist turning action can be understood as the probability that the determined wrist turning action is greater than or equal to a preset probability threshold (for example, 90%).
  • the electronic device can perform preprocessing on sensor data, such as sensor data A and sensor data B, for example, intercepting the first sub-data in sensor data A and the second sub-data in sensor data B, so as to The sub-data and the second sub-data determine whether the corresponding user's gesture action is a suspected wrist turning action. That is to say, the electronic device first screens out suspected wrist-turning movements with a relatively high possibility of wrist-turning movements, and then subsequently determines whether the suspected wrist-turning movements are real wrist-turning movements to improve the accuracy of the final recognition result.
  • a process for the electronic device to determine whether the user's gesture is a suspected wrist turning action may be as follows:
  • sensor data A as gyroscope signal data and sensor data B as acceleration signal data
  • the electronic device can filter them first to remove noise in the signal data.
  • the electronic device may filter the gyroscope signal data and the acceleration signal data by means of mean value filtering or other filtering methods.
  • the electronic device can analyze the gyroscope signal data and acceleration signal data to determine whether it is a suspected wrist turning action.
  • the electronic device can determine whether it is a suspected wrist turning action in the following way: For the gyroscope signal data, the electronic device takes the first frame signal as the starting point, and intercepts the preset number of frames (for example, 100 frames, that is, 1 second signal data) as the first signal segment A (i.e. the first sub-data); for the acceleration signal data, the electronic device also takes the first frame signal as the starting point, and intercepts 100 frame signals as the first signal segment B (being the second sub-data), analyze and judge the first signal segment A and the first signal segment B, and the specific analysis process can be as follows:
  • the preset number of frames for example, 100 frames, that is, 1 second signal data
  • the electronic device also takes the first frame signal as the starting point, and intercepts 100 frame signals as the first signal segment B (being the second sub-data), analyze and judge the first signal segment A and the first signal segment B, and the specific analysis process can be as follows:
  • the electronic device Since the electronic device is in a relatively static state when the user holds the electronic device to scan the code, the electronic device takes the last frame signal of the first signal segment. Assuming that the radian value of the three-axis angular velocity corresponding to the last frame signal of the first signal segment A is (x1, y1, z1), and the unit is rad/s, the electronic device can obtain the three-axis angular velocity of the gyroscope according to (x1, y1, z1).
  • the modulus M1 of the radian value of the shaft angular velocity can be based on The relational expression to obtain M1, and then determine whether M1 is in the [N1, N2] interval (condition 1), for example, [N1, N2] interval can be [0, 5] interval, optional, [0, 4] interval Or in the interval [0, 3], the modulus M1 is approximately 0 when the electronic device is stationary.
  • condition 1 for example, [N1, N2] interval can be [0, 5] interval, optional, [0, 4] interval Or in the interval [0, 3], the modulus M1 is approximately 0 when the electronic device is stationary.
  • the electronic device can calculate the three-axis acceleration according to (x2, y2, z2)
  • the value of the modulus M2, for example, according to M2 is obtained by the relational expression, and then M2 is normalized, and it is judged whether the normalized M2 is in the [N3, N4] interval (condition 2), for example, the [N3, N4] interval can be [0.6, 1.5 ] interval, the optional [0.8, 1.2] interval, the modulus M2 is approximately 1 when the electronic device is stationary.
  • the display screen of the electronic device when the direction of the code scanning port is vertically forward, the display screen of the electronic device generally faces forward. It can be judged whether z2 in the above three-axis acceleration value is in the [N5, N6] interval (condition 3), for example, the [N5, N6] interval can be [-0.707, 0.707] interval.
  • the display screen of the electronic device When the direction of the scanning port is horizontal and upward, the display screen of the electronic device is generally facing downward. At this time, the up-down or left-right inclination angle of the display screen is within 45°, then the electronic device can also judge whether z2 in the above-mentioned three-axis acceleration value is is less than the first threshold (condition 3), for example, the first threshold may be -0.707.
  • the electronic device can also be analyzed when the user stretches out the electronic device to scan the code. Since the action of the user stretching out the electronic device to scan the code is relatively natural, usually not very fast or very slow, then for the above-mentioned first signal segment A (that is, the signal data of the gyroscope), there will generally be a main peak signal ( Condition 4), the position of the main peak is generally located in the middle area of the first signal segment A (condition 5), the signal distribution before the main peak shows a monotonous increasing trend, and the signal distribution after the main peak shows a monotonous decreasing trend, or, the signal distribution before the main peak It shows a monotonically decreasing trend, and the signal distribution after the main peak shows a monotonically increasing trend (condition 6).
  • Condition 4 the position of the main peak is generally located in the middle area of the first signal segment A (condition 5)
  • the signal distribution before the main peak shows a monotonous increasing trend
  • the signal distribution after the main peak shows a monotonous decreasing trend
  • the signal distribution after the main peak shows a monoton
  • Condition 1 Whether M1 is in the [N1, N2] interval;
  • Condition 3 whether z2 is in the [N5, N6] interval, or whether z2 is smaller than the first threshold;
  • Condition 4 There is a main peak signal in the first signal segment A;
  • Condition 5 The position of the main peak is located in the middle area of the first signal segment A;
  • Condition 6 The signal distribution before the main peak shows a monotonically increasing trend, and the signal distribution after the main peak shows a monotonically decreasing trend, or, the signal distribution before the main peak shows a monotonically decreasing trend, and the signal distribution after the main peak shows a monotonically increasing trend.
  • the above-mentioned first signal segment A and The user gesture action corresponding to the first signal segment B is a suspected wrist turning action.
  • the electronic device outputs 1 when the wrist turning action is suspected, and the electronic device outputs 0 when the wrist turning action is not suspected.
  • FIG. 8 shows the modulus of the radian value of the three-axis angular velocity corresponding to each frame of the gyroscope signal in the above-mentioned FIG. 7, and the modulus of the three-axis acceleration value corresponding to the acceleration signal of each frame.
  • the horizontal axis represents the number of signal frames
  • the vertical axis represents the magnitude of the modulus value of the triaxial angular velocity radian value corresponding to each frame signal.
  • the horizontal axis Represents the number of signal frames
  • the vertical axis represents the magnitude of the modulus value of the three-axis acceleration value corresponding to each frame of signal.
  • the signal data corresponding to the rectangular dotted line frame can be respectively the first signal segment A and the first signal segment B, and the triaxial angular velocity of the first signal segment A
  • the modulus value of the radian value and the modulus value of the triaxial acceleration value of the first signal segment B refer to the data in the rectangular dotted line box in FIG. 8 .
  • the z value of the last frame signal of the first signal segment B is less than -0.707, and there is a main peak signal in the first signal segment A, which is located in the middle area of the first signal segment A, before the main peak The distribution of the signal of the signal shows a monotonous decreasing trend, and the signal distribution after the main peak shows a monotonous increasing trend;
  • the modulus value of the last frame signal of the first signal segment A is in the interval [0, 3], and the first The modulus of the last frame signal of signal segment B is in the [0.8, 1.2] interval, that is, the first signal segment A and the first signal segment B meet the above conditions, and it is determined that the user's current gesture is a suspected wrist turning action .
  • the electronic device judges whether the above conditions are satisfied, it may judge in the order of conditions 4, 5, 6, 1, 2, 3, or in the order of 5, 4, 1, 6, 2, 3 Judgment is performed, that is to say, there is no restriction on the order of judgment of each condition. And, if a certain condition of the sequence judgment is not satisfied, the judgment of subsequent conditions can no longer be performed; for example, for the sequence of conditions 4, 5, 6, 1, 2, 3, if condition 4 is not satisfied, then no The condition judgment after condition 5 is then performed, or if condition 4 is satisfied but condition 5 is not satisfied, the condition judgment after condition 6 is no longer performed, and so on.
  • the electronic device can determine whether the user's gesture is a suspected wrist turning action according to the first signal segment A and the first signal segment B. If not, for the gyroscope signal data, the electronic device uses the first The second frame signal is taken as the starting point, and the 100-frame signal is intercepted as the second signal segment C; for the acceleration signal data, the electronic device also takes the second frame signal as the starting point, and the 100-frame signal is intercepted as the second signal segment D.
  • the electronic device continues to analyze the two second signal segments with the above-mentioned analysis process to determine whether the corresponding user's gesture is a suspected wrist-turning action, and so on.
  • the electronic device may continue to process the signal data corresponding to the suspected wrist turning action, so as to determine whether it is an extended wrist turning action.
  • the electronic device can perform feature extraction separately to obtain the corresponding feature set, and the extracted features can be used to represent the posture change information of the electronic device, so that the electronic device can further determine whether the user has a wrist turning action .
  • the electronic device can also use the three-axis acceleration value (x4, y4 , z4) Determine the acceleration perpendicular to the ground; for example, the acceleration of gravity perpendicular to the ground can be obtained by mapping the relationship between the electronic device coordinate system (such as the attitude of the mobile phone and the tablet) and the reference coordinate system (earth coordinate system).
  • the embodiment of the present application refers to the velocity of any point on the object when it makes a circular motion with respect to a fixed axis as the linear velocity, and the electronic device can determine the three-axis velocity according to the radian value (x3, y3, z3) of the three-axis angular velocity; for example, Determine the three-axis speed according to the relationship of (x3, y3, z3) ⁇ r, where r is the radius of the circle.
  • the embodiment of the present application can refer to the six-axis fusion algorithm to obtain an Euler angle, and map the standard acceleration of gravity to three axes according to the Euler angle to obtain the distribution of gravity in three axes.
  • the embodiment of the present application refers to the matrix that has the effect of changing the direction of the vector but does not change the size when multiplied by a vector and maintains the chirality as the rotation matrix.
  • the embodiment of the present application calculates the reference coordinate system ( Earth coordinate system) to the rotation matrix of the electronic device coordinate system.
  • each quaternion is a linear combination of 1, m, n, and k, that is, a quaternion can generally be expressed as a+bm+cn+dk, where a, b, c, and d are real numbers, and m ,
  • the geometric meaning of n and k can be understood as a kind of rotation.
  • the embodiment of the present application calculates the rotation from the reference coordinate system (earth coordinate system) to the electronic device coordinate system; wherein, the m rotation represents the intersecting plane of the z-axis and the y-axis The rotation from the positive direction of the z-axis to the positive direction of the y-axis, the n rotation represents the positive rotation of the x-axis to the positive direction of the z-axis in the plane where the x-axis and the z-axis intersect, and the k-rotation represents the positive direction of the y-axis in the plane where the y-axis and the x-axis intersect Rotation towards the positive x-axis.
  • the features extracted by the electronic device are not limited to the above nine types of features, and may be more or less than the nine types of features, which is not limited in this embodiment of the present application.
  • the electronic device may input the obtained feature set into a preset first model for recognition, so as to determine whether the above suspected wrist turning action is a real wrist turning action.
  • the above-mentioned first model may be a network model such as RNN, LSTM, or GRU.
  • GRU is a variant of LSTM network, which has a simpler structure than LSTM network; usually, three gate functions are introduced in LSTM: input gate, forget gate and output gate to control the input value, Memory value and output value, and there are only two gates in GRU: update gate and reset gate.
  • the specific structure can be seen in Figure 9.
  • the zt and rt in Figure 9 represent the update gate and the reset gate, respectively.
  • the update gate is used to control the degree to which the state information at the previous moment is brought into the current state. The larger the value of the update gate, the state information at the previous moment is indicated.
  • the reset gate controls how much information from the previous state is written to the current candidate set On the other hand, the smaller the reset gate is, the less information from the previous state is written.
  • the recognition result of the wrist turning action can be obtained.
  • 0 can be used to indicate the non-wrist turning action
  • 1 can be used to indicate the wrist turning action after stretching out
  • 2 can be used to indicate the wrist turning action after retracting. Therefore, in the output If the result is 1, it can be determined that the above-mentioned suspected wrist turning action is a wrist turning action after stretching out, and a QR code needs to be displayed.
  • the embodiment of the present application comprehensively considers the positive samples and negative samples in the training process of the first model, and uses the data set composed of positive samples and negative samples as training data to train the first model.
  • the positive samples are the collected gyroscope signal data and acceleration signal data when the user is holding the electronic device in different initial states and different end states
  • the negative sample is the collected user holding the electronic device in different states. Gyroscope signal data and acceleration signal data during non-wrist turning movements.
  • the positive sample may be the collected signal data of the user changing from the state of holding the electronic device vertically to the horizontal screen state of turning the electronic device to the left
  • the negative sample may be the collected signal data of the user changing from the state of holding the electronic device vertically to Pick up the signal data in read state.
  • the electronic device can use them as training data to train the first model.
  • the target object that the electronic device is close to should be as light-colored as possible, and kept on the right side of the body; after close to the target object, pause for 1-2 seconds before changing the state. Pause again for 1-2 seconds before executing the next action; each set of data for each scene is collected at least 10 times, and the proximity light sensor of the electronic device needs to be close to the target.
  • each scene is collected for 15 minutes; when collecting data in the same scene, multiple behaviors can be changed; after performing each action, pause for 1-2 seconds before executing the next action.
  • the electronic device can display the corresponding two-dimensional code page if it is determined that the current user stretches out and turns the wrist after performing the above process. It can be known from the above description in FIG. 5 that the electronic device can display a default QR code correspondingly, such as payment QR code, then what is displayed at this time is payment QR code; or, the electronic device can correspond to display the user's own frequently used QR code, for example, the setting is payment QR code, then what is displayed at this time is payment QR code.
  • the display screen of the electronic device may display any other page, and when the electronic device determines that the two-dimensional code page needs to be displayed, it switches any other page to the corresponding two-dimensional QR code page.
  • the electronic device recognizes the user's gestures when operating the mobile phone based on the acquired sensor data to determine whether to display the two-dimensional code, and displays the corresponding two-dimensional code page when it is determined to display the two-dimensional code , thereby reducing the operation steps for the user to retrieve the QR code, and making the process of the user presenting the QR code simple and efficient.
  • the electronic device determines whether the user stretches out the wrist and then displays the QR code according to the acquired sensor data.
  • the user may have In the case of extending the wrist and turning the wrist, then, in order to improve the accuracy of the judgment result of whether the electronic device needs to display the two-dimensional code, it can also be combined with other gestures of the user (hereinafter referred to as is the default action) to make a judgment.
  • the user's preset action combined may be the user's double-tap action, triple-tap action on the back of the electronic device, or a shaking action of holding the electronic device.
  • the first sensor data can be data collected by an acceleration sensor, such as acceleration signal data; it can also be data collected by an acceleration sensor, such as acceleration signal data; it can also be data collected by a pressure sensor, such as pressure signal data; Several kinds of signal data mentioned above can be included at the same time.
  • S202 Determine whether the user's gesture action is a preset action according to the first sensor data, and if so, perform S206.
  • the electronic device may perform filtering processing on it first, so as to remove noise in the signal data. Then, the electronic device can analyze the first sensor data to determine whether the gesture action of the user is a preset action.
  • the preset action here may include the above-mentioned double-tap action, triple-tap action on the back of the electronic device, or shaking action of holding the electronic device.
  • the process of analyzing the acceleration signal data to determine whether it is a preset action may include: starting from the first frame signal of the acceleration signal data, electronically
  • the device can sequentially judge whether there are two consecutive peaks that meet the conditions in the acceleration signal of about 1000HZ.
  • the condition here means that the difference between the moments corresponding to the two peaks is within the preset threshold (for example, there are two peaks within 1 second) , and the peak value of the two peaks is in the [N7, N8] interval, and the peak width is in the [N9, N10] interval.
  • the [N7, N8] interval can be [5, 10]
  • the interval, [N9, N10] interval may be [50, 100] interval. If there are two peaks satisfying the conditions, the electronic device determines that the user's current gesture action is a double-tap action on the back of the electronic device, that is, it conforms to a preset action.
  • the signal distribution diagram of the acceleration signal data of the tapping action on the back of the electronic device can be referred to FIG. 11.
  • the horizontal axis represents the number of signal frames
  • the vertical axis represents the The amplitude of the x-axis acceleration value
  • the horizontal axis represents the number of signal frames
  • the vertical axis represents the amplitude of the y-axis acceleration value corresponding to each frame signal
  • the horizontal axis represents the number of signal frames
  • the vertical axis represents the magnitude of the z-axis acceleration value corresponding to each frame of signal.
  • the process of analyzing the first sensor data to determine whether it is a preset action may include: the electronic device may input the first sensor data into the second model for recognition to obtain a preset action recognition result .
  • the second model can be a decision tree model, and in the obtained recognition results, 0 can be used to indicate a non-gesture action, 1 can be used to indicate a double-tap action on the back of the electronic device, and 2 can be used to indicate a triple-tap action on the back of the electronic device.
  • 3 represents a shaking action of holding the electronic device; then, if the output result is 1 or 2 or 3, the electronic device may determine that the gesture action of the user is a preset action.
  • the embodiment of the present application comprehensively considers the positive samples and negative samples in the training process of the second model, and uses the data set composed of positive samples and negative samples as training data to train the second model.
  • the positive samples are the collected acceleration signal data of the user's multiple tapping and shaking actions
  • the negative samples are the collected user's walking, running, jumping, daily use of electronic devices, putting down, picking up, and raising hands, etc. acceleration signal data. After collecting positive samples and negative samples, the electronic device can use them as training data to train the second model.
  • the second sensor data may be data collected by a gyroscope sensor, such as gyroscope signal data; it may also be data collected by an acceleration sensor, such as acceleration signal data; it may also include both gyroscope signal data and acceleration signal data.
  • a gyroscope sensor such as gyroscope signal data
  • an acceleration sensor such as acceleration signal data
  • the preset duration range may be 3 seconds, that is, in the embodiment of the present application, it is set that the occurrence time of the preset action must be within 3 seconds before the occurrence time of the wrist-turning action after stretching out. If it has been determined in S202 that the gesture action corresponding to the first acquisition moment is a preset action, and it has been determined in S205 that the gesture action corresponding to the second acquisition moment is an extended wrist movement, then at the first acquisition moment in the second In the case of within 3 seconds before the collection time, the electronic device displays the corresponding two-dimensional code interface.
  • the electronic device can display a default QR code, such as payment QR code; or, the electronic device can display the user’s frequently used QR code, such as payment QR code.
  • the electronic The device does not display the QR code interface.
  • the electronic device recognizes the gesture action of the user during operation according to the acquired sensor data to determine whether to display the two-dimensional code, and displays the corresponding two-dimensional code page when it is determined to display the two-dimensional code, This further reduces the operation steps for the user to retrieve the QR code, making the process of showing the QR code simple and efficient for the user; at the same time, combining the user's preset action and wrist turning action to jointly determine and display the corresponding QR code can also improve the electronic The accuracy of the equipment to display the judgment result of the QR code.
  • the first sensor data may be data collected from at least one of a gyroscope sensor, an acceleration sensor or a pressure sensor, such as at least one of acceleration signal data, gyroscope signal data or pressure signal data.
  • the second sensor data may include gyroscope signal data and acceleration signal data.
  • the preset duration range may be 3 seconds, that is, after the user performs a preset action on the electronic device, the electronic device starts to monitor whether there is an action of stretching out and turning the wrist within 3 seconds, for example, a monitoring thread may be started to monitor.
  • a monitoring thread may be started to monitor.
  • the electronic device can display the QR code page when it judges that the above-mentioned suspected wrist turning action is a wrist turning action after stretching out.
  • electronic devices can display default QR codes, such as payment QR code; or, the electronic device can display the user’s frequently used QR code, such as payment QR code.
  • the monitoring operation can be started . And when it detects that there is an action of stretching out and turning the wrist, it will display the QR code page.
  • the QR code displayed here can be the default QR code, such as The QR code for payment; or, it can display the QR code that the user sets frequently, such as payment QR code.
  • QR codes there are many types of QR codes currently, in order to enable electronic devices to accurately display the corresponding QR codes according to different demand scenarios, as shown in Figure 13, when the user opens the smart perception function When switching on and off, you can also set the QR codes corresponding to different gestures. For example, setting the double-tap action on the back of the electronic device corresponds to The payment QR code and the three-click action on the back of the electronic device correspond to The payment QR code and the shaking action of the electronic device correspond to the health code; among them, the user can click the triangle icon behind the corresponding action on the page in Figure 13 Select the corresponding QR code in the pop-up QR code list (not shown in the figure).
  • the preset action determined by the electronic device when the preset action determined by the electronic device is the double-tap action of the user on the back of the electronic device, and the action of stretching out and then turning the wrist is monitored, it can display payment QR code; when the preset action determined by the electronic device is the user's three-click action on the back of the electronic device, and the wrist movement is monitored after stretching out, it can display The payment QR code; when the preset action determined by the electronic device is the user's shaking action on the electronic device, and the movement of stretching out and turning the wrist is monitored, the health code can be displayed.
  • the electronic device after the electronic device displays the two-dimensional code page, it can continue to monitor whether there is an action of turning the wrist after retracting, and close the above-mentioned two-dimensional code page when there is an action of turning the wrist after retracting, and display the two-dimensional code Any other page before the page display.
  • the QR code currently displayed on the electronic device is a payment QR code
  • the QR code page needs to be closed after the user enters the password and the payment is successful; or when some payment applications are set to password-free payment , you can directly close the QR code page.
  • the process of determining whether there is a wrist turning action after retraction please refer to the above-mentioned process of S102-S103. wrist action.
  • the electronic device when the electronic device recognizes that the user has a preset action according to the acquired sensor data, it monitors whether there is an action of stretching out and turning the wrist within the range of the preset time length, and determines when there is an action of turning the wrist after stretching out.
  • Display the QR code to reduce the operation steps for the user to call up the QR code, making the process of showing the QR code simple and efficient for the user; at the same time, combined with the user's preset action and wrist turning action to jointly determine the corresponding QR code to be displayed It can also improve the accuracy of the electronic device for judging the result of displaying the two-dimensional code.
  • Fig. 14 is a timing interaction diagram of a method for displaying a two-dimensional code provided by an embodiment of the present application. Taking the first sensor data as acceleration signal data and the second sensor data as gyroscope signal data and acceleration signal data as an example, the method includes :
  • the acceleration sensor collects acceleration signal data, and the collection time of the acceleration signal data is the first collection time.
  • the acceleration sensor sends the acceleration signal data to the algorithm module.
  • the algorithm module invokes the SensorAlg to process the acceleration signal data, and determines whether the user's gesture action is a preset action, and if so, executes S404.
  • the algorithm module starts a monitoring thread, which is used to monitor whether there is an action of stretching out and turning the wrist within a preset time range from the first acquisition moment.
  • the algorithm module acquires gyroscope signal data from the gyroscope sensor, and acquires acceleration signal data from the acceleration sensor.
  • the algorithm module preprocesses the gyroscope signal data and the acceleration signal data to determine whether the user's gesture action is a suspected wrist turning action. If yes, execute S407.
  • the algorithm module determines that the above-mentioned suspected wrist turning action is a wrist turning action after stretching out.
  • the listening thread detects that there is an action of extending and turning the wrist.
  • the monitoring thread sends the monitoring result to the decision module.
  • the decision-making module reports to the corresponding application (as shown in Figure 14 that the application is as an example) to send a display command.
  • the monitoring result may include the identification of the corresponding application, so that the decision-making module can accurately send the display instruction to the corresponding application.
  • S411 Send the page data of the payment QR code to the decision-making module according to the received display instruction.
  • the decision module sends the page data of the payment QR code to the display driver, and instructs the display driver to call the display screen to display the payment QR code page.
  • the display driver invokes the display screen to display the payment QR code page.
  • the display screen displays a payment QR code page.
  • the electronic device includes hardware and/or software modules corresponding to each function.
  • the present application can be implemented in the form of hardware or a combination of hardware and computer software in combination with the units and algorithm steps of each example described in the embodiments disclosed herein. Whether a certain function is executed by hardware or computer software drives hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art may use different methods to implement the described functions in combination with the embodiments for each specific application, but such implementation should not be regarded as exceeding the scope of the present application.
  • the functional modules of the electronic device can be divided according to the above method examples.
  • each function can be divided into various functional modules, such as a detection unit, a processing unit, a display unit, etc., or two or more than two
  • the functions are integrated in one module.
  • the above-mentioned integrated modules can be implemented in the form of hardware or in the form of software function modules. It should be noted that the division of modules in the embodiment of the present application is schematic, and is only a logical function division, and there may be other division methods in actual implementation.
  • the electronic device provided in this embodiment is used to execute the above method for displaying a two-dimensional code, so it can achieve the same effect as the above implementation method.
  • the electronic device may also include a processing module, a memory module and a communication module.
  • the processing module can be used to control and manage the actions of the electronic device.
  • the memory module can be used to support electronic devices to execute stored program codes and data, and the like.
  • the communication module can be used to support the communication between the electronic device and other devices.
  • the processing module may be a processor or a controller. It can implement or execute the various illustrative logical blocks, modules and circuits described in connection with the present disclosure.
  • the processor can also be a combination of computing functions, such as a combination of one or more microprocessors, a combination of digital signal processing (digital signal processing, DSP) and a microprocessor, and the like.
  • the storage module may be a memory.
  • the communication module may be a device that interacts with other electronic devices, such as a radio frequency circuit, a Bluetooth chip, and a Wi-Fi chip.
  • the electronic device involved in this embodiment may be a device having the structure shown in FIG. 2 .
  • the embodiment of the present application also provides a computer-readable storage medium.
  • a computer program is stored in the computer-readable storage medium.
  • the processor executes the method of displaying a two-dimensional code in any of the above-mentioned embodiments. method.
  • the embodiment of the present application also provides a computer program product.
  • the computer program product When the computer program product is run on a computer, it causes the computer to execute the above-mentioned related steps, so as to realize the method for displaying a two-dimensional code in the above-mentioned embodiment.
  • an embodiment of the present application also provides a device, which may specifically be a chip, a component or a module, and the device may include a connected processor and a memory; wherein the memory is used to store computer-executable instructions, and when the device is running, The processor can execute the computer-executable instructions stored in the memory, so that the chip executes the method for displaying a two-dimensional code in the above method embodiments.
  • the electronic device, computer-readable storage medium, computer program product or chip provided in this embodiment is all used to execute the corresponding method provided above, therefore, the beneficial effects it can achieve can refer to the above-mentioned The beneficial effects of the corresponding method will not be repeated here.
  • the disclosed devices and methods may be implemented in other ways.
  • the device embodiments described above are only illustrative.
  • the division of modules or units is only a logical function division. In actual implementation, there may be other division methods.
  • multiple units or components can be combined or It may be integrated into another device, or some features may be omitted, or not implemented.
  • the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces, and the indirect coupling or communication connection of devices or units may be in electrical, mechanical or other forms.
  • a unit described as a separate component may or may not be physically separated, and a component shown as a unit may be one physical unit or multiple physical units, which may be located in one place or distributed to multiple different places. Part or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
  • each functional unit in each embodiment of the present application may be integrated into one processing unit, each unit may exist separately physically, or two or more units may be integrated into one unit.
  • the above-mentioned integrated units can be implemented in the form of hardware or in the form of software functional units.
  • an integrated unit is realized in the form of a software function unit and sold or used as an independent product, it can be stored in a readable storage medium.
  • the technical solution of the embodiment of the present application is essentially or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the software product is stored in a storage medium Among them, several instructions are included to make a device (which may be a single-chip microcomputer, a chip, etc.) or a processor (processor) execute all or part of the steps of the methods in various embodiments of the present application.
  • the aforementioned storage medium includes: various media that can store program codes such as U disk, mobile hard disk, read only memory (ROM), random access memory (random access memory, RAM), magnetic disk or optical disk.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Business, Economics & Management (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • General Business, Economics & Management (AREA)
  • Strategic Management (AREA)
  • Accounting & Taxation (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • General Engineering & Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Human Computer Interaction (AREA)
  • User Interface Of Digital Computer (AREA)
  • Electric Clocks (AREA)

Abstract

一种显示二维码的方法和电子设备,该方法由电子设备执行,包括:获取第一传感器数据,第一传感器数据为第一时刻进行采集;若根据第一传感器数据确定第一时刻对应的用户的第一动作为预设动作,则确定从第一时刻起的预设时长范围内用户是否有翻腕动作;在预设时长范围内用户有翻腕动作的情况下,显示预设的二维码页面。该方法可以使用户出示二维码的过程变得简单高效。

Description

显示二维码的方法和电子设备
本申请要求于2021年12月28日提交国家知识产权局、申请号为202111633073.0、申请名称为“显示二维码的方法和电子设备”的中国专利申请的优先权,以及要求于2022年01月28日提交国家知识产权局、申请号为202210109243.3、申请名称为“显示二维码的方法和电子设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及电子技术领域,具体涉及一种显示二维码的方法和电子设备。
背景技术
随着智能手机等电子设备的广泛应用,人们的生活愈加便利。例如,购买物品时不再需要携带现金,直接使用手机中的付款二维码;或者,乘坐公共交通工具时不再需要携带公交卡,直接使用手机中的乘车二维码,等等。
当前,在用户需要使用二维码进行付款或乘车时,通常要先在手机上打开对应的应用程序(application,APP),然后打开该APP对应的二维码。比如在支付场景中,需要先打开
Figure PCTCN2022113601-appb-000001
APP或者
Figure PCTCN2022113601-appb-000002
APP,然后在APP中点击“付款”选项,才可以调出对应的付款二维码,其操作步骤比较繁琐且耗时。
发明内容
本申请提供了一种显示二维码的方法和电子设备,可以使用户出示二维码的过程变得简单高效。
第一方面,本申请提供一种显示二维码的方法,该方法由电子设备执行,包括:获取第一传感器数据,第一传感器数据为第一时刻进行采集;若根据第一传感器数据确定第一时刻对应的用户的第一动作为预设动作,则确定从第一时刻起的预设时长范围内用户是否有翻腕动作;在预设时长范围内用户有翻腕动作的情况下,显示预设的二维码页面。
可选地,第一传感器数据可以是来自陀螺仪传感器、加速度传感器或压力传感器中的至少一种所采集的数据,例如陀螺仪信号数据、加速度信号数据或者压力信号数据中的至少一种。
可选地,翻腕动作可以包括伸出后翻腕动作,伸出后翻腕动作可以包括竖屏翻腕动作、横屏翻腕动作、倒扣翻腕动作、存在一定角度倾斜翻腕动作或者抬手向内翻腕动作。
在获取该第一传感器数据时还可获取采集数据时的第一时刻(也即第一采集时刻)。那么,在确定到第一采集时刻用户的手势动作为预设动作时,可以从第一采集时刻起,监听预设时长范围内(例如3秒内)是否有翻腕动作,如果有则显示二维码页面。此实现方式中,所显示的二维码页面可以为一个默认的二维码,比如
Figure PCTCN2022113601-appb-000003
的付款二维码;或者,可以为用户设置的自己常用的二维码,比如设置的是
Figure PCTCN2022113601-appb-000004
的付款二维码,那么此时显示的即为
Figure PCTCN2022113601-appb-000005
的付款二维码。
此实现方式中,电子设备根据获取的传感器数据识别到用户具有预设动作时,监听在预设时长范围内是否有翻腕动作,并在有翻腕动作时确定显示二维码,以减少用户调取二维码的操作步骤,使用户出示二维码的过程变得简单高效;同时,结合用户的预设动作和翻腕动作共同确定显示对应的二维码,还可提高电子设备对显示二维码判断结果的准确度。
结合第一方面,在第一方面的有些实现方式中,上述确定从第一时刻起的预设时长范围内用户是否有翻腕动作,包括:获取第二传感器数据,第二传感器数据为第二时刻进行采集,第二时刻在第一时刻之后的预设时长范围内;根据第二传感器数据,确定第二时刻对应的用户的第二动作是否为翻腕动作。
其中,第二传感器数据可以包括陀螺仪信号数据和加速度信号数据,第二传感器数据的采集时刻记为第二时刻(也即第二采集时刻)。该第二采集时刻在上述第一采集时刻之后的预设时长范围内,也即是说,电子设备通过对第一采集时刻之后的预设时长范围内的传感器数据进行分析,来确定该时长范围内是否有用户的翻腕动作。由此,在确定有翻腕动作的话,电子设备便可显示二维码页面,提高用户出示二维码的效率。
结合第一方面,在第一方面的有些实现方式中,上述根据第二传感器数据,确定第二时刻对应的用户的第二动作是否为翻腕动作,包括:对第二传感器数据进行预处理,确定第二动作是否为疑似翻腕动作,疑似翻腕动作为翻腕动作的概率大于或者等于预设的概率阈值;在第二动作为疑似翻腕动作的情况下,确定第二动作是否为翻腕动作。
其中,电子设备对上述第二传感器数据分析时,可以先对其进行预处理,以确定是否对应有疑似翻腕动作,并在有疑似翻腕动作时再进一步确认是否为伸出后翻腕动作。由此,电子设备先筛选出翻腕动作可能性比较大的疑似翻腕动作,然后再确定疑似翻腕动作是否为真正的翻腕动作,提高最终识别结果的准确度。
结合第一方面,在第一方面的有些实现方式中,第二传感器数据包括陀螺仪信号数据和加速度信号数据,上述对第二传感器数据进行预处理,确定第二动作是否为疑似翻腕动作,包括:从陀螺仪信号数据中获取第一子数据,第一子数据为陀螺仪信号数据中连续的预设帧数的数据;从加速度信号数据中获取第二子数据,第二子数据为加速度信号数据中连续的预设帧数的信号,第一子数据在陀螺仪信号数据中的位置与第二子数据在加速度信号数据中的位置相同;若第一子数据和第二子数据满足第一预设条件,则确定第二动作为疑似翻腕动作。
其中,电子设备可以以上述第二传感器数据的第一帧信号为起始点,截取100帧信号作为第一子数据,再以上述第三传感器数据的第一帧信号为起始点,截取100帧信号作为第二子数据,确定第一子数据和第二子数据是否满足第一预设条件,若满足则确定上述第二动作为疑似翻腕动作。若不满足则再从第二传感器数据的第二帧信号为起始点,截取100帧信号作为第一子数据,从上述第三传感器数据的第二帧信号为起始点,截取100帧信号作为第二子数据,再次进行判断,以此类推。
可选地,上述第一预设条件包括以下条件中的至少一个:
条件1:第一子数据的最后一帧信号对应的角速度模值处于第一区间;
条件2:第二子数据的最后一帧信号对应的加速度模值处于第二区间;
条件3:第二子数据的最后一帧信号对应的z轴加速度值处于第三区间,或者小于第一阈值;
条件4:第一子数据存在主峰信号;
条件5:主峰信号位于第一子数据的中间区域;
条件6:主峰信号之前的信号分布呈单调递增趋势、主峰之后的信号分布呈单调递减趋势,或者,主峰信号之前的信号分布呈单调递减趋势、主峰之后的信号分布呈单调递增趋势。
其中,第一区间可以为[N1,N2]区间,例如[0,3],第二区间可以为[N3,N4]区间,例如[0.8,1.2],第三区间可以为[N5,N6]区间,例如[-0.707,0.707],第一阈值可以为-0.707。由此,通过 第一预设条件筛选出上述第一子数据和第二子数据对应的手势动作是否为翻腕动作,以提高最终识别结果的准确度。
结合第一方面,在第一方面的有些实现方式中,上述确定第二动作是否为翻腕动作,包括:通过预设的第一模型对第一子数据和第二子数据进行识别,得到第一识别结果;在第一识别结果为第一预设结果的情况下,确定第二动作为翻腕动作。
其中,第一模型可以为循环神经网络模型(recurrent neural network,RNN)、长短期记忆网络模型(long short-term memory,LSTM)和门控循环单元网络模型(gated recurrent unit,GRU)中的任意一种。电子设备在确定上述第二动作为疑似翻腕动作后,可继续对第一子数据和第二子数据进行处理,例如可以对其进行特征提取,得到特征集合,然后再将特征集合输入第一模型,得到第一识别结果。可选地,第一识别结果可以采用0表示非翻腕动作,1表示伸出后翻腕动作,2表示收回后翻腕动作。那么,在第一识别结果为1时,即可确定第二动作为伸出后翻腕动作。由此电子设备先筛选出翻腕动作可能性比较大的疑似翻腕动作,然后再确定疑似翻腕动作是否为真正的翻腕动作,提高最终识别结果的准确度。
结合第一方面,在第一方面的有些实现方式中,上述根据第一传感器数据确定第一时刻对应的用户的第一动作为预设动作,包括:通过预设的第二模型对第一传感器数据进行识别,得到第二识别结果;在第二识别结果为第二预设结果的情况下,确定第一动作为预设动作。
可选地,预设动作可以包括用户对电子设备背部的双击动作、三击动作或者持电子设备的晃动动作。
其中,第二模型可以为决策树模型,通过第二模型对上述第一传感器数据进行识别,得到第二识别结果。可选地,第二识别结果可以采用0表示非手势动作,1表示对电子设备背部的双击动作,2表示对电子设备背部的三击动作,3表示持电子设备的晃动动作。那么,在第二识别结果为1或2或3时,即可确定第一动作为预设动作。由此,通过模型对第一传感器数据进行判断,可提高识别结果的准确性。
结合第一方面,在第一方面的有些实现方式中,上述显示预设的二维码页面,包括:若第一动作为用户对电子设备背部的双击动作,则显示第一二维码页面;或,若第一动作为用户对电子设备背部的三击动作,则显示第二二维码页面;或,若第一动作为用户持电子设备的晃动动作,则显示第三二维码页面。
结合第一方面,在第一方面的有些实现方式中,上述方法还包括:显示包含有显示设置控件的第一界面,该显示设置控件包括针对双击动作的设置控件、针对三击动作的设置控件和针对晃动动作的设置控件;接收用户在第一界面上作用于显示设置控件的第一操作;响应于第一操作,设置当用户对电子设备背部执行双击动作时,显示第一二维码页面,当用户对电子设备背部执行三击动作时,显示第二二维码页面,当用户对电子设备执行晃动动作时,显示第三二维码页面。
其中,电子设备可以为用户提供不同的手势动作显示不同的二维码页面,那么当用户想要出示一个二维码页面时,只要执行相应的手势动作即可。比如,设置对电子设备背部的双击动作对应的是
Figure PCTCN2022113601-appb-000006
的付款二维码、对电子设备背部的三击动作对应的是
Figure PCTCN2022113601-appb-000007
的付款二维码、持电子设备的晃动动作对应的是健康码等。并且电子设备还可以为用户提供进行设置的操作界面(即第一界面),以方便用户对于不同的需求执行相应的设置操作,提高了用户的使用体验度。
结合第一方面,在第一方面的有些实现方式中,在显示预设的二维码页面之后,上述方法还包括:获取第三传感器数据;对第三传感器数据进行处理,得到第三识别结果;在第三识别结果 表征第三传感器数据对应的用户的第三动作为收回后翻腕动作的情况下,显示第一页面,第一页面为电子设备在显示二维码页面之前所显示的页面。
其中,因电子设备是持续获取上述陀螺仪信号数据和加速度信号数据并进行识别处理的,那么会存在某个时刻,电子设备得到的翻腕动作识别结果为2(即第三识别结果表征的第三动作为收回后翻腕动作)。在此场景下,电子设备可以从显存中获取显示屏上当前显示画面的数据,若当前显示的是二维码页面,则电子设备可以关闭该二维码页面,并显示出二维码页面显示之前的其他任意页面(即第一页面)。由此,在用户扫码后并将电子设备收回时,电子设备也可自动关闭二维码页面,提高了用户关闭二维码过程的简易度。
第二方面,本申请提供一种装置,该装置包含在电子设备中,该装置具有实现上述第一方面及上述第一方面的可能实现方式中电子设备行为的功能。功能可以通过硬件实现,也可以通过硬件执行相应的软件实现。硬件或软件包括一个或多个与上述功能相对应的模块或单元。例如,接收模块或单元、处理模块或单元等。
第三方面,本申请提供一种电子设备,电子设备包括:处理器、存储器和接口;处理器、存储器和接口相互配合,使得电子设备执行第一方面的技术方案中任意一种方法。
第四方面,本申请提供一种芯片,包括处理器。处理器用于读取并执行存储器中存储的计算机程序,以执行第一方面及其任意可能的实现方式中的方法。
可选地,芯片还包括存储器,存储器与处理器通过电路或电线连接。
进一步可选地,芯片还包括通信接口。
第五方面,本申请提供一种计算机可读存储介质,计算机可读存储介质中存储了计算机程序,当计算机程序被处理器执行时,使得该处理器执行第一方面的技术方案中任意一种方法。
第六方面,本申请提供一种计算机程序产品,计算机程序产品包括:计算机程序代码,当计算机程序代码在电子设备上运行时,使得该电子设备执行第一方面的技术方案中任意一种方法。
附图说明
图1是相关技术中出示二维码页面的过程示意图;
图2是本申请实施例提供的一例电子设备的结构示意图;
图3是本申请实施例提供的电子设备的软件结构框图;
图4是本申请实施例提供的一例扫码场景的各种翻腕动作示意图;
图5中的(a)图是本申请实施例提供的一例开启智慧感知功能的操作界面示意图;
图5中的(b)图是本申请实施例提供的另一例开启智慧感知功能的操作界面示意图;
图6是本申请实施例提供的一例显示二维码的方法的流程示意图;
图7是本申请实施例提供的一例陀螺仪信号数据和加速度信号数据的信号图;
图8是本申请实施例提供的一例三轴角速度弧度值的模值和三轴加速度值的模值的信号图;
图9是本申请实施例提供的一例GRU模型的结构示意图;
图10是本申请实施例提供的另一例显示二维码的方法的流程示意图;
图11是本申请实施例提供的一例对电子设备背部进行敲击动作的加速度信号数据的信号分布图;
图12是本申请实施例提供的又一例显示二维码的方法的流程示意图;
图13是本申请实施例提供的又一例开启智慧感知功能的操作界面示意图;
图14是本申请实施例提供的又一例显示二维码的方法的流程示意图。
具体实施方式
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行描述。其中,在本申请实施例的描述中,除非另有说明,“/”表示或的意思,例如,A/B可以表示A或B;本文中的“和/或”仅仅是一种描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。另外,在本申请实施例的描述中,“多个”是指两个或多于两个。
以下,术语“第一”、“第二”、“第三”仅用于描述目的,而不能理解为指示或暗示相对重要性或者隐含指明所指示的技术特征的数量。由此,限定有“第一”、“第二”、“第三”的特征可以明示或者隐含地包括一个或者更多个该特征。
目前,电子设备的种类越来越多,以电子设备是手机为例,该手机上可以安装多个APP,例如
Figure PCTCN2022113601-appb-000008
APP、
Figure PCTCN2022113601-appb-000009
APP以及健康码APP等。假设用户当前需要使用
Figure PCTCN2022113601-appb-000010
进行付款,如图1所示,用户可以通过点击
Figure PCTCN2022113601-appb-000011
图标进入应用界面,然后点击应用界面上的“付款”选项,手机的显示界面上便显示出了
Figure PCTCN2022113601-appb-000012
的付款二维码。此时,用户可以将该付款二维码对准商家提供的扫码口,以进行扫码付款;在付款结束后,用户还需要将付款二维码的页面关闭或者将
Figure PCTCN2022113601-appb-000013
APP关闭。对于其他类APP,用户想要使用其中的二维码时,也是需要进行类似的操作步骤。由此可以看出,用户目前调取二维码的操作步骤较为繁琐,比较耗时。
有鉴于此,本申请实施例提供一种显示二维码的方法,可以通过识别用户操作手机时的手势动作,以确定是否需要显示二维码,并在确定显示二维码时显示出对应的二维码页面,进而减少用户调取二维码的操作步骤,使用户出示二维码的过程变得简单高效。需要说明的是,本申请实施例提供的显示二维码的方法可以应用于手机、平板电脑、可穿戴设备等可以安装APP或具有相应二维码功能的电子设备上,本申请实施例对电子设备的具体类型不作任何限制。
示例性的,图2是本申请实施例提供的一例电子设备100的结构示意图。电子设备100可以包括处理器110,外部存储器接口120,内部存储器121,通用串行总线(universal serial bus,USB)接口130,充电管理模块140,电源管理模块141,电池142,天线1,天线2,移动通信模块150,无线通信模块160,音频模块170,扬声器170A,受话器170B,麦克风170C,耳机接口170D,传感器模块180,按键190,马达191,指示器192,摄像头193,显示屏194,以及用户标识模块(subscriber identification module,SIM)卡接口195等。其中传感器模块180可以包括压力传感器180A,陀螺仪传感器180B,气压传感器180C,磁传感器180D,加速度传感器180E,距离传感器180F,接近光传感器180G,指纹传感器180H,温度传感器180J,触摸传感器180K,环境光传感器180L,骨传导传感器180M等。
处理器110可以包括一个或多个处理单元,例如:处理器110可以包括应用处理器(application processor,AP),调制解调处理器,图形处理器(graphics processing unit,GPU),图像信号处理器(image signal processor,ISP),控制器,存储器,视频编解码器,数字信号处理器(digital signal processor,DSP),基带处理器,和/或神经网络处理器(neural-network processing unit,NPU)等。其中,不同的处理单元可以是独立的器件,也可以集成在一个或多个处理器中。
在一些实施例中,处理器110可以包括一个或多个接口。接口可以包括集成电路(inter-integrated circuit,I2C)接口,集成电路内置音频(inter-integrated circuit sound,I2S)接口,脉冲编码调制(pulse code modulation,PCM)接口,通用异步收发传输器(universal asynchronous receiver/transmitter,UART)接口,移动产业处理器接口(mobile industry processor interface,MIPI), 通用输入输出(general-purpose input/output,GPIO)接口,用户标识模块(subscriber identity module,SIM)接口,和/或通用串行总线(universal serial bus,USB)接口等。
可以理解的是,本申请实施例示意的各模块间的接口连接关系,只是示意性说明,并不构成对电子设备100的结构限定。在本申请另一些实施例中,电子设备100也可以采用上述实施例中不同的接口连接方式,或多种接口连接方式的组合。
电子设备100的无线通信功能可以通过天线1,天线2,移动通信模块150,无线通信模块160,调制解调处理器以及基带处理器等实现。天线1和天线2用于发射和接收电磁波信号。图2中的天线1和天线2的结构仅为一种示例。电子设备100中的每个天线可用于覆盖单个或多个通信频带。不同的天线还可以复用,以提高天线的利用率。例如:可以将天线1复用为无线局域网的分集天线。在另外一些实施例中,天线可以和调谐开关结合使用。
电子设备100通过GPU,显示屏194,以及应用处理器等实现显示功能。GPU为图像处理的微处理器,连接显示屏194和应用处理器。GPU用于执行数学和几何计算,用于图形渲染。处理器110可包括一个或多个GPU,其执行程序指令以生成或改变显示信息。
显示屏194用于显示图像,视频等。显示屏194包括显示面板。显示面板可以采用液晶显示屏(liquid crystal display,LCD),有机发光二极管(organic light-emitting diode,OLED),有源矩阵有机发光二极体或主动矩阵有机发光二极体(active-matrix organic light emitting diode,AMOLED),柔性发光二极管(flex light-emitting diode,FLED),Miniled,MicroLed,Micro-oLed,量子点发光二极管(quantum dot light emitting diodes,QLED)等。在一些实施例中,电子设备100可以包括1个或N个显示屏194,N为大于1的正整数。
压力传感器180A用于感受压力信号,可以将压力信号转换成电信号。在一些实施例中,压力传感器180A可以设置于显示屏194。压力传感器180A的种类很多,如电阻式压力传感器,电感式压力传感器,电容式压力传感器等。电容式压力传感器可以是包括至少两个具有导电材料的平行板。当有力作用于压力传感器180A,电极之间的电容改变。电子设备100根据电容的变化确定压力的强度。当有触摸操作作用于显示屏194,电子设备100根据压力传感器180A检测触摸操作强度。电子设备100也可以根据压力传感器180A的检测信号计算触摸的位置。在一些实施例中,作用于相同触摸位置,但不同触摸操作强度的触摸操作,可以对应不同的操作指令。例如:当有触摸操作强度小于第一压力阈值的触摸操作作用于短消息应用图标时,执行查看短消息的指令。当有触摸操作强度大于或等于第一压力阈值的触摸操作作用于短消息应用图标时,执行新建短消息的指令。
陀螺仪传感器180B可以用于确定电子设备100的运动姿态。在一些实施例中,可以通过陀螺仪传感器180B确定电子设备100围绕三个轴(即,x,y和z轴)的角速度。陀螺仪传感器180B可以用于拍摄防抖。示例性的,当按下快门,陀螺仪传感器180B检测电子设备100抖动的角度,根据角度计算出镜头模组需要补偿的距离,让镜头通过反向运动抵消电子设备100的抖动,实现防抖。陀螺仪传感器180B还可以用于导航,体感游戏场景。
加速度传感器180E可检测电子设备100在各个方向上(一般为三轴)加速度的大小。当电子设备100静止时可检测出重力的大小及方向。还可以用于识别电子设备姿态,应用于横竖屏切换,计步器等应用。
接近光传感器180G可以包括例如发光二极管(LED)和光检测器,例如光电二极管。发光二极管可以是红外发光二极管。电子设备100通过发光二极管向外发射红外光。电子设备100使用光 电二极管检测来自附近物体的红外反射光。当检测到充分的反射光时,可以确定电子设备100附近有物体。当检测到不充分的反射光时,电子设备100可以确定电子设备100附近没有物体。电子设备100可以利用接近光传感器180G检测用户手持电子设备100贴近耳朵通话,以便自动熄灭屏幕达到省电的目的。接近光传感器180G也可用于皮套模式,口袋模式自动解锁与锁屏。
在一个实施例中,上述电子设备100还包括传感器中枢(Sensor Hub),或称为传感集线器、传感器协处理器,其主要连接并低功耗地处理来自传感器模块180的数据。Sensor Hub可以包括但不限于应用处理器、协处理器(Coprocessor)、微处理器(micro-programmed control unit,MCU)等低功耗的处理模块或处理电路。通常,Sensor Hub可以处理诸如上述压力传感器180A,陀螺仪传感器180B,气压传感器180C,磁传感器180D,加速度传感器180E,距离传感器180F,接近光传感器180G,指纹传感器180H,温度传感器180J,触摸传感器180K,环境光传感器180L,骨传导传感器180M等传感器的数据,以及进行各个传感器数据的融合处理。
其中,根据不同的电子设备和业务场景需求,当前的Sensor Hub主要分为三种:一种是将Sensor Hub作为单独芯片,放置在应用处理器与各类传感器之间;另一种是将Sensor Hub与各类传感器合二为一,接收各类传感器的数据进行融合,再将融合处理后的数据提供给应用处理器;再一种是由应用处理器集成Sensor Hub,各类传感器将数据提供给应用处理器内部的Sensor Hub,Sensor Hub融合处理后再将数据提供给应用处理器。
可以理解的是,本申请实施例示意的结构并不构成对电子设备100的具体限定。在本申请另一些实施例中,电子设备100可以包括比图示更多或更少的部件,或者组合某些部件,或者拆分某些部件,或者不同的部件布置。图示的部件可以以硬件,软件或软件和硬件的组合实现。
图3是本申请实施例的电子设备100的软件结构框图。分层架构将软件分成若干个层,每一层都有清晰的角色和分工。层与层之间通过软件接口通信。在一些实施例中,可以将Android系统分为若干层,从上至下分别为应用程序层、框架层、Sensor Hub层、系统层和硬件层。
如图3所示,应用程序层可以包括电子设备100中安装的各种应用程序,比如
Figure PCTCN2022113601-appb-000014
APP、
Figure PCTCN2022113601-appb-000015
APP以及健康码APP等。框架层可以包括决策模块,用于根据上层或下层传输的数据进行指令决策,指示上层或下层执行相应的指令动作。Sensor Hub层中的算法模块用于调用Sensor算法(SensorAlg)处理硬件层传感器的传感器数据,并将处理结果交由决策模块进行决策。系统层的显示驱动可接收上层传输的显示数据,并交由显示屏进行显示。硬件层可以包括电子设备100中的各种硬件模块,比如陀螺仪传感器、加速度传感器以及显示屏等。
为了便于理解,本申请以下实施例将以具有图2和图3所示结构的电子设备为例,结合附图和应用场景,对本申请实施例提供的显示二维码的方法进行具体阐述。
在用户将调取出的二维码对准商家提供的扫码口进行扫码时,通常情况下,如图4所示,商家提供的扫码口的方向可以为竖直向前、水平向上或者倾斜向上等,那么用户就需要将电子设备的显示屏竖直、水平、倒扣或者倾斜的对准扫码口。因此,本申请实施例中,基于扫码时用户操作手机的手势动作,分析电子设备中陀螺仪传感器和加速度传感器的传感器数据,以确定用户是否有扫码对应的翻腕动作。例如图4所示的竖屏翻腕动作、横屏翻腕动作、倒扣翻腕动作或者存在一定角度倾斜翻腕动作等,在电子设备确定了用户具有上述翻腕动作时,可以自动弹出显示对应的二维码。其中,本申请实施例可以将用户手持电子设备时手腕翻动的动作称为翻腕动作,上述竖屏翻腕动作、横屏翻腕动作、倒扣翻腕动作或者存在一定角度倾斜翻腕动作称为伸出后翻腕动作,伸出后翻腕动作之后再收回翻腕的动作称为收回后翻腕动作,除此之外,用户还可以具有 抬手向内翻腕动作等(比如抬手观看电子设备屏幕的动作),这些动作也可称为伸出后翻腕动作;以下实施例以伸出后翻腕动作为例对显示二维码的方法进行说明。
其中,电子设备自动弹出显示二维码的功能可以由用户自定义设置,若用户想要使用该功能,则可以通过设置路径打开该功能的开关。如图5所示,在设置页面具有一个“智慧感知”选项,用户点击该选项后,可以跳转至智慧感知功能(也即是电子设备自动弹出显示二维码的功能)的开关页面;在该页面上,用户可以通过点击开关控件来开启智慧感知功能。在一个实施例中,如图5中的(a)图所示,用户打开该功能时,对应有一个默认的二维码,比如对应的是
Figure PCTCN2022113601-appb-000016
的付款二维码,那么后续电子设备自动弹出显示的即为
Figure PCTCN2022113601-appb-000017
的付款二维码。在一个实施例中,如图5中的(b)图所示,用户打开该功能时,可以选择一个自己较常用的二维码作为电子设备自动弹出显示的二维码;比如选择的是
Figure PCTCN2022113601-appb-000018
的付款二维码,那么后续电子设备自动弹出显示的即为微
Figure PCTCN2022113601-appb-000019
的付款二维码。
在用户打开了电子设备中的上述功能后,电子设备便可以持续获取陀螺仪传感器和加速度传感器的传感器数据,以确定用户是否有扫码对应的翻腕动作,进而显示对应的二维码。具体地,图6是本申请实施例提供的一例显示二维码的方法的流程示意图,该方法由电子设备执行,包括:
S101,获取传感器数据。
可选的,传感器数据可以包括传感器数据A和传感器数据B。其中,传感器数据A可以为陀螺仪传感器采集的数据,例如陀螺仪信号数据,传感器数据B可以为加速度传感器采集的数据,例如加速度信号数据。陀螺仪信号数据通常为电子设备移动时三个轴(即,x,y和z轴)的角速度,此处的三个轴是陀螺仪传感器自身坐标系的坐标轴;加速度信号数据通常为电子设备移动时三个轴(即,x,y和z轴)的加速度,此处的三个轴是加速度传感器自身坐标系的坐标轴。示例性地,电子设备所获取的陀螺仪信号数据和加速度信号数据的信号分布图可参见图7,图7的陀螺仪信号数据示意图中,横轴代表信号帧数,纵轴代表每帧信号对应的x、y和z轴角速度的幅值,图7的加速度信号数据示意图中,横轴代表信号帧数,纵轴代表每帧信号对应的x、y和z轴加速度的幅值。
需要说明的是,电子设备是以一定的频率持续获取上述传感器数据的,并在获取到传感器数据时持续执行下述步骤的过程。在一个实施例中,因用户通常是在电子设备解锁后才有出示二维码的需求,则电子设备可以在处于解锁亮屏状态时,获取传感器数据A和传感器数据B。
S102,对传感器数据进行预处理,确定用户的手势动作是否为疑似翻腕动作。若是,执行S103。
其中,疑似翻腕动作可以理解为其确定是翻腕动作的概率大于或者等于预设的概率阈值(比如90%)。本实施例中,电子设备可以对传感器数据,例如传感器数据A和传感器数据B进行预处理,例如截取传感器数据A中的第一子数据以及传感器数据B中的第二子数据,以根据第一子数据和第二子数据确定所对应的用户的手势动作是否为疑似翻腕动作。也即是说,电子设备先筛选出翻腕动作可能性比较大的疑似翻腕动作,然后后续再确定疑似翻腕动作是否为真正的翻腕动作,提高最终识别结果的准确度。
电子设备确定用户的手势动作是否为疑似翻腕动作的过程可以如下:
以传感器数据A为陀螺仪信号数据、传感器数据B为加速度信号数据为例,电子设备获取到陀螺仪信号数据和加速度信号数据后,可以先对其进行滤波处理,以去除信号数据中的噪声。在一个实施例中,电子设备可以采用均值滤波的方法或其他滤波方法对陀螺仪信号数据和加速度信号数据进行滤波处理。在得到滤波后的陀螺仪信号数据和加速度信号数据之后,电子设备可以对 该陀螺仪信号数据和加速度信号数据进行分析,以确定是否为疑似翻腕动作。
作为一种可实现的方式,电子设备可以采用以下方式确定是否为疑似翻腕动作:对于陀螺仪信号数据,电子设备以第一帧信号为起始点,截取预设帧数(例如100帧,即1秒的信号数据)的信号作为第一个信号段A(即第一子数据);对于加速度信号数据,电子设备同样以第一帧信号为起始点,截取100帧信号作为第一个信号段B(即第二子数据),对该第一个信号段A和第一个信号段B进行分析判断,具体的分析过程可以如下:
因用户持电子设备扫码时,电子设备呈相对静止状态,因此电子设备取第一个信号段的最后一帧信号。假设第一个信号段A的最后一帧信号对应的三轴角速度弧度值为(x1,y1,z1),单位为rad/s,电子设备可以根据(x1,y1,z1)求得陀螺仪三轴角速度弧度值的模值M1,例如可以根据
Figure PCTCN2022113601-appb-000020
的关系式求得M1,然后判断M1是否在[N1,N2]区间(条件1),例如,[N1,N2]区间可以为[0,5]区间,可选的,[0,4]区间或[0,3]区间,电子设备静止时模值M1近似为0。
假设第一个信号段B的最后一帧信号对应的三轴加速度值为(x2,y2,z2),单位为m/s 2,电子设备可以根据(x2,y2,z2)求得三轴加速度值的模值M2,例如可以根据
Figure PCTCN2022113601-appb-000021
的关系式求得M2,然后对M2进行归一化,并判断归一化后的M2是否在[N3,N4]区间(条件2),例如,[N3,N4]区间可以为[0.6,1.5]区间,可选的[0.8,1.2]区间,电子设备静止时模值M2近似为1。
同时,如上述的图4可知,当扫码口的方向为竖直向前时,电子设备的显示屏一般朝前,此时显示屏的前后倾角或左右倾角在45°以内,那么电子设备还可以判断上述三轴加速度值中的z2是否在[N5,N6]区间(条件3),例如[N5,N6]区间可以为[-0.707,0.707]区间。当扫码口的方向为水平向上时,电子设备的显示屏一般朝下,此时显示屏的上下倾角或左右倾角在45°以内,那么电子设备还可以判断上述三轴加速度值中的z2是否小于第一阈值(条件3),例如第一阈值可以为-0.707。
由上述条件1至条件3的描述可知,其是根据电子设备的终止状态进行判断的,除此之外,电子设备还可以再从用户伸出电子设备进行扫码的过程进行分析。由于用户伸出电子设备进行扫码的动作比较自然,通常不会很迅速或很缓慢,那么对于上述第一个信号段A(即陀螺仪的信号数据)来说,一般会存在一个主峰信号(条件4),主峰的位置一般位于第一个信号段A的中间区域(条件5),主峰之前的信号分布呈单调递增趋势、主峰之后的信号分布呈单调递减趋势,或者,主峰之前的信号分布呈单调递减趋势、主峰之后的信号分布呈单调递增趋势(条件6)。
综上,本申请实施例提供了6个判断条件:
条件1:M1是否在[N1,N2]区间;
条件2:M2是否在区间[N3,N4]区间;
条件3:z2是否在[N5,N6]区间,或者,z2是否小于第一阈值;
条件4:第一个信号段A存在主峰信号;
条件5:主峰的位置位于第一个信号段A的中间区域;
条件6:主峰之前的信号分布呈单调递增趋势、主峰之后的信号分布呈单调递减趋势,或者,主峰之前的信号分布呈单调递减趋势、主峰之后的信号分布呈单调递增趋势。
那么,当“条件4满足”且“条件5满足”且“条件6满足”且“条件1满足”且“条件2 满足”且“条件3满足”时,可确定上述第一个信号段A和第一个信号段B所对应的用户手势动作为疑似翻腕动作。例如是疑似翻腕动作时电子设备输出1,不是疑似翻腕动作时电子设备输出0。
示例性地,图8为上述图7中每一帧陀螺仪信号对应的三轴角速度弧度值的模值、以及每一帧加速度信号对应的三轴加速度值的模值,图8的三轴角速度弧度值的模值示意图中,横轴代表信号帧数,纵轴代表每帧信号对应的三轴角速度弧度值的模值的幅值,图8的三轴加速度值的模值示意图中,横轴代表信号帧数,纵轴代表每帧信号对应的三轴加速度值的模值的幅值。上述图7所示的陀螺仪信号数据和加速度信号数据中,矩形虚线框对应的信号数据可分别为第一个信号段A和第一个信号段B,第一个信号段A的三轴角速度弧度值的模值和第一个信号段B的三轴加速度值的模值可参见图8中的矩形虚线框内的数据。由图7可以看出,第一个信号段B的最后一帧信号的z值小于-0.707,第一个信号段A存在主峰信号,且位于第一个信号段A的中间区域,在主峰之前的信号分布呈单调递减趋势、主峰之后的信号分布呈单调递增趋势;由图8可以看出,第一个信号段A的最后一帧信号的模值在[0,3]区间,第一个信号段B的最后一帧信号的模值在[0.8,1.2]区间,即第一个信号段A和第一个信号段B满足上述条件,也就确定用户当前的手势动作为疑似翻腕动作。
需要说明的是,电子设备在判断上述条件是否满足时,可以按照条件4、5、6、1、2、3的顺序进行判断,也可以按照5、4、1、6、2、3的顺序进行判断,也即是说,对各条件的判断顺序不做限制。并且,如果顺序判断的某一个条件未满足时,则可以不再进行后续条件的判断;例如,对于条件4、5、6、1、2、3的顺序,如果条件4没有满足时,则不再进行条件5之后的条件判断,或者,条件4满足、但条件5不满足时,则不再进行条件6之后的条件判断,以此类推。
电子设备经过上述的分析判断过程,可以根据第一个信号段A和第一个信号段B确定用户的手势动作是否为疑似翻腕动作,如果不是,则对于陀螺仪信号数据,电子设备以第二帧信号为起始点,截取100帧信号作为第二个信号段C;对于加速度信号数据,电子设备也以第二帧信号为起始点,截取100帧信号作为第二个信号段D。继续以上述的分析过程对两个第二个信号段进行分析,以确定所对应的用户的手势动作是否为疑似翻腕动作,以此类推。
需说明的是,上述陀螺仪信号数据的第i个信号段和加速度信号数据第i个信号段(i为自然数)所对应的时刻相同,那么第一个信号段A和第一个信号段B所对应的用户的手势动作即为同一个动作。
S103,确定上述疑似翻腕动作是否为伸出后翻腕动作,若是,执行S104。
其中,电子设备确定上述的疑似翻腕动作后,可继续对该疑似翻腕动作对应的信号数据进行处理,以确定是否为伸出后翻腕动作。
假设该疑似翻腕动作对应的信号数据即上述第一个信号段A和第一个信号段B,针对第一个信号段A的第j帧信号和第一个信号段B的第j帧信号(1≤j≤100),电子设备可以分别进行特征提取,以得到对应的特征集合,所提取的特征可以用于表征电子设备的姿态变化信息,以使电子设备进一步确定用户是否具有翻腕动作。
示例性地,电子设备对第一个信号段A的第j帧信号和第一个信号段B的第j帧信号进行特征提取时,可以得到如表1所示的9类特征。
表1
Figure PCTCN2022113601-appb-000022
以j=1为例,假设第一个信号段A的第1帧信号对应的三轴角速度弧度值为(x3,y3,z3),第一个信号段B的第1帧信号对应的三轴加速度值为(x4,y4,z4),则三轴角速度弧度值的模值
Figure PCTCN2022113601-appb-000023
三轴加速度值的模值
Figure PCTCN2022113601-appb-000024
另外,因加速度传感器具有自身坐标系(包括x轴、y轴和z轴),一般情况下,该z轴的方向不与地面垂直,因此,电子设备还可以根据三轴加速度值(x4,y4,z4)确定与地面垂直方向的加速度;例如可以通过电子设备坐标系(如手机、平板的姿态)与参考坐标系(地球坐标系)的关系进行映射得到与地面垂直方向的重力加速度。对于三轴线速度,本申请实施例将物体上任一点对定轴作圆周运动时的速度称为线速度,电子设备可以根据三轴角速度弧度值(x3,y3,z3)确定三轴线速度;例如,根据(x3,y3,z3)×r的关系式确定三轴线速度,r为圆周半径。对于重力在三轴的分布,本申请实施例可以参考六轴融合算法得到一个欧拉角,根据欧拉角将标准重力加速度映射到三个轴上即得到重力在三轴的分布。对于旋转矩阵,本申请实施例将在乘以一个向量的时候有改变向量的方向但不改变大小的效果并保持了手性的矩阵称为旋转矩阵,本申请实施例计算的是参考坐标系(地球坐标系)到电子设备坐标系的旋转矩阵。对于四元数,每个四元数都是1、m、n和k的线性组合,即四元数一般可表示为a+bm+cn+dk,a、b、c、d是实数,m、n和k的几何意义可以理解为一种旋转,本申请实施例计算的是参考坐标系(地球坐标系)到电子设备坐标系的旋转;其中,m旋转代表z轴与y轴相交平面中z轴正向向y轴正向的旋转,n旋转代表x轴与z轴相交平面中x轴正向向z轴正向的旋转,k旋转代表y轴与x轴相交平面中y轴正向向x轴正向的旋转。
那么,对于100帧信号,则共有100×28个特征,此处将这100×28个特征称为特征集合。需要说明的是,电子设备所提取的特征不限于上述9类特征,可以多于或者少于该9类特征,本申请实施例对此不做限制。
在得到上述特征集合后,电子设备可以将得到的特征集合输入预设的第一模型进行识别,以确定上述的疑似翻腕动作是否为真实的翻腕动作。
在一个实施例中,上述第一模型可以为RNN、LSTM、GRU等网络模型。以GRU为例,GRU 是LSTM网络的一种变体,它较LSTM网络的结构更加简单;通常,在LSTM中会引入了三个门函数:输入门、遗忘门和输出门来控制输入值、记忆值和输出值,而在GRU中只有两个门:更新门和重置门,具体结构可以参见图9。图9中的zt和rt分别表示更新门和重置门,更新门用于控制前一时刻的状态信息被带入到当前状态中的程度,更新门的值越大说明前一时刻的状态信息带入越多,重置门控制前一状态有多少信息被写入到当前的候选集
Figure PCTCN2022113601-appb-000025
上,重置门越小,前一状态的信息被写入的越少。电子设备将特征集合输入GRU网络后,可以得到翻腕动作识别结果,其中可以用0表示非翻腕动作,1表示伸出后翻腕动作,2表示收回后翻腕动作,因此,在输出的结果为1的情况下,可确定上述的疑似翻腕动作是伸出后翻腕动作,则需要显示二维码。
可以理解,电子设备在使用上述第一模型进行识别之前,通常还需要对该第一模型进行训练,以提高第一模型识别结果的精度。在此,本申请实施例综合考虑第一模型训练过程中的正样本和负样本,以正样本和负样本组成的数据集作为训练数据对第一模型进行训练。其中,正样本为所采集的用户在不同初始状态、不同终止状态下持电子设备进行翻腕动作时的陀螺仪信号数据和加速度信号数据,负样本为所采集的用户在不同状态下持电子设备进行的非翻腕动作时的陀螺仪信号数据和加速度信号数据。示例性地,正样本可以为采集的用户从垂握电子设备的状态转换为将电子设备向左翻转横屏状态下的信号数据,负样本可以为采集的用户从垂握电子设备的状态转换为拿起阅读状态下的信号数据。在采集到正样本和负样本后,电子设备便可以将其作为训练数据对第一模型进行训练。
为尽量符合用户的使用习惯,在采集上述正样本时,电子设备所贴近的目标物尽量为浅色,并保持在身体右侧;贴近目标物后停顿1-2秒再变换状态,变换状态后再次停顿1-2秒再执行下一个动作;每个场景的每组数据至少采集10次,电子设备的贴近光传感器需贴紧目标物。在采集上述负样本时,每个场景采集15分钟;同一场景下采集数据时,可变换多种行为;执行每个动作后停顿1-2秒再执行下一个动作。
S104,显示二维码页面。
其中,电子设备通过执行上述过程,若确定当前用户有伸出后翻腕动作,则可以显示对应的二维码页面。由上述图5的描述可知,电子设备可以对应显示一个默认的二维码,比如
Figure PCTCN2022113601-appb-000026
的付款二维码,那么此时显示的即为
Figure PCTCN2022113601-appb-000027
的付款二维码;或者,电子设备可以对应显示用户设置的自己常用的二维码,比如设置的是
Figure PCTCN2022113601-appb-000028
的付款二维码,那么此时显示的即为
Figure PCTCN2022113601-appb-000029
的付款二维码。
在一个实施例中,在显示二维码页面之前,电子设备的显示屏上显示的可以是其他任意页面,当电子设备确定需要显示二维码页面时,便将其他任意页面切换为对应的二维码页面。
上述显示二维码的方法,电子设备通过根据获取的传感器数据识别用户操作手机时的手势动作,以确定是否需要显示二维码,并在确定显示二维码时显示出对应的二维码页面,进而减少用户调取二维码的操作步骤,使用户出示二维码的过程变得简单高效。
由上述实施例的描述可知,电子设备是根据获取的传感器数据确定用户是否有伸出后翻腕动作进而显示二维码的,但在日常应用中,用户可能会有在非扫码场景下进行伸出翻腕的情况,那么,为提高电子设备对是否需要显示二维码判断结果的准确度,还可以在用户具有伸出后翻腕动作的基础上,结合用户的其他手势动作(以下称为预设动作)进行判断。
在一个实施例中,所结合的用户的预设动作可以为用户对电子设备背部的双击动作、三击动作、或者持电子设备的晃动动作等。通过分析电子设备中陀螺仪传感器和加速度传感器的传感器 数据,以确定用户是否有预设动作和扫码对应的伸出后翻腕动作,并在确定具有上述手势动作时,自动弹出显示对应的二维码。下面以图10所示的实施例介绍电子设备结合用户的预设动作和伸出后翻腕动作以确定显示二维码页面的具体过程,包括:
S201,获取第一传感器数据,第一传感器数据的采集时刻为第一采集时刻。
可选地,第一传感器数据可以为加速度传感器采集的数据,例如加速度信号数据;也可以为加速度传感器采集的数据,例如加速度信号数据;亦可以是压力传感器采集的数据,例如压力信号数据;还可以同时包括上述几种信号数据。
S202,根据第一传感器数据确定用户的手势动作是否为预设动作,若是执行S206。
其中,电子设备获取到第一传感器数据后,可以先对其进行滤波处理,以去除信号数据中的噪声。然后,电子设备可以对第一传感器数据进行分析,以确定用户的手势动作是否为预设动作。这里的预设动作可以包括上述的用户对电子设备背部的双击动作、三击动作、或者持电子设备的晃动动作等。
作为一种可实现的方式,以第一传感器数据为加速度信号数据为例,对加速度信号数据进行分析以确定是否为预设动作的过程可以包括:从加速度信号数据的第一帧信号开始,电子设备可以依次判断约1000HZ的加速度信号是否存在满足条件的连续两个波峰,这里的条件是指:两个波峰对应的时刻的差值在预设阈值内(比如在1秒内存在两个波峰)、且两个波峰的峰值在[N7,N8]区间、峰宽在[N9,N10]区间,例如对于加速度信号数据的x轴数据来说,[N7,N8]区间可以为[5,10]区间、[N9,N10]区间可以为[50,100]区间。若存在满足条件的两个波峰,则电子设备确定用户当前的手势动作为对电子设备背部的双击动作,即符合预设动作。
示例性地,对电子设备背部进行敲击动作的加速度信号数据的信号分布图可以参见图11,图11中的x轴数据示意图中,横轴代表信号帧数,纵轴代表每帧信号对应的x轴加速度值的幅值;图11中的y轴数据示意图中,横轴代表信号帧数,纵轴代表每帧信号对应的y轴加速度值的幅值;图11中的z轴数据示意图中,横轴代表信号帧数,纵轴代表每帧信号对应的z轴加速度值的幅值。由图11可以看出,x轴数据的矩形虚线框内,存在两个连续的波峰,且两个波峰的峰值在[5,10]区间内,峰宽在[50,100]区间内,那么此段数据对应的用户的手势动作为双击动作。
作为另一种可实现的方式,对第一传感器数据进行分析以确定是否为预设动作的过程可以包括:电子设备可以将第一传感器数据输入第二模型进行识别,以得到预设动作识别结果。可选地,该第二模型可以为决策树模型,所得到的识别结果中,可以用0表示非手势动作,1表示对电子设备背部的双击动作,2表示对电子设备背部的三击动作,3表示持电子设备的晃动动作;那么,若输出结果为1或2或3,则电子设备可以确定用户的手势动作为预设动作。
可以理解,电子设备在使用上述第二模型进行识别之前,也需要对该第二模型进行训练,以提高第二模型识别结果的精度。在此,本申请实施例综合考虑第二模型训练过程中的正样本和负样本,以正样本和负样本组成的数据集作为训练数据对第二模型进行训练。其中,正样本为所采集的用户多次进行的敲击动作和晃动动作的加速度信号数据,负样本为所采集的用户走路、跑步、跳跃、日常使用电子设备放下、拿起、抬手等动作的加速度信号数据。在采集到正样本和负样本后,电子设备便可以将其作为训练数据对第二模型进行训练。
S203,获取第二传感器数据,第二传感器数据的采集时刻为第二采集时刻。
其中,第二传感器数据可以为陀螺仪传感器采集的数据,例如陀螺仪信号数据;也可以为加速度传感器采集的数据,例如加速度信号数据;还可以同时包括陀螺仪信号数据和加速度信号数 据。
S204,对第二传感器数据进行预处理,确定用户的手势动作是否为疑似翻腕动作。若是,执行S205。
S205,确定上述疑似翻腕动作是否为伸出后翻腕动作,若是执行S206。
其中,S203-S205的实现过程与上述S101-S103的实现过程类似,在此不再赘述。
S206,若第一采集时刻在第二采集时刻之前的预设时长范围内,则显示二维码页面。
其中,预设时长范围可以为3秒,即本申请实施例设定预设动作的发生时刻需在伸出后翻腕动作的发生时刻之前的3秒内。若上述S202中已确定第一采集时刻对应的手势动作是预设动作,上述S205中已确定第二采集时刻对应的手势动作是伸出后翻腕动作,那么,在第一采集时刻在第二采集时刻之前的3秒范围内的情况下,则电子设备显示对应的二维码界面。
可以理解,电子设备可以显示默认的二维码,比如
Figure PCTCN2022113601-appb-000030
的付款二维码;或者,电子设备可以显示用户设置的自己常用的二维码,比如
Figure PCTCN2022113601-appb-000031
的付款二维码。
还可以理解,如果S202中的手势动作不是预设动作,或者S205中的手势动作不是伸出后翻腕动作,或者第一采集时刻并不在第二采集时刻之前的预设时长范围内,则电子设备不显示二维码界面。
上述显示二维码的方法,电子设备通过根据获取的传感器数据识别用户操作时的手势动作,以确定是否需要显示二维码,并在确定显示二维码时显示出对应的二维码页面,进而减少用户调取二维码的操作步骤,使用户出示二维码的过程变得简单高效;同时,结合用户的预设动作和翻腕动作共同确定显示对应的二维码,还可提高电子设备对显示二维码判断结果的准确度。
下面以图12所示的实施例介绍电子设备结合用户的预设动作和伸出后翻腕动作以确定显示二维码页面的另一具体过程,包括:
S301,获取第一传感器数据,第一传感器数据的采集时刻为第一采集时刻。
其中,第一传感器数据可以为来自陀螺仪传感器、加速度传感器或压力传感器中的至少一种所采集的数据,例如加速度信号数据、陀螺仪信号数据或压力信号数据中的至少一种。
S302,根据第一传感器数据确定用户的手势动作是否为预设动作,若是,执行S303。
该步骤的实现过程可以参见上述S202的描述,在此不再赘述。
S303,从第一采集时刻起,监听预设时长范围内的第二传感器数据是否对应有疑似翻腕动作;若有则执行S304。
其中,第二传感器数据可以包括陀螺仪信号数据和加速度信号数据。
S304,确定上述疑似翻腕动作是否为伸出后翻腕动作,若是执行S305。
其中,预设时长范围可以为3秒,即在用户对电子设备执行预设动作后,电子设备开始监听3秒内是否有伸出后翻腕动作,例如可以启动一个监听线程进行监听。对于S303和S304中如何确定是否有疑似翻腕动作以及该疑似翻腕动作是否为伸出后翻腕动作的过程可以参见上述S102-S103的过程,在此不再赘述。
S305,显示二维码页面。
该步骤中,电子设备判断上述疑似翻腕动作为伸出后翻腕动作的情况下,即可显示二维码页面。例如电子设备可以显示默认的二维码,比如
Figure PCTCN2022113601-appb-000032
的付款二维码;或者,电子设备可以显示用户设置的自己常用的二维码,比如
Figure PCTCN2022113601-appb-000033
的付款二维码。
在一个可实现的方式中,当电子设备所确定的预设动作为用户对电子设备背部的双击动作、 三击动作、或者持电子设备的晃动动作中的任一种时,便可启动监听操作。并在监听到有伸出后翻腕动作时,显示二维码页面,此处所显示的二维码可以为默认的二维码,比如
Figure PCTCN2022113601-appb-000034
的付款二维码;或者,可以显示用户设置的自己常用的二维码,比如
Figure PCTCN2022113601-appb-000035
的付款二维码。
在另一个可实现的方式中,因当前的二维码种类较多,为使电子设备能够根据不同的需求场景准确显示出对应的二维码,如图13所示,在用户打开智慧感知功能的开关时,还可以设置不同手势动作对应的二维码。例如,设置对电子设备背部的双击动作对应的是
Figure PCTCN2022113601-appb-000036
的付款二维码、对电子设备背部的三击动作对应的是
Figure PCTCN2022113601-appb-000037
的付款二维码、持电子设备的晃动动作对应的是健康码;其中,用户可以在图13的页面上点击相应动作后方的三角图标
Figure PCTCN2022113601-appb-000038
在弹出的二维码列表(图中未示出)中选择对应的二维码。
那么,在此实现方式中,当电子设备所确定的预设动作是用户对电子设备背部的双击动作,并又监听到伸出后翻腕动作时,可显示
Figure PCTCN2022113601-appb-000039
的付款二维码;当电子设备所确定的预设动作是用户对电子设备背部的三击动作,并又监听到伸出后翻腕动作时,可显示
Figure PCTCN2022113601-appb-000040
的付款二维码;当电子设备所确定的预设动作是用户对电子设备的晃动动作,并又监听到伸出后翻腕动作时,可显示健康码。
可以理解,如果电子设备在第一采集时刻起,没有在预设时长范围内监听到伸出后翻腕动作,则不显示二维码界面。
在一个实施例中,因电子设备显示二维码页面之后,还可继续监听是否有收回后翻腕动作,并在有收回后翻腕动作时关闭上述二维码页面,并显示出二维码页面显示之前的其他任意页面。需要说明的是,若电子设备当前显示的二维码是付款类二维码,则需要在用户输入密码付款成功后再关闭该二维码页面;或者一些付款类应用被设置为免密支付时,可以直接关闭该二维码页面。对于确定是否有收回后翻腕动作的过程可参见上述S102-S103的过程,例如S103中电子设备得到的翻腕动作识别结果为2(即收回后翻腕动作)时,可确定有收回后翻腕动作。
上述显示二维码的方法,电子设备根据获取的传感器数据识别到用户具有预设动作时,监听在预设时长范围内是否有伸出翻腕动作,并在有伸出后翻腕动作时确定显示二维码,以减少用户调取二维码的操作步骤,使用户出示二维码的过程变得简单高效;同时,结合用户的预设动作和翻腕动作共同确定显示对应的二维码,还可提高电子设备对显示二维码判断结果的准确度。
对于下述图14所示实施例的过程,是结合上述图3所示的电子设备的软件结构进行描述的。图14是本申请实施例提供的一例显示二维码的方法的时序交互图,以第一传感器数据为加速度信号数据、第二传感器数据为陀螺仪信号数据和加速度信号数据为例,该方法包括:
S401,加速度传感器采集加速度信号数据,加速度信号数据的采集时刻为第一采集时刻。
S402,加速度传感器将加速度信号数据发送至算法模块。
S403,算法模块调用SensorAlg对加速度信号数据进行处理,确定用户的手势动作是否为预设动作,若是,执行S404。
S404,算法模块启动监听线程,用于监听从第一采集时刻起,预设时长范围内是否有伸出后翻腕动作。
S405,算法模块从陀螺仪传感器获取陀螺仪信号数据,从加速度传感器获取加速度信号数据。
S406,算法模块对陀螺仪信号数据和加速度信号数据进行预处理,确定用户的手势动作是否为疑似翻腕动作。若是,执行S407。
S407,算法模块确定上述疑似翻腕动作为伸出后翻腕动作。
S408,监听线程监听到有伸出后翻腕动作。
S409,监听线程将监听结果发送至决策模块。
S410,决策模块根据监听结果向对应的应用(图14以该应用是
Figure PCTCN2022113601-appb-000041
为例进行说明)发送显示指令。
可以理解,该监听结果中可以包括对应的应用的标识,以使决策模块能准确的将显示指令发送至对应的应用。
S411,
Figure PCTCN2022113601-appb-000042
根据接收到的显示指令将付款二维码的页面数据发送至决策模块。
S412,决策模块将付款二维码的页面数据发送至显示驱动,指示显示驱动调用显示屏显示付款二维码页面。
S413,显示驱动调用显示屏显示付款二维码页面。
S414,显示屏显示付款二维码页面。
上文详细介绍了本申请实施例提供的显示二维码的方法的示例。可以理解的是,电子设备为了实现上述功能,其包含了执行各个功能相应的硬件和/或软件模块。本领域技术人员应该很容易意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,本申请能够以硬件或硬件和计算机软件的结合形式来实现。某个功能究竟以硬件还是计算机软件驱动硬件的方式来执行,取决于技术方案的特定应用和设计约束条件。本领域技术人员可以结合实施例对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。
本申请实施例可以根据上述方法示例对电子设备进行功能模块的划分,例如,可以对应各个功能划分为各个功能模块,例如检测单元、处理单元、显示单元等,也可以将两个或两个以上的功能集成在一个模块中。上述集成的模块既可以采用硬件的形式实现,也可以采用软件功能模块的形式实现。需要说明的是,本申请实施例中对模块的划分是示意性的,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式。
需要说明的是,上述方法实施例涉及的各步骤的所有相关内容均可以援引到对应功能模块的功能描述,在此不再赘述。
本实施例提供的电子设备,用于执行上述显示二维码的方法,因此可以达到与上述实现方法相同的效果。
在采用集成的单元的情况下,电子设备还可以包括处理模块、存储模块和通信模块。其中,处理模块可以用于对电子设备的动作进行控制管理。存储模块可以用于支持电子设备执行存储程序代码和数据等。通信模块,可以用于支持电子设备与其他设备的通信。
其中,处理模块可以是处理器或控制器。其可以实现或执行结合本申请公开内容所描述的各种示例性的逻辑方框,模块和电路。处理器也可以是实现计算功能的组合,例如包含一个或多个微处理器组合,数字信号处理(digital signal processing,DSP)和微处理器的组合等等。存储模块可以是存储器。通信模块具体可以为射频电路、蓝牙芯片、Wi-Fi芯片等与其他电子设备交互的设备。
在一个实施例中,当处理模块为处理器,存储模块为存储器时,本实施例所涉及的电子设备可以为具有图2所示结构的设备。
本申请实施例还提供了一种计算机可读存储介质,计算机可读存储介质中存储了计算机程序,当计算机程序被处理器执行时,使得处理器执行上述任一实施例的显示二维码的方法。
本申请实施例还提供了一种计算机程序产品,当该计算机程序产品在计算机上运行时,使得 计算机执行上述相关步骤,以实现上述实施例中的显示二维码的方法。
另外,本申请的实施例还提供一种装置,这个装置具体可以是芯片,组件或模块,该装置可包括相连的处理器和存储器;其中,存储器用于存储计算机执行指令,当装置运行时,处理器可执行存储器存储的计算机执行指令,以使芯片执行上述各方法实施例中的显示二维码的方法。
其中,本实施例提供的电子设备、计算机可读存储介质、计算机程序产品或芯片均用于执行上文所提供的对应的方法,因此,其所能达到的有益效果可参考上文所提供的对应的方法中的有益效果,此处不再赘述。
通过以上实施方式的描述,所属领域的技术人员可以了解到,为描述的方便和简洁,仅以上述各功能模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能模块完成,即将装置的内部结构划分成不同的功能模块,以完成以上描述的全部或者部分功能。
在本申请所提供的几个实施例中,应该理解到,所揭露的装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,模块或单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个装置,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。
作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是一个物理单元或多个物理单元,即可以位于一个地方,或者也可以分布到多个不同地方。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。
集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个可读取存储介质中。基于这样的理解,本申请实施例的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该软件产品存储在一个存储介质中,包括若干指令用以使得一个设备(可以是单片机,芯片等)或处理器(processor)执行本申请各个实施例方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(read only memory,ROM)、随机存取存储器(random access memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。
以上内容,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以权利要求的保护范围为准。

Claims (17)

  1. 一种显示二维码的方法,所述方法由电子设备执行,其特征在于,所述方法包括:
    获取第一传感器数据,所述第一传感器数据为第一时刻进行采集;
    若根据所述第一传感器数据确定所述第一时刻对应的用户的第一动作为预设动作,则确定从所述第一时刻起的预设时长范围内所述用户是否有翻腕动作;
    在所述预设时长范围内所述用户有翻腕动作的情况下,显示预设的二维码页面。
  2. 根据权利要求1所述的方法,其特征在于,所述确定从所述第一时刻起的预设时长范围内所述用户是否有翻腕动作,包括:
    获取第二传感器数据,所述第二传感器数据为第二时刻进行采集,所述第二时刻在所述第一时刻之后的预设时长范围内;
    根据所述第二传感器数据,确定所述第二时刻对应的所述用户的第二动作是否为翻腕动作。
  3. 根据权利要求2所述的方法,其特征在于,所述根据所述第二传感器数据,确定所述第二时刻对应的所述用户的第二动作是否为翻腕动作,包括:
    对所述第二传感器数据进行预处理,确定所述第二动作是否为疑似翻腕动作,所述疑似翻腕动作为翻腕动作的概率大于或者等于预设的概率阈值;
    在所述第二动作为疑似翻腕动作的情况下,确定所述第二动作是否为翻腕动作。
  4. 根据权利要求3所述的方法,其特征在于,所述第二传感器数据包括陀螺仪信号数据和加速度信号数据,所述对所述第二传感器数据进行预处理,确定所述第二动作是否为疑似翻腕动作,包括:
    从所述陀螺仪信号数据中获取第一子数据,所述第一子数据为所述陀螺仪信号数据中连续的预设帧数的数据;
    从所述加速度信号数据中获取第二子数据,所述第二子数据为所述加速度信号数据中连续的预设帧数的信号,所述第一子数据在所述陀螺仪信号数据中的位置与所述第二子数据在所述加速度信号数据中的位置相同;
    若所述第一子数据和所述第二子数据满足第一预设条件,则确定所述第二动作为疑似翻腕动作。
  5. 根据权利要求4所述的方法,其特征在于,所述第一预设条件包括以下条件中的至少一个:
    条件1:所述第一子数据的最后一帧信号对应的角速度模值处于第一区间;
    条件2:所述第二子数据的最后一帧信号对应的加速度模值处于第二区间;
    条件3:所述第二子数据的最后一帧信号对应的z轴加速度值处于第三区间,或者小于第一阈值;
    条件4:所述第一子数据存在主峰信号;
    条件5:所述主峰信号位于所述第一子数据的中间区域;
    条件6:所述主峰信号之前的信号分布呈单调递增趋势、所述主峰之后的信号分布呈单调递减趋势,或者,所述主峰信号之前的信号分布呈单调递减趋势、所述主峰之后的信号分布呈单调递增趋势。
  6. 根据权利要求4或5所述的方法,其特征在于,所述确定所述第二动作是否为翻腕动作,包括:
    通过预设的第一模型对第一子数据和第二子数据进行识别,得到第一识别结果;
    在所述第一识别结果为第一预设结果的情况下,确定所述第二动作为翻腕动作。
  7. 根据权利要求1-6任一项所述的方法,其特征在于,所述根据所述第一传感器数据确定所述第一时刻对应的用户的第一动作为预设动作,包括:
    通过预设的第二模型对所述第一传感器数据进行识别,得到第二识别结果;
    在所述第二识别结果为第二预设结果的情况下,确定所述第一动作为预设动作。
  8. 根据权利要求7所述的方法,其特征在于,所述预设动作包括所述用户对所述电子设备背部的双击动作、三击动作或者持所述电子设备的晃动动作。
  9. 根据权利要求8所述的方法,其特征在于,所述显示预设的二维码页面,包括:
    若所述第一动作为所述用户对所述电子设备背部的双击动作,则显示第一二维码页面;或,
    若所述第一动作为所述用户对所述电子设备背部的三击动作,则显示第二二维码页面;或,
    若所述第一动作为所述用户持所述电子设备的晃动动作,则显示第三二维码页面。
  10. 根据权利要求9所述的方法,其特征在于,所述方法还包括:
    显示包含有显示设置控件的第一界面,所述显示设置控件包括针对所述双击动作的设置控件、针对所述三击动作的设置控件和针对所述晃动动作的设置控件;
    接收所述用户在所述第一界面上作用于所述显示设置控件的第一操作;
    响应于所述第一操作,设置当所述用户对所述电子设备背部执行双击动作时,显示第一二维码页面,当所述用户对所述电子设备背部执行三击动作时,显示第二二维码页面,当所述用户对所述电子设备执行晃动动作时,显示第三二维码页面。
  11. 根据权利要求1-10任一项所述的方法,其特征在于,所述翻腕动作包括伸出后翻腕动作,所述伸出后翻腕动作包括竖屏翻腕动作、横屏翻腕动作、倒扣翻腕动作、存在一定角度倾斜翻腕动作或者抬手向内翻腕动作。
  12. 根据权利要求1-11任一项所述的方法,其特征在于,所述第一传感器数据是来自陀螺仪传感器、加速度传感器或压力传感器中的至少一种所采集的数据。
  13. 根据权利要求1-12任一项所述的方法,其特征在于,在所述显示预设的二维码页面之后,所述方法还包括:
    获取第三传感器数据;
    对所述第三传感器数据进行处理,得到第三识别结果;
    在所述第三识别结果表征所述第三传感器数据对应的所述用户的第三动作为收回后翻腕动作的情况下,显示第一页面,所述第一页面为所述电子设备在显示所述二维码页面之前所显示的页面。
  14. 根据权利要求6所述的方法,其特征在于,所述第一模型为RNN模型、LSTM模型和GRU模型中的任意一种。
  15. 根据权利要求7所述的方法,其特征在于,所述第二模型为决策树模型。
  16. 一种电子设备,其特征在于,包括:
    一个或多个处理器;
    一个或多个存储器;
    所述存储器存储有一个或多个程序,当所述一个或多个程序被所述处理器执行时,使得所述电子设备执行如权利要求1至15中任一项所述的方法。
  17. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质中存储了计算机程序, 当所述计算机程序被处理器执行时,使得所述处理器执行权利要求1至15中任一项所述的方法。
PCT/CN2022/113601 2021-12-28 2022-08-19 显示二维码的方法和电子设备 Ceased WO2023124129A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
EP22821834.3A EP4227876B1 (en) 2021-12-28 2022-08-19 Method for displaying two-dimensional code, and electronic device
US18/001,751 US12481975B2 (en) 2021-12-28 2022-08-19 Method for displaying two-dimensional code and electronic device

Applications Claiming Priority (4)

Application Number Priority Date Filing Date Title
CN202111633073.0 2021-12-28
CN202111633073 2021-12-28
CN202210109243.3A CN116415951B (zh) 2021-12-28 2022-01-28 显示二维码的方法和电子设备
CN202210109243.3 2022-01-28

Publications (1)

Publication Number Publication Date
WO2023124129A1 true WO2023124129A1 (zh) 2023-07-06

Family

ID=86328874

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/113601 Ceased WO2023124129A1 (zh) 2021-12-28 2022-08-19 显示二维码的方法和电子设备

Country Status (3)

Country Link
US (1) US12481975B2 (zh)
EP (1) EP4227876B1 (zh)
WO (1) WO2023124129A1 (zh)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN121657873A (zh) * 2026-02-03 2026-03-13 雷鸟创新技术(深圳)有限公司 状态识别方法、装置、电子设备及计算机可读存储介质

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106384146A (zh) * 2016-09-23 2017-02-08 北京华大智宝电子系统有限公司 金融ic卡、支付系统及支付方法
CN111596751A (zh) * 2020-05-19 2020-08-28 歌尔智能科技有限公司 腕戴设备的显示控制方法、装置、腕戴设备及存储介质
CN111638841A (zh) * 2020-05-20 2020-09-08 维沃移动通信有限公司 消息详情页的显示方法、装置及电子设备
CN113572896A (zh) * 2021-06-23 2021-10-29 荣耀终端有限公司 基于用户行为模型的二维码显示方法及相关设备

Family Cites Families (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2013132505A (ja) 2011-12-27 2013-07-08 Daiichi Shokai Co Ltd 遊技機
CN112596847A (zh) * 2016-01-08 2021-04-02 创新先进技术有限公司 一种应用中功能的调用方法及装置
CN108369627B (zh) 2016-09-30 2020-10-09 华为技术有限公司 一种获得进行用户相关操作时的距离阈值的方法和装置
CN107037955A (zh) * 2016-10-24 2017-08-11 阿里巴巴集团控股有限公司 一种显示图像信息的方法及装置
CN107632758A (zh) 2017-08-09 2018-01-26 珠海市魅族科技有限公司 一种快捷支付方法、装置、计算机装置及计算机可读存储介质
CN110554768A (zh) 2018-05-31 2019-12-10 努比亚技术有限公司 一种智能穿戴设备控制方法、设备和计算机可读存储介质
CN109146463B (zh) 2018-07-25 2021-05-28 南昌努比亚技术有限公司 移动支付方法、移动终端及计算机可读存储介质
CN108762854A (zh) 2018-08-17 2018-11-06 深圳市万通顺达科技股份有限公司 基于操作系统的呼出二维码的方法及其系统、存储介质
CN109917956B (zh) 2019-02-22 2021-08-03 华为技术有限公司 一种控制屏幕显示的方法和电子设备
CN110032313A (zh) 2019-02-28 2019-07-19 努比亚技术有限公司 一种屏幕切换方法、终端及计算机可读存储介质
CN110536004B (zh) 2019-07-23 2021-08-31 华为技术有限公司 多传感器应用于具有柔性屏幕的电子设备的方法及电子设备
CN113407053B (zh) 2019-10-15 2022-04-19 荣耀终端有限公司 一种触摸屏、电子设备、显示控制方法
CN112783321B (zh) * 2019-11-08 2024-07-12 苹果公司 使用多个传感器的基于机器学习的手势识别
US11449802B2 (en) * 2019-11-08 2022-09-20 Apple Inc. Machine-learning based gesture recognition using multiple sensors
CN111593751A (zh) 2020-06-12 2020-08-28 中交隧道工程局有限公司 一种高大陡长坡面水土流失防治结构及方法
CN113283493B (zh) 2021-05-19 2024-11-29 Oppo广东移动通信有限公司 样本的获取方法、装置、终端及存储介质

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106384146A (zh) * 2016-09-23 2017-02-08 北京华大智宝电子系统有限公司 金融ic卡、支付系统及支付方法
CN111596751A (zh) * 2020-05-19 2020-08-28 歌尔智能科技有限公司 腕戴设备的显示控制方法、装置、腕戴设备及存储介质
CN111638841A (zh) * 2020-05-20 2020-09-08 维沃移动通信有限公司 消息详情页的显示方法、装置及电子设备
CN113572896A (zh) * 2021-06-23 2021-10-29 荣耀终端有限公司 基于用户行为模型的二维码显示方法及相关设备

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
See also references of EP4227876A4

Also Published As

Publication number Publication date
US12481975B2 (en) 2025-11-25
US20240127218A1 (en) 2024-04-18
EP4227876A4 (en) 2024-02-21
EP4227876B1 (en) 2026-02-11
EP4227876A1 (en) 2023-08-16

Similar Documents

Publication Publication Date Title
CN110045908B (zh) 一种控制方法和电子设备
CN110321047B (zh) 一种显示控制方法及设备
CN111382624B (zh) 动作识别方法、装置、设备及可读存储介质
WO2020177585A1 (zh) 一种手势处理方法及设备
WO2020155876A1 (zh) 控制屏幕显示的方法及电子设备
CN111553846B (zh) 超分辨率处理方法及装置
CN111400605A (zh) 基于眼球追踪的推荐方法及装置
CN111669462A (zh) 一种显示图像的方法及相关装置
US9223415B1 (en) Managing resource usage for task performance
EP4024839B1 (en) Operation method and electronic device
EP4589977A1 (en) Gesture sensing method, device and storage medium
WO2021151320A1 (zh) 一种握持姿态检测方法及电子设备
CN111582184B (zh) 页面检测方法、装置、设备及存储介质
CN111524528B (zh) 防录音检测的语音唤醒方法及装置
WO2021000943A1 (zh) 一种指纹开关的管理方法及装置
WO2022228043A1 (zh) 显示方法、电子设备、存储介质和程序产品
WO2022143094A1 (zh) 一种窗口页面的交互方法、装置、电子设备以及可读存储介质
CN116737290B (zh) 指关节敲击事件的识别方法及电子设备
WO2023124129A1 (zh) 显示二维码的方法和电子设备
CN113936240A (zh) 确定样本图像的方法、装置、设备及存储介质
CN116521018B (zh) 误触提示方法、终端设备及存储介质
CN116415951B (zh) 显示二维码的方法和电子设备
CN116301362B (zh) 图像处理方法、电子设备及存储介质
CN114510192B (zh) 图像处理方法及相关装置
CN120340104B (zh) 隔空手势识别方法及电子设备

Legal Events

Date Code Title Description
ENP Entry into the national phase

Ref document number: 2022821834

Country of ref document: EP

Effective date: 20221220

WWE Wipo information: entry into national phase

Ref document number: 18001751

Country of ref document: US

121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 22821834

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

WWG Wipo information: grant in national office

Ref document number: 18001751

Country of ref document: US

WWG Wipo information: grant in national office

Ref document number: 2022821834

Country of ref document: EP