Control method of electronic device, electronic device, wireless router and storage medium

Through the wireless router, the electronic device automatically parses and executes scene identification, solving the complex problem of positioning and scene recognition methods in the prior art, realizing automatic control of wireless connections and servers without the need, and simplifying the operation process.

CN117714983BActive Publication Date: 2025-03-14HONOR DEVICE CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202310566783.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-05-18
Publication Date
2025-03-14
Estimated Expiration
2043-05-18

AI Technical Summary

Technical Problem

The existing electronic device positioning and scene recognition methods based on wireless routers are complex, requiring multiple wireless routers or electronic devices to establish wireless connections with wireless routers, and requiring servers, resulting in cumbersome operations.

Method used

The management frame is sent through the wireless router, and the electronic device receives and parses the scene identifiers in the management frame, and automatically performs corresponding operations to realize automatic control of wireless connections and servers without the need.

Benefits of technology

It realizes that the electronic devices within its signal coverage are automatically controlled through a wireless router without user operation and establishing a wireless connection with the wireless router, simplifying the operation process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117714983B_ABST
    Figure CN117714983B_ABST
Patent Text Reader

Abstract

The present application provides a control method of an electronic device, an electronic device, a wireless router and a storage medium, and relates to the field of wireless communication technology. The method can add a scene identifier to a management frame sent by a wireless router, and the electronic device can receive the management frame of the wireless router when it enters the coverage range of the wireless signal of the wireless router. The electronic device can identify whether the received management frame carries the scene identifier, and when the scene identifier is identified, perform an operation corresponding to the identified scene identifier; in this way, the electronic device is automatically controlled without the need for the electronic device and the wireless router to establish a wireless connection, and without the need for manual operation by the user, and even as long as there is a wireless router, the electronic device within the signal coverage range of the wireless router can be automatically controlled.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of wireless communication technology, and in particular to a control method for an electronic device, an electronic device, a wireless router, and a storage medium. Background Art

[0002] With the development of electronic devices, the functions of electronic devices are becoming more and more powerful. Some functions are related to the location or scene of the electronic device. In order to improve the intelligence of electronic devices and user experience, electronic devices can be set to perform different operations in different locations or scenes.

[0003] Currently, there are some methods for positioning electronic devices or scene recognition based on wireless routers. However, in some positioning applications, multiple wireless routers are required to locate the electronic device; in some scene recognition applications, the electronic device and the wireless router need to establish a wireless connection before recognition; even in some applications, the server is required to achieve positioning or scene recognition; therefore, the current positioning or scene recognition methods based on wireless routers are relatively cumbersome. Summary of the invention

[0004] The present application provides a control method for an electronic device, an electronic device, a wireless router and a storage medium, which can realize automatic control of electronic devices within the signal coverage range of a wireless router without the need for a user to operate the electronic device or to establish a wireless connection between the electronic device and the wireless router, provided there is a wireless router.

[0005] In order to achieve the above purpose, this application adopts the following technical solutions:

[0006] In a first aspect, the present application provides a control method of an electronic device, comprising:

[0007] The electronic device receives a first management frame, where the first management frame is a first beacon frame or a first probe data frame;

[0008] The electronic device parses the first management frame to obtain a scene identifier;

[0009] The electronic device performs an operation corresponding to the scene identifier parsed in the first management frame based on the scene identifier parsed in the first management frame.

[0010] In the present application, the first management frame is sent by the wireless router. When a user carries an electronic device into the wireless signal coverage range of the wireless router, the electronic device can receive the management frame sent by the wireless router. The electronic device can parse the scene identifier from the received management frame, and then perform an operation corresponding to the scene identifier based on the parsed scene identifier, thereby achieving automatic control of the electronic device within the signal coverage range of the wireless router without the need for the user to operate the electronic device or for the electronic device to establish a wireless connection with the wireless router, and in the case of a wireless router.

[0011] In an implementation manner of the first aspect, before the electronic device performs an operation corresponding to the scene identifier parsed in the first management frame based on the scene identifier parsed in the first management frame, the method further includes:

[0012] The electronic device determines that the signal strength of the first management frame is greater than a first value, where the first value is a signal strength threshold corresponding to the scene identifier parsed in the first management frame.

[0013] In the present application, in order to reduce the occurrence of the following situation: electronic devices that are not in the space where the wireless router is located also automatically execute the operation corresponding to the scene identifier carried in the management frame sent by the wireless router, a signal strength threshold can be set, wherein different scene identifiers can correspond to different signal strength thresholds. When the electronic device determines that the signal strength of the received management frame is greater than the signal strength threshold corresponding to the parsed scene identifier, the operation corresponding to the scene identifier is executed.

[0014] In another implementation of the first aspect, the electronic device performs, based on the scene identifier parsed in the first management frame, an operation corresponding to the scene identifier parsed in the first management frame, including:

[0015] When the scene identifier parsed in the first management frame is the first scene identifier, the electronic device sets the electronic device to a silent mode based on the first scene identifier;

[0016] When the scene identifier parsed in the first management frame is a second scene identifier, the electronic device sets the electronic device to an airplane mode based on the second scene identifier;

[0017] When the scene identifier parsed in the first management frame is the third scene identifier, the electronic device sets a prompt message to be displayed when the electronic device switches from a screen-off state to a screen-on state based on the third scene identifier, and the prompt message is used to indicate a jump to a payment interface.

[0018] In the present application, different scene identifiers and different operations performed by the electronic device can be set according to the placement location of the wireless router, making the implementation of the present solution more flexible.

[0019] In another implementation manner of the first aspect, when the scene identifier parsed in the first management frame is a first scene identifier, the method further includes:

[0020] The electronic device records the BSSid carried in the first management frame where the first scenario identifier is located, where the BSSid is a unique identifier of a wireless access point that sends the first management frame.

[0021] In the present application, when the electronic device is in a certain scene, the unique identifier of the wireless access point that led to entering the scene can be recorded to subsequently determine whether to exit the scene (i.e., switch back to the initial mode, or exit to the state before executing the operation corresponding to the scene identifier).

[0022] In another implementation of the first aspect, after the electronic device sets the electronic device to a silent mode based on the first scene identifier, the method further includes:

[0023] The electronic device receives a second management frame, where the second management frame is a second beacon frame or a second probe data frame;

[0024] The electronic device identifies a BSSid of the received second management frame;

[0025] The electronic device determines that the BSSid of the second management frame is consistent with the recorded BSSid of the first management frame;

[0026] Determining, by the electronic device, that the signal strength of the second management frame is less than or equal to a first value, where the first value is a signal strength threshold corresponding to the scene identifier identified in the first management frame;

[0027] The electronic device is switched to an initial mode, where the initial mode is a mode before the electronic device is switched to the flight mode.

[0028] In the present application, since the electronic device may continuously broadcast beacon frames, when the electronic device is in a certain scenario (for example, it is always in a conference room), it may continue to receive beacon frames sent by the wireless router that carry the same scene identifier. In this case, if the BSSid of the newly received management frame is consistent with the management frame that causes the current scene, there is no need to continue to identify the scene identifier, but instead continue to check the signal strength of the second management frame with the same BSSid that is most recently received, so as to exit the current scene and return to the initial mode when the signal strength is low.

[0029] In another implementation of the first aspect, after the electronic device determines that the signal strength of the second management frame is less than or equal to the first value, the method further includes:

[0030] The electronic device deletes the recorded BSSid of the first management frame.

[0031] In this application, when the electronic device exits the current scene, it is also necessary to delete the BSSid of the management frame corresponding to the current scene.

[0032] In another implementation of the first aspect, after the electronic device sets the electronic device to a silent mode based on the first scene identifier, the method further includes:

[0033] If the electronic device does not receive a management frame within the first time period, or the BSSid identified in the management frame received within the first time period is inconsistent with the BSSid recorded in the first management frame, the electronic device switches to an initial mode, and the initial mode is the mode before the electronic device switches to the flight mode.

[0034] In this application, in order to improve the user experience, it can also be set that when the user leaves the space where the wireless router is located, the electronic device automatically exits the scene and returns to the initial state, that is, switches back to the initial mode or (under triggering conditions) no longer performs the corresponding operation. Therefore, the conditions for the electronic device to switch back to the initial mode are set.

[0035] In another implementation of the first aspect, if the electronic device does not receive a management frame within the first duration, or a BSSid identified in a management frame received within the first duration is inconsistent with a BSSid of the recorded first management frame, the method further includes:

[0036] The electronic device deletes the recorded BSSid of the first management frame.

[0037] In another implementation of the first aspect, the electronic device performs an operation corresponding to the scene identifier parsed in the first management frame based on the scene identifier parsed in the first management frame, and then the method further includes:

[0038] The electronic device receives a third management frame, where the third management frame is a third beacon frame or a third probe data frame;

[0039] The electronic device parses the scene identifier from the third management frame;

[0040] The electronic device determines the BSSid in which the first management frame is recorded;

[0041] The electronic device determines that an operation corresponding to the scene identifier parsed from the first management frame and an operation corresponding to the scene identifier parsed from the third management frame conflict, wherein the electronic device records the conflicting operation;

[0042] The electronic device does not perform the operation corresponding to the scene identifier in the third management frame;

[0043] Alternatively, the electronic device sends a prompt message, where the prompt message is used to prompt the user to select one of the conflicting operations, and the electronic device receives the operation selected by the user and executes the operation selected by the user.

[0044] In the present application, the management frames sent by two wireless routers in the overlapping area may both carry scene identifiers. Therefore, the electronic device may receive a management frame carrying the scene identifier of another scene when it is in a certain scene. If the operations performed in the two scenes conflict, for example, one operation is to switch to flight mode and the other operation is to switch to silent mode, in this case, the electronic device can be set not to perform the newly identified scene without exiting the previous scene, or a prompt message can be sent to the user to allow the user to choose the operation performed by the electronic device according to the actual situation.

[0045] In another implementation of the first aspect, the electronic device performs an operation corresponding to the scene identifier parsed in the first management frame based on the scene identifier parsed in the first management frame, and then the method further includes:

[0046] The electronic device receives a third management frame, where the third management frame is a third beacon frame or a third probe data frame;

[0047] The electronic device parses the scene identifier from the third management frame;

[0048] The electronic device determines the BSSid in which the first management frame is recorded;

[0049] The electronic device determines that there is no conflict between the operation corresponding to the scene identifier parsed from the first management frame and the operation corresponding to the scene identifier parsed from the third management frame, wherein the electronic device records the conflicting operation;

[0050] The electronic device executes an operation corresponding to the scene identifier in the third management frame.

[0051] In the present application, if the operations performed in the two scenes do not conflict, the electronic device can also perform the operation corresponding to the newly detected scene (or scene identifier) ​​without exiting the previous scene (or scene identifier).

[0052] In another implementation manner of the first aspect, the scenario identifier is located in a VendorSpecific of the management frame.

[0053] In this application, there is no need to modify the communication protocol of the wireless router. Instead, the scene identifier is summarized and set in the fields reserved for suppliers in the existing communication protocol to facilitate promotion.

[0054] In a second aspect, the present application provides a control method for an electronic device, comprising:

[0055] The wireless router sends a first management frame, which is a first beacon frame or a first probe data frame. The first management frame carries a scene identifier, and the scene identifier is used to instruct the electronic device that receives the first management frame to perform an operation corresponding to the scene identifier.

[0056] In an implementation manner of the second aspect, the scenario identifier is located in a VendorSpecific of the management frame.

[0057] In a third aspect, an electronic device is provided, comprising a processor, wherein the processor is used to run a computer program stored in a memory to implement any method of the first aspect of the present application.

[0058] In a fourth aspect, a wireless router is provided, comprising a processor, the processor being configured to run a computer program stored in a memory to implement any method of the second aspect of the present application.

[0059] In a fifth aspect, a chip system is provided, comprising a processor, wherein the processor is coupled to a memory, and the processor executes a computer program stored in the memory to implement any method of the first aspect or any method of the third aspect of the present application.

[0060] In a sixth aspect, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by one or more processors, the computer program implements any method of the first aspect or any method of the second aspect of the present application.

[0061] In the seventh aspect, an embodiment of the present application provides a computer program product. When the computer program product runs on a device, the device executes any method of the first aspect or any method of the second aspect of the present application.

[0062] It can be understood that the beneficial effects of the second to seventh aspects mentioned above can be found in the relevant description of the first aspect mentioned above, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0063] Figure 1A schematic diagram of a hardware structure of an electronic device to which the control method of an electronic device provided in an embodiment of the present application is applied;

[0064] Figure 2 A schematic diagram of an application scenario of a control method for an electronic device provided in an embodiment of the present application;

[0065] Figure 3 A schematic diagram of active scanning and passive scanning of an electronic device provided in an embodiment of the present application;

[0066] Figure 4 A schematic diagram of a field reserved for a provider in a management frame provided in an embodiment of the present application;

[0067] Figure 5 A table diagram of a scenario and operations performed by an electronic device in the scenario provided in an embodiment of the present application;

[0068] Figure 6 A schematic diagram of a setting interface of a wireless router provided in an embodiment of the present application;

[0069] Figure 7 A schematic diagram of a setting interface of an electronic device provided in an embodiment of the present application;

[0070] Figure 8 A flowchart of a control method for an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0071] In the following description, specific details such as specific system structures and technologies are provided for illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application can also be implemented in other embodiments without these specific details.

[0072] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of described features, wholes, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or combinations thereof.

[0073] It should also be understood that in the embodiments of the present application, "one or more" refers to one, two or more than two; "and / or" describes the association relationship of associated objects, indicating that three relationships may exist; for example, A and / or B may represent: A exists alone, A and B exist at the same time, and B exists alone, where A and B may be singular or plural. The character " / " generally indicates that the associated objects before and after are in an "or" relationship.

[0074] In addition, in the description of the present application specification and the appended claims, the terms "first", "second", "third", "fourth", etc. are only used to distinguish the descriptions and cannot be understood as indicating or implying relative importance.

[0075] References to "one embodiment" or "some embodiments" etc. described in the specification of this application mean that one or more embodiments of the present application include specific features, structures or characteristics described in conjunction with the embodiment. Therefore, the statements "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways.

[0076] The embodiment of the present application provides a control method for an electronic device, and the electronic device may be a tablet computer, a mobile phone, a wearable device, a laptop computer, an ultra-mobile personal computer (UMPC), a netbook, a personal digital assistant (PDA), etc. The embodiment of the present application does not limit the specific type of the electronic device.

[0077] Figure 1 The schematic diagram of the structure of an electronic device is shown. The electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. Among them, the sensor module 180 may include a pressure sensor 180A, a touch sensor 180K, an ambient light sensor 180L, etc.

[0078] It is understood that the structure illustrated in the embodiment of the present application does not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may include more or fewer components than shown in the figure, or combine some components, or split some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.

[0079] 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 processor (graphics processing unit, GPU), an image signal processor (image signal processor, ISP), a controller, a memory, a video codec, a digital signal processor (digital signal processor, DSP), a coprocessor (sensor coprocessor, SCP), a baseband processor, and / or a neural-network processing unit (neural-network processing unit, NPU), etc. Among them, different processing units can be independent devices or integrated in one or more processors. For example, the processor 110 is used to execute the resource scheduling method in the embodiment of the present application.

[0080] The controller may be the nerve center and command center of the electronic device 100. The controller may generate an operation control signal according to the instruction operation code and the timing signal to complete the control of fetching and executing instructions.

[0081] The processor 110 may also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may store instructions or data that the processor 110 has just used or cyclically used. If the processor 110 needs to use the instruction or data again, it may be directly called from the memory. This avoids repeated access, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.

[0082] The USB interface 130 is an interface that complies with USB standard specifications, and may specifically be a Mini USB interface, a Micro USB interface, a USB Type C interface, etc. The USB interface 130 may be used to connect a charger to charge the electronic device 100, and may also be used to transmit data between the electronic device 100 and a peripheral device.

[0083] It is understandable that the interface connection relationship between the modules illustrated in the embodiment of the present application is only a schematic illustration and does not constitute a structural limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may also adopt different interface connection methods in the above embodiments, or a combination of multiple interface connection methods.

[0084] The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100. The external memory card communicates with the processor 110 through the external memory interface 120 to implement a data storage function, such as storing music, video and other files in the external memory card.

[0085] The internal memory 121 can be used to store computer executable program codes, and the executable program codes include instructions. The processor 110 executes various functional applications and data processing of the electronic device 100 by running the instructions stored in the internal memory 121. The internal memory 121 may include a program storage area and a data storage area. Among them, the program storage area can store an operating system and an application required for at least one function (such as a sound playback function, an image playback function, etc.).

[0086] In addition, the internal memory 121 may include a high-speed random access memory and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc.

[0087] The charging management module 140 is used to receive charging input from a charger. The charger may be a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 140 may receive charging input from the wired charger through the USB interface 130 .

[0088] The power management module 141 is used to connect the battery 142, the charging management module 140 and the processor 110. The power management module 141 receives input from the battery 142 and / or the charging management module 140 to power the processor 110, the internal memory 121, the external memory, the display screen 194, the camera 193, and the wireless communication module 160.

[0089] In some other embodiments, the power management module 141 may also be disposed in the processor 110. In some other embodiments, the power management module 141 and the charging management module 140 may also be disposed in the same device.

[0090] The wireless communication function of the electronic device 100 can be implemented through the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor and the baseband processor.

[0091] Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in electronic device 100 can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve the utilization of antennas. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network. In some other embodiments, the antenna can be used in combination with a tuning switch.

[0092] The mobile communication module 150 can provide solutions for wireless communications including 2G / 3G / 4G / 5G, etc., applied to the electronic device 100. The mobile communication module 150 may include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves from the antenna 1, and filter, amplify, etc. the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modulation and demodulation processor, and convert it into electromagnetic waves for radiation through the antenna 1.

[0093] The wireless communication module 160 can provide wireless communication solutions including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR), etc., which are applied to the electronic device 100. The wireless communication module 160 can be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, modulates the frequency of the electromagnetic wave signal and performs filtering, and sends the processed signal to the processor 110. The wireless communication module 160 can also receive the signal to be sent from the processor 110, modulate the frequency of it, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2.

[0094] In some embodiments, antenna 1 of electronic device 100 is coupled to mobile communication module 150, and antenna 2 is coupled to wireless communication module 160, so that electronic device 100 can communicate with the network and other devices through wireless communication technology.

[0095] The electronic device 100 can implement audio functions such as music playing and recording through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone jack 170D, and the application processor.

[0096] The audio module 170 is used to convert digital audio signals into analog audio signals for output, and is also used to convert analog audio inputs into digital audio signals. The audio module 170 can also be used to encode and decode audio signals. In some embodiments, the audio module 170 can be arranged in the processor 110, or some functional modules of the audio module 170 can be arranged in the processor 110.

[0097] The speaker 170A, also called a "speaker", is used to convert an audio electrical signal into a sound signal. The electronic device 100 can listen to music or listen to a hands-free call through the speaker 170A.

[0098] The receiver 170B, also called a "earpiece", is used to convert audio electrical signals into sound signals. When the electronic device 100 receives a call or voice message, the voice can be received by placing the receiver 170B close to the human ear.

[0099] Microphone 170C, also called "microphone" or "microphone", is used to convert sound signals into electrical signals. When making a call or sending a voice message, the user can make a sound by approaching the microphone 170C with his mouth to input the sound signal into the microphone 170C. The electronic device 100 can be provided with at least one microphone 170C. In other embodiments, the electronic device 100 can be provided with two microphones 170C, which can not only monitor voice information but also realize noise reduction function. In other embodiments, the electronic device 100 can also be provided with three, four or more microphones 170C to realize the collection of sound signals, noise reduction, identification of sound sources, realization of directional recording functions, etc. The headphone jack 170D is used to connect wired headphones. The headphone jack 170D can be a USB interface 130, or it can be a 3.5mm open mobile terminal platform (OMTP) standard interface, or a cellular telecommunications industry association of the USA (CTIA) standard interface.

[0100] The pressure sensor 180A is used to sense the pressure signal and can convert the pressure signal into an electrical signal. In some embodiments, the pressure sensor 180A can be set on the display screen 194. There are many types of pressure sensors 180A, such as resistive pressure sensors, inductive pressure sensors, capacitive pressure sensors, etc. A capacitive pressure sensor can be a parallel plate including at least two conductive materials. When a force acts on the pressure sensor 180A, the capacitance between the electrodes changes. The electronic device 100 determines the intensity of the pressure based on the change in capacitance. When a touch operation acts on the display screen 194, the electronic device 100 detects the intensity of the touch operation based on the pressure sensor 180A. The electronic device 100 can also calculate the position of the touch based on the detection signal of the pressure sensor 180A.

[0101] The touch sensor 180K is also called a "touch panel". The touch sensor 180K can be set on the display screen 194, and the touch sensor 180K and the display screen 194 form a touch screen, also called a "touch screen". The touch sensor 180K is used to detect touch operations acting on or near it. The touch sensor can pass the detected touch operation to the application processor to determine the type of touch event. Visual output related to the touch operation can be provided through the display screen 194. In other embodiments, the touch sensor 180K can also be set on the surface of the electronic device 100, which is different from the position of the display screen 194.

[0102] The ambient light sensor 180L is used to sense the ambient light brightness. The electronic device 100 can adaptively adjust the brightness of the display screen 194 according to the perceived ambient light brightness. The ambient light sensor 180L can also be used to automatically adjust the white balance when taking pictures. The ambient light sensor 180L can also cooperate with the proximity light sensor 180G to detect whether the electronic device 100 is in a pocket to prevent accidental touches.

[0103] The key 190 includes a power key, a volume key, etc. The key 190 may be a mechanical key or a touch key. The electronic device 100 may receive key input and generate key signal input related to user settings and function control of the electronic device 100.

[0104] Motor 191 can generate vibration prompts. Motor 191 can be used for incoming call vibration prompts, and can also be used for touch vibration feedback.

[0105] The electronic device 100 implements the display function through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing, which connects the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs that execute program instructions to generate or change display information.

[0106] The display screen 194 is used to display images, videos, etc. 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 (AMOLED), a flexible light-emitting diode (FLED), Miniled, MicroLed, Micro-OLED, a quantum dot light-emitting diode (QLED), etc. In some embodiments, the electronic device 100 may include 1 or N display screens 194, where N is a positive integer greater than 1.

[0107] The camera 193 is used to capture still images or videos. The object generates an optical image through the lens and projects it onto the photosensitive element. The photosensitive element can be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the optical signal into an electrical signal, and then passes the electrical signal to the ISP to be converted into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into an image signal in a standard RGB, YUV or other format. In some embodiments, the electronic device 100 may include 1 or N cameras 193, where N is a positive integer greater than 1.

[0108] The SIM card interface 195 is used to connect a SIM card. The SIM card can be connected to and separated from the electronic device 100 by inserting it into the SIM card interface 195 or pulling it out from the SIM card interface 195. The electronic device 100 can support 1 or N SIM card interfaces, where N is a positive integer greater than 1. The SIM card interface 195 can support Nano SIM cards, Micro SIM cards, SIM cards, and the like. Multiple cards can be inserted into the same SIM card interface 195 at the same time. The types of the multiple cards can be the same or different. The SIM card interface 195 can also be compatible with different types of SIM cards. The SIM card interface 195 can also be compatible with external memory cards. The electronic device 100 interacts with the network through the SIM card to implement functions such as calls and data communications. In some embodiments, the electronic device 100 uses an eSIM, i.e., an embedded SIM card. The eSIM card can be embedded in the electronic device 100 and cannot be separated from the electronic device 100.

[0109] The embodiments of the present application do not particularly limit the specific structure of the execution subject of the control method of an electronic device, as long as the code of the control method of an electronic device provided by the embodiments of the present application can be run to communicate according to the control method of an electronic device provided by the embodiments of the present application. For example, the execution subject of the control method of an electronic device provided by the embodiments of the present application can be a functional module in the electronic device that can call and execute a program, or a communication device applied to the electronic device, such as a chip.

[0110] With the development of electronic devices, the functions of electronic devices are becoming more and more powerful. Some functions are related to the location or scene of the electronic device. In order to improve the intelligence of electronic devices and user experience, electronic devices can be set to perform different operations in different locations or scenes.

[0111] Currently, there are some methods for positioning electronic devices or scene recognition based on wireless routers. However, in some positioning applications, multiple wireless routers are required to locate the electronic device; in some scene recognition applications, the electronic device and the wireless router need to establish a wireless connection before recognition; even in some applications, the server is required to achieve positioning or scene recognition; therefore, the current positioning or scene recognition methods based on wireless routers are relatively cumbersome.

[0112] An embodiment of the present application provides a method for controlling an electronic device, where the electronic device can perform location or scene recognition based on a wireless router, and then control the electronic device based on the location or scene recognized by the electronic device.

[0113] As an example, see Figure 2 In (a), when a user brings an electronic device (e.g., a mobile phone) close to a wireless router in a conference room, the electronic device switches to silent mode; similarly, when the user carries the electronic device away from or far away from the conference room, the electronic device switches to an initial mode, which is the mode before switching to silent mode, such as the vibration mode shown in the figure.

[0114] As another example, refer to Figure 2 In (b), when a user carries an electronic device (e.g., a mobile phone) on an airplane, the electronic device switches to airplane mode; when the user carries the electronic device off the airplane, the electronic device switches to an initial mode, which is the mode before switching to airplane mode, such as the ringtone mode shown in the figure.

[0115] As another example, refer to Figure 2In (c), when the user brings the electronic device close to the payment counter and the display screen of the electronic device switches from the off screen state to the bright screen state, the electronic device displays a jump prompt, which is used to jump to the payment interface. When the user leaves the payment counter with the electronic device and the display screen of the electronic device switches from the off screen state to the bright screen state, the electronic device no longer displays the jump prompt.

[0116] In order to more clearly understand the above-mentioned scenarios, the control method of the electronic device provided in the embodiment of the present application will be described in detail below.

[0117] In the embodiment of the present application, the management frame sent by the wireless router can be used for positioning or scene recognition. In the embodiment of the present application, the management frame sent by the wireless router includes a Beacon frame and a Probe data frame.

[0118] Among them, Beacon frames are mainly used in the passive scanning phase of electronic devices. Figure 3 In (a), the wireless router can send broadcast information at a certain period, and the broadcast information is a Beacon frame, and carries the BSSid of the wireless router. When the electronic device is in power saving mode, it will passively receive the Beacon frames broadcast by the surrounding wireless routers. Of course, each electronic device (for example, electronic device 1, electronic device 2, and electronic device 3) within the coverage range of the wireless signal of the wireless router can receive the Beacon frames sent by the wireless router.

[0119] Among them, the Probe data frame is mainly used in the active scanning stage of electronic equipment. Figure 3In (b), the electronic device can actively send a probe signal (i.e., Probe Request) on the channel supported by the electronic device in sequence to detect the wireless networks existing around it. The probe signal is Probe Request. The probe signal is divided into two categories, one does not specify any BSSid, and the other specifies the BSSid. If the probe signal does not specify the BSSid, the probe signal is used to obtain all available wireless network signals around it, and all wireless routers that receive the probe signal will respond to the electronic device by sending a ProbeRequest and inform the electronic device of its own BSSid. In this way, the electronic device can search for the surrounding wireless networks. If the BSSid is specified in the probe signal, the probe signal is used to obtain the specified BSSid, and only the wireless router whose BSSid in the probe signal is consistent with its own BSSid will respond to the electronic device (for example, after wireless router B receives the Probe Request, it returns a Probe Response). Regardless of the type of probe signal, the response information sent by the wireless router that needs to respond to the electronic device is the Probe Response.

[0120] Whether it is the Beacon frame sent by the wireless router in passive scanning or the Probe Response data frame sent by the wireless router in active scanning, a variable field, namely VendorSpecific, is reserved for a specific vendor. The variable TLV in the VendorSpecific can define different scenario identifiers.

[0121] Reference Figure 4 , as an example of a data structure for the Vendor Specific in the Beacon and Probe data frames. Figure 4 Bits 0-10 in the field are fixed fields in the Vendor Specific field. Figure 4 Bits 11 to 16 in the VendorSpecific field are shown as the TLV field in the VendorSpecific field. A location or scene identifier may be added to the TLV field.

[0122] An example of a four-byte scenario is as follows:

[0123] 0X0100~0X01FF: scene identifier of mute related scenes;

[0124] 0X0200~0X02FF: scene identification of flight-related scenes;

[0125] 0X0300~0X03FF: scenario identifier of payment-related scenarios;

[0126] …….

[0127] The above scene identification is only used as an example. In actual applications, other scene identifications can also be set, and the present application embodiment does not limit this. In the present application embodiment, the electronic device can also configure the operations corresponding to the electronic device under different scene identifications. Figure 5 , which is an example of corresponding operations of an electronic device in different scenarios provided in an embodiment of the present application.

[0128] After the electronic device identifies that the scene identifier in the management frame sent by the wireless router is a silent scene, the electronic device may be switched to a silent mode;

[0129] After the electronic device identifies that the scene identifier in the management frame sent by the wireless router is a flight scene, the electronic device can be switched to the flight mode;

[0130] After the electronic device recognizes that the scene identifier in the management frame sent by the wireless router is a payment scene, the electronic device displays a jump prompt on the interface when the screen-off state is switched to the screen-on state, and jumps to the payment interface after receiving the user's confirmation jump operation.

[0131] The above examples only list the operations corresponding to some scenarios. The specific scenarios, scenario identifiers and executed operations can also be set according to actual conditions.

[0132] In addition, in actual applications, since the embodiments of the present application do not require the electronic device to access a wireless router, but only require the electronic device to enter the signal coverage range of the wireless router to identify the scene identifier, in order to avoid electronic devices passing through the signal coverage range of the wireless router also performing corresponding operations, it can be set that the scene identifier is identified in the management frame received by the electronic device, and the signal strength of the management frame that identifies the scene identifier is greater than a threshold, and the electronic device then performs the operation corresponding to the scene identifier.

[0133] As an example, in a small conference room, the threshold is -55dBm;

[0134] In a large theater, the threshold is -75dBm;

[0135] At an airport, the threshold is -60dBm.

[0136] Therefore, even if the operations performed by the electronic device are the same, but the reference signal strength thresholds are different, in this case different scene identifiers can be set for different locations. Therefore, in the above embodiment, the scene identifiers of the mute-related scene include multiple, the scene identifiers of the flight-related scene include multiple, and the scene identifiers of the payment scene also include multiple.

[0137] As an example, a wireless router set up in a conference room can be configured as a conference scene with a scene identifier of 0X0101. When the signal strength of a management frame carrying the scene identifier is greater than -55dBm, the operation performed is the silent mode.

[0138] The wireless router installed on the airplane can be configured as a flight scene with a scene identifier of 0X0201. When the signal strength of the management frame carrying the scene identifier is greater than -60dBm, the operation performed is the flight mode.

[0139] The wireless router set up in the theater can be configured as the theater scene, with the scene identifier 0X0110. When the signal strength of the management frame carrying the scene identifier is greater than -75dBm, the operation executed is the silent mode. Of course, the wireless router set up at home can be configured as the home scene, with the scene identifier 0X0401. When the signal strength of the management frame carrying the scene identifier is greater than the signal strength threshold corresponding to the scene identifier, the operation executed is the vibration mode.

[0140] The wireless router near the supermarket checkout counter can be configured as a payment scenario with a scenario identifier of 0X0301. When the signal strength of the management frame carrying the scenario identifier is greater than the signal strength threshold corresponding to the scenario identifier, the operation performed is that when the electronic device switches from the screen-off state to the screen-on state, the electronic device displays a jump prompt to jump to the payment interface after the user confirms the operation.

[0141] In addition, different thresholds can be set for the same type of locations. That is, if the wireless routers are located in the same type of locations (all conference rooms), the operations performed are the same (all set to silent mode), and different scene identifiers need to be set for different thresholds.

[0142] As another example, in a small conference room (for example, the maximum distance between the location in the conference room and the wireless router is less than 7 meters), the threshold is -55dBm, and the scene identifier is 0X0101; in a large conference room (for example, the maximum distance between the location in the conference room and the wireless router is less than 20 meters), the threshold is -70dBm, and the scene identifier is 0X0111. Other examples are not listed one by one.

[0143] The implementation of the above embodiment also requires relevant settings or configurations to be performed on the wireless router and the electronic device.

[0144] Taking the settings on a wireless router as an example, the user can configure a location (or scene) and corresponding operations for the wireless router in the settings interface of the wireless router.

[0145] As an example, see Figure 6, the company manager logs in to the setting interface of the wireless router located in the conference room through an electronic device (mobile phone or computer). The company manager can configure the location of the wireless router on the electronic device, and the user can select one of the locations available for selection. If the selected option has a next-level interface, the next-level interface will be entered. For example, after the user selects the conference room, the next-level interface will be entered to select the size of the conference room. After the user selects the size of the conference room (for example, less than 30 square meters), the user can continue to return to the previous interface, and the user continues to select the operation that the electronic device needs to perform, such as mute. The electronic device needs to send the above configuration information (conference room, less than 30 square meters and mute operation) to the wireless router located in the conference room. After the wireless router receives the configuration information, it determines the scene identifier that needs to be carried in the management frame based on the conference room, less than 30 square meters and mute operation according to its own built-in configuration file, that is, configures the management frame sent by itself. After the wireless router is configured, the management frame sent by the wireless router carries the scene identifier 0X0101.

[0146] As another example, an airline manager logs into the setting interface of a wireless router located in an aircraft through an electronic device (mobile phone or computer). The airline manager can configure the location, aircraft model (or size, etc.) and the operation to be performed on the electronic device. The electronic device needs to send the above configuration information (aircraft, small flight and flight operation) to the wireless router located in the aircraft cabin. After receiving the configuration information, the wireless router configures the management frame it sends. After the wireless router is configured, the management frame sent by the wireless router carries the scene identifier 0X0201.

[0147] Other scenario configurations are not given examples one by one.

[0148] In addition, the electronic device needs to pre-set a configuration file, which defines the operations corresponding to different scene identifiers (different scene identifiers may correspond to different thresholds), or. The configuration file may be built into the electronic device when it leaves the factory, or it may be updated to the electronic device when the electronic device updates the system, or the function may be realized by downloading the corresponding APP on the server, etc.

[0149] If a configuration file has been pre-installed in the electronic device, the user can also choose on the interface of the electronic device whether to enable automatic scene recognition, whether to automatically mute the silent scene, whether to automatically unmute when leaving, whether to automatically enable flight functions when boarding a plane, etc.

[0150] Reference Figure 7As shown in the interface diagram, users can turn on the automatic scene recognition function. After turning on the automatic scene recognition function, the interface will display functions related to automatic scene recognition, such as automatic muting when silent scenes are turned on, automatic unmuting when leaving, and automatic flight when boarding.

[0151] When a configuration file is pre-set in the electronic device, and automatic scene recognition and automatic mute of silent scenes are turned on, the electronic device will recognize the scene identifier in the management frame received from the wireless router, match the scene identifier with the scene identifier in the configuration file, and execute the operation (mute) corresponding to the successfully matched scene identifier in the configuration file after the electronic device recognizes the scene identifier in the management frame received from the wireless router.

[0152] The interface schematic diagram provided in the embodiment of the present application is for illustration only and may differ from the actual interface in the product. The interface schematic diagram in the figure does not impose any limitation on the present application.

[0153] Reference Figure 8 , which is a flow chart of a method for setting up an electronic device provided in an embodiment of the present application.

[0154] S101, wireless router A receives a setting instruction. The setting instruction carries information such as the conference room, conference room size, and silent mode.

[0155] The configuration process requires the participation of an electronic device, which can be a computer, tablet computer, mobile phone, etc., denoted as electronic device A. Electronic device A accesses the configuration page of wireless router A, and the configuration page can provide users with multiple usage location (or scene) options: cabin, conference room, theater, home, payment front desk, factory, etc.; the configuration page can also provide users with multiple operation options: flight, silent, vibration, normal, jump to payment interface, etc.

[0156] The user selects the conference room, silent mode, and of course, the size of the conference room, etc. The electronic device A sends a configuration instruction to the wireless router A, and the configuration instruction carries the above configuration information. Therefore, the wireless router A can receive the setting instruction carrying the information such as the conference room, the size of the conference room, and the silent mode.

[0157] S102: Wireless router A obtains scene identifier 1 according to information carried in the received setting instruction.

[0158] A configuration file is also configured in wireless router A, and the configuration file contains scene identifiers corresponding to various types of information. The scene identifier 1 is only used as an example and does not mean that the specific content is "scene identifier 1".

[0159] S103, wireless router A configures scene identifier 1 into the management frame.

[0160] After the configuration is completed, the management frame sent by the wireless router A carries the scene identifier 1. In addition, the management frame sent by the wireless router also carries the BSSid (the unique identifier of the AP) of the AP from which the wireless router sends the management frame.

[0161] In addition, there is a wireless router B, which has not been configured on the wireless router A, so the management frame sent by the wireless router B does not carry the scene identifier.

[0162] S201, the electronic device receives a management frame sent by wireless router B.

[0163] When a user brings an electronic device close to wireless router B and enters the coverage range of the wireless signal of wireless router B, the electronic device will receive the management frame sent by wireless router B.

[0164] S202: The electronic device fails to recognize a scene identifier from a received management frame.

[0165] Since wireless router B does not perform the configuration process shown in the wireless router A, the electronic device does not recognize the scene identifier from the management frame sent by wireless router B.

[0166] When the user carries the electronic device away from the wireless router B and leaves the coverage of the wireless signal of the wireless router B, the electronic device will no longer receive the management frame sent by the wireless router B.

[0167] There is no order relationship between the process from step S101 to step S103 and the process from step S201 to step S202.

[0168] When a user brings an electronic device close to wireless router A and enters the coverage range of the wireless signal of wireless router A, the electronic device performs the following operations:

[0169] S301, the electronic device receives a management frame sent by wireless router A, where the management frame carries a scenario identifier and BSSid1.

[0170] S302, the electronic device identifies scene identifier 1 and BSSid1 from the received management frame.

[0171] S303: The electronic device determines that the signal strength of the management frame where the scene identifier 1 is located is greater than the signal strength threshold corresponding to the scene identifier 1.

[0172] S304: When the electronic device determines that the scene identifier 1 is recognized in the management frame and the signal strength of the management frame is greater than the signal strength threshold corresponding to the scene identifier 1, the electronic device switches to the silent mode.

[0173] In the embodiment of the present application, the configuration file in the electronic device sets the corresponding relationship between different scene identifiers and the operations performed by the electronic device. Therefore, the operation to be performed can be determined by querying the configuration file.

[0174] Of course, in the configuration file, the executed operation can also be distinguished in the form of an identifier.

[0175] S305: The electronic device receives a management frame from wireless router A.

[0176] In the embodiment of the present application, wireless router A will not stop broadcasting management frames just because an electronic device recognizes the scene identifier. Wireless router A periodically sends management frames. Therefore, when the electronic device is within the signal coverage range of wireless router A, the electronic device will periodically receive the management frame.

[0177] S306, the electronic device identifies BSSid1 from the received management frame.

[0178] The embodiment of the present application may be configured as follows: the electronic device first identifies the BSSid. If the identified BSSid is a recorded BSSid, it indicates that the operation of scene identification corresponding to the BSSid is currently being performed, and the operation of identifying the scene identification may no longer be performed, thereby reducing power consumption. If the identified BSSid is not recorded, the operation of identifying the scene identification from the management frame may be performed.

[0179] Therefore, in the case where BSSid1 has been recorded in step S304, the signal strength of the management frame corresponding to BSSid1 is determined, so as to switch to the initial mode when the signal strength is less than or equal to the signal strength threshold.

[0180] S307 , the electronic device determines that the signal strength of the management frame where the BSSid is located is less than or equal to the signal strength threshold corresponding to the scenario identifier 1 .

[0181] S308, the electronic device switches to an initial mode, where the initial mode is a mode before switching to the silent mode.

[0182] The embodiments of the present application only take setting as a conference room scene and switching to silent mode as examples to describe the operations performed by the wireless router and the electronic device. In actual applications, different scenes can be set and different operations can be performed based on actual conditions.

[0183] As another embodiment of the present application, in a specific implementation, the electronic device may be within the coverage range of the wireless signals of two wireless routers that are both set with scene identifiers, that is, the electronic device is located in the intersection area of ​​wireless router A (setting a conference room scene, silent mode) and wireless router C (setting a work scene, vibration mode).

[0184] If the electronic device recognizes that operations corresponding to scene identifiers in multiple management frames conflict, in this case, the electronic device may not perform the conflicting operations.

[0185] Of course, the user may also be prompted through a prompt interface that there is a conflict in the operations corresponding to the current scene, and the user may decide which operation to perform.

[0186] It can also be set that when the electronic device is executing an operation corresponding to a scene identifier, it will switch to another scene with a conflict to execute another conflicting operation unless the BSSid corresponding to the scene identifier no longer exists in the received management frame or the signal strength of the management frame represented by the BSSid corresponding to the scene identifier in the received management frame is less than or equal to the signal strength threshold corresponding to the scene identifier. That is, the electronic device will not enter the identification of the next scene identifier, execute the operation, etc. unless it switches out of the previous scene identifier.

[0187] If the electronic device recognizes that there is no conflict in the operations corresponding to the scene identifiers in multiple management frames, for example, the electronic device is located in the intersection area of ​​wireless router A (setting conference room scene, silent mode) and wireless router C (setting payment scene, payment jump prompt). In this case, the electronic device can perform operations that do not conflict. That is, the electronic device first switches to silent mode, and when the screen is switched from off to on, a jump prompt is displayed to prompt the user to jump to the payment interface.

[0188] The control method of the electronic device provided in the embodiment of the present application includes:

[0189] The electronic device receives a first management frame, where the first management frame is a first beacon frame or a first probe data frame;

[0190] The electronic device parses the first management frame to obtain a scene identifier;

[0191] The electronic device performs an operation corresponding to the scene identifier parsed in the first management frame based on the scene identifier parsed in the first management frame.

[0192] In the present application, the first management frame is sent by the wireless router. When a user carries an electronic device into the wireless signal coverage range of the wireless router, the electronic device can receive the management frame sent by the wireless router. The electronic device can parse the scene identifier from the received management frame, and then perform an operation corresponding to the scene identifier based on the parsed scene identifier, thereby achieving automatic control of the electronic device within the signal coverage range of the wireless router without the need for the user to operate the electronic device or for the electronic device to establish a wireless connection with the wireless router, and in the case of a wireless router.

[0193] In an implementation manner of the first aspect, before the electronic device performs an operation corresponding to the scene identifier parsed in the first management frame based on the scene identifier parsed in the first management frame, the method further includes:

[0194] The electronic device determines that the signal strength of the first management frame is greater than a first value, where the first value is a signal strength threshold corresponding to the scene identifier parsed in the first management frame.

[0195] In the present application, in order to reduce the occurrence of the following situation: electronic devices that are not in the space where the wireless router is located also automatically execute the operation corresponding to the scene identifier carried in the management frame sent by the wireless router, a signal strength threshold can be set, wherein different scene identifiers can correspond to different signal strength thresholds. When the electronic device determines that the signal strength of the received management frame is greater than the signal strength threshold corresponding to the parsed scene identifier, the operation corresponding to the scene identifier is executed.

[0196] In another implementation of the first aspect, the electronic device performs, based on the scene identifier parsed in the first management frame, an operation corresponding to the scene identifier parsed in the first management frame, including:

[0197] When the scene identifier parsed in the first management frame is the first scene identifier, the electronic device sets the electronic device to a silent mode based on the first scene identifier;

[0198] When the scene identifier parsed in the first management frame is a second scene identifier, the electronic device sets the electronic device to an airplane mode based on the second scene identifier;

[0199] When the scene identifier parsed in the first management frame is the third scene identifier, the electronic device sets a prompt message to be displayed when the electronic device switches from a screen-off state to a screen-on state based on the third scene identifier, and the prompt message is used to indicate a jump to a payment interface.

[0200] In the present application, different scene identifiers and different operations performed by the electronic device can be set according to the placement location of the wireless router, making the implementation of the present solution more flexible.

[0201] In another implementation manner of the first aspect, when the scene identifier parsed in the first management frame is a first scene identifier, the method further includes:

[0202] The electronic device records the BSSid carried in the first management frame where the first scene identifier is located, where the BSSid is the unique identifier of the wireless access point that sends the first management frame. Of course, in actual applications, other information can also be used as the unique identifier of the wireless access point to distinguish different wireless access points (AP).

[0203] In the present application, when the electronic device is in a certain scene, the unique identifier of the wireless access point that led to entering the scene can be recorded to subsequently determine whether to exit the scene (i.e., switch back to the initial mode, or exit to the state before executing the operation corresponding to the scene identifier).

[0204] In another implementation of the first aspect, after the electronic device sets the electronic device to a silent mode based on the first scene identifier, the method further includes:

[0205] The electronic device receives a second management frame, where the second management frame is a second beacon frame or a second probe data frame;

[0206] The electronic device identifies a BSSid of the received second management frame;

[0207] The electronic device determines that the BSSid of the second management frame is consistent with the recorded BSSid of the first management frame;

[0208] Determining, by the electronic device, that the signal strength of the second management frame is less than or equal to a first value, where the first value is a signal strength threshold corresponding to the scene identifier identified in the first management frame;

[0209] The electronic device is switched to an initial mode, where the initial mode is a mode before the electronic device is switched to the flight mode.

[0210] In the present application, since the electronic device may continuously broadcast beacon frames, when the electronic device is in a certain scenario (for example, it is always in a conference room), it may continue to receive beacon frames sent by the wireless router that carry the same scene identifier. In this case, if the BSSid of the newly received management frame is consistent with the management frame that causes the current scene, there is no need to continue to identify the scene identifier, but instead continue to check the signal strength of the second management frame with the same BSSid that is most recently received, so as to exit the current scene and return to the initial mode when the signal strength is low.

[0211] In another implementation of the first aspect, after the electronic device determines that the signal strength of the second management frame is less than or equal to the first value, the method further includes:

[0212] The electronic device deletes the recorded BSSid of the first management frame.

[0213] In this application, when the electronic device exits the current scene, it is also necessary to delete the BSSid of the management frame corresponding to the current scene.

[0214] In another implementation of the first aspect, after the electronic device sets the electronic device to a silent mode based on the first scene identifier, the method further includes:

[0215] If the electronic device does not receive a management frame within the first time period, or the BSSid identified in the management frame received within the first time period is inconsistent with the BSSid recorded in the first management frame, the electronic device switches to an initial mode, and the initial mode is the mode before the electronic device switches to the flight mode.

[0216] In this application, in order to improve the user experience, it can also be set that when the user leaves the space where the wireless router is located, the electronic device automatically exits the scene and returns to the initial state, that is, switches back to the initial mode or (under triggering conditions) no longer performs the corresponding operation. Therefore, the conditions for the electronic device to switch back to the initial mode are set.

[0217] Since the wireless router sends the beacon frame periodically, the first duration may be set as the time threshold.

[0218] In another implementation of the first aspect, if the electronic device does not receive a management frame within the first duration, or a BSSid identified in a management frame received within the first duration is inconsistent with a BSSid of the recorded first management frame, the method further includes:

[0219] The electronic device deletes the recorded BSSid of the first management frame.

[0220] In another implementation of the first aspect, the electronic device performs an operation corresponding to the scene identifier parsed in the first management frame based on the scene identifier parsed in the first management frame, and then the method further includes:

[0221] The electronic device receives a third management frame, where the third management frame is a third beacon frame or a third probe data frame;

[0222] The electronic device parses the scene identifier from the third management frame;

[0223] The electronic device determines the BSSid in which the first management frame is recorded;

[0224] The electronic device determines that an operation corresponding to the scene identifier parsed from the first management frame and an operation corresponding to the scene identifier parsed from the third management frame conflict, wherein the electronic device records the conflicting operation;

[0225] The electronic device does not perform the operation corresponding to the scene identifier in the third management frame;

[0226] Alternatively, the electronic device sends a prompt message, where the prompt message is used to prompt the user to select one of the conflicting operations, and the electronic device receives the operation selected by the user and executes the operation selected by the user.

[0227] In the present application, the management frames sent by two wireless routers in the overlapping area may both carry scene identifiers. Therefore, the electronic device may receive a management frame carrying the scene identifier of another scene when it is in a certain scene. If the operations performed in the two scenes conflict, for example, one operation is to switch to flight mode and the other operation is to switch to silent mode, in this case, the electronic device can be set not to perform the newly identified scene without exiting the previous scene, or a prompt message can be sent to the user to allow the user to choose the operation performed by the electronic device according to the actual situation.

[0228] In another implementation of the first aspect, the electronic device performs an operation corresponding to the scene identifier parsed in the first management frame based on the scene identifier parsed in the first management frame, and then the method further includes:

[0229] The electronic device receives a third management frame, where the third management frame is a third beacon frame or a third probe data frame;

[0230] The electronic device parses the scene identifier from the third management frame;

[0231] The electronic device determines the BSSid in which the first management frame is recorded;

[0232] The electronic device determines that there is no conflict between the operation corresponding to the scene identifier parsed from the first management frame and the operation corresponding to the scene identifier parsed from the third management frame, wherein the electronic device records the conflicting operation;

[0233] The electronic device executes an operation corresponding to the scene identifier in the third management frame.

[0234] In the present application, if the operations performed in the two scenes do not conflict, the electronic device can also perform the operation corresponding to the newly detected scene (or scene identifier) ​​without exiting the previous scene (or scene identifier).

[0235] In another implementation manner of the first aspect, the scenario identifier is located in a VendorSpecific of the management frame.

[0236] In this application, there is no need to modify the communication protocol of the wireless router. Instead, the scene identifier is summarized and set in the fields reserved for suppliers in the existing communication protocol to facilitate promotion.

[0237] An embodiment of the present application provides a control method for an electronic device, including:

[0238] The wireless router sends a first management frame, which is a first beacon frame or a first probe data frame. The first management frame carries a scene identifier, and the scene identifier is used to instruct the electronic device that receives the first management frame to perform an operation corresponding to the scene identifier.

[0239] In an implementation manner of the second aspect, the scenario identifier is located in a VendorSpecific of the management frame.

[0240] The first, second, third, etc. in the embodiments of the present application are used for distinction and are not used for special limitation.

[0241] The embodiment of the present application also provides a wireless router, which can execute the steps executed by the router side in the above method embodiment.

[0242] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.

[0243] The embodiment of the present application further provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments can be implemented.

[0244] The embodiment of the present application also provides a computer program product. When the computer program product is run on an electronic device or a wireless router, the electronic device can implement the steps in the above-mentioned various method embodiments.

[0245] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present application implements all or part of the processes in the above-mentioned embodiment method, which can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may at least include: any entity or device capable of carrying the computer program code to the first device, a recording medium, a computer memory, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), an electric carrier signal, a telecommunication signal, and a software distribution medium. For example, a USB flash drive, a mobile hard disk, a magnetic disk or an optical disk. In some jurisdictions, according to legislation and patent practice, computer-readable media cannot be electric carrier signals and telecommunication signals.

[0246] The embodiment of the present application also provides a chip system, the chip system includes a processor, the processor is coupled to a memory, and the processor executes a computer program stored in the memory to implement the steps of any method embodiment of the present application. The chip system can be a single chip or a chip module composed of multiple chips.

[0247] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0248] Those of ordinary skill in the art will appreciate that the units and method steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0249] The above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.

Claims

1. A control method for an electronic device, characterized in that: include: The electronic device receives a first management frame, where the first management frame is a first beacon frame or a first probe data frame; The electronic device parses the first management frame to obtain a scene identifier; The electronic device performs, based on the scene identifier parsed in the first management frame, an operation corresponding to the scene identifier parsed in the first management frame; When the electronic device is in a scene corresponding to the scene identifier parsed by the first management frame, the electronic device receives a third management frame, where the third management frame is a third beacon frame or a third probe data frame, and the third management frame and the first management frame are sent by different wireless access points; The electronic device parses the scene identifier from the third management frame; When the electronic device determines that there is no conflict between the operation corresponding to the scene identifier parsed from the first management frame and the operation corresponding to the scene identifier parsed from the third management frame, the electronic device performs the operation corresponding to the scene identifier in the third management frame; In a case where the electronic device determines that an operation corresponding to the scene identifier parsed from the first management frame and an operation corresponding to the scene identifier parsed in the third management frame conflict, wherein the electronic device records conflicting operations, and the conflicting operations include the operation corresponding to the scene identifier parsed in the first management frame and the operation corresponding to the scene identifier parsed in the third management frame; The electronic device does not perform the operation corresponding to the scene identifier in the third management frame; Alternatively, the electronic device sends a first prompt message, the first prompt message is used to prompt the user to select one of the conflicting operations, and the electronic device receives the operation selected by the user and executes the operation selected by the user; The operations corresponding to the scene identifier include: Setting the electronic device to silent mode; Setting the electronic device to flight mode; The electronic device is configured to display a second prompt message when the screen-off state switches to the screen-on state, wherein the second prompt message includes an instruction to jump to a payment interface.

2. The method according to claim 1, characterized in that Before the electronic device performs, based on the scene identifier parsed in the first management frame, an operation corresponding to the scene identifier parsed in the first management frame, the method further includes: The electronic device determines that the signal strength of the first management frame is greater than a first value, where the first value is a signal strength threshold corresponding to the scene identifier parsed in the first management frame.

3. The method according to claim 1 or 2, characterized in that The electronic device performs, based on the scene identifier parsed in the first management frame, an operation corresponding to the scene identifier parsed in the first management frame, further comprising: When the scene identifier parsed in the first management frame is the first scene identifier, the electronic device sets the electronic device to a silent mode based on the first scene identifier, and the electronic device is in a scene corresponding to the scene identifier parsed by the first management frame; When the scene identifier parsed in the first management frame is a second scene identifier, the electronic device sets the electronic device to an airplane mode based on the second scene identifier, and the electronic device is in a scene corresponding to the scene identifier parsed in the first management frame; When the scene identifier parsed in the first management frame is the third scene identifier, the electronic device displays prompt information when the electronic device switches from a screen-off state to a screen-on state based on the third scene identifier, and the prompt information is used to indicate a jump to a payment interface. The electronic device is in a scene corresponding to the scene identifier parsed by the first management frame.

4. The method according to claim 3, characterized in that When the scene identifier parsed in the first management frame is a first scene identifier, the method further includes: The electronic device records the BSSid carried in the first management frame where the first scenario identifier is located, where the BSSid is a unique identifier of a wireless access point that sends the first management frame.

5. The method according to claim 4, characterized in that After the electronic device sets the electronic device to a silent mode based on the first scene identifier, the method further includes: The electronic device receives a second management frame, where the second management frame is a second beacon frame or a second probe data frame; The electronic device identifies a BSSid of the received second management frame; The electronic device determines that the BSSid of the second management frame is consistent with the recorded BSSid of the first management frame; Determining, by the electronic device, that the signal strength of the second management frame is less than or equal to a first value, where the first value is a signal strength threshold corresponding to the scene identifier identified in the first management frame; The electronic device switches to an initial mode, where the initial mode is a mode before the electronic device switches to the flight mode, and the electronic device is no longer in a scene corresponding to a scene identifier parsed by the first management frame.

6. The method according to claim 5, characterized in that After the electronic device determines that the signal strength of the second management frame is less than or equal to the first value, the method further includes: The electronic device deletes the recorded BSSid of the first management frame, and the electronic device is no longer in the scene corresponding to the scene identifier parsed by the first management frame.

7. The method according to claim 4, characterized in that After the electronic device sets the electronic device to a silent mode based on the first scene identifier, the method further includes: If the electronic device does not receive a management frame within the first time period, or the BSSid identified in the management frame received within the first time period is inconsistent with the BSSid recorded in the first management frame, the electronic device switches to an initial mode, and the initial mode is the mode before the electronic device switches to the flight mode, and the electronic device is no longer in the scene corresponding to the scene identifier parsed by the first management frame.

8. The method according to claim 7, characterized in that If the electronic device does not receive a management frame within the first duration, or the BSSid identified in the management frame received within the first duration is inconsistent with the BSSid of the recorded first management frame, the method further includes: The electronic device deletes the recorded BSSid of the first management frame, and the electronic device is no longer in the scene corresponding to the scene identifier parsed by the first management frame.

9. The method according to claim 1, wherein: The scenario identifier is located in the VendorSpecific of the management frame.

10. An electronic device, characterized in that: The electronic device comprises a processor, and the processor is used to run a computer program stored in a memory, so that the electronic device implements the method according to any one of claims 1 to 9.

11. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by one or more processors, the method according to any one of claims 1 to 9 is implemented.

Citation Information

Patent Citations

  • Automatic switching method of profile

    CN104219387A

  • WiFi access control method, device and equipment, and storage medium

    CN108834164A

  • Wi-Fi connection method and Wi-Fi connection device

    CN111132137A