Short-distance communication method of mobile device, electronic device and storage medium
By adjusting the frequency of short-distance scanning according to the location and status of the mobile device, the increase in power consumption caused by frequent scanning of mobile devices in short-distance communication is solved, achieving longer battery life and better user experience.
Patent Information
- Application Number
- CN202311451666.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-02
- Publication Date
- 2025-05-06
AI Technical Summary
Frequent scanning of mobile devices during short-distance communication results in increased power consumption, affecting battery life and user experience.
Depending on the location and status of the mobile device, the short-distance communication module is turned on under preset conditions and the short-distance scanning frequency is adjusted until the target device is discovered.
By reducing frequent scanning during short-distance communication, we reduce power consumption and waste of mobile devices, extend battery life and improve user experience.
Smart Images

Figure CN119946592A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of short-distance communication, and in particular to a short-distance communication method for a mobile device, an electronic device and a storage medium. Background Art
[0002] With the advancement of technology and the development of society, mobile devices have become an indispensable part of people's lives. When using mobile devices, they can be connected to other devices through short-range communication to control other devices. For example, car-machine interconnection can be achieved through technologies such as Bluetooth, UWB and WIFI, thereby sending data instructions to control the vehicle to perform corresponding operations.
[0003] However, short-range communication between mobile devices and other devices requires steps such as scanning, discovery, connection, and transmission. During the scanning phase, the mobile device needs to scan frequently to discover the target device, which increases the power consumption burden of the mobile device, causing unnecessary power consumption waste, affecting battery life, and thus affecting the user experience.
[0004] Accordingly, the art requires a new short-range communication solution for mobile devices to solve the above problems. Summary of the invention
[0005] In order to overcome the above-mentioned defects, the present application is proposed to provide a short-range communication method, electronic device and storage medium for a mobile device to solve or at least partially solve the technical problem of power consumption waste caused by frequent scanning when the mobile device communicates with other devices over a short distance.
[0006] In a first aspect, a short-range communication method of a mobile device is provided, the method comprising:
[0007] Get the location and status of the mobile device;
[0008] When the location and state of the mobile device meet the preset conditions, the short-range communication module is turned on, and the short-range scanning frequency is adjusted until the target device is found;
[0009] Among them, the preset condition is that the location of the mobile device is within the preset range of the target device and the state of the mobile device meets the preset communication state; the state of the mobile device at least includes the startup state, the screen off state, the sleep state and the power saving state.
[0010] In a technical solution of the short-range communication method of the above mobile device, the method further includes:
[0011] When the position and state of the mobile device do not meet the preset conditions, the short-range communication module is not turned on, or the short-range communication module is turned on and short-range scanning is performed based on a first preset frequency.
[0012] In a technical solution of the short-distance communication method of the above mobile device, the preset communication state includes the startup state and the power saving state; and the adjusting the short-distance scanning frequency includes:
[0013] When the state of the mobile device is the startup state, gradually adjusting the short-range scanning frequency from the first preset frequency to the second preset frequency;
[0014] When the state of the mobile device is the power saving state, short-distance scanning is performed based on the first preset frequency.
[0015] In a technical solution of the short-distance communication method of the above mobile device, when the position and state of the mobile device do not meet the preset conditions, the short-distance communication module is not turned on:
[0016] When the location of the mobile device is not within the preset range of the target device and the state of the mobile device is the power saving state, the short-range communication module is not turned on. In a technical solution of the short-range communication method of the above mobile device, when the position and state of the mobile device do not meet the preset conditions, turning on the short-range communication module and performing short-range scanning based on a first preset frequency includes:
[0017] When the location of the mobile device is not within the preset range of the target device and the state of the mobile device is the startup state, the short-range communication module is turned on, and the short-range scanning is performed based on the first preset frequency. In a technical solution of the short-range communication method of the above mobile device, when the position and state of the mobile device do not meet the preset conditions, not turning on the short-range communication module further includes:
[0018] When the state of the mobile device does not satisfy the preset communication state, the short-range communication module is not enabled.
[0019] In a technical solution of the short-range communication method of the above mobile device, when the position and state of the mobile device meet a preset condition, the method further includes:
[0020] If the mobile device and the target device are located on the same floor, the short-range communication module is turned on and the short-range scanning frequency is adjusted.
[0021] In a technical solution of the short-range communication method of the mobile device, determining whether the position of the mobile device is within a preset range of the target device includes:
[0022] Obtaining the geographic fence of the area where the target device is located;
[0023] If the mobile device enters the geo-fence, determining that the location of the mobile device is within a preset range of the target device;
[0024] If the mobile device does not enter the geographic fence, it is determined that the location of the mobile device is not within the preset range of the target device.
[0025] In a technical solution of the short-range communication method of the above mobile device, gradually adjusting the short-range scanning frequency from the first preset frequency to the second preset frequency includes:
[0026] Obtaining the distance between the mobile device and the target device;
[0027] When the distance gradually decreases, gradually increasing the short-distance scanning frequency from the first preset frequency to the second preset frequency;
[0028] The first preset frequency is smaller than the second preset frequency.
[0029] In a technical solution of the short-range communication method of the above mobile device, if the mobile device and the target device are located on the same floor, before turning on the short-range communication module and adjusting the short-range scanning frequency, the method further includes:
[0030] Acquiring air pressure data of the mobile device;
[0031] It is determined whether the mobile device and the target device are located on the same floor based on the air pressure data of the mobile device.
[0032] In a second aspect, an electronic device is provided, which includes a processor and a storage device, wherein the storage device is suitable for storing multiple program codes, and the program codes are suitable for being loaded and run by the processor to execute the short-range communication method of the mobile device described in any one of the technical solutions of the short-range communication method of the above-mentioned mobile device.
[0033] In a third aspect, a computer-readable storage medium is provided, which stores a plurality of program codes, wherein the program codes are suitable for being loaded and run by a processor to execute the short-range communication method for a mobile device described in any one of the technical solutions of the short-range communication method for the above-mentioned mobile device.
[0034] Solution 1. A short-range communication method for a mobile device, characterized in that the method comprises:
[0035] Get the location and status of the mobile device;
[0036] When the location and state of the mobile device meet the preset conditions, the short-range communication module is turned on, and the short-range scanning frequency is adjusted until the target device is found;
[0037] Among them, the preset condition is that the location of the mobile device is within the preset range of the target device and the state of the mobile device meets the preset communication state; the state of the mobile device at least includes the startup state, the screen off state, the sleep state and the power saving state.
[0038] Solution 2. A short-range communication method for a mobile device according to Solution 1, characterized in that:
[0039] The method further comprises:
[0040] When the position and state of the mobile device do not meet the preset conditions, the short-range communication module is not turned on, or the short-range communication module is turned on and short-range scanning is performed based on a first preset frequency.
[0041] Solution 3. The short-distance communication method for a mobile device according to Solution 1, characterized in that the preset communication state includes the startup state and the power saving state; and the adjusting the short-distance scanning frequency includes:
[0042] When the state of the mobile device is the startup state, gradually adjusting the short-range scanning frequency from the first preset frequency to the second preset frequency;
[0043] When the state of the mobile device is the power saving state, short-distance scanning is performed based on the first preset frequency.
[0044] Solution 4. The short-distance communication method of a mobile device according to Solution 2, characterized in that when the position and state of the mobile device do not meet the preset conditions, not turning on the short-distance communication module comprises:
[0045] When the location of the mobile device is not within the preset range of the target device and the state of the mobile device is the power saving state, the short-range communication module is not turned on.
[0046] Solution 5. The short-distance communication method of a mobile device according to Solution 2, characterized in that when the position and state of the mobile device do not meet the preset conditions, turning on the short-distance communication module and performing short-distance scanning based on a first preset frequency includes:
[0047] When the location of the mobile device is not within the preset range of the target device and the state of the mobile device is the startup state, the short-range communication module is turned on, and the short-range scanning is performed based on the first preset frequency.
[0048] Solution 6. The short-distance communication method of a mobile device according to Solution 2, characterized in that when the position and state of the mobile device do not meet the preset conditions, not turning on the short-distance communication module further comprises:
[0049] When the state of the mobile device does not satisfy the preset communication state, the short-range communication module is not enabled.
[0050] Solution 7. The short-distance communication method of a mobile device according to Solution 1 is characterized in that when the position and state of the mobile device meet a preset condition, the method further comprises:
[0051] If the mobile device and the target device are located on the same floor, the short-range communication module is turned on and the short-range scanning frequency is adjusted.
[0052] Solution 8. The short-distance communication method for a mobile device according to Solution 1 or 2, characterized in that determining whether the position of the mobile device is within a preset range of the target device comprises:
[0053] Obtaining the geographic fence of the area where the target device is located;
[0054] If the mobile device enters the geo-fence, determining that the location of the mobile device is within a preset range of the target device;
[0055] If the mobile device does not enter the geographic fence, it is determined that the location of the mobile device is not within the preset range of the target device.
[0056] Solution 9. The short-range communication method for a mobile device according to Solution 3, characterized in that gradually adjusting the short-range scanning frequency from a first preset frequency to a second preset frequency comprises:
[0057] Obtaining the distance between the mobile device and the target device;
[0058] When the distance gradually decreases, gradually increasing the short-distance scanning frequency from the first preset frequency to the second preset frequency;
[0059] The first preset frequency is smaller than the second preset frequency.
[0060] Solution 10. The short-range communication method for a mobile device according to Solution 7 is characterized in that if the mobile device and the target device are located on the same floor, before turning on the short-range communication module and adjusting the short-range scanning frequency, the method further includes:
[0061] Acquiring air pressure data of the mobile device;
[0062] It is determined whether the mobile device and the target device are located on the same floor based on the air pressure data of the mobile device.
[0063] Scheme 11. An electronic device, comprising a processor and a storage device, wherein the storage device is suitable for storing multiple program codes, and is characterized in that the program codes are suitable for being loaded and run by the processor to execute the short-range communication method of the mobile device described in any one of Schemes 1 to 10.
[0064] Solution 12. A computer-readable storage medium storing a plurality of program codes, wherein the program codes are suitable for being loaded and run by a processor to execute the short-range communication method for a mobile device according to any one of Solutions 1 to 10.
[0065] The above one or more technical solutions of this application have at least one or more of the following Beneficial effects:
[0066] In the technical solution of the present application, the location and status of the mobile device are obtained. When the location and status of the mobile device meet the preset conditions, the short-distance communication module is turned on and the short-distance scanning frequency is adjusted until the target device is found; wherein the preset conditions are that the location of the mobile device is within the preset range of the target device and the status of the mobile device meets the preset communication status; the status of the mobile device includes at least the startup status, the screen-off status, the sleep status and the power saving status. Through the above implementation, the short-distance communication module can be turned on and the short-distance scanning frequency can be adjusted according to the location and status of the mobile device, thereby reducing the power consumption waste caused by frequent scanning of the mobile device during short-distance communication, enhancing the endurance of the mobile device, and improving the user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0067] The disclosure of the present application will become easier to understand with reference to the accompanying drawings. It is easy for those skilled in the art to understand that these drawings are only for illustrative purposes and are not intended to limit the scope of protection of the present application. Among them:
[0068] Figure 1 It is a schematic flow chart of main steps of a short-distance communication method of a mobile device according to an embodiment of the present application;
[0069] Figure 2 It is a flowchart of the main steps of determining whether the position of a mobile device is within a preset range of a target device according to an embodiment of the present application;
[0070] Figure 3 is a schematic diagram of a geo-fence of an area where a target device is located according to an embodiment of the present application;
[0071] Figure 4It is a schematic diagram of the main steps of gradually adjusting the short-distance scanning frequency from a first preset frequency to a second preset frequency according to an embodiment of the present application;
[0072] Figure 5 is a schematic diagram of an area where a target device is located according to an embodiment of the present application;
[0073] Figure 6 is a flowchart of main steps for determining whether a mobile device and a target device are located on the same floor according to an embodiment of the present application;
[0074] Figure 7 is a flowchart of main steps of a short-distance communication method for a mobile device according to another embodiment of the present application;
[0075] Figure 8 It is a schematic diagram of the main structure of an electronic device according to an embodiment of the present application.
[0076] List of reference numerals:
[0077] 801: processor; 802: storage device. DETAILED DESCRIPTION
[0078] Some embodiments of the present application are described below with reference to the accompanying drawings. Those skilled in the art should understand that these embodiments are only used to explain the technical principles of the present application and are not intended to limit the protection scope of the present application.
[0079] In the description of the present application, "processor" may include hardware, software or a combination of the two. The processor may be a central processing unit, a microprocessor, an image processor, a digital signal processor or any other suitable processor. The processor has data and / or signal processing functions. The processor may be implemented in software, hardware or a combination of the two. Non-temporary computer-readable storage media include any suitable medium that can store program code, such as a disk, a hard disk, an optical disk, a flash memory, a read-only memory, a random access memory, etc. The term "A and / or B" means all possible combinations of A and B, such as just A, just B or A and B. The term "at least one A or B" or "at least one of A and B" has a similar meaning to "A and / or B" and may include just A, just B or A and B.
[0080] Explain some terms involved in this application.
[0081] Mobile device: also known as mobile device, mobile device, handheld device, etc., is a pocket-sized computing device, usually with a small display screen, touch input or small keyboard input. Mobile devices mainly include smart phones, tablet computers, laptops, handheld terminals, walkie-talkies, MP3, MP4, wearable devices such as smart watches and smart glasses, etc.
[0082] Short-range communication: refers to the use of radio waves by the sender and receiver to transmit information underground within a range of tens of meters. Short-range communication can be carried out through technologies such as Wi-Fi, Bluetooth, ZigBee, IrDA, NFC and UWB ultra-wideband.
[0083] Geofencing: It is an application of LBS (Location Based Services), which uses a virtual fence to enclose a virtual geographic boundary. When a mobile device enters, leaves, or moves in a specific geographic area, the mobile device can receive automatic notifications and warnings.
[0084] As described in the background technology, short-range communication between mobile devices and other devices requires steps such as scanning, discovery, connection, and transmission. During the scanning stage, the mobile device needs to scan frequently to discover the target device, which increases the power consumption burden of the mobile device, causing unnecessary power consumption waste, affecting battery life, and thus affecting the user experience.
[0085] In order to solve the above problems, the present application provides a short-range communication method for a mobile device, an electronic device and a storage medium.
[0086] See attached Figure 1 , Figure 1 FIG. 1 is a flow chart of the main steps of a short-distance communication method for a mobile device according to an embodiment of the present application. Figure 1 As shown, the short-range communication method of a mobile device in the embodiment of the present application mainly includes the following steps S101 to S102.
[0087] Step S101: Obtain the location and status of the mobile device;
[0088] Step S102: When the location and state of the mobile device meet the preset conditions, the short-range communication module is turned on and the short-range scanning frequency is adjusted until the target device is found.
[0089] Among them, the preset conditions are that the location of the mobile device is within the preset range of the target device and the state of the mobile device meets the preset communication state; the state of the mobile device at least includes the startup state, the screen off state, the sleep state and the power saving state.
[0090] Based on the method described in steps S101 to S102 above, the short-range communication module can be turned on and the short-range scanning frequency can be adjusted according to the location and status of the mobile device, thereby reducing power consumption waste caused by frequent scanning of the mobile device during short-range communication, enhancing the battery life of the mobile device, and improving the user experience.
[0091] The above steps S101 to S102 are further explained below.
[0092] In some implementations of step S101, the status of the mobile device may be obtained through power information, power management information, network connection information, lock screen status, etc. of the mobile device.
[0093] Furthermore, the acquired state of the mobile device may include a startup state, a screen-off state, a sleep state, a power-saving state, and the like.
[0094] The startup state refers to the state after the mobile device is turned on and the user presses the power button or unlocks the screen. At this time, the screen of the mobile device is on, the system is in operation, and various operations can be performed;
[0095] The screen-off state means that the mobile device is in the locked state, the screen is turned off but the system is still running. At this time, the mobile device can receive notifications such as incoming calls and text messages, but cannot perform interactive operations.
[0096] Sleep state means that the mobile device is in the locked state, the screen is turned off and the system enters the dormant state. At this time, the mobile device consumes almost no power, but cannot receive notifications such as calls and text messages.
[0097] The power saving state refers to a low-power mode that a mobile device enters in order to save power, such as the power saving mode of the Android system and the low-power mode of the IOS system. In the power saving state, the mobile device will shut down some unnecessary functions and services and can only perform basic communications and functional operations to reduce power consumption and extend battery life.
[0098] It should be pointed out that the above examples of the status of mobile devices are only schematic illustrations. In actual applications, the status of mobile devices may also include standby status, flight status, etc. Those skilled in the art may set them according to specific scenarios, which is not limited here.
[0099] In some implementations of step S101, the location of the mobile device may be obtained based on a positioning service built into the mobile device, such as Find My iPhone of an IOS system and Find My Device of an Android system, which is not limited here.
[0100] Furthermore, based on the above method, only the status of the mobile device or only the location of the mobile device can be obtained, and subsequent steps can be performed based on the status of the mobile device or the location of the mobile device. Alternatively, both the status and location of the mobile device can be obtained at the same time, and subsequent steps can be performed based on the status and location of the mobile device. This is not limited here.
[0101] The above is the description of step S101 , and the following is a further description of step S102 .
[0102] In some implementations of the above step S102, it is possible to determine whether the location and state of the mobile device meet a preset condition, and selectively enable the short-range communication module according to the determination result, and adjust the short-range scanning frequency until the target device is found. The preset condition is that the location of the mobile device is within a preset range of the target device and the state of the mobile device meets a preset communication state.
[0103] Specifically, it can be determined whether the location of the mobile device is within a preset range of the target device, and whether the state of the mobile device satisfies a preset communication state.
[0104] The target device may include a driving device, a smart home device, an NFC device, etc. The mobile device can control the target device to perform corresponding operations by performing short-range communication with the target device.
[0105] Further, in some embodiments, see the attached Figure 2 , Figure 2 1 is a flow chart of the main steps of determining whether the location of a mobile device is within a preset range of a target device according to an embodiment of the present application. Figure 2 As shown, it mainly includes the following steps S201 to S204:
[0106] Step S201: Obtain the geographic fence of the area where the target device is located;
[0107] Geofencing is an application of LBS, which is to use a virtual fence to enclose a virtual geographic boundary. Taking the target device as a driving device as an example, the geofence is the virtual boundary of the parking lot geographic area. The geofence can be dynamically generated (such as a radius around a point location) or matched to a set of predefined boundaries. Specifically, the geofence of the target device's location can be obtained through map data.
[0108] In some embodiments, see Appendix Figure 3 , Figure 3 It is a schematic diagram of a geographic fence of an area where a target device is located according to an embodiment of the present application.
[0109] Step S202: Determine whether the mobile device enters the geographic fence.
[0110] Specifically, when a mobile device turns on the relevant location service, it can receive automatic notifications and warnings when entering, leaving, or moving within the geo-fence of a specific geographic area. Geofencing technology can help users automatically register when entering a certain area, so it can be determined whether the mobile device has entered the geo-fence of the area where the target device is located.
[0111] Further, if the mobile device enters the geographic fence of the area where the target device is located, step S203 is executed; if the mobile device does not enter the geographic fence of the area where the target device is located, step S204 is executed.
[0112] Step S203: Determine whether the location of the mobile device is within a preset range of the target device.
[0113] Step S204: determining that the location of the mobile device is not within the preset range of the target device.
[0114] In some embodiments, the preset communication state of the mobile device may include a startup state and a power saving state. When the mobile device is in the preset communication state, it indicates that the user may need to establish short-distance communication with the target device through the mobile device. When the mobile device is in a non-preset communication state, i.e., a screen-off state and a sleep state, it indicates that the user may not need to establish short-distance communication with the target device through the mobile device.
[0115] Furthermore, when the location of the mobile device is within the preset range of the target device and the status of the mobile device meets the preset communication status, the short-range communication module can be turned on and the short-range scanning frequency can be selectively adjusted according to the status of the mobile device until the target device is found.
[0116] In some implementations, when the mobile device is in the startup state, the short-range scanning frequency may be gradually adjusted from the first preset frequency to the second preset frequency.
[0117] Specifically, when the mobile device enters the startup state of the geographic fence in the area where the target device is located, it means that the system of the mobile device is running, and the user may need to establish short-distance communication with the target device through the mobile device. At this time, the short-distance communication module of the mobile device can be turned on, and the short-distance scanning frequency can be gradually adjusted from the first preset frequency to the second preset frequency until the target device is found.
[0118] For further information, see Appendix Figure 4 , Figure 4 FIG. 1 is a flow chart of the main steps of gradually adjusting the short-distance scanning frequency from a first preset frequency to a second preset frequency according to an embodiment of the present application. Figure 4 As shown, it mainly includes the following steps S401 to S402:
[0119] Step S401: Obtain the distance between the mobile device and the target device;
[0120] Specifically, a corresponding positioning device or sensor can be set on the target device, such as a driving device, and the driving device and the mobile device can be connected to the same server. When the mobile device turns on the positioning service, the positions of the mobile device and the driving device can be obtained, and the distance between the mobile device and the target device can be further obtained.
[0121] Step S402: When the distance gradually decreases, the short-distance scanning frequency is gradually increased from a first preset frequency to a second preset frequency.
[0122] The first preset frequency is smaller than the second preset frequency.
[0123] In some implementations of step S402, since the location range of the geo-fence of the target device is relatively wide, if the mobile device enters the geo-fence and starts to perform short-distance scanning continuously, it will cause unnecessary power consumption. Therefore, according to the decrease in the distance between the mobile device and the target device, the time interval between adjacent short-distance scans can be determined, and the frequency of short-distance scanning can be gradually increased to find the target device as soon as possible.
[0124] Specifically, when the short-range communication module is turned on and the mobile device is far away from the target device, such as 100 meters, scanning can be performed at a first preset frequency. As the mobile device approaches the target device and the distance gradually decreases, the short-range scanning frequency is gradually increased from the first preset frequency to the second preset frequency.
[0125] Among them, the first preset frequency can be the default lower scanning frequency after the long-distance communication module is turned on, such as 20 seconds / time, and the second preset frequency can be the highest scanning frequency that the long-distance communication module can reach, such as 1 second / time, which is not limited here.
[0126] It should be noted that if the short-range communication module gradually increases based on the first preset frequency and finds the target device before reaching the second preset frequency, the mobile device can establish a connection with the target device, and the short-range communication module stops scanning to reduce power consumption of the mobile device.
[0127] In some implementations of step S402, the relationship between the distance between the mobile device and the target device and the scanning frequency of the short-range communication module may refer to an inverse proportional function, an exponential function, a logarithmic function, and the like.
[0128] Specifically, in the analytical expression of the inverse proportional function f(x)=k / x, k is a constant, x is the distance between the mobile device and the target device, and as the distance x decreases, the scanning frequency f(x) increases from the first preset frequency to the second preset scanning frequency; in the analytical expression of the logarithmic function f(x)=log a In x, a is a constant, and x is the distance between the mobile device and the target device. When 0<a<1, as the distance x decreases, the scanning frequency f(x) increases from the first preset frequency to the second preset scanning frequency. In the analytical expression of the exponential function f(x)=a x In the figure, a is a constant, x is the distance between the mobile device and the target device, and when 0<a<1, as the distance x decreases, the scanning frequency f(x) increases from the first preset frequency to the second preset scanning frequency.
[0129] In practical applications, those skilled in the art may set the first preset frequency and the second preset frequency according to specific scenarios and select corresponding functions to constrain the relationship between the distance between the mobile device and the target device and the scanning frequency of the short-range communication module, which is not limited here.
[0130] Through the above method, the power consumption waste of the mobile device can be reduced, the power consumption and response speed of the mobile device when searching for the target device can be effectively balanced, and the efficiency and reliability of short-distance communication can be improved.
[0131] In other implementations, when the mobile device is in a power saving state, short-range scanning may be performed based on a first preset frequency.
[0132] Specifically, when the mobile device enters the power saving state of the geographic fence in the area where the target device is located, it means that the mobile device is in a low power consumption mode and the power consumption loss of the mobile device needs to be reduced as much as possible. The user may need to establish short-distance communication with the target device through the mobile device. At this time, the short-distance communication module can be turned on and short-distance scanning can be performed based on the first preset frequency to reduce the power consumption loss of the mobile device and extend the battery life.
[0133] Among them, the first preset frequency is a lower frequency, such as 20 seconds / time, which is not limited here.
[0134] In some other implementations of the above step S102, when the location of the mobile device is within the preset range of the target device and the status of the mobile device satisfies the preset communication status, the area where the target device is located may also be a multi-story building. Figure 5 , Figure 5 is a schematic diagram of an area where a target device is located according to an embodiment of the present application.
[0135] like Figure 5As shown, the target driving device is parked on a certain floor of a multi-storey parking lot. At this time, if the location of the mobile device is within the parking lot geographic fence of the target driving device, the short-range communication mode is directly turned on for scanning, which may cause power consumption loss of the mobile device.
[0136] Therefore, when the area where the target device is located is a multi-story building, it is possible to determine whether the mobile device and the target device are located on the same floor, and perform corresponding operations based on the determination result.
[0137] In some embodiments, see Appendix Figure 6 , Figure 6 1 is a flow chart of the main steps of determining whether a mobile device and a target device are located on the same floor according to an embodiment of the present application. Figure 6 As shown, it mainly includes the following steps S601 to S602:
[0138] Step S601: Obtaining air pressure data of a mobile device;
[0139] Specifically, an air pressure sensor may be provided in the mobile device, and the air pressure data of the mobile device may be further acquired through the air pressure sensor.
[0140] Step S602: determining whether the mobile device and the target device are located on the same floor based on the air pressure data of the mobile device.
[0141] In some embodiments, the altitude of the mobile device can be calculated based on the air pressure data of the mobile device, and it is further determined whether the difference between the altitude of the mobile device and the altitude of the target device meets a preset error. If so, it is determined that the mobile device and the target device are on the same floor; otherwise, it is determined that the mobile device and the target device are not on the same floor.
[0142] In some embodiments, the air pressure data of the mobile device can be directly compared with the air pressure data of the floor where the target device is located to obtain the difference between the air pressure data of the mobile device and the air pressure data of the floor where the target device is located, and it is determined whether the difference meets the preset error. If so, it is determined that the mobile device and the target device are on the same floor; otherwise, it is determined that the mobile device and the target device are not on the same floor.
[0143] Furthermore, if the mobile device and the target device are located on the same floor, the short-range communication module is turned on and the short-range scanning frequency is adjusted until the target device is found.
[0144] The above is a further description of step S102.
[0145] Furthermore, the short-range communication method of a mobile device in an embodiment of the present application also includes: when the position and status of the mobile device do not meet the preset conditions, the short-range communication module is not turned on, or the short-range communication module is turned on and a short-range scan is performed based on a first preset frequency.
[0146] Among them, the location and status of the mobile device do not meet the preset conditions, including that the location of the mobile device is not within the preset range of the target device, or the status of the mobile device does not meet the preset communication status, that is, the status of the mobile device is off screen or sleep state.
[0147] Therefore, it can be determined whether the location of the mobile device is within the preset range of the target device.
[0148] In some embodiments, when the location of the mobile device is not within the preset range of the target device, it means that the location of the mobile device is not within the preset range of the target device, and the state of the mobile device satisfies the preset communication state, that is, the state of the mobile device is in the startup state or the power saving state, at this time, the corresponding operation can be performed according to the state of the mobile device.
[0149] Furthermore, in some implementations, when the location of the mobile device is not within a preset range of the target device and the mobile device is in a power saving state, the short-range communication module is not enabled.
[0150] Specifically, when the mobile device has not entered the geographic fence of the target device area and the mobile device is in power saving mode, it means that the user may not need to establish short-distance communication with the target device through the mobile device at this time, so the short-distance communication module can be turned off to avoid unnecessary power consumption of the mobile device.
[0151] In some implementations, when the location of the mobile device is not within a preset range of the target device and the mobile device is in an activated state, the short-range communication module is turned on and a short-range scan is performed based on a first preset frequency.
[0152] Specifically, when the mobile device has not entered the geographic fence of the target device area and the mobile device is in the started state, it means that the user may need to establish short-range communication with the target device through the mobile device. Therefore, the short-range communication module can be turned on and short-range scanning can be performed based on the first preset frequency to reduce the power consumption loss of the mobile device and extend the battery life.
[0153] In some embodiments, when the location of the mobile device is within the preset range of the target device, it means that the location of the mobile device is within the preset range of the target device, and the state of the mobile device does not meet the preset communication state, that is, the state of the mobile device is off-screen or sleep state, and the short-range communication module may not be turned on at this time.
[0154] That is, when the state of the mobile device does not satisfy the preset communication state, the short-range communication module is not turned on.
[0155] Specifically, when the mobile device enters the geo-fence of the target device area and the screen is off, the screen of the mobile device is turned off, indicating that the user may not need to establish short-distance communication with the target device through the mobile device. At this time, the short-distance communication module can be turned off to reduce the power consumption loss of the mobile device.
[0156] When the mobile device enters the geo-fence of the target device area and is in sleep mode, the system of the mobile device enters sleep mode, indicating that the user does not need to establish short-distance communication with the target device through the mobile device. At this time, the short-distance communication module can be turned off to reduce the power consumption loss of the mobile device.
[0157] In some embodiments, see Appendix Figure 7 , Figure 7 FIG. 1 is a flow chart of the main steps of a short-distance communication method for a mobile device according to another embodiment of the present application. Figure 7 As shown, it mainly includes the following steps S701 to S708:
[0158] Step S701: Obtain the location and status of the mobile device;
[0159] Step S702: Determine whether the location of the mobile device is within a preset range of the target device and whether the status of the mobile device satisfies a preset communication status;
[0160] Further, if yes, execute step S703, otherwise execute step S704.
[0161] Step S703: Determine whether the status of the mobile device is in the startup state;
[0162] Further, if yes, execute step S705, otherwise execute step S706.
[0163] Step S704: determining whether the location of the mobile device is within a preset range of the target device;
[0164] Further, if yes, execute step S707, otherwise execute step S708.
[0165] Step S705: Turn on the short-distance communication module, and gradually adjust the short-distance scanning frequency from the first preset frequency to the second preset frequency;
[0166] Step S706: Turn on the short-range communication module and perform short-range scanning based on a first preset frequency;
[0167] Step S707: Disable the short-range communication module;
[0168] Step S708: Determine whether the state of the mobile device is a power saving state;
[0169] Further, if yes, execute step S707, otherwise execute step S706.
[0170] The above is Figure 7 An illustration of a short-range communication method for a mobile device is shown.
[0171] Furthermore, in the short-range communication method of a mobile device provided in the present application, when the location of the mobile device is not within the preset range of the target device and the state of the mobile device does not meet the preset communication state, the short-range communication module is not turned on to avoid unnecessary power consumption loss.
[0172] Through the above implementation, the short-range communication module can be turned on and the short-range scanning frequency can be adjusted according to the location and status of the mobile device, thereby reducing the power consumption waste caused by frequent scanning of the mobile device during short-range communication, enhancing the battery life of the mobile device, and improving the user experience.
[0173] It should be pointed out that although the various steps in the above embodiments are described in a specific order, those skilled in the art can understand that in order to achieve the effect of the present application, different steps do not have to be executed in such an order. They can be executed simultaneously (in parallel) or in other orders. These changes are within the scope of protection of the present application.
[0174] It is understood by those skilled in the art that all or part of the processes in the method for implementing the above-mentioned embodiment of the present application can also 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 storage medium may include: any entity or device, medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory, random access memory, electrical carrier signal, telecommunication signal and software distribution medium, etc. that can carry the computer program code.
[0175] Furthermore, the present application also provides an electronic device. Figure 8 , Figure 8 Schematic diagram of the main structure of an electronic device according to an embodiment of the present application. Figure 8As shown, the electronic device in the embodiment of the present application mainly includes a processor 801 and a storage device 802. The storage device 802 can be configured to store a program for the short-distance communication method of the mobile device executing the above method embodiment, and the processor 801 can be configured to execute the program in the storage device 802, which includes but is not limited to the program for the short-distance communication method of the mobile device executing the above method embodiment. For ease of explanation, only the part related to the embodiment of the present application is shown. For specific technical details not disclosed, please refer to the method part of the embodiment of the present application.
[0176] In some possible implementations of the present application, the electronic device may include multiple processors 801 and multiple storage devices 802. The program for executing the short-distance communication method of the mobile device of the above method embodiment may be divided into multiple subprograms, and each subprogram may be loaded and run by the processor 801 to execute different steps of the short-distance communication method of the mobile device of the above method embodiment. Specifically, each subprogram may be stored in different storage devices 802, and each processor 801 may be configured to execute the programs in one or more storage devices 802 to jointly implement the short-distance communication method of the mobile device of the above method embodiment, that is, each processor 801 executes different steps of the short-distance communication method of the mobile device of the above method embodiment, to jointly implement the short-distance communication method of the mobile device of the above method embodiment.
[0177] The above-mentioned multiple processors 801 may be processors deployed on the same device. For example, the above-mentioned electronic device may be a high-performance device composed of multiple processors, and the above-mentioned multiple processors 801 may be processors configured on the high-performance device. In addition, the above-mentioned multiple processors 801 may also be processors deployed on different devices. For example, the above-mentioned electronic device may be a server cluster, and the above-mentioned multiple processors 801 may be processors on different servers in the server cluster.
[0178] Furthermore, the present application also provides a computer-readable storage medium. In a computer-readable storage medium embodiment according to the present application, the computer-readable storage medium may be configured to store a program for the short-range communication method of the mobile device executing the above-mentioned method embodiment, and the program may be loaded and run by the processor to implement the short-range communication method of the above-mentioned mobile device. For ease of explanation, only the parts related to the embodiment of the present application are shown. For specific technical details not disclosed, please refer to the method part of the embodiment of the present application. The computer-readable storage medium may be a storage device formed by various electronic devices. Optionally, the computer-readable storage medium in the embodiment of the present application is a non-temporary computer-readable storage medium.
[0179] It should be noted that the relevant user personal information that may be involved in the various embodiments of the present application is strictly in accordance with the requirements of laws and regulations, following the principles of legality, legitimacy and necessity, based on the reasonable purposes of business scenarios, to process the personal information that users actively provide during the use of products / services or generated due to the use of products / services, as well as the personal information obtained with the user's authorization.
[0180] The user personal information processed by this application will vary depending on the specific product / service scenario, and shall be based on the specific scenario in which the user uses the product / service, and may involve the user's account information, device information, driving information, vehicle information or other related information. This application will treat the user's personal information and its processing with a high degree of diligence.
[0181] This application attaches great importance to the security of user personal information and has taken reasonable and feasible security protection measures that meet industry standards to protect user information and prevent personal information from being accessed, disclosed, used, modified, damaged or lost without authorization.
[0182] So far, the technical solution of the present application has been described in conjunction with an embodiment shown in the accompanying drawings, but it is easy for those skilled in the art to understand that the protection scope of the present application is obviously not limited to these specific embodiments. Without departing from the principles of the present application, those skilled in the art can make equivalent changes or substitutions to the relevant technical features, and the technical solutions after these changes or substitutions will fall within the protection scope of the present application.
Claims
1. A short-distance communication method for a mobile device, characterized in that: The method comprises: Get the location and status of the mobile device; When the location and state of the mobile device meet the preset conditions, the short-range communication module is turned on, and the short-range scanning frequency is adjusted until the target device is found; Among them, the preset condition is that the location of the mobile device is within the preset range of the target device and the state of the mobile device meets the preset communication state; the state of the mobile device at least includes the startup state, the screen off state, the sleep state and the power saving state.
2. The short-distance communication method of a mobile device according to claim 1, characterized in that: The method further comprises: When the position and state of the mobile device do not meet the preset conditions, the short-range communication module is not turned on, or the short-range communication module is turned on and short-range scanning is performed based on a first preset frequency.
3. The short-distance communication method of a mobile device according to claim 1, characterized in that: The preset communication state includes the startup state and the power saving state; and the adjusting the short-distance scanning frequency includes: When the state of the mobile device is the startup state, gradually adjusting the short-range scanning frequency from the first preset frequency to the second preset frequency; When the state of the mobile device is the power saving state, short-distance scanning is performed based on the first preset frequency.
4. The short-distance communication method of a mobile device according to claim 2, characterized in that: When the position and state of the mobile device do not meet the preset conditions, not starting the short-range communication module includes: When the location of the mobile device is not within the preset range of the target device and the state of the mobile device is the power saving state, the short-range communication module is not turned on.
5. The short-distance communication method of a mobile device according to claim 2, characterized in that: When the position and state of the mobile device do not meet the preset conditions, turning on the short-range communication module and performing short-range scanning based on a first preset frequency includes: When the location of the mobile device is not within the preset range of the target device and the state of the mobile device is the startup state, the short-range communication module is turned on, and the short-range scanning is performed based on the first preset frequency.
6. The short-distance communication method of a mobile device according to claim 2, characterized in that: When the position and state of the mobile device do not meet the preset conditions, not turning on the short-range communication module also includes: When the state of the mobile device does not satisfy the preset communication state, the short-range communication module is not enabled.
7. The short-distance communication method of a mobile device according to claim 1, characterized in that: When the position and state of the mobile device meet a preset condition, the method further includes: If the mobile device and the target device are located on the same floor, the short-range communication module is turned on and the short-range scanning frequency is adjusted.
8. The short-distance communication method of a mobile device according to claim 1 or 2, characterized in that: Determining whether the location of the mobile device is within a preset range of the target device includes: Obtaining the geographic fence of the area where the target device is located; If the mobile device enters the geo-fence, determining that the location of the mobile device is within a preset range of the target device; If the mobile device does not enter the geographic fence, it is determined that the location of the mobile device is not within the preset range of the target device.
9. The short-distance communication method of a mobile device according to claim 3, characterized in that: The step of gradually adjusting the short-distance scanning frequency from a first preset frequency to a second preset frequency includes: Obtaining the distance between the mobile device and the target device; When the distance gradually decreases, gradually increasing the short-distance scanning frequency from the first preset frequency to the second preset frequency; The first preset frequency is smaller than the second preset frequency.
10. The short-distance communication method of a mobile device according to claim 7, characterized in that: If the mobile device and the target device are located on the same floor, before turning on the short-range communication module and adjusting the short-range scanning frequency, the method further includes: Acquiring air pressure data of the mobile device; It is determined whether the mobile device and the target device are located on the same floor based on the air pressure data of the mobile device.