Location service method, device, equipment and computer program product
By setting up electronic fence areas on location service devices and using low-power daemons to detect location changes, the high power consumption problem of devices in location sharing services for the elderly and children is solved, and low-power location sharing services are realized.
Patent Information
- Application Number
- CN202210962846.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-11
- Publication Date
- 2025-10-28
- Estimated Expiration
- 2042-08-11
AI Technical Summary
During location-sharing services for the elderly and/or children, the prolonged activity of electronic maps on location service devices leads to significant power consumption.
By setting up electronic fence areas on location service devices, it can be determined whether the device is in a stationary state. If so, the location service application is switched to a sleep state, and a low-power system-level daemon periodically detects location changes. When the application is detected to have crossed the fence area, it is woken up and the location is reported in real time.
While ensuring the accuracy of location sharing services, the power consumption of location service devices has been reduced, extending the device's usage time.
Smart Images

Figure CN115309254B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of location service technology, specifically to a location service method, apparatus, device, and computer program product. Background Technology
[0002] During location-sharing services, electronic maps need to constantly obtain the location of location-sharing devices and share this location with other parties. However, the monitoring process for the elderly and / or children is often lengthy, and prolonged activity of electronic maps on location-sharing devices can lead to significant power consumption. Therefore, a solution is needed to reduce the power consumption of location-sharing devices while ensuring the accuracy of location information. Summary of the Invention
[0003] This disclosure provides a location service method, apparatus, device, and computer program product.
[0004] In a first aspect, embodiments of this disclosure provide a location service method, comprising:
[0005] Obtain the location of the location service device;
[0006] Determine whether the location service device has switched to a stationary state based on its location;
[0007] After determining that the location service device has switched to a stationary state, a preset operation is performed through the location service application. The preset operation includes: determining a first electronic fence area around the location service device, sending a guardian request carrying the first electronic fence area to a first system-level daemon process, and switching the location service application to a dormant state. After receiving the guardian request, the first system-level daemon process detects changes in the location of the location service device, and sends a wake-up event to the location service application after detecting that the location service device has crossed the first electronic fence area.
[0008] Further, determining whether the location service device has switched to a stationary state based on its location includes:
[0009] When the location of the location service device does not exceed the second electronic fence area surrounding the location service device within a predetermined time range, the location service device is determined to switch to a stationary state; wherein, the second electronic fence area is less than or equal to the first electronic fence area.
[0010] Furthermore, the method also includes:
[0011] In response to a wake-up event received from the first system-level daemon, the location service application is switched from a dormant state to an active state;
[0012] Jump to the step of obtaining the location of the location service device and execute it.
[0013] Furthermore, the method also includes:
[0014] After determining that the location service device has switched to mobile mode, the process jumps to the step of obtaining the location of the location service device and executes it.
[0015] Furthermore, the method also includes:
[0016] The location of the location service device is reported to the server so that the server can generate the movement route of the location service device based on its location.
[0017] Furthermore, the method also includes:
[0018] In response to an event that the battery level of the location service device is lower than a preset battery threshold, when the location service device is in a mobile state, the frequency of reporting the location of the location service device to the cloud server is reduced.
[0019] Furthermore, the location service device includes a first processor core and a second processor core; the power consumption of the second processor core is less than that of the first processor core; the location service application runs on the first processor core; the method further includes:
[0020] The first system-level daemon process is registered with the operating system of the location service device, so that the first system-level daemon process runs on the second processor kernel of the location service device.
[0021] Furthermore, the method also includes:
[0022] A second system-level daemon is registered with the operating system of the location service device so that the server's location service can push a wake-up request to the second system-level daemon, and the second system-level daemon can send a wake-up event to the location service application after receiving the wake-up request.
[0023] Secondly, this disclosure provides a location service device, including a first processor core and a second processor core; the power consumption of the first processor core is higher than that of the second processor core; wherein:
[0024] A location service application is executed on the first processor core to implement the method described in the first aspect;
[0025] A first system-level daemon process for waking up the location service application is executed on the second processor core.
[0026] Furthermore, it also includes: a positioning module; wherein,
[0027] The positioning module is used to measure the positioning information of the location service device and calculate the location of the location service device based on the positioning information;
[0028] The first system-level daemon process determines whether the location service device crosses the first electronic fence area set by the location service application based on the location of the location service device calculated by the positioning module.
[0029] Thirdly, this disclosure provides a location service device, comprising:
[0030] The acquisition module is configured to acquire the location of the location service device.
[0031] The determination module is configured to determine whether the location service device has switched to a stationary state based on the location of the location service device;
[0032] The execution module is configured to perform a preset operation through the location service application after determining that the location service device has switched to a stationary state. The preset operation includes: determining a first electronic fence area surrounding the location service device, sending a guardian request carrying the first electronic fence area to a first system-level daemon process, and switching the location service application to a dormant state. After receiving the guardian request, the first system-level daemon process detects changes in the location of the location service device and sends a wake-up event to the location service application after detecting that the location service device has crossed the first electronic fence area.
[0033] The function can be implemented by hardware or by hardware executing corresponding software. The hardware or software includes one or more modules corresponding to the above function.
[0034] In one possible design, the above-described device includes a memory and a processor. The memory stores one or more computer instructions that support the device in performing the corresponding methods described above, and the processor is configured to execute the computer instructions stored in the memory. The device may also include a communication interface for communicating with other devices or communication networks.
[0035] Fourthly, embodiments of this disclosure provide an electronic device including a memory, a processor, and a computer program stored in the memory, wherein the processor executes the computer program to implement the method described in any of the above aspects.
[0036] Fifthly, embodiments of this disclosure provide a computer-readable storage medium for storing computer instructions used by any of the above-described devices, which, when executed by a processor, are used to implement the methods described in any of the above aspects.
[0037] In a sixth aspect, embodiments of this disclosure provide a computer program product comprising computer instructions which, when executed by a processor, are used to implement the methods described in any of the preceding aspects.
[0038] The technical solutions provided in this disclosure may have the following beneficial effects:
[0039] In this embodiment of the disclosure, during the provision of location services such as location sharing services, the location service application can obtain the location of the location service device in real time and determine whether the location service device is in a stationary state based on its location. If the location service device is in a stationary state, a preset operation is executed. This preset operation includes determining a first electronic fence area surrounding the location service device, sending a protection request carrying the first electronic fence area to a first system-level daemon process, and switching itself to a sleep state. After receiving the protection request, the first system-level daemon process periodically detects the location of the location service device and sends a wake-up event to the location service application after detecting that the location service device has switched from a stationary state to a mobile state. In this way, when the location service device is in a stationary state, the high-power location service application can be switched to a sleep state, and the low-power first system-level daemon process can periodically detect the location of the location service device. After detecting that the location service device has switched from a stationary state to a mobile state, the first system-level daemon process wakes up the location service application, which then detects the location of the location service device in real time, thereby reducing energy consumption during the location service process.
[0040] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this disclosure. Attached Figure Description
[0041] Other features, objects, and advantages of this disclosure will become more apparent from the following detailed description of non-limiting embodiments, taken in conjunction with the accompanying drawings. In the drawings:
[0042] Figure 1 A flowchart of a location service method according to an embodiment of the present disclosure is shown;
[0043] Figure 2 The diagram illustrates two ways in which a location service application is activated according to an embodiment of the present disclosure;
[0044] Figure 3 This diagram shows a structural block diagram of a location service device according to an embodiment of the present disclosure;
[0045] Figure 4 This diagram illustrates a location sharing service process according to an embodiment of the present disclosure.
[0046] Figure 5 This diagram shows a structural block diagram of a location service device according to an embodiment of the present disclosure;
[0047] Figure 6 This is a schematic diagram of the structure of an electronic device suitable for implementing a location service method according to an embodiment of the present disclosure. Detailed Implementation
[0048] In the following, exemplary embodiments of the present disclosure will be described in detail with reference to the accompanying drawings to enable those skilled in the art to readily implement them. Furthermore, for clarity, portions unrelated to the description of the exemplary embodiments have been omitted from the drawings.
[0049] In this disclosure, it should be understood that terms such as “comprising” or “having” are intended to indicate the presence of features, figures, steps, behaviors, components, parts or combinations thereof disclosed in this specification, and do not preclude the possibility of the presence or addition of one or more other features, figures, steps, behaviors, components, parts or combinations thereof.
[0050] It should also be noted that, unless otherwise specified, the embodiments and features described in this disclosure can be combined with each other. This disclosure will now be described in detail with reference to the accompanying drawings and embodiments.
[0051] The details of the embodiments of this disclosure are described in detail below through specific examples.
[0052] Figure 1 A flowchart illustrating a location service method according to an embodiment of the present disclosure is shown. Figure 1 As shown, the location service method includes the following steps:
[0053] In step S101, the location of the location service device is obtained;
[0054] In step S102, it is determined whether the location service device has switched to a stationary state based on its location.
[0055] In step S103, after determining that the location service device has switched to a stationary state, a preset operation is performed through the location service application. The preset operation includes: determining a first electronic fence area surrounding the location service device, sending a guardian request carrying the first electronic fence area to a first system-level daemon process, and switching the location service application to a dormant state. After receiving the guardian request, the first system-level daemon process detects changes in the location of the location service device, and sends a wake-up event to the location service application after detecting that the location service device has crossed the first electronic fence area.
[0056] In this embodiment, the location service method is executed on a location service device. A location service application is installed on the device and obtains the device's location in real time based on user authorization. The location service application can obtain the device's location through the positioning module on the device. After obtaining the device's location, it can be determined whether the device is in a stationary state.
[0057] In some embodiments, the location service device may include, but is not limited to, wearable smart devices and / or handheld electronic devices. The wearable smart devices may include, but are not limited to, smartwatches, smart bracelets, smart glasses, etc., and the handheld electronic devices may include, but are not limited to, mobile phones, tablets, etc.
[0058] In some embodiments, the location of a location service device can be determined by whether its location remains within a preset range over a predetermined time period. For example, if the location of the location service device does not exceed a range of 0-150 meters within the predetermined time period, then the location service device can be considered to have switched from a mobile state to a stationary state. A mobile state can be understood as the location of the location service device changing, at least not falling outside the preset range within the predetermined time period.
[0059] If the location service device is determined to have switched to a stationary state, the location service application can perform a preset operation, which may include, but is not limited to:
[0060] Determine a first electronic fence area surrounding the location service device and send a guardian request carrying the first electronic fence area to a first system-level daemon process;
[0061] Put the location service application into sleep mode;
[0062] Upon receiving a guardian request, the first system-level daemon process detects changes in the location of the location service device and sends a wake-up event to the location service application after detecting that the current location of the location service device has crossed the first electronic fence area.
[0063] In some embodiments, the first system-level daemon can determine whether the location service device has switched from a stationary state to a mobile state by detecting whether the location of the location service device crosses the first electronic fence area when the location service application is in a dormant state.
[0064] The first electronic fence area surrounding the location service device can be set based on the location of the location service device. For example, it can be set as a circular area with the location of the location service device as the center and a preset length as the radius, such as 250 meters.
[0065] It should be noted that the location service application obtains the location of the location service device in real time. After determining that the location service device is in a stationary state based on the currently obtained location, the first electronic fence area can be set based on the currently obtained location. The first electronic fence area includes the location information of the corresponding geographical area.
[0066] In some embodiments, the first system-level daemon can be pre-registered in the operating system, or registered by the location service application before sending the first electronic fence area, depending on actual needs, and is not limited here.
[0067] After sending a daemon request to the first system-level daemon, the location service application switches itself to a dormant state. It's important to note that while in dormant mode, the location service application no longer performs any operations, but it can receive wake-up events from the operating system. That is, the first system-level daemon can send a wake-up event to the location service application, thus switching it from dormant to active mode. This active state can be understood as the normal operating state of the location service application.
[0068] The first system-level daemon, being a system process within the operating system, remains active as long as the operating system is not shut down or restarted. Therefore, it can periodically detect the location of the location service device and determine whether it has switched from a stationary to a mobile state based on location changes. Once it confirms the device is mobile, it can wake up the location service application by sending a system-level wake-up event, allowing the application to detect the device's location in real time and report this information to the server. The server records the device's location, creating location log information that can be viewed by users with the appropriate permissions. This server can be a cloud server. For example, if the location service device is a mobile phone or children's smartwatch worn by an elderly person or child, their children or parents can view the location log information in real time, enabling remote monitoring.
[0069] In this embodiment of the disclosure, during the provision of location services such as location sharing services, the location service application can obtain the location of the location service device in real time and determine whether the location service device is in a stationary state based on its location. If the location service device is in a stationary state, a preset operation is executed. This preset operation includes determining a first electronic fence area surrounding the location service device, sending a protection request carrying the first electronic fence area to a first system-level daemon process, and switching itself to a sleep state. After receiving the protection request, the first system-level daemon process periodically detects the location of the location service device and sends a wake-up event to the location service application after detecting that the location service device has switched from a stationary state to a mobile state. In this way, when the location service device is in a stationary state, the high-power location service application can be switched to a sleep state, and the low-power first system-level daemon process can periodically detect the location of the location service device. After detecting that the location service device has switched from a stationary state to a mobile state, the first system-level daemon process wakes up the location service application, which then detects the location of the location service device in real time, thereby reducing energy consumption during the location service process.
[0070] In an optional implementation of this embodiment, step S102, namely the step of determining whether the location service device has switched to a stationary state based on the location of the location service device, further includes:
[0071] When the location of the location service device does not exceed the second electronic fence area surrounding the location service device within a predetermined time range, the location service device is determined to switch to a stationary state; wherein, the second electronic fence area is less than or equal to the first electronic fence area.
[0072] In this optional implementation, after the location service device crosses the first electronic fence area, it can be determined that it has switched from a stationary state to a mobile state. When the location service device switches from a mobile state to a stationary state, it can be determined by whether the location of the location service device is within a certain preset range around the location service device within a predetermined time range. For example, if the location of the location service device does not exceed the range of 0-150 meters within the predetermined time range, it can be considered that the location service device has switched from a mobile state to a stationary state.
[0073] Therefore, a second electronic fence area can be set up. If the location service device does not exceed the second electronic fence area within a predetermined time range, it can be considered that the location service device has switched to a stationary state, that is, the location service device is in a stationary state.
[0074] In an optional implementation of this embodiment, the method further includes the following steps:
[0075] In response to a wake-up event received from the first system-level daemon, the location service application is switched from a dormant state to an active state;
[0076] Jump to the step of obtaining the location of the location service device and execute it.
[0077] In this optional implementation, when the location service application is in a dormant state, it can receive a wake-up event from the first system-level daemon and switch its dormant state to an active state. In the active state, the location service application can restart real-time acquisition of the location of the location service device, determine whether the location service device is in a stationary state, and perform the aforementioned preset operations after determining that the location service device is in a stationary state. The location service application can repeat the above steps in the active state until it switches itself to a dormant state.
[0078] In an optional implementation of this embodiment, the method further includes the following steps:
[0079] After determining that the location service device has switched to mobile mode, the process jumps to the step of obtaining the location of the location service device and executes it.
[0080] In this optional implementation, the location service application obtains the location of the location service device in real time. If, based on this location, it determines that the location service device is not in a stationary state but is in a moving state, it can continue to obtain the real-time location of the location service device and determine whether the location service device is in a stationary state. If it is determined that the location service device is in a stationary state, the aforementioned preset operation is executed. When the location service application is in an active state, it can repeat the above steps until it switches to a dormant state.
[0081] In an optional implementation of this embodiment, the method further includes the following steps:
[0082] The location of the location service device is reported to the server so that the server can generate the movement route of the location service device based on its location.
[0083] In this optional implementation, the location service application obtains the location of the location service device in real time and reports the location of the location service device to the server. The server can record the location of the location service device and generate the movement route of the location service device. Based on the movement route, the server can provide location services such as location sharing to users with permissions to the location service device.
[0084] In an optional implementation of this embodiment, the method further includes the following steps:
[0085] In response to an event that the battery level of the location service device is lower than a preset battery threshold, when the location service device is in a mobile state, the frequency of reporting the location of the location service device to the cloud server is reduced.
[0086] In this optional implementation, the location service application typically obtains the location of the location service device in real time and uploads the obtained location to the server in real time. However, when the location service device's battery is low, if the location service device is in motion and the location service application is not in sleep mode, in order to further reduce the power consumption of the location service device, the frequency of reporting the location of the location service device to the server can be reduced. For example, the location service application obtains the location from the location service device's positioning module once per second. When the location service device's battery is higher than or equal to a preset battery threshold, it can report the location to the server once per second. When the location service device's battery is lower than the preset battery threshold, it can report the location to the server once every 10 seconds.
[0087] In an optional implementation of this embodiment, the location service device includes a first processor core and a second processor core; the power consumption of the second processor core is less than that of the first processor core; the location service application runs on the first processor core; the method further includes the following steps:
[0088] The first system-level daemon process is registered with the operating system of the location service device, so that the first system-level daemon process runs on the second processor kernel of the location service device.
[0089] In this optional implementation, the location service application can register a first system-level daemon with the operating system. This registration can occur either when the application starts or when the location service device is determined to be stationary. This first system-level daemon can run on the second processor core of the location service device. The location service device can include, but is not limited to, a first processor core and a second processor core. The first processor core can be a more powerful but power-intensive core, while the second processor core can be a less powerful but power-efficient core. For example, the first and second processor cores can be the large and small cores, respectively, in a large-core and small-core architecture of an electronic device. Because the location service application provides numerous functions and has high requirements for real-time performance and computational power, it can run on the first processor core. The first system-level daemon, however, only needs to detect the location of the location service device and determine whether the device has transitioned from a stationary to a mobile state when the application is in a dormant state. Therefore, its requirements for kernel computational power are not high, and the first system-level daemon can be registered and run on the second processor core to further reduce the energy consumption of the location service.
[0090] In an optional implementation of this embodiment, the method further includes the following steps:
[0091] A second system-level daemon is registered with the operating system of the location service device so that the server's location service can push a wake-up request to the second system-level daemon, and the second system-level daemon can send a wake-up event to the location service application after receiving the wake-up request.
[0092] In this optional implementation, the location service application can also register a second system-level daemon with the operating system of the location service device. After receiving a wake-up request pushed by the server's location service, the second system-level daemon sends a wake-up event to the location service application.
[0093] In this embodiment, the location service application enters a dormant state after the location service device is in a dormant state. This is to reduce unnecessary power consumption caused by the location service application. However, the application continues to provide location services, such as location sharing, even in dormant mode. If the location service device remains in a dormant state for an extended period, such as several hours, a second system-level daemon process can be registered in the operating system to ensure the data accuracy of location services like location sharing. The server's location service can then send a wake-up request to this daemon process via a socket interface. Upon receiving the wake-up request, the second daemon process will also send a wake-up event to the location service application, waking it from dormant to active mode. Since the location service application continuously monitors the location of the device and uploads the data to the server when active, this method allows the server's location service to send a wake-up request to the second system-level daemon process when the location service application is dormant for an extended period. For example, if the server determines that the location information of the device has not been updated for a long time, the location service can send a wake-up request to the second system-level daemon process so that the location service application can switch to active mode and report the device's location to the server.
[0094] Figure 2 The diagram illustrates two methods in which a location service application is activated according to an embodiment of this disclosure. For example... Figure 2 As shown, location service applications can switch to a dormant state after the location service device is in a stationary state. In order to ensure that the location service application can accurately report the location of the location service device to the server and provide better location services to users, this disclosure proposes two ways to wake up the location service application from the dormant state.
[0095] One approach is hardware-driven wake-up, which is implemented by a first system-level daemon process registered in the operating system. This daemon process obtains the location of the location service device from its positioning module. The positioning module can include, but is not limited to, positioning-related hardware structures (such as satellite positioning chips), the system positioning kernel, and the positioning interface layer. The first system-level daemon process obtains the location of the location service device from the positioning interface layer.
[0096] Another approach is remote wake-up. In this method, the server's location service can send a wake-up request to a second system-level daemon running on the location service device when needed. Upon receiving the wake-up request, the second system-level daemon wakes up the location service application, switching it from a dormant state to an active state. It's important to note that the second system-level daemon, similar to the first system-level daemon, is a system-level process and can run on a lower-power second processor core.
[0097] Figure 3 A structural block diagram of a location service device according to an embodiment of the present disclosure is shown. Figure 3 As shown, the location service device includes: a first processor core and a second processor core; the power consumption of the first processor core is higher than that of the second processor core; wherein:
[0098] The location service application is executed on the first processor core to implement the above location service method;
[0099] A first system-level daemon process for waking up the location service application is executed on the second processor core.
[0100] In this embodiment, the processor of the location service device can be a multi-core processor, and this multi-core processor may include, but is not limited to, a first processor core and a second processor core. The first processor core can be relatively powerful, capable of meeting the needs of applications providing location services such as electronic maps, while the second processor core can be a relatively weak core with low power consumption, on which processes with low computing power requirements can run, such as the first system-level daemon process and / or the second system-level daemon process mentioned in the embodiments of this disclosure. It should be noted that the first system-level daemon process and the second system-level daemon process can run on the same core or on different cores.
[0101] The location service application runs on the first processor core, while the first system-level daemon and / or the second system-level daemon run on the second processor core.
[0102] A location service application is installed on the location service device and obtains the device's location in real time based on user authorization. The location service application can obtain the device's location through the positioning module on the device. After obtaining the device's location, it can determine whether the device is in a stationary state.
[0103] In some embodiments, whether a location service device is in a stationary state at a certain location can be determined by whether the location of the location service device is within a certain preset range within a predetermined time range. For example, if the location of the location service device does not exceed the range of 0-150 meters within the predetermined time range, then the location service device can be considered to be in a stationary state.
[0104] If the location service device is determined to be in a stationary state, the location service application may perform a preset action, which may include, but is not limited to:
[0105] Determine a first electronic fence area surrounding the location service device and send a guardian request carrying the first electronic fence area to a first system-level daemon process;
[0106] Put the location service application into sleep mode;
[0107] Upon receiving a guardian request, the first system-level daemon process detects changes in the location of the location service device and sends a wake-up event to the location service application after detecting that the current location of the location service device has crossed the first electronic fence area.
[0108] In some embodiments, the first system-level daemon can be pre-registered in the operating system, or registered by the location service application before sending the first electronic fence area, depending on actual needs, and is not limited here.
[0109] After sending a daemon request to the first system-level daemon, the location service application switches itself to a dormant state. It's important to note that while in dormant mode, the location service application no longer performs any operations, but it can receive wake-up events from the operating system. That is, the first system-level daemon can send a wake-up event to the location service application, thus switching it from dormant to active mode. This active state can be understood as the normal operating state of the location service application.
[0110] The first system-level daemon, being a system process within the operating system, remains active as long as the operating system is not shut down or restarted. Therefore, the first system-level daemon can periodically detect the location of the location service device and determine whether the device has switched from a stationary state to a mobile state based on location changes. Once it determines the device is in a mobile state, it can wake up the location service application by sending a system-level wake-up event, enabling the application to detect the device's location in real time and report this information to the server. The server can record the device's location, creating location record information that can be viewed by users with the relevant permissions. For example, if the device is a mobile phone or children's smartwatch carried by an elderly person or / or child, the children or parents can view the location record information in real time, allowing for remote monitoring. Further details in this embodiment can be found in the description of the location service method above, and will not be repeated here.
[0111] In this embodiment of the disclosure, during the provision of location services such as location sharing services, the location service application can obtain the location of the location service device in real time and determine whether the location service device is in a stationary state based on its location. If the location service device is in a stationary state, a preset operation is executed. This preset operation includes determining a first electronic fence area surrounding the location service device, sending a protection request carrying the first electronic fence area to a first system-level daemon process, and switching itself to a sleep state. After receiving the protection request, the first system-level daemon process periodically detects the location of the location service device and sends a wake-up event to the location service application after detecting that the location service device has switched from a stationary state to a mobile state. In this way, when the location service device is in a stationary state, the high-power location service application can be switched to a sleep state, and the low-power first system-level daemon process can periodically detect the location of the location service device. After detecting that the location service device has switched from a stationary state to a mobile state, the first system-level daemon process wakes up the location service application, which then detects the location of the location service device in real time, thereby reducing energy consumption during the location service process.
[0112] In an optional implementation of this embodiment, the location service device further includes: a positioning module; wherein,
[0113] The positioning module is used to measure the positioning information of the location service device and calculate the location of the location service device based on the positioning information;
[0114] The first system-level daemon process determines whether the location service device crosses the first electronic fence area set by the location service application based on the location of the location service device calculated by the positioning module.
[0115] In this optional implementation, the positioning module can be a satellite positioning module, such as GPS or BeiDou, which receives positioning information and calculates the location of the location service device based on the positioning information. The first system-level daemon process obtains the location of the location service device from the positioning module and determines whether the location service device has crossed a first electronic fence area based on the location. The first electronic fence area is the area where the location service device stays before the location service application goes into sleep mode. When the first system-level daemon process detects that the location service device has crossed the first electronic fence area, it considers that the location service device has changed from a stationary state to a moving state, and thus sends a wake-up event to the location service application to trigger the location service application to switch from a sleep state to an active state.
[0116] Figure 4 A schematic diagram of a location sharing service process according to an embodiment of this disclosure is shown. Figure 4 As shown, User B enables the automatic location recording function for family members on Phone A. User A carries Phone A, which has a location service application installed and running. The location service application detects User A's location and reports it to the server in real time. User B can view User A's location record through the server. When the location service application detects that User A has switched to a stationary state at location X, it sets a first electronic fence area and notifies the system-level daemon process to monitor User A's movement, while the location application service enters a dormant state. User B can see User A at location X through the server. If the system-level daemon process detects that User A's movement exceeds 250m, i.e., crosses the previously set first electronic fence area, it wakes up the location service application. The location service application automatically switches from dormant to awake state and begins detecting the location of location service devices and reporting it to the server. At this time, User B can see that User A has left location X and is moving. As User A continues to move, User B can see that User A is continuously moving; when User A's phone battery is low, the location reporting frequency decreases. After user B arrives at location Y, if the movement range does not exceed the second electronic fence area within 10 minutes, for example, the movement range does not exceed 150m within 10 minutes, the location service application will set the first electronic fence area again, send the first electronic fence area to the system-level daemon process, and then enter the sleep state again. The above steps are repeated to achieve uninterrupted recording of user A's location.
[0117] The following are embodiments of the apparatus disclosed herein, which can be used to execute embodiments of the method disclosed herein.
[0118] Figure 5 This diagram illustrates a structural block diagram of a location service device according to an embodiment of the present disclosure. This device can be implemented as part or all of an electronic device through software, hardware, or a combination of both. Figure 5 As shown, the location service device includes:
[0119] The acquisition module 501 is configured to acquire the location of the location service device;
[0120] The determination module 502 is configured to determine whether the location service device has switched to a stationary state based on the location of the location service device;
[0121] The execution module 503 is configured to perform a preset operation through the location service application after determining that the location service device has switched to a stationary state. The preset operation includes: determining a first electronic fence area around the location service device, sending a guardian request carrying the first electronic fence area to a first system-level daemon process, and switching the location service application to a dormant state. After receiving the guardian request, the first system-level daemon process detects the location change of the location service device and sends a wake-up event to the location service application after detecting that the location service device has crossed the first electronic fence area.
[0122] In this embodiment, the location service device operates on a location service equipment. A location service application is installed on the location service equipment and obtains the location of the location service equipment in real time based on user authorization. The location service application can obtain the location of the location service equipment through the positioning module on the location service equipment. After obtaining the location of the location service equipment, it can be determined whether the location service equipment is in a stationary state.
[0123] In some embodiments, the location service device may include, but is not limited to, wearable smart devices and / or handheld electronic devices. The wearable smart devices may include, but are not limited to, smartwatches, smart bracelets, smart glasses, etc., and the handheld electronic devices may include, but are not limited to, mobile phones, tablets, etc.
[0124] In some embodiments, the location of a location service device can be determined by whether its location remains within a preset range over a predetermined time period. For example, if the location of the location service device does not exceed a range of 0-150 meters within the predetermined time period, then the location service device can be considered to have switched from a mobile state to a stationary state. A mobile state can be understood as the location of the location service device changing, at least not falling outside the preset range within the predetermined time period.
[0125] If the location service device is determined to have switched to a stationary state, the location service application can perform a preset operation, which may include, but is not limited to:
[0126] Determine a first electronic fence area surrounding the location service device and send a guardian request carrying the first electronic fence area to a first system-level daemon process;
[0127] Put the location service application into sleep mode;
[0128] Upon receiving a guardian request, the first system-level daemon process detects changes in the location of the location service device and sends a wake-up event to the location service application after detecting that the current location of the location service device has crossed the first electronic fence area.
[0129] In some embodiments, the first system-level daemon can determine whether the location service device has switched from a stationary state to a mobile state by detecting whether the location of the location service device crosses the first electronic fence area when the location service application is in a dormant state.
[0130] The first electronic fence area surrounding the location service device can be set based on the location of the location service device. For example, it can be set as a circular area with the location of the location service device as the center and a preset length as the radius, such as 250 meters.
[0131] It should be noted that the location service application obtains the location of the location service device in real time. After determining that the location service device is in a stationary state based on the currently obtained location, the first electronic fence area can be set based on the currently obtained location. The first electronic fence area includes the location information of the corresponding geographical area.
[0132] In some embodiments, the first system-level daemon can be pre-registered in the operating system, or registered by the location service application before sending the first electronic fence area, depending on actual needs, and is not limited here.
[0133] After sending a daemon request to the first system-level daemon, the location service application switches itself to a dormant state. It's important to note that while in dormant mode, the location service application no longer performs any operations, but it can receive wake-up events from the operating system. That is, the first system-level daemon can send a wake-up event to the location service application, thus switching it from dormant to active mode. This active state can be understood as the normal operating state of the location service application.
[0134] The first system-level daemon, being a system process within the operating system, remains active as long as the operating system is not shut down or restarted. Therefore, it can periodically detect the location of the location service device and determine whether it has switched from a stationary to a mobile state based on location changes. Once it confirms the device is mobile, it can wake up the location service application by sending a system-level wake-up event, allowing the application to detect the device's location in real time and report this information to the server. The server records the device's location, creating location log information that can be viewed by users with the appropriate permissions. This server can be a cloud server. For example, if the location service device is a mobile phone or children's smartwatch worn by an elderly person or child, their children or parents can view the location log information in real time, enabling remote monitoring.
[0135] In this embodiment of the disclosure, during the provision of location services such as location sharing services, the location service application can obtain the location of the location service device in real time and determine whether the location service device is in a stationary state based on its location. If the location service device is in a stationary state, a preset operation is executed. This preset operation includes determining a first electronic fence area surrounding the location service device, sending a protection request carrying the first electronic fence area to a first system-level daemon process, and switching itself to a sleep state. After receiving the protection request, the first system-level daemon process periodically detects the location of the location service device and sends a wake-up event to the location service application after detecting that the location service device has switched from a stationary state to a mobile state. In this way, when the location service device is in a stationary state, the high-power location service application can be switched to a sleep state, and the low-power first system-level daemon process can periodically detect the location of the location service device. After detecting that the location service device has switched from a stationary state to a mobile state, the first system-level daemon process wakes up the location service application, which then detects the location of the location service device in real time, thereby reducing energy consumption during the location service process.
[0136] In an optional implementation of this embodiment, the determining module includes:
[0137] The status determination submodule is configured to determine that the location service device switches to a stationary state when the location of the location service device does not exceed the second electronic fence area surrounding the location service device within a predetermined time range; wherein the second electronic fence area is less than or equal to the first electronic fence area.
[0138] In this optional implementation, after the location service device crosses the first electronic fence area, it can be determined that it has switched from a stationary state to a mobile state. When the location service device switches from a mobile state to a stationary state, it can be determined by whether the location of the location service device is within a certain preset range around the location service device within a predetermined time range. For example, if the location of the location service device does not exceed the range of 0-150 meters within the predetermined time range, it can be considered that the location service device has switched from a mobile state to a stationary state.
[0139] Therefore, a second electronic fence area can be set up. If the location service device does not exceed the second electronic fence area within a predetermined time range, it can be considered that the location service device has switched to a stationary state, that is, the location service device is in a stationary state.
[0140] In an optional implementation of this embodiment, the apparatus further includes:
[0141] The first response module is configured to switch the location service application from a dormant state to an active state in response to a wake-up event received from the first system-level daemon.
[0142] The first redirect module is configured to redirect to and execute the step of obtaining the location of the location service device.
[0143] In this optional implementation, when the location service application is in a dormant state, it can receive a wake-up event from the first system-level daemon and switch its dormant state to an active state. In the active state, the location service application can restart real-time acquisition of the location of the location service device, determine whether the location service device is in a stationary state, and perform the aforementioned preset operations after determining that the location service device is in a stationary state. The location service application can repeat the above steps in the active state until it switches itself to a dormant state.
[0144] In an optional implementation of this embodiment, the apparatus further includes:
[0145] The second jump module is configured to jump to and execute the step of obtaining the location of the location service device after determining that the location service device has switched to a mobile state.
[0146] In this optional implementation, the location service application obtains the location of the location service device in real time. If, based on this location, it determines that the location service device is not in a stationary state but is in a moving state, it can continue to obtain the real-time location of the location service device and determine whether the location service device is in a stationary state. If it is determined that the location service device is in a stationary state, the aforementioned preset operation is executed. When the location service application is in an active state, it can repeat the above steps until it switches to a dormant state.
[0147] In an optional implementation of this embodiment, the apparatus further includes:
[0148] The reporting module is configured to report the location of the location service device to the server, so that the server can generate the movement route of the location service device based on the location of the location service device.
[0149] In this optional implementation, the location service application obtains the location of the location service device in real time and reports the location of the location service device to the server. The server can record the location of the location service device and generate the movement route of the location service device. Based on the movement route, the server can provide location services such as location sharing to users with permissions to the location service device.
[0150] In an optional implementation of this embodiment, the apparatus further includes:
[0151] The second response module is configured to reduce the frequency of reporting the location of the location service device to the cloud server when the location service device is in a mobile state in response to an event that the battery level of the location service device is lower than a preset battery threshold.
[0152] In this optional implementation, the location service application typically obtains the location of the location service device in real time and uploads the obtained location to the server in real time. However, when the battery of the location service device is low, in order to further reduce the power consumption of the location service device, the frequency of reporting the location of the location service device to the server can be reduced. For example, the location service application obtains the location from the positioning module of the location service device once per second. When the battery of the location service device is higher than or equal to a preset battery threshold, the location can be reported to the server once per second. When the battery of the location service device is lower than the preset battery threshold, the location can be reported to the server once every 10 seconds.
[0153] In an optional implementation of this embodiment, the location service device includes a first processor core and a second processor core; the power consumption of the second processor core is less than that of the first processor core; the location service application runs on the first processor core; the device further includes:
[0154] The first registration module is configured to register the first system-level daemon process with the operating system of the location service device, so that the first system-level daemon process runs on the second processor kernel of the location service device.
[0155] In this optional implementation, the location service application can register a first system-level daemon with the operating system. This registration can occur either when the application starts or when the location service device is determined to be stationary. This first system-level daemon can run on the second processor core of the location service device. The location service device can include, but is not limited to, a first processor core and a second processor core. The first processor core can be a more powerful but power-intensive core, while the second processor core can be a less powerful but power-efficient core. For example, the first and second processor cores can be the large and small cores, respectively, in a large-core and small-core architecture of an electronic device. Because the location service application provides numerous functions and has high requirements for real-time performance and computational power, it can run on the first processor core. The first system-level daemon, however, only needs to detect the location of the location service device and determine whether the device has transitioned from a stationary to a mobile state when the application is in a dormant state. Therefore, its requirements for kernel computational power are not high, and the first system-level daemon can be registered and run on the second processor core to further reduce the energy consumption of the location service.
[0156] In an optional implementation of this embodiment, the apparatus further includes:
[0157] The second registration module is configured to register a second system-level daemon process with the operating system of the location service device, so that the server's location service pushes a wake-up request to the second system-level daemon process, and the second system-level daemon process sends a wake-up event to the location service application after receiving the wake-up request.
[0158] In this optional implementation, the location service application can also register a second system-level daemon with the operating system of the location service device. After receiving a wake-up request pushed by the server's location service, the second system-level daemon sends a wake-up event to the location service application.
[0159] In this embodiment, the location service application enters a sleep state after the location service device is in a dormant state. This is to reduce unnecessary power consumption caused by the location service application. However, the location service application still provides location services, such as location sharing services, even in the sleep state. If the location service device remains in a dormant state for an extended period, such as several hours, a second system-level daemon process can be registered in the operating system to ensure the data accuracy of location services such as location sharing. The server's location service can then send a wake-up request to the second system-level daemon process via a socket interface. Upon receiving the wake-up request, the second system-level daemon process will also send a wake-up event to the location service application to wake it from the sleep state to the active state. Since the location service application continuously monitors the location of the location service device and uploads the information to the server when in the active state, this method allows the server's location service to send a wake-up request to the second system-level daemon process when the location service application has been dormant for an extended period. For example, if the server determines that the location information of the location service device has not been updated for a long time, the location service can send a wake-up request to the second system-level daemon process so that the location service application can switch to the active state and report the location of the location service device to the server.
[0160] Figure 6 This is a schematic diagram of the structure of an electronic device suitable for implementing a location service method according to an embodiment of the present disclosure.
[0161] like Figure 6 As shown, the electronic device 600 includes a processing unit 601, which can be implemented as a CPU, GPU, FPGA, NPU, or other processing unit. The processing unit 601 can execute various processes according to any of the methods described above in this disclosure, based on a program stored in the read-only memory (ROM) 602 or a program loaded from the storage portion 608 into the random access memory (RAM) 603. The RAM 603 also stores various programs and data required for the operation of the electronic device 600. The processing unit 601, ROM 602, and RAM 603 are interconnected via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.
[0162] The following components are connected to I / O interface 605: an input section 606 including a keyboard, mouse, etc.; an output section 607 including a cathode ray tube (CRT), liquid crystal display (LCD), etc., and speakers, etc.; a storage section 608 including a hard disk, etc.; and a communication section 609 including a network interface card such as a LAN card, modem, etc. The communication section 609 performs communication processing via a network such as the Internet. A drive 610 is also connected to I / O interface 605 as needed. A removable medium 611, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., is installed on drive 610 as needed so that computer programs read from it can be installed into storage section 608 as needed.
[0163] In particular, according to embodiments of this disclosure, any of the methods described above in the embodiments of this disclosure can be implemented as a computer software program. For example, embodiments of this disclosure include a computer program product comprising a computer program tangibly embodied on a machine-readable medium, the computer program containing program code for performing any of the methods in the embodiments of this disclosure. In such an embodiment, the computer program can be downloaded and installed from a network via communication section 609, and / or installed from removable medium 611.
[0164] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0165] The units or modules described in the embodiments of this disclosure can be implemented in software or hardware. The described units or modules can also be located in a processor, and the names of these units or modules do not necessarily constitute a limitation on the unit or module itself.
[0166] In another aspect, this disclosure also provides a computer-readable storage medium, which may be a computer-readable storage medium included in the apparatus described in the above embodiments; or it may be a standalone computer-readable storage medium not assembled into a device. The computer-readable storage medium stores one or more programs that are used by one or more processors to perform the methods described in this disclosure.
[0167] The above description is merely a preferred embodiment of this disclosure and an explanation of the technical principles employed. Those skilled in the art should understand that the scope of the invention involved in this disclosure is not limited to technical solutions formed by specific combinations of the above-described technical features, but should also cover other technical solutions formed by arbitrary combinations of the above-described technical features or their equivalents without departing from the inventive concept. For example, technical solutions formed by substituting the above-described features with (but not limited to) technical features disclosed in this disclosure that have similar functions.
Claims
1. A location service method, wherein, Includes: Obtain the location of the location service device; When the location of the location service device does not exceed the second electronic fence area surrounding the location service device within a predetermined time range, the location service device is determined to switch to a stationary state. After determining that the location service device has switched to a stationary state, a preset operation is performed through the location service application; The preset operations include: determining a first electronic fence area surrounding the location service device, sending a guardian request carrying the first electronic fence area to a first system-level daemon process, and switching the location service application to a dormant state; after receiving the guardian request, the first system-level daemon process detects changes in the location of the location service device, and sends a wake-up event to the location service application after detecting that the location service device has crossed the first electronic fence area; wherein, the second electronic fence area is less than or equal to the first electronic fence area.
2. The method according to claim 1, wherein, The method further includes: In response to a wake-up event received from the first system-level daemon, the location service application is switched from a dormant state to an active state; Jump to the step of obtaining the location of the location service device and execute it.
3. The method according to claim 1, wherein, The method further includes: After determining that the location service device has switched to mobile mode, the process jumps to the step of obtaining the location of the location service device and executes it.
4. The method according to claim 1, wherein, The method further includes: The location of the location service device is reported to the server so that the server can generate the movement route of the location service device based on its location.
5. The method according to claim 4, wherein, The method further includes: In response to an event that the battery level of the location service device is lower than a preset battery threshold, when the location service device is in a mobile state, the frequency of reporting the location of the location service device to the server is reduced.
6. The method according to any one of claims 1-5, wherein, The location service device includes a first processor core and a second processor core; The power consumption of the second processor core is less than that of the first processor core; The location service application runs on the first processor core; the method further includes: The first system-level daemon process is registered with the operating system of the location service device, so that the first system-level daemon process runs on the second processor kernel of the location service device.
7. The method according to any one of claims 1-5, wherein, The method further includes: A second system-level daemon is registered with the operating system of the location service device so that the server's location service can push a wake-up request to the second system-level daemon, and the second system-level daemon can send a wake-up event to the location service application after receiving the wake-up request.
8. The method according to any one of claims 1-5, wherein, The location service equipment includes wearable smart devices and / or handheld electronic devices.
9. A location service device, comprising a first processor core and a second processor core; wherein the power consumption of the first processor core is higher than that of the second processor core; wherein: A location service application is executed on the first processor core to implement the method described in any one of claims 1-8; A first system-level daemon process for waking up the location service application is executed on the second processor core.
10. The location service device according to claim 9, further comprising: Positioning module; among which, The positioning module is used to measure the positioning information of the location service device and calculate the location of the location service device based on the positioning information; The first system-level daemon process determines whether the location service device crosses the first electronic fence area set by the location service application based on the location of the location service device calculated by the positioning module.
11. A location service device, wherein, include: The acquisition module is configured to acquire the location of the location service device. The determination module is configured to determine that the location service device switches to a stationary state when the location of the location service device does not exceed the second electronic fence area surrounding the location service device within a predetermined time range; The execution module is configured to perform a preset operation through the location service application after determining that the location service device has switched to a stationary state; The preset operations include: determining a first electronic fence area surrounding the location service device, sending a guardian request carrying the first electronic fence area to a first system-level daemon process, and switching the location service application to a dormant state; after receiving the guardian request, the first system-level daemon process detects changes in the location of the location service device, and sends a wake-up event to the location service application after detecting that the location service device has crossed the first electronic fence area; wherein, the second electronic fence area is less than or equal to the first electronic fence area.
12. An electronic device, wherein, The method includes a memory, a processor, and a computer program stored in the memory, wherein the processor executes the computer program to implement the method of any one of claims 1-8.
13. A computer program product comprising computer instructions, wherein, When executed by a processor, the computer instructions implement the method described in any one of claims 1-8.
Citation Information
Patent Citations
Positioning method and device, computer equipment and storage medium
CN112383959A
Multi-core processor for optimized power consumption in a security and home automation system
US20160202673A1
Carry-on device for Anti-lost system, and Anti-lost system
WO2015180674A1