Business processing method and related device

By judging the opening status of multiple cycle services in the terminal device and turning on the sensor at a time point where a specific time is coincident, the problem of large power consumption of the terminal device when performing multiple cycle services is solved, and power consumption reduction and equipment performance improvement are achieved.

CN119653458APending Publication Date: 2025-03-18HUAWEI TECH CO LTD
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202311193006.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-09-15
Publication Date
2025-03-18

AI Technical Summary

Technical Problem

When terminal devices perform multiple cycles of services, their power consumption is high, resulting in shortening of battery life and degradation of equipment performance.

Method used

By implementing a service processing method in the terminal device, the opening status of multiple cycles of services is judged, and the sensor is turned on at a time point where a specific time is coincident, reducing the number of sensor openings.

Benefits of technology

It effectively reduces the power consumption of terminal devices, extends battery life, and improves the performance and service response speed of the device.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119653458A_ABST
    Figure CN119653458A_ABST
Patent Text Reader

Abstract

The invention provides a service processing method and a related device, which can be applied to the technical field of terminals. In the application, the terminal equipment can judge whether the first service and the second service are in the open state at the first moment, periodically execute the first service under the condition that the first service is in the open state, and periodically execute the second service under the condition that the second service is in the open state. The first service is a service for periodically starting the first sensor to collect data, the second service is a service for periodically starting the second sensor to collect data, and both the first sensor and the second sensor can comprise a target sensor. According to the method, the execution time of the first service and the execution time of the second service can coincide at the specific moment, so that the target sensor only needs to be started once at the specific moment, the starting frequency of the target sensor can be reduced, and the power consumption of the terminal equipment can be reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of terminal technology, and in particular to a service processing method and related devices. Background Art

[0002] With the development of terminal devices, users have more and more functional requirements for terminal devices. For example, terminal devices can be used to perform a variety of periodic services for health detection, such as periodic blood oxygen, periodic heart rate, etc.

[0003] Currently, a method for a terminal device to execute a periodic service may include: after the terminal device receives an instruction from a user to start a periodic service, the terminal device may periodically control a sensor related to the periodic service to collect data based on an execution cycle of the periodic service.

[0004] However, it is found during use that when the terminal device executes multiple periodic services, the power consumption of the terminal device is relatively large. Summary of the invention

[0005] The present application provides a service processing method and related devices for solving the problem of high power consumption of terminal equipment in the prior art.

[0006] In the first aspect, the present application provides a service processing method, which is applied to a terminal device. The method includes: judging whether a first service is in an on state at a first moment, the first service is a service that periodically turns on a first sensor to collect data, the execution period of the first service is a first period, and the first sensor includes a target sensor; if the first service is in an on state at the first moment, the first service is executed periodically with the first moment as the starting moment; judging whether a second service is in an on state at the first moment, the second service is a service that periodically turns on a second sensor to collect data, the execution period of the second service is a second period, and the second sensor includes the target sensor; if the second service is in an on state at the first moment, the second service is executed periodically with the first moment as the starting moment.

[0007] In the method, the first time may be preset in advance. As an example, the first time may be 0:10.

[0008] Optionally, the first time may also be the time when the terminal device is turned on. As an example, assuming that the terminal device is turned on at 0:10, the first time may be 0:10.

[0009] Optionally, the duration between the first moment and the power-on time of the terminal device may also be a preset duration. The preset duration may be preset in advance. As an example, assuming that the terminal device is powered on at 0:10 and the preset duration is five minutes, the first moment may be 0:15.

[0010] Optionally, the execution period of the first service may also be preset in advance. Optionally, the execution period of the second service may also be preset in advance.

[0011] In the method, the execution time of the first service and the second service may overlap at a specific moment, wherein the duration between the specific moment and the first moment may be a common multiple of the first cycle and the second cycle.

[0012] In this way, the target sensor only needs to be turned on once at the specific moment, thereby reducing the number of times the target sensor is turned on, which is beneficial to reducing the power consumption of the terminal device.

[0013] In some possible implementations, the second period is greater than the first period, and the method further includes: if the first service is not in an open state at the first moment, determining whether the first service is in an open state at a second moment, the duration between the second moment and the first moment is equal to the first duration, and the first duration is equal to the greatest common divisor of the duration of the first period and the duration of the second period.

[0014] In an example, assuming that the first period is ten minutes and the second period is thirty minutes, the first duration may be ten minutes. assuming that the first time is 0:10, the second time may be 0:20.

[0015] In this example, the greatest common divisor of the duration of the first cycle and the duration of the second cycle is equal to the duration of the first cycle, and the duration between the second moment and the first moment can be equal to the duration of the first cycle, so that the execution time of the first service and the second service can overlap at a specific moment, thereby reducing the number of times the target sensor is turned on, which is conducive to reducing the power consumption of the terminal device. Among them, the duration between the specific moment and the second moment can be a common multiple of the first cycle and the second cycle.

[0016] In addition, the duration between the second moment and the first moment can be equal to the duration of the first cycle, so that the time interval between two consecutive judgments by the terminal device on whether the first service is in the on state can be equal to the duration of the first cycle, which is conducive to ensuring the value output rate of the first service.

[0017] In another example, assuming that the first period is ten minutes and the second period is fifteen minutes, the first duration may be five minutes. assuming that the first time is 0:10, the second time may be 0:15.

[0018] In this example, the duration between the second moment and the first moment can be equal to the greatest common divisor of the duration of the first cycle and the duration of the second cycle, so that the execution time of the first service and the second service can overlap at a specific moment, thereby reducing the number of times the target sensor is turned on, which is conducive to reducing the power consumption of the terminal device. The duration between the specific moment and the second moment can be a common multiple of the first cycle and the second cycle.

[0019] In addition, the duration between the second moment and the first moment can be shorter than the duration of the first cycle, so that the time interval between two consecutive judgments by the terminal device on whether the first service is in the on state can be shorter than the duration of the first cycle, which is conducive to ensuring the value output rate of the first service.

[0020] In some possible implementations, the method further includes: if the second service is not in an open state at the first moment, determining whether the second service is in an open state at a third moment; if the second service is in an open state at the third moment, periodically executing the second service with the third moment as a starting moment.

[0021] Optionally, the duration between the third moment and the first moment may also be equal to the first duration.

[0022] In some examples, assuming that the first period is ten minutes and the second period is thirty minutes, the first duration may be ten minutes. assuming that the first time is 0:10, the second time may be 0:20, and the third time may also be 0:20.

[0023] In this example, the third moment and the second moment can be the same moment. In this way, when the first business and the second business are not in the turned-on state at the first moment, it can be determined at the second moment (or the third moment) whether the first business and the second business are in the turned-on state. When it is determined that the first business and the second business are in the turned-on state at the second moment (or the third moment), each business can be periodically executed based on the execution cycle of each business.

[0024] In this way, the execution time of the first service and the second service can overlap at a specific moment, thereby reducing the number of times the target sensor is turned on, which is conducive to reducing the power consumption of the terminal device. The duration between the specific moment and the second moment can be a common multiple of the first cycle and the second cycle.

[0025] In addition, the duration between the third moment and the first moment can be equal to the duration of the first cycle, and the duration of the first cycle is less than the duration of the second cycle. In this way, the time interval between two consecutive judgments by the terminal device as to whether the second service is in the on state can be less than the duration of the second cycle, which is conducive to ensuring the value output rate of the second service.

[0026] In some other examples, assuming that the first period is ten minutes and the second period is fifteen minutes, the first duration may be five minutes. assuming that the first time is 0:10, the second time may be 0:15, and the third time may be 0:15.

[0027] In this example, the third moment and the second moment can be the same moment. In this way, when the first business and the second business are not in the turned-on state at the first moment, it can be determined at the second moment (or the third moment) whether the first business and the second business are in the turned-on state. When it is determined that the first business and the second business are in the turned-on state at the second moment (or the third moment), each business can be periodically executed based on the execution cycle of each business.

[0028] In this way, the execution time of the first service and the second service can overlap at a specific moment, thereby reducing the number of times the target sensor is turned on, which is conducive to reducing the power consumption of the terminal device. The duration between the specific moment and the second moment can be a common multiple of the first cycle and the second cycle.

[0029] In addition, the duration between the third moment and the first moment can be shorter than the duration of the first cycle, and the duration of the first cycle is shorter than the duration of the second cycle. In this way, the time interval between two consecutive judgments by the terminal device as to whether the second service is in the on state can be shorter than the duration of the second cycle, which is beneficial to ensuring the value output rate of the second service.

[0030] In some possible implementations, the method further includes: if the second service is not in the on state at the third moment and is judged to be not in the on state at each of the M moments, then judging whether the second service is in the on state at the fourth moment, the fourth moment is separated from the third moment by a duration of the second cycle, M is a positive integer, the duration between the mth moment among the M moments and the first moment is equal to m times the first durations, m is a positive integer and ranges from 1 to M, the Mth moment among the M moments is located before the fourth moment, the M+1th moment is located at the fourth moment, and the duration between the M+1th moment and the first moment is equal to M+1 times the first durations.

[0031] In one example, assuming that the execution cycle of the first service is ten minutes and the execution cycle of the second service is thirty minutes, the first duration may be ten minutes. Assuming that the first time is 0:10, if the terminal device determines that the second service is not in the on state at 0:10, it determines again at 0:20 whether the second service is in the on state. If the terminal device determines that the second service is not in the on state at 0:20, it determines again at 0:30 whether the second service is in the on state. If the terminal device determines that the second service is not in the on state at 0:30, it determines again at 0:40 whether the second service is in the on state. If the terminal device determines that the second service is not in the on state at 0:40, it determines again at 0:50 whether the second service is in the on state.

[0032] In this example, 0:20 may be the third moment, the M moments may include three moments: 0:20, 0:30 and 0:40, and the fourth moment may include 0:50, which is the M+1th moment.

[0033] In another example, assuming that the execution cycle of the first service is ten minutes and the execution cycle of the second service is fifteen minutes, the first duration may be five minutes. Assuming that the first time is 0:10, if the terminal device determines that the second service is not in the on state at 0:10, it determines again at 0:15 whether the second service is in the on state. If the terminal device determines that the second service is not in the on state at 0:15, it determines again at 0:20 whether the second service is in the on state. If the terminal device determines that the second service is not in the on state at 0:20, it determines again at 0:25 whether the second service is in the on state. If the terminal device determines that the second service is not in the on state at 0:25, it determines again at 0:30 whether the second service is in the on state.

[0034] In this example, 0:15 may be the third moment, the M moments may include three moments: 0:15, 0:20, and 0:25, and the fourth moment may include 0:30, which is the M+1th moment.

[0035] In this method, the execution time of the first service and the second service can overlap at a specific moment, thereby reducing the number of times the target sensor is turned on, which is beneficial to reducing the power consumption of the terminal device. The duration between the specific moment and the second moment can be a common multiple of the first cycle and the second cycle.

[0036] In addition, the first duration can be less than or equal to the duration of the first cycle, and the duration of the first cycle is less than the duration of the second cycle. In this way, the time interval between two consecutive judgments by the terminal device as to whether the second service is in the on state can be less than the duration of the second cycle, which is conducive to ensuring the value output rate of the second service.

[0037] In some possible implementations, the method also includes: if the first service and the second service are both in the turned-on state at the target time, determining the priority of the first service and the second service based on at least one of the first condition, the second condition and the third condition, the first condition being that the service requiring more sensors has a higher priority, the second condition being that the service requiring more sensor preset data has a higher priority, the third condition being that the service requiring less preset service running time has a higher priority, the judgment priority of the first condition is higher than the judgment priority of the second condition, and the judgment priority of the second condition is higher than the judgment priority of the third condition; determining the execution order of the first service and the second service based on the order of their priorities from high to low.

[0038] Optionally, the sensors required for each service may be preset in advance.

[0039] Optionally, the preset reporting frequency of the sensor preset for each service may also be preset in advance.

[0040] Optionally, the preset service running time of each service may also be preset in advance.

[0041] In the first example, assuming that the number of first sensors is greater than the number of second sensors, and the preset reporting frequencies of sensors and the preset service running times of the first service and the second service are the same, the priority of the first service is higher than the priority of the second service, and the execution order of the first service is higher than the execution order of the second service.

[0042] In the second example, assuming that the preset reporting frequency of the sensor of the first service is greater than the preset reporting frequency of the sensor of the second service, and the number of the first sensor and the second sensor is the same, and the preset service running time of the first service and the second service is also the same, the priority of the first service is higher than the priority of the second service, and the execution order of the first service is higher than the execution order of the second service.

[0043] In the third example, assuming that the preset service running time of the first service is less than the preset service running time of the second service, and the number of the first sensor and the second sensor is the same, and the preset reporting frequency of the sensors of the first service and the second service is also the same, the priority of the first service is higher than the priority of the second service, and the execution order of the first service is higher than the execution order of the second service.

[0044] In this method, the terminal device can first execute the first service and then execute the second service. The terminal device can turn on the first sensor when executing the first service, and the terminal device does not need to repeatedly turn on the shared target sensor when executing the second service. This can reduce the number of times the target sensor is turned on, which is beneficial to reducing the power consumption of the terminal device.

[0045] In some possible implementations, the execution order of the first business and the second business is determined in descending order based on the priorities of the first business and the second business, including: if the priority of the first business is higher than the priority of the second business, determining to start the first sensor at the target time, and starting other sensors of the second sensor except the target sensor after the target time; or, if the priority of the first business is lower than the priority of the second business, determining to turn on the second sensor at the target time, and turning on other sensors of the first sensor except the target sensor after the target time.

[0046] In this method, the terminal device can first turn on the sensors required for higher priority services, and then turn on other sensors required for lower priority services except the target sensor. This can reduce the number of times the target sensor is turned on, which is beneficial to reducing the power consumption of the terminal device.

[0047] In some possible implementations, the method further includes: determining a target data reporting frequency based on a preset data reporting frequency of the first service and a preset data reporting frequency of the second service, wherein the target data reporting frequency is equal to the greatest common divisor of the preset data reporting frequency of the first service and the preset data reporting frequency of the second service; and determining the target data reporting frequency as the data reporting frequency of the target sensor after the target time.

[0048] In one example, assuming that the preset reporting frequency of the sensor of the first service is once every 50 milliseconds, and the preset reporting frequency of the sensor of the second service is once every 500 milliseconds, then the greatest common divisor of the preset data reporting frequency of the first service and the preset data reporting frequency of the second service is once every 50 milliseconds, and the target data reporting frequency can be once every 50 milliseconds.

[0049] In another example, assuming that the preset reporting frequency of the sensor of the first service is once every 50 milliseconds, and the preset reporting frequency of the sensor of the second service is once every 60 milliseconds, then the greatest common divisor of the preset data reporting frequency of the first service and the preset data reporting frequency of the second service is once every 10 milliseconds, and the target data reporting frequency can be once every 10 milliseconds.

[0050] In this method, the data reporting frequency of the target sensor after the target time can be the target data reporting frequency, which can ensure that the data reporting frequency of the target sensor after the target time can simultaneously meet the data reporting frequency requirements of the first service and the second service.

[0051] In some possible implementations, the method further includes: determining a target business from the first business and the second business, the target business being the business with a shorter preset business running time among the first business and the second business; if the preset business running time of the target business is less than the preset business running time of other businesses among the first business and the second business except the target business, determining the end time of the target business based on the preset business running time of the target business, the interval between the end time and the target time being equal to the preset business time of the target business; and determining the preset data reporting frequency of the other businesses as the data reporting frequency of the target sensor after the end time.

[0052] For example, assuming that the preset service running time of the first service is 1 second, and the preset service running time of the second service is 3 seconds, and assuming that the target time is 0:30, the terminal device determines that the data reporting frequency of the target sensor after 0:30 is the target data reporting frequency, and determines that the data reporting frequency of the target sensor after 0:31 is the preset data reporting frequency of the second service.

[0053] In this example, it can be avoided that after the first service is completed, when the target sensor still reports at a high data reporting frequency, the target sensor collects and reports some redundant data, which is beneficial to further reduce the power consumption of the terminal device.

[0054] In a second aspect, the present application provides a service processing method, which is applied to a terminal device. The method comprises: the processor of the terminal device determines that the service to be processed is in an open state at a target time, the service to be processed is a service that periodically opens a third sensor to collect data, and the service to be processed includes a first service and / or a second service; when the processor determines to execute the service to be processed, an indication information is sent to the third sensor, and the indication information is used to instruct the third sensor to collect and report data.

[0055] In the method, the processor of the terminal device can be a single-core processor, and the method for the terminal device to determine whether the pending service is turned on and to determine the execution of the pending service is all executed by the processor. When the pending service includes a first service and a second service, the execution time of the first service and the execution time of the second service can overlap at a specific time. This can not only reduce the power consumption of the terminal device, but also reduce the response time of the terminal device to execute the pending service, thereby improving the response speed of the pending service.

[0056] In some possible implementations, when the service to be processed includes a first service and a second service, the third sensor includes a first sensor and a second sensor, the first service is a service that periodically turns on the first sensor to collect data, the second service is a service that periodically turns on the second sensor to collect data, and the first sensor and the second sensor both include target sensors.

[0057] The processor sending the indication information to the third sensor includes: the processor sending the indication information to the first sensor and the second sensor based on the priorities of the first service and the second service.

[0058] In some possible implementations, the processor sending the indication information to the first sensor and the second sensor based on the priorities of the first service and the second service includes:

[0059] If the priority of the first service is higher than the priority of the second service, the processor sends first indication information to the first sensor, wherein the first indication information is used to instruct the first sensor to collect first data and upload the first data at the target time; and the processor sends second indication information to other sensors in the second sensor except the target sensor, wherein the second indication information is used to instruct the other sensors to collect second data and upload the second data after the target time.

[0060] Or, if the priority of the first service is lower than the priority of the second service, the processor sends third indication information to the second sensor, and the third indication information is used to instruct the second sensor to collect second data at the target time and upload the second data; and the processor sends fourth indication information to other sensors in the first sensor except the target sensor, and the fourth indication information is used to instruct the other sensors to collect first data and upload the first data after the target time.

[0061] In some possible implementations, the method further includes: the processor sending fifth indication information to the target sensor, the fifth indication information being used to instruct the target sensor to report data based on a target data reporting frequency after the target time, wherein the target data reporting frequency is equal to the greatest common divisor of a preset data reporting frequency of the first service and a preset data reporting frequency of the second service.

[0062] In some possible implementations, the method also includes: the processor sends sixth indication information to the target sensor, and the sixth indication information is used to instruct the target sensor to report data based on a preset data reporting frequency of other services after the end time of the target service, the target service is the service with a shorter preset service running time between the first service and the second service, and the other service is other services between the first service and the second service except the target service.

[0063] In a third aspect, the present application provides a service processing method, which is applied in a terminal device. The method comprises: the first processor of the terminal device receives service status information, the service status information is used to indicate that the service to be processed is in an open state at the target time, the service to be processed is a service that periodically turns on a third sensor to collect data, and the service to be processed includes a first service and / or a second service; when the first processor determines to execute the service to be processed, the first information is sent to the second processor, the first information is used to indicate the execution of the service to be processed; the first processor receives indication information from the second processor, the indication information is used to indicate the third sensor to collect and report data; the first processor sends the indication information to the third sensor.

[0064] In this method, the processor of the terminal device can be a dual-core processor, and the method for the terminal device to determine whether the pending service is turned on and determine to execute the pending service is executed by the first processor. Since the power consumption of the first processor is lower than that of the second processor, this can further reduce the power consumption of the terminal device.

[0065] In some possible implementations, when the service to be processed includes a first service and a second service, the third sensor includes a first sensor and a second sensor, the first service is a service that periodically turns on the first sensor to collect data, the second service is a service that periodically turns on the second sensor to collect data, and the first sensor and the second sensor both include target sensors.

[0066] The first processor sending the indication information to the third sensor includes: the first processor sending the indication information to the first sensor and the second sensor based on the priorities of the first service and the second service.

[0067] In some possible implementations, the first processor sending the indication information to the first sensor and the second sensor based on the priorities of the first service and the second service includes:

[0068] If the priority of the first service is higher than the priority of the second service, the first processor sends first indication information to the first sensor, wherein the first indication information is used to instruct the first sensor to collect first data and upload the first data at the target time; and the first processor sends second indication information to other sensors in the second sensor except the target sensor, wherein the second indication information is used to instruct the other sensors to collect second data and upload the second data after the target time.

[0069] Or, if the priority of the first service is lower than the priority of the second service, the first processor sends third indication information to the second sensor, and the third indication information is used to instruct the second sensor to collect second data at the target time and upload the second data; and the first processor sends fourth indication information to other sensors in the first sensor except the target sensor, and the fourth indication information is used to instruct the other sensors to collect first data and upload the first data after the target time.

[0070] In some possible implementations, the method also includes: the first processor sends fifth indication information to the target sensor, and the fifth indication information is used to instruct the target sensor to report data based on a target data reporting frequency after the target time, and the target data reporting frequency is equal to the greatest common divisor of the preset data reporting frequency of the first service and the preset data reporting frequency of the second service.

[0071] In some possible implementations, the method also includes: the first processor sends sixth indication information to the target sensor, and the sixth indication information is used to instruct the target sensor to report data based on a preset data reporting frequency of other services after the end time of the target service, the target service is the service with a shorter preset service running time between the first service and the second service, and the other services are other services between the first service and the second service except the target service.

[0072] In a fourth aspect, the present application provides an apparatus, including modules or units for implementing the method in the first aspect and any possible implementation of the first aspect. It should be understood that each module or unit can implement the corresponding function by executing a computer program.

[0073] In a fifth aspect, the present application provides an apparatus, including modules or units for implementing the method in the second aspect and any possible implementation of the second aspect. It should be understood that each module or unit can implement the corresponding function by executing a computer program.

[0074] In a sixth aspect, the present application provides a device, including modules or units for implementing the method in the third aspect and any possible implementation of the third aspect. It should be understood that each module or unit can implement the corresponding function by executing a computer program.

[0075] In a seventh aspect, the present application provides a device comprising a processor, wherein the processor is used to execute the method described in any possible implementation manner of the first to third aspects.

[0076] The device may further include a memory for storing instructions and data. The memory is coupled to the processor, and when the processor executes the instructions stored in the memory, the methods described in the above aspects may be implemented. The device may further include a communication interface, and the communication interface is used for the device to communicate with other devices. Exemplarily, the communication interface may be a transceiver, circuit, bus, module or other type of communication interface.

[0077] In an eighth aspect, the present application provides a computer-readable storage medium storing a program code for execution by a business processing device, wherein the program code includes instructions for implementing the methods in the first to third aspects.

[0078] In a ninth aspect, the present application provides a computer program product comprising instructions, which, when executed on a service processing device, enables the service processing device to implement the methods in the first to third aspects.

[0079] It can be understood that the effects that can be obtained from the second to ninth aspects can be referred to the description in the first aspect and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0080] Figure 1 A schematic diagram of an applicable intelligent detection scenario of an embodiment of the present application;

[0081] Figure 2 A schematic diagram of the structure of a terminal device provided in an embodiment of the present application;

[0082] Figure 3 A schematic diagram of a user interface provided in an embodiment of the present application;

[0083] Figure 4 This is a schematic diagram of the execution time of different businesses;

[0084] Figure 5 A schematic diagram of a system architecture of a terminal device provided in an embodiment of the present application;

[0085] Figure 6 A schematic diagram of the system architecture of another terminal device provided in an embodiment of the present application;

[0086] Figure 7 A flowchart of a business processing method provided for this application;

[0087] Figure 8 Multiple business diagrams provided for one embodiment of the present application;

[0088] Fig. 9 A schematic diagram of scheduling multiple services provided in an embodiment of the present application;

[0089] Fig.10 A schematic diagram of a flow chart of a service processing method of a terminal device provided in another embodiment of the present application;

[0090] Fig.11 A schematic diagram of a service processing method flow of a terminal device provided in yet another embodiment of the present application;

[0091] Fig.12 A schematic diagram of the structure of a service processing device provided by an embodiment of the present application;

[0092] Fig.13 A schematic diagram of the structure of a service processing device provided in another embodiment of the present application;

[0093] Fig.14 A schematic diagram of the structure of a service processing device provided in yet another embodiment of the present application;

[0094] Fig.15 A schematic diagram of the structure of a business processing device provided in yet another embodiment of the present application. DETAILED DESCRIPTION

[0095] The technical solutions in the embodiments of the present application will be described below in conjunction with the drawings in the embodiments of the present application.

[0096] In order to facilitate the clear description of the technical solutions of the embodiments of the present application, in the embodiments of the present application, the words "first" and "second" are used to distinguish the same items or similar items with substantially the same functions and effects. For example, the first information and the second information are only used to distinguish different information, and their order is not limited. Those skilled in the art can understand that the words "first" and "second" do not limit the quantity and execution order, and the words "first" and "second" do not necessarily limit them to be different.

[0097] In the embodiments of the present application, "at least one" refers to one or more, and "more than one" refers to two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone, where A and B can be singular or plural. The character " / " generally indicates that the previous and next associated objects are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b, or c can represent: a, b, c; a and b; a and c; b and c; or a and b and c. Among them, a, b, c can be single or multiple.

[0098] This application can be applied to Figure 1 In the intelligent detection scenario shown in Figure 1 As shown, the terminal device can be used to perform a variety of periodic services, such as periodic blood oxygen, periodic heart rate, periodic pressure and exercise recording.

[0099] Each periodic service has its own corresponding execution cycle. For any periodic service, the periodic service is executed periodically based on the execution cycle of the periodic service.

[0100] As an example, assuming that the execution cycle of periodic blood oxygen measurement is 10 minutes, after the user turns on the blood oxygen measurement service on the terminal device, the terminal device can periodically measure blood oxygen, and the time interval between any two adjacent measurements is 10 minutes.

[0101] In the present application, the terminal device may be a wearable terminal device (also referred to as a wearable device), such as a watch, a bracelet, a headset, a helmet (such as a virtual reality helmet), etc., or a non-wearable device, such as a portable terminal device with detection functions such as an accelerometer (ACC), a photoplethysmo graphy (PPG), and an electrocardiogram (ECG), such as a mobile phone, a tablet computer, a laptop computer, etc. Exemplary embodiments of portable terminal devices include but are not limited to portable terminal devices equipped with or other operating systems. It should be understood that the above-mentioned terminal device may not be a portable terminal device, but a desktop computer capable of detecting ECG and / or PPG, etc., which is not limited in the embodiments of the present application.

[0102] In order to better understand the embodiments of the present application, the hardware structure of the terminal device of the embodiments of the present application is introduced below. Figure 2 A schematic diagram of the structure of a terminal device provided in an embodiment of the present application.

[0103] The terminal device may include a processor 210, an external memory interface 220, an internal memory 221, a universal serial bus (USB) interface 230, a charging management module 240, a power management module 241, a battery 242, an antenna 1, an antenna 2, a mobile communication module 250, a wireless communication module 260, an audio module 270, a speaker 270A, a receiver 270B, a microphone 270C, an earphone interface 270D, a sensor module 280, a button 290, a motor 291, an indicator 292, a camera 293, a display screen 294, and a subscriber identification module (SIM) card interface 295, etc.

[0104] Optionally, the sensor module 280 may include a pressure sensor 280A, a touch sensor 280B, an ACC sensor 280C, a capacitance sensor 280D, a PPG sensor 280E, and the like.

[0105] The processor 210 may include one or more processing units. For example, the processor 210 may include an application processor (AP), a modem processor, a graphics processor (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), etc. Different processing units may be independent devices or integrated into one or more processors. A memory may also be provided in the processor 210 for storing instructions and data.

[0106] The USB interface 230 is an interface that complies with the USB standard specification, and specifically can be a Mini USB interface, a Micro USB interface, a USB Type C interface, etc. The USB interface 230 can be used to connect a charger to charge the terminal device, and can also be used to transfer data between the terminal device and peripheral devices. It can also be used to connect headphones to play audio through the headphones. The interface can also be used to connect other terminal devices, such as AR devices, etc.

[0107] The charging management module 240 is used to receive charging input from a charger. The charger can be a wireless charger or a wired charger. While the charging management module 240 is charging the battery 242, it can also charge the terminal device through the power management module 241.

[0108] The power management module 241 is used to connect the battery 242, the charging management module 240 and the processor 210. The power management module 241 receives input from the battery 242 and / or the charging management module 240, and supplies power to the processor 210, the internal memory 221, the external memory, the camera 293, the display screen 294, the audio module 270 and the wireless communication module 260. In some embodiments, the power management module 241 can also be set in the processor 210. In other embodiments, the power management module 241 and the charging management module 240 can also be set in the same device.

[0109] Optionally, in some embodiments, the power management module 241 may also be referred to as a battery management unit (PMU), and the PWU may be used to obtain status information of the battery 242 , such as the remaining power and temperature of the battery 242 .

[0110] The wireless communication function of the terminal device can be realized through antenna 1, antenna 2, mobile communication module 250, wireless communication module 260, modem processor and baseband processor.

[0111] Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. The antenna in the terminal device can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve the utilization of the antenna.

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

[0113] The wireless communication module 260 can provide wireless communication solutions including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), etc. applied to the terminal device. The wireless communication module 260 can be one or more devices integrating at least one communication processing module. The wireless communication module 260 receives electromagnetic waves via the antenna 2, modulates the frequency of the electromagnetic wave signal and filters it, and sends the processed signal to the processor 210. The wireless communication module 260 can also receive the signal to be sent from the processor 210, modulate the frequency of it, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2.

[0114] In some embodiments, antenna 1 of the terminal device is coupled to mobile communication module 250, and antenna 2 is coupled to wireless communication module 260, so that the mobile phone can communicate with the network and other devices through wireless communication technology.

[0115] The camera 293 is used to capture static images or videos. In some embodiments, the terminal device may include 1 or N cameras 293, where N is a positive integer greater than 1.

[0116] The display screen 294 is used to display images, videos, etc. The display screen 294 includes a display panel. In some embodiments, the terminal device may include 1 or N display screens 294, where N is a positive integer greater than 1.

[0117] In some embodiments, a touch sensor may be provided in the display screen 294 to form a touch screen, which is not limited in the embodiments of the present application. It is understood that in some embodiments, the terminal device may include the display screen 294 or may not include the display screen 294. For example, when the terminal device is a bracelet, it may include the display screen 294 or may not include the display screen 294. When the terminal device is a watch, it may include the display screen 294.

[0118] The external memory interface 220 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the terminal device. The external memory card communicates with the processor 210 through the external memory interface 220 to implement a data storage function. For example, files such as music and videos can be stored in the external memory card.

[0119] The internal memory 221 can be used to store computer executable program codes, and the executable program codes include instructions. The internal memory 221 can include a program storage area and a data storage area. Among them, the program storage area can store applications required for at least one function in the operating system (such as a sound playback function, an image playback function, etc.). The data storage area can store data created during the use of the terminal device (such as audio data, a phone book, etc.).

[0120] The terminal device can implement audio functions such as music playing and recording through the audio module 270, the speaker 270A, the receiver 270B, the microphone 270C, the earphone interface 270D, and the application processor.

[0121] The audio module 270 is used to convert digital audio information into analog audio signal output, and is also used to convert analog audio input into digital audio signals. The speaker 270A, also known as the "speaker", is used to convert audio electrical signals into sound signals. The terminal device can listen to music or listen to hands-free calls through the speaker 270A. The receiver 270B, also known as the "earpiece", is used to convert audio electrical signals into sound signals. When the terminal device answers a call or voice message, the voice can be answered by placing the receiver 270B close to the human ear. The microphone 270C, also known as the "microphone" or "microphone", is used to convert sound signals into electrical signals. The headphone jack 270D is used to connect wired headphones.

[0122] The pressure sensor 280A is used to sense the pressure signal and can convert the pressure signal into an electrical signal. In some embodiments, the pressure sensor 280A can be set on the display screen 294. When a touch operation is applied to the display screen 294, the terminal device can detect the intensity of the touch operation according to the pressure sensor 280A. The terminal device can also calculate the touch position according to the detection signal of the pressure sensor 280A. There are many types of pressure sensors 280A, such as resistive pressure sensors, inductive pressure sensors, capacitive pressure sensors, etc., which are not limited in the embodiments of the present application.

[0123] The touch sensor 280B may be disposed on the display screen 294, and the touch sensor 280B and the display screen 294 form a touch screen, also known as a "touch screen". The touch sensor 280B is used to detect a touch operation acting on or near it. The touch sensor 280B may transmit the detected touch operation to the application processor 210 to determine the type of touch event. A visual output related to the touch operation may be provided through the display screen 294. In other embodiments, the touch sensor 280B may also be disposed on the surface of the display screen 294, at a different position from the display screen 294.

[0124] The ACC sensor 280C can be used to detect the magnitude of acceleration of the terminal device in various directions (generally three axes). Optionally, when the terminal device is a wearable device, if the user wears the wearable device and the wearable device moves under the drive of the user, the ACC sensor 280C can detect the magnitude of acceleration in various directions to reflect the movement state of the human body.

[0125] The capacitive sensor 280D can be used to detect the capacitance between two electrodes to achieve specific functions.

[0126] In some embodiments, the capacitive sensor 280D can be used to detect the capacitance between the human body and the terminal device. The capacitance can reflect whether the contact between the human body and the terminal device is good, and can be applied to ECG detection, in which the human body can be used as an electrode. When the capacitive sensor 280D is set on the electrode on the terminal device, the capacitive sensor 280D can detect the capacitance between the human body and the electrode. When the capacitance detected by the capacitive sensor 280D is too large or too small, it means that the contact between the human body and the electrode is poor; when the capacitance detected by the capacitive sensor 280D is moderate, it means that the contact between the human body and the electrode is good. Since whether the contact between the human body and the electrode is good will affect the electrode detection electrical signal, and then affect the generation of ECG, the terminal device can refer to the capacitance detected by the capacitive sensor 280D when generating ECG.

[0127] The PPG sensor 280E can be used to detect heart rate, that is, the number of heartbeats per unit time. In some embodiments, the PPG sensor 280E may include a light transmitting unit and a light receiving unit. The light transmitting unit can irradiate a light beam into a human body (such as a blood vessel), and the light beam is reflected / refracted in the human body, and the reflected / refracted light is received by the light receiving unit to obtain a light signal. Since the light transmittance of the blood changes during the fluctuation process, the emitted / refracted light changes, and the light signal detected by the PPG sensor 280E also changes. The PPG sensor 280E can convert the light signal into an electrical signal and determine the heart rate corresponding to the electrical signal.

[0128] The button 290 includes a power button, a volume button, etc. The button 290 may be a mechanical button. It may also be a touch button. The terminal device may receive the button input and generate a key signal input related to the user settings and function control of the terminal device. The motor 291 may generate a vibration prompt. The indicator 292 may be an indicator light, which may be used to indicate the charging status, the change in power, or may be used to indicate messages, missed calls, notifications, etc. The timer 296 may be used to record time information. For example, when the terminal device records a video, the start time and end time of the video may be recorded, and the duration of the recorded video may be recorded.

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

[0130] In some embodiments, the terminal device may be a wearable device, such as a smart watch or a smart bracelet. The wearable device may also include a main body ( Figure 1 Not shown) and wrist strap ( Figure 1 The wristband can be fixedly connected or movably connected to the main body, and the wristband can be wrapped around the wrist, arm, leg or other parts of the body to fix the wearable device to the user. The main body may include a shell and a cover, the shell surrounds the cover, for example, the shell includes a groove arranged at the top, the cover is accommodated in the groove, and the edge of the cover is adjacent to and fixed on the groove of the shell to form the surface of the main body. The structure formed by the shell and the cover has a receiving space inside, which can accommodate Figure 1 The combination of one or more components shown and not shown can realize various functions of the wearable device. Optionally, the main body also includes an input device, and the accommodating space in the structure formed by the cover and the shell can accommodate part of the input device, and the exposed part of the input device is convenient for the user to contact.

[0131] The wearable device can pair with the wireless communication module of other terminal devices and establish a wireless connection through the wireless communication module in the wearable device to achieve wireless communication with other terminal devices through the wireless connection.

[0132] Currently, a method for a terminal device to execute a periodic service may include: after the terminal device receives an instruction from a user to start a periodic service, the terminal device may periodically control a sensor related to the periodic service to collect data based on an execution cycle of the periodic service.

[0133] In some scenarios, the terminal device may be a mobile phone. Taking the periodic service as an example, assuming that a user interface of the terminal device is Figure 3 As shown, the interface includes a periodic blood oxygen start button. When the user clicks the start button, the terminal device can receive an instruction to start the periodic blood oxygen. Then, based on the execution cycle of the periodic blood oxygen, the processor periodically controls the PPG sensor to collect data. After the PPG data is collected, the data can be uploaded to the processor, and then the processor controls the display screen to display the data.

[0134] In other scenarios, the terminal device may be a wearable device, which may communicate with other terminal devices (such as mobile phones) to jointly execute periodic services. Figure 3After clicking the start button in the user interface shown, the other terminal device can receive the instruction to turn on the periodic blood oxygen and send an instruction message to the wearable device, which is used to instruct the user to turn on the periodic blood oxygen. After the wearable device receives the instruction, it can periodically control the PPG sensor to collect data through the processor based on the execution cycle of the periodic blood oxygen. After the PPG data is collected, the data can be uploaded to the processor. After the wearable device receives the data, it can send the data to other terminal devices, and then after the other terminal devices receive the data, the processor of the other terminal devices controls the display screen of the other terminal devices to display the data.

[0135] However, it is found during use that when the terminal device executes multiple periodic services, the power consumption of the terminal device is relatively large.

[0136] like Figure 4 As shown, assuming that the execution cycle of services A and B is 10 minutes, and assuming that the user clicks to start service A at 0:00, the terminal device starts to control the sensor corresponding to service A to collect and upload data at 0:00, controls the sensor corresponding to service A to collect and upload data again at 0:10, and controls the sensor corresponding to service A to collect and upload data again at 0:20, and so on, until the user closes service A.

[0137] And assuming that the user clicks to start service B at 0:04, the terminal device starts to control the sensor corresponding to service B to collect and upload data at 0:04, controls the sensor corresponding to service B again to collect and upload data at 0:14, controls the sensor corresponding to service B again to collect and upload data at 0:24, and so on, until the user closes service B.

[0138] Assuming that the sensors corresponding to services A and B include the same sensor, the terminal device needs to turn on the sensor each time service A or service B is executed. The more times the sensor is turned on, the greater the power consumption of the terminal device.

[0139] To this end, the present application provides a technical solution for solving the problem of high power consumption of terminal devices in the prior art.

[0140] In the present application, the terminal device can determine whether the first service and the second service are in an on state at a first moment, and in the on state, respectively use the first moment as a starting moment and execute them periodically according to the execution cycle of each service.

[0141] In this method, the first moment may be preset in advance, and the execution cycles of the first service and the second service may also be preset in advance.

[0142] Optionally, when the execution period of the second service is greater than the execution period of the first service, if the first service is not in the enabled state at the first moment, it is determined at the second moment whether the first service is in the enabled state.

[0143] In some examples, the duration between the second moment and the first moment may be equal to the execution cycle of the first service. In other examples, the duration between the second moment and the first moment may also be equal to the greatest common divisor of the execution cycle of the first service and the execution cycle of the second service.

[0144] Optionally, if the second service is not in the enabled state at the first moment, it is determined at the third moment whether the second service is in the enabled state.

[0145] In some examples, the duration between the third moment and the first moment may be equal to the execution period of the second service. In other examples, the duration between the third moment and the first moment may be equal to the greatest common divisor of the execution period of the first service and the execution period of the second service.

[0146] In this method, the execution time of the first service and the second service can overlap at a specific time, thereby reducing the number of times the sensor is turned on, which is beneficial to reducing the power consumption of the terminal device.

[0147] Furthermore, if the first service and the second service are both in the turned-on state at a certain moment, the priority of the first service and the second service can be determined based on the number of sensors required, and / or the frequency of sensor preset data reporting, and / or the preset service running time, and then the execution order of the first service and the second service can be determined based on the priority of the first service and the second service.

[0148] Among them, the priority of the service that requires more sensors is higher, the priority of the service that reports preset data of sensors more frequently is higher, and the priority of the service that has less preset service running time is higher.

[0149] In this method, the terminal device can first turn on the sensors required for higher priority services. In this way, when the terminal device subsequently executes lower priority services, it can directly reuse the sensor data of the higher priority services, thereby reducing the number of sensor data reporting times, which is beneficial to reducing the power consumption of the terminal device.

[0150] In this application, the processor of the terminal device may be a single-core processor. Figure 5 As shown, the processor of the terminal device may be a control unit (microcontroller unit, MCU) processor, and the MCU processor may include an M55 core, and the processor may be connected to the sensor module of the terminal device.

[0151] In this system, the sensor module of the terminal device may include an ACC sensor, a PPG sensor, etc.

[0152] In the system, the terminal device can control any one or more sensors in the sensor module through the processor. For example, the processor can control the sensor to collect data and report the data.

[0153] Optionally, the processor of the terminal device may also be a dual-core processor. Figure 6 As shown, the processor of the terminal device may be an MCU processor, and the MCU processor may include a first processor and a second processor.

[0154] In the system, the first processor and the second processor may be packaged in the same chip, or may be separately packaged in different chips.

[0155] As an example, the first processor and the second processor may be an M33 core and an M55 core respectively, the M33 core and the M55 core may be connected via a bus, and the M33 core may be connected to the sensor module.

[0156] In this system, the M55 core can communicate with the M33 core, and the M33 core can communicate with any one or more sensors in the sensor module.

[0157] For example, the M55 core may send service status information to the M33 core, where the service status information is used to indicate whether the user has activated the service. The M33 core may determine the execution time of the service and send the execution time of the service to the M55 core.

[0158] In addition, after the M55 core determines the service execution time, it can control any one or more sensors in the sensor module through the M33 core. For example, the M55 core can control the sensor to collect data and report the data through the M33 core.

[0159] Next, this application will combine Figures 7 to 15 , the solution of this application is introduced in detail.

[0160] Figure 7 A flowchart of a business processing method provided for this application. Figure 7 As shown, the method may include S701 to S704.

[0161] S701, the terminal device determines at a first moment whether a first service is in an on state, the first service is a service that periodically starts a first sensor to collect data, the execution period of the first service is a first period, and the first sensor includes a target sensor.

[0162] In this method, the terminal device can be Figure 2The terminal device shown in FIG. The processor of the terminal device may be as follows: Figure 5 The single-core processor shown may also be Figure 6 Dual-core processor shown.

[0163] In the method, the first time may be preset in advance. As an example, the first time may be 0:10.

[0164] Optionally, the first time may also be the time when the terminal device is turned on. As an example, assuming that the terminal device is turned on at 0:10, the first time may be 0:10.

[0165] Optionally, the duration between the first moment and the power-on time of the terminal device may also be a preset duration. The preset duration may be preset in advance. As an example, assuming that the terminal device is powered on at 0:10 and the preset duration is five minutes, the first moment may be 0:15.

[0166] Optionally, the execution period of the first service may also be preset in advance. As an example, the execution period of the first service may be ten minutes.

[0167] In the method, the first sensor may be a sensor that needs to be scheduled when the terminal device executes the first service. The number of the first sensors may be one or more. As an example, the first sensor may include an ACC sensor.

[0168] In a possible implementation, a method for a terminal device to determine at a first moment whether a first service is in an on state may include: first, the terminal device determines at the first moment whether a user has turned on the first service.

[0169] In one example, the terminal device may be a mobile phone. Taking the first service as periodic blood oxygen as an example, assuming that a user interface of the terminal device is as follows Figure 3 As shown, the interface includes a periodic blood oxygen start button. When the user clicks the start button, the terminal device can receive an instruction to start the periodic blood oxygen, and determine that the first service is in the start state based on the instruction.

[0170] In another example, the terminal device may be a wearable device, which can communicate with other terminal devices (such as mobile phones). Figure 3 After clicking the start button in the user interface shown, the other terminal device can receive the instruction to start the periodic blood oxygen monitoring and send an instruction message to the wearable device, which is used to instruct the user to start the periodic blood oxygen monitoring. After receiving the instruction, the wearable device can determine that the user's first service is in the on state.

[0171] In the method, when the first service is in an on state, the terminal device determines that the first service can be executed, but may not execute the first service immediately. In other words, the first service may be a service that is in an on state but has not started to be executed.

[0172] S702: If the first service is in an enabled state at the first moment, periodically execute the first service with the first moment as a start moment.

[0173] Assuming that the first time is 0:10 and the execution period of the first service is ten minutes, if the first service is in an on state at the first time, the terminal device can execute the first service every ten minutes starting from 0:10.

[0174] In this method, the terminal device executing the first service can be understood as the terminal device sending indication information to the first sensor based on the processor, where the indication information is used to instruct the first sensor to collect data and upload the collected data.

[0175] In other words, the terminal device may send indication information to the first sensor based on the processor every ten minutes. For example, at 0:10, the terminal device may send indication information to the first sensor based on the processor. For another example, at 0:20, the terminal device may send indication information to the first sensor based on the processor.

[0176] In one example, the processor of the terminal device may be a single-core processor. Figure 5 As shown, assuming that the processor of the terminal device includes an M55 core, the M55 core can send indication information to the first sensor.

[0177] In another example, the processor of the terminal device may be a dual-core processor. Figure 6 As shown, assuming that the processor of the terminal device includes an M33 core and an M55 core, after the M55 core determines that the user turns on the first service, it can send the switch status information of the first service to the M33 core, and the switch status information of the first service is used to instruct the user to turn on the first service. Optionally, after receiving the indication information, the M33 core can send the indication information to the first sensor.

[0178] In this method, before executing the first service each time, the terminal device may also determine whether to execute the first service based on the first sensor.

[0179] Optionally, the method for a terminal device to determine whether to execute a first service based on a first sensor may include: the terminal device may send an indication message to the first sensor through a processor, and the indication message is used to instruct the first sensor to collect and upload data; if the processor receives data collected by the first sensor or determines that the data collected by the first sensor has changed, the terminal device determines to execute the first service.

[0180] In one example, the processor of the terminal device may be a single-core processor. Figure 5 As shown, assuming that the processor of the terminal device includes an M55 core, after the M55 core determines that the user turns on the first service, it can send an indication message to the first sensor, and the indication message is used to instruct the first sensor to collect and upload data. If the M55 core receives the data collected by the first sensor or determines that the data collected by the first sensor changes, the M55 core can determine to execute the first service.

[0181] In another example, the processor of the terminal device may be a dual-core processor. Figure 6 As shown, assuming that the processor of the terminal device includes an M33 core and an M55 core, after the M55 core determines that the user turns on the first service, it can send the switch status information of the first service to the M33 core, and the switch status information of the first service is used to instruct the user to turn on the first service. Correspondingly, after receiving the indication information, the M33 core can send indication information to the first sensor, and the indication information is used to instruct the first sensor to collect and upload data. If the M33 core receives the data collected by the first sensor or determines that the data collected by the first sensor has changed, the M33 core can determine to execute the first service.

[0182] In this example, the method for determining whether to execute the first service can be executed by the M33 core. Since the power consumption of the M33 core is lower than that of the M55 core, this is beneficial to reducing the total power consumption of the terminal device.

[0183] Optionally, after the first service starts to be executed, the terminal device may no longer determine whether the first service is in an enabled state.

[0184] S703, the terminal device determines at a first moment whether a second service is in an on state, the second service is a service of periodically starting a second sensor to collect data, the execution period of the second service is a second period, and the second sensor includes a target sensor.

[0185] Optionally, the execution period of the second service may also be preset in advance. As an example, the execution period of the second service may be thirty minutes.

[0186] In the method, the second sensor may be a sensor that needs to be scheduled when the terminal device executes the second service. The number of the second sensors may be one or more. As an example, the second sensor may include an ACC sensor and a PPG sensor.

[0187] In this method, the target sensor may be a sensor shared by the first service and the second service. Assuming that the first sensor includes an ACC sensor and the second sensor includes an ACC sensor and a PPG sensor, the target sensor may be an ACC sensor.

[0188] The method for the terminal device to determine whether the second service is in an enabled state may refer to the method for the terminal device to determine whether the first service is in an enabled state in S701, which will not be described in detail here.

[0189] S704: If the second service is in an enabled state at the first moment, periodically execute the second service with the first moment as a start moment.

[0190] Assuming that the first time is 0:10 and the execution period of the second service is thirty minutes, if the second service is turned on at the first time, the terminal device can execute the second service every thirty minutes starting from 0:10.

[0191] In this method, the terminal device executing the second service can be understood as the terminal device sending indication information to the second sensor based on the processor, where the indication information is used to instruct the second sensor to collect data and upload the collected data.

[0192] In other words, the terminal device may send indication information to the second sensor based on the processor every thirty minutes. For example, at 0:10, the terminal device may send indication information to the second sensor based on the processor. For another example, at 0:40, the terminal device may send indication information to the second sensor based on the processor.

[0193] Among them, the method for the terminal device to send indication information to the second sensor based on the processor can refer to S702, which will not be repeated here.

[0194] Optionally, before the terminal device subsequently executes the second service, it may also determine whether to execute the second service based on the second sensor.

[0195] The method for the terminal device to determine whether to execute the second service based on the second sensor can refer to the method for the terminal device to determine whether to execute the first service based on the first sensor in S702, which will not be repeated here.

[0196] In the method, the execution time of the first service and the second service may overlap at a specific moment, wherein the duration between the specific moment and the first moment may be a common multiple of the first cycle and the second cycle.

[0197] In this way, the target sensor only needs to be turned on once at the specific moment, thereby reducing the number of times the target sensor is turned on, which is beneficial to reducing the power consumption of the terminal device.

[0198] In some possible implementations, when the second period is greater than the first period, if the first service is not in the on state at the first moment, the terminal device determines whether the first service is in the on state at the second moment, and the duration between the second moment and the first moment may be equal to the first duration, and the first duration may be equal to the greatest common divisor of the duration of the first period and the duration of the second period.

[0199] In an example, assuming that the first period is ten minutes and the second period is thirty minutes, the first duration may be ten minutes. assuming that the first time is 0:10, the second time may be 0:20.

[0200] In this example, the greatest common divisor of the duration of the first cycle and the duration of the second cycle is equal to the duration of the first cycle, and the duration between the second moment and the first moment can be equal to the duration of the first cycle, so that the execution time of the first service and the second service can overlap at a specific moment, thereby reducing the number of times the target sensor is turned on, which is conducive to reducing the power consumption of the terminal device. Among them, the duration between the specific moment and the second moment can be a common multiple of the first cycle and the second cycle.

[0201] In addition, the duration between the second moment and the first moment can be equal to the duration of the first cycle, so that the time interval between two consecutive judgments by the terminal device on whether the first service is in the on state can be equal to the duration of the first cycle, which is conducive to ensuring the value output rate of the first service.

[0202] In another example, assuming that the first period is ten minutes and the second period is fifteen minutes, the first duration may be five minutes. assuming that the first time is 0:10, the second time may be 0:15.

[0203] In this example, the duration between the second moment and the first moment can be equal to the greatest common divisor of the duration of the first cycle and the duration of the second cycle, so that the execution time of the first service and the second service can overlap at a specific moment, thereby reducing the number of times the target sensor is turned on, which is conducive to reducing the power consumption of the terminal device. The duration between the specific moment and the second moment can be a common multiple of the first cycle and the second cycle.

[0204] In addition, the duration between the second moment and the first moment can be shorter than the duration of the first cycle, so that the time interval between two consecutive judgments by the terminal device on whether the first service is in the on state can be shorter than the duration of the first cycle, which is conducive to ensuring the value output rate of the first service.

[0205] Optionally, in other examples, assuming that the first cycle is five minutes and the second cycle is six minutes, and assuming that the first moment is 0:10, the second moment may be 0:15, and the duration between the second moment and the first moment may be equal to the duration of the first cycle.

[0206] In this example, since the duration of the first cycle and the duration of the second cycle have one and only one common divisor, and the common divisor is 1, the duration between the second moment and the first moment can be equal to the duration of the first cycle. This can avoid multiple judgments when judging whether to start the first service based on the greatest common divisor of the duration of the first cycle and the duration of the second cycle, which is beneficial to reducing the power consumption of the terminal device.

[0207] Moreover, in this example, the execution time of the first service and the second service may also overlap at a specific moment, thereby reducing the number of times the target sensor is turned on, which is beneficial to reducing the power consumption of the terminal device. The duration between the specific moment and the second moment may be a common multiple of the first cycle and the second cycle.

[0208] In addition, the duration between the second moment and the first moment can be equal to the duration of the first cycle, so that the time interval between two consecutive judgments by the terminal device on whether the first service is in the on state can be equal to the duration of the first cycle, which is conducive to ensuring the value output rate of the first service.

[0209] Optionally, in some examples, after the terminal device starts to periodically execute the second service at a first moment, it may not determine whether to execute the second service at a second moment.

[0210] In some possible implementations, if the second service is not enabled at the first time, it is determined whether the second service is enabled at the third time. If the second service is enabled at the third time, the second service is periodically executed starting from the third time.

[0211] Optionally, the duration between the third moment and the first moment may also be equal to the first duration.

[0212] In some examples, assuming that the first period is ten minutes and the second period is thirty minutes, the first duration may be ten minutes. assuming that the first time is 0:10, the second time may be 0:20, and the third time may also be 0:20.

[0213] In this example, the third moment and the second moment can be the same moment. In this way, when the first business and the second business are not in the turned-on state at the first moment, it can be determined at the second moment (or the third moment) whether the first business and the second business are in the turned-on state. When it is determined that the first business and the second business are in the turned-on state at the second moment (or the third moment), each business can be periodically executed based on the execution cycle of each business.

[0214] In this way, the execution time of the first service and the second service can overlap at a specific moment, thereby reducing the number of times the target sensor is turned on, which is conducive to reducing the power consumption of the terminal device. The duration between the specific moment and the second moment can be a common multiple of the first cycle and the second cycle.

[0215] In addition, the duration between the third moment and the first moment can be equal to the duration of the first cycle, and the duration of the first cycle is less than the duration of the second cycle. In this way, the time interval between two consecutive judgments by the terminal device as to whether the second service is in the on state can be less than the duration of the second cycle, which is conducive to ensuring the value output rate of the second service.

[0216] In some other examples, assuming that the first period is ten minutes and the second period is fifteen minutes, the first duration may be five minutes. assuming that the first time is 0:10, the second time may be 0:15, and the third time may be 0:15.

[0217] In this example, the third moment and the second moment can be the same moment. In this way, when the first business and the second business are not in the turned-on state at the first moment, it can be determined at the second moment (or the third moment) whether the first business and the second business are in the turned-on state. When it is determined that the first business and the second business are in the turned-on state at the second moment (or the third moment), each business can be periodically executed based on the execution cycle of each business.

[0218] In this way, the execution time of the first service and the second service can overlap at a specific moment, thereby reducing the number of times the target sensor is turned on, which is conducive to reducing the power consumption of the terminal device. The duration between the specific moment and the second moment can be a common multiple of the first cycle and the second cycle.

[0219] In addition, the duration between the third moment and the first moment can be shorter than the duration of the first cycle, and the duration of the first cycle is shorter than the duration of the second cycle. In this way, the time interval between two consecutive judgments by the terminal device as to whether the second service is in the on state can be shorter than the duration of the second cycle, which is beneficial to ensuring the value output rate of the second service.

[0220] Optionally, the duration between the third moment and the first moment may also be equal to the duration of the second cycle.

[0221] For example, assuming that the first cycle is five minutes and the second cycle is six minutes, and assuming that the first time is 0:10, the second time may be 0:15 and the third time may be 0:16.

[0222] In this example, since the duration of the first cycle and the duration of the second cycle have one and only one common divisor, and the common divisor is 1, the duration between the third moment and the first moment can be equal to the duration of the second cycle. This can avoid multiple judgments when judging whether to start the second service based on the greatest common divisor of the duration of the first cycle and the duration of the second cycle, which is beneficial to reducing the power consumption of the terminal device.

[0223] Moreover, in this example, the execution time of the first service and the second service may also overlap at a specific moment, thereby reducing the number of times the target sensor is turned on, which is beneficial to reducing the power consumption of the terminal device. The duration between the specific moment and the second moment may be a common multiple of the first cycle and the second cycle.

[0224] In addition, the duration between the third moment and the first moment can be equal to the duration of the second cycle, so that the time interval between two consecutive judgments by the terminal device as to whether the second service is in the on state can be equal to the duration of the second cycle, which is conducive to ensuring the value output rate of the second service.

[0225] Optionally, in some examples, if the terminal device starts to periodically execute the first service at the first moment, it may not determine whether to execute the first service at the third moment.

[0226] In some possible implementations, if the second service is not in the on state at the third moment and is judged to be not in the on state at each of the M moments, then it is judged whether the second service is in the on state at the fourth moment, the fourth moment is separated from the third moment by a second cycle duration, M is a positive integer, the duration between the mth moment and the first moment among the M moments is equal to m first durations, m is a positive integer ranging from 1 to M, the Mth moment among the M moments is before the fourth moment, the M+1th moment is located at the fourth moment or after the fourth moment, and the duration between the M+1th moment and the first moment is equal to M+1 first durations.

[0227] In one example, assuming that the execution cycle of the first service is ten minutes and the execution cycle of the second service is thirty minutes, the first duration may be ten minutes. Assuming that the first time is 0:10, if the terminal device determines that the second service is not in the on state at 0:10, it determines again at 0:20 whether the second service is in the on state. If the terminal device determines that the second service is not in the on state at 0:20, it determines again at 0:30 whether the second service is in the on state. If the terminal device determines that the second service is not in the on state at 0:30, it determines again at 0:40 whether the second service is in the on state. If the terminal device determines that the second service is not in the on state at 0:40, it determines again at 0:50 whether the second service is in the on state.

[0228] In this example, 0:20 may be the third moment, the M moments may include three moments: 0:20, 0:30 and 0:40, and the fourth moment may include 0:50, which is the M+1th moment.

[0229] In another example, assuming that the execution cycle of the first service is ten minutes and the execution cycle of the second service is fifteen minutes, the first duration may be five minutes. Assuming that the first time is 0:10, if the terminal device determines that the second service is not in the on state at 0:10, it determines again at 0:15 whether the second service is in the on state. If the terminal device determines that the second service is not in the on state at 0:15, it determines again at 0:20 whether the second service is in the on state. If the terminal device determines that the second service is not in the on state at 0:20, it determines again at 0:25 whether the second service is in the on state. If the terminal device determines that the second service is not in the on state at 0:25, it determines again at 0:30 whether the second service is in the on state.

[0230] In this example, 0:15 may be the third moment, the M moments may include three moments: 0:15, 0:20, and 0:25, and the fourth moment may include 0:30, which is the M+1th moment.

[0231] In this method, the execution time of the first service and the second service can overlap at a specific moment, thereby reducing the number of times the target sensor is turned on, which is beneficial to reducing the power consumption of the terminal device. The duration between the specific moment and the second moment can be a common multiple of the first cycle and the second cycle.

[0232] In addition, the first duration can be less than or equal to the duration of the first cycle, and the duration of the first cycle is less than the duration of the second cycle. In this way, the time interval between two consecutive judgments by the terminal device as to whether the second service is in the on state can be less than the duration of the second cycle, which is conducive to ensuring the value output rate of the second service.

[0233] Optionally, in some embodiments, the terminal device may not determine whether the second service is at the start time at a specific time (such as the first time, the third time, etc. described above). For example, the terminal device may set a detection period, and all services may determine whether they are at the start time based on the detection period.

[0234] In the technical solution of the present application, if the first business and the second business are both in the turned-on state at the target time, the priorities of the first business and the second business can be determined based on at least one of the first condition, the second condition and the third condition, and then the execution order of the first business and the second business can be determined based on the order of their priorities from high to low.

[0235] The first condition may be: the service that requires more sensors has a higher priority. The second condition may be: the service that requires more sensor preset data reporting frequency has a higher priority. The third condition may be: the service that requires less preset service running time has a higher priority.

[0236] Optionally, the sensor required for each service may be preset in advance. For example, the sensor required for the first service is the first sensor, and the sensor required for the second service is the second sensor.

[0237] Optionally, the preset reporting frequency of the sensor preset for each service may also be preset in advance.

[0238] Optionally, the preset service running time of each service may also be preset in advance.

[0239] In a possible implementation, the terminal device determines the order of execution of the first service and the second service based on the order of their priorities from high to low, which may include: if the priority of the first service is higher than the priority of the second service, determining to start the first sensor at the target time, and starting other sensors in the second sensor except the target sensor after the target time; or, if the priority of the first service is lower than the priority of the second service, determining to turn on the second sensor at the target time, and turning on other sensors in the first sensor except the target sensor after the target time.

[0240] In the first example, assuming that the number of first sensors is greater than the number of second sensors, and the preset reporting frequencies of sensors and the preset service running times of the first service and the second service are the same, the priority of the first service is higher than the priority of the second service, and the execution order of the first service is higher than the execution order of the second service.

[0241] For example, assuming that the first sensor includes an ACC sensor and a PPG sensor, the second sensor includes an ACC sensor, and the number of first sensors is greater than the number of second sensors, the priority of the first service is higher than the priority of the second service, and the execution order of the first service is higher than the execution order of the second service.

[0242] In this example, the target sensor may be an ACC sensor. The terminal device may first turn on the first sensor, and then turn on other sensors in the second sensor except the target sensor, which may reduce the number of times the target sensor is turned on, thereby facilitating the reduction of power consumption of the terminal device.

[0243] In the second example, assuming that the preset reporting frequency of the sensor of the first service is greater than the preset reporting frequency of the sensor of the second service, and the number of the first sensor and the second sensor is the same, and the preset service running time of the first service and the second service is also the same, the priority of the first service is higher than the priority of the second service, and the execution order of the first service is higher than the execution order of the second service.

[0244] For example, assuming that the preset reporting frequency of the sensor of the first service is once every 50 milliseconds, and the preset reporting frequency of the sensor of the second service is once every 500 milliseconds, the priority of the first service is higher than the priority of the second service, and the execution order of the first service is higher than the execution order of the second service.

[0245] In this example, the terminal device may first turn on the first sensor, and then turn on other sensors in the second sensor except the target sensor, which can reduce the number of times the target sensor is turned on, thereby helping to reduce the power consumption of the terminal device.

[0246] In the third example, assuming that the preset service running time of the first service is less than the preset service running time of the second service, and the number of the first sensor and the second sensor is the same, and the preset reporting frequency of the sensors of the first service and the second service is also the same, the priority of the first service is higher than the priority of the second service, and the execution order of the first service is higher than the execution order of the second service.

[0247] For example, assuming that the preset service running time of the first service is 1 second and the preset service running time of the second service is 3 seconds, the priority of the first service is higher than the priority of the second service, and the execution order of the first service is higher than the execution order of the second service.

[0248] In this example, the terminal device may first turn on the first sensor, and then turn on other sensors in the second sensor except the target sensor, which can reduce the number of times the target sensor is turned on, thereby helping to reduce the power consumption of the terminal device.

[0249] Optionally, if at least two parameters in the first service and the second service are different, including the number of sensors, the frequency of sensor preset data reporting, and the preset service running time, the priority of the first service and the second service can be determined based on the judgment priority of the first condition, the second condition, and the third condition.

[0250] Among them, the judgment priority of the first condition may be higher than the judgment priority of the second condition, and the judgment priority of the second condition may be higher than the judgment priority of the third condition.

[0251] Optionally, after the terminal device determines the order of execution of the first service and the second service based on the order of their priorities from high to low, it can also determine the target data reporting frequency based on the preset data reporting frequency of the first service and the preset data reporting frequency of the second service, where the target data reporting frequency is equal to the greatest common divisor of the preset data reporting frequency of the first service and the preset data reporting frequency of the second service, and then determines the target data reporting frequency as the data reporting frequency of the target sensor after the target time.

[0252] In one example, assuming that the preset reporting frequency of the sensor of the first service is once every 50 milliseconds, and the preset reporting frequency of the sensor of the second service is once every 500 milliseconds, then the greatest common divisor of the preset data reporting frequency of the first service and the preset data reporting frequency of the second service is once every 50 milliseconds, and the target data reporting frequency can be once every 50 milliseconds.

[0253] In another example, assuming that the preset reporting frequency of the sensor of the first service is once every 50 milliseconds, and the preset reporting frequency of the sensor of the second service is once every 60 milliseconds, then the greatest common divisor of the preset data reporting frequency of the first service and the preset data reporting frequency of the second service is once every 10 milliseconds, and the target data reporting frequency can be once every 10 milliseconds.

[0254] In this method, the data reporting frequency of the target sensor after the target time can be the target data reporting frequency, which can ensure that the data reporting frequency of the target sensor after the target time can simultaneously meet the data reporting frequency requirements of the first service and the second service.

[0255] Furthermore, the terminal device can also determine the target service from the first service and the second service, the target service being the service with the shorter preset service running time among the first service and the second service; if the preset service running time of the target service is less than the preset service running time of other services except the target service among the first service and the second service, the end time of the target service is determined based on the preset service running time of the target service, and the interval between the end time and the target time is equal to the preset service time of the target service; the preset data reporting frequency of other services is determined as the data reporting frequency of the target sensor after the said end time.

[0256] For example, assuming that the preset service running time of the first service is 1 second, and the preset service running time of the second service is 3 seconds, and assuming that the target time is 0:30, the terminal device determines that the data reporting frequency of the target sensor after 0:30 is the target data reporting frequency, and determines that the data reporting frequency of the target sensor after 0:31 is the preset data reporting frequency of the second service.

[0257] In this example, it can be avoided that after the first service is completed, when the target sensor still reports at a high data reporting frequency, the target sensor collects and reports some redundant data, which is beneficial to further reduce the power consumption of the terminal device.

[0258] Optionally, after determining the data reporting frequency of the target sensor, the terminal device may send indication information to the target sensor based on the processor, where the indication information is used to instruct the target sensor to report based on the data reporting frequency determined by the terminal device.

[0259] Among them, the method for the terminal device to send indication information to the target sensor based on the processor can refer to the step of the terminal device sending indication information to the first sensor based on the processor in S701, which will not be repeated here.

[0260] It can be understood that the above embodiment is described by taking the first service and the second service as examples. Optionally, when more than two services are involved, the above method is also applicable.

[0261] For example, suppose that at 0:00, the terminal device determines that services A, B, C, and D are all in an on state, and the terminal device determines that services A, B, C, and D need to be executed.

[0262] like Figure 8 As shown, it is assumed that the sensor required by service A is an ACC sensor, the preset data reporting frequency of the sensor of service A is once every 500 milliseconds, and the preset service running time of service A is 1 second. The sensor required by service B is an ACC sensor, the preset data reporting frequency of the sensor of service B is once every 50 milliseconds, and the preset service running time of service B is 1 second. The sensors required by service C are ACC sensors and PPG sensors, the preset data reporting frequency of the sensor of service C is once every 500 milliseconds, and the preset service running time of service C is 1 second. The sensors required by service D are ACC sensors and PPG sensors, the preset data reporting frequency of the sensor of service D is once every 500 milliseconds, and the preset service running time of service C is 3 seconds.

[0263] Based on the number of sensors required for each of the four services, the preset data reporting frequency of the sensors, and the preset service running time, the terminal device can determine the order of priority from high to low as follows: service C, service D, service B, service A. Based on the priority order, the terminal device can determine the execution order as follows: service C, service D, service B, and service A, and determine the scheduling of services A, B, C, and D as follows: Fig. 9 shown.

[0264] In this example, at 0:00, the terminal device executes services A, B, C, and D based on the execution order, and determines that the data reporting frequency of the ACC sensor is once every 50 milliseconds, and determines that the data reporting frequency of the PPG is once every 500 milliseconds.

[0265] At 0:01, the terminal device stops executing services A, B, and C, and determines that the data reporting frequency of the ACC sensor is once every 500 milliseconds.

[0266] At 0:03, the terminal device stops executing service D.

[0267] Next, this application will provide a detailed introduction to the method for the terminal device to obtain sensor data. Fig.10 A flowchart of a service processing method for a terminal device provided in another embodiment of the present application.

[0268] In this method, the processor of the terminal device may be as follows: Figure 5 Single-core processor shown.

[0269] S1001: The processor of the terminal device determines that a service to be processed is in an open state at a target time, and the service to be processed is a service that periodically opens a third sensor to collect data.

[0270] As an example, the service to be processed may include the first service and / or the second service. The third sensor may be a sensor required by the service to be processed.

[0271] As an example, assuming that the service to be processed includes the first service, the third sensor may be the first sensor.

[0272] As another example, assuming that the service to be processed includes the second service, the third sensor may be the second sensor.

[0273] As another example, assuming that the service to be processed includes a first service and a second service, the third sensor may include a first sensor and a second sensor, and both the first sensor and the second sensor include a target sensor.

[0274] Among them, the method for the terminal device to determine that the to-be-processed service is in the open state at the target time can refer to the step in S701 where the terminal device determines that the first service is in the open state, which will not be repeated here.

[0275] S1002: When the processor of the terminal device determines to execute the pending service, it sends indication information to the third sensor, where the indication information is used to instruct the third sensor to collect and report data. Correspondingly, the third sensor receives the indication information.

[0276] The method for the processor of the terminal device to determine the execution of the to-be-processed service may refer to the step of the terminal device determining the execution of the first service in S702, which will not be described in detail here.

[0277] Optionally, when the service to be processed includes a first service and a second service, the terminal device may send indication information to the first sensor and the second sensor based on the priorities of the first service and the second service.

[0278] The method for the processor of the terminal device to determine the priorities of the first service and the second service may refer to the aforementioned embodiment and will not be described in detail here.

[0279] Optionally, the method for the processor of the terminal device to send indication information to the first sensor and the second sensor based on the priority of the first service and the second service may include: if the priority of the first service is higher than the priority of the second service, the processor sends first indication information to the first sensor, the first indication information is used to instruct the first sensor to collect the first data at the target time and upload the first data; and the processor sends second indication information to other sensors in the second sensor except the target sensor, the second indication information is used to instruct other sensors to collect the second data after the target time and upload the second data. Or, if the priority of the first service is lower than the priority of the second service, the processor sends third indication information to the second sensor, the third indication information is used to instruct the second sensor to collect the second data at the target time and upload the second data; and the processor sends fourth indication information to other sensors in the first sensor except the target sensor, the fourth indication information is used to instruct other sensors to collect the first data after the target time and upload the first data.

[0280] Furthermore, the processor may also send fifth indication information to the target sensor, the fifth indication information being used to instruct the target sensor to report data based on a target data reporting frequency after the target time, where the target data reporting frequency is equal to the greatest common divisor of a preset data reporting frequency of the first service and a preset data reporting frequency of the second service.

[0281] Furthermore, the processor can also send sixth indication information to the target sensor, and the sixth indication information is used to instruct the target sensor to report data based on the preset data reporting frequency of other services after the end time of the service to be processed, the service to be processed is the service with a shorter running time among the first service and the second service, and other services are other services among the first service and the second service except the service to be processed.

[0282] S1003: The third sensor collects data based on the indication information.

[0283] S1004: The third sensor sends the data collected by the third sensor to the processor. Correspondingly, the processor receives the data collected by the third sensor.

[0284] In the method, the processor of the terminal device can be a single-core processor, and the method for the terminal device to determine whether the pending service is turned on and to determine the execution of the pending service is all executed by the processor. When the pending service includes a first service and a second service, the execution time of the first service and the execution time of the second service can overlap at a specific time. This can not only reduce the power consumption of the terminal device, but also reduce the response time of the terminal device to execute the pending service, thereby improving the response speed of the pending service.

[0285] Optionally, Fig.11 A flowchart of a service processing method for a terminal device is provided in accordance with another embodiment of the present application.

[0286] In this method, the processor of the terminal device may be as follows: Figure 6 In this example, the processor of the terminal device may include a first processor and a second processor. The first processor may be as follows Figure 6 The M33 core shown in the figure, the second processor can be as follows Figure 6 The M55 nucleus shown.

[0287] S1101, a first processor receives service status information from a second processor, where the service status information is used to indicate that a service to be processed is in an open state at a target time, and the service to be processed is a service that periodically opens a third sensor to collect data.

[0288] As an example, the service to be processed may include the first service and / or the second service. The third sensor may be a sensor required by the service to be processed.

[0289] As an example, assuming that the service to be processed includes the first service, the third sensor may be the first sensor.

[0290] As another example, assuming that the service to be processed includes the second service, the third sensor may be the second sensor.

[0291] As another example, assuming that the service to be processed includes a first service and a second service, the third sensor may include a first sensor and a second sensor, and both the first sensor and the second sensor include a target sensor.

[0292] In this method, the method for the second processor to determine whether the first service and the second service are in the on state at the target time can refer to the step in S701 where the terminal device determines whether the first service is in the on state, which will not be repeated here.

[0293] S1102: When the first processor determines to execute the pending service, the first processor sends first information to the second processor, where the first information is used to instruct the execution of the pending service. Correspondingly, the second processor receives the first information.

[0294] In this method, the method for the first processor to determine to execute the to-be-processed service can refer to the step in S702 where the terminal device determines to execute the first service, which will not be described in detail here.

[0295] S1103: The second processor sends instruction information to the first processor, where the instruction information is used to instruct the third sensor to collect and report data. Correspondingly, the first processor receives the instruction information.

[0296] S1104: The first processor sends the indication information to the third sensor. Correspondingly, the third sensor receives the indication information.

[0297] Optionally, when the service to be processed includes a first service and a second service, the second processor of the terminal device may send indication information to the first processor based on the priorities of the first service and the second service.

[0298] The method for the second processor of the terminal device to determine the priority of the first service and the second service can refer to the aforementioned embodiment and will not be described in detail here.

[0299] Optionally, the method in which the second processor of the terminal device sends indication information to the first processor based on the priorities of the first service and the second service may include:

[0300] If the priority of the first service is higher than the priority of the second service, the second processor sends a first indication message to the first processor, and the first indication message is used to instruct the first sensor to collect the first data and upload the first data at the target time. Accordingly, after receiving the first indication message, the first processor can send the first indication message to the first sensor. And the second processor sends a second indication message to the first processor, and the second indication message is used to instruct other sensors in the second sensor except the target sensor to collect the second data and upload the second data after the target time. Accordingly, after receiving the second indication message, the first processor can send the second indication message to the other sensor.

[0301] Or, if the priority of the first service is lower than the priority of the second service, the second processor sends a third indication message to the first processor, and the third indication message is used to instruct the second sensor to collect the second data and upload the second data at the target time. Accordingly, after receiving the third indication message, the first processor can send the third indication message to the second sensor. And the second processor sends a fourth indication message to the first processor, and the fourth indication message is used to instruct the other sensors to collect the first data and upload the first data after the target time. Accordingly, after receiving the fourth indication message, the first processor can send the fourth indication message to the other sensor.

[0302] Furthermore, the second processor may also send fifth indication information to the first processor, the fifth indication information being used to instruct the target sensor to report data based on a target data reporting frequency after the target time, the target data reporting frequency being equal to the greatest common divisor of a preset data reporting frequency of the first service and a preset data reporting frequency of the second service. Accordingly, after receiving the fifth indication information, the first processor may send the fifth indication information to the target sensor.

[0303] Furthermore, the second processor may also send sixth indication information to the first processor, the sixth indication information being used to instruct the target sensor to report data based on the preset data reporting frequency of other services after the end time of the service to be processed, the service to be processed being the service with the shorter preset service running time between the first service and the second service, and the other service being the service other than the service to be processed between the first service and the second service. Accordingly, after receiving the sixth indication information, the first processor may send the sixth indication information to the target sensor.

[0304] S1105: The third sensor collects data based on the indication information.

[0305] S1106: The third sensor sends the data collected by the third sensor to the first processor. Correspondingly, the first processor receives the data collected by the third sensor.

[0306] S1107: The first processor sends the data collected by the third sensor to the second processor. Correspondingly, the second processor receives the data collected by the third sensor.

[0307] In this method, the processor of the terminal device can be a dual-core processor, and the method for the terminal device to determine whether the pending service is turned on and determine to execute the pending service is performed by the first processor. Since the power consumption of the first processor is lower than that of the second processor, this can further reduce the power consumption of the terminal device.

[0308] Fig.12 This is a schematic diagram of the structure of a service processing device provided by an embodiment of the present application. Fig.12 As shown, the business processing device 1200 may include a determination module 1201 and an execution module 1202 .

[0309] As an example, the service processing device 1200 may be used to implement Figure 7 The business processing method of the embodiment shown in the figure, wherein the judging module 1201 can be used to execute S701 and S703, and the executing module 1202 can be used to execute S702 and S704.

[0310] Optionally, the service processing device 1200 may be applied to a terminal device. For example, the service processing device 1200 may be applied to a processor of the terminal device. The processor of the terminal device may be Figure 5 or Figure 6 Processor shown.

[0311] Fig.13 This is a schematic diagram of the structure of a service processing device provided by an embodiment of the present application. Fig.13 As shown, the service processing device 1300 may include a determining module 1301 , a sending module 1302 and a receiving module 1303 .

[0312] As an example, the service processing device 1300 may be used to implement Fig.10 The service processing method of the embodiment shown in the figure, wherein the determining module 1301 can be used to execute S1001, the sending module 1302 can be used to execute S1002, and the receiving module 1303 can be used to execute S1004.

[0313] Optionally, the service processing device 1300 may be applied to Figure 5 In the processor of the terminal device shown.

[0314] Fig.14 This is a schematic diagram of the structure of a service processing device provided by an embodiment of the present application. Fig.14 As shown, the service processing device 1400 may include a receiving module 1401 and a sending module 1402 .

[0315] As an example, the service processing device 1400 may be used to implement Fig.14 The service processing method of the embodiment shown in the figure, wherein the receiving module 1401 can be used to execute S1101, S1103 and S1106, and the sending module 1402 can be used to execute S1102, S1104 and S1107.

[0316] Optionally, the service processing device 1400 may be applied to Figure 6 In the first processor of the terminal device shown.

[0317] Fig.15This is a schematic diagram of the structure of a service processing device provided by another embodiment of the present application. Fig.15 As shown, the service processing device 1500 includes a processor 1501 and an interface circuit 1502. The processor 1501 and the interface circuit 1502 are coupled to each other. It can be understood that the interface circuit 1502 can be a transceiver or an input-output interface. Optionally, the service processing device 1500 can also include a memory 1503 for storing instructions executed by the processor 1501 or storing input data required by the processor 1501 to run the instructions or storing data generated after the processor 1501 runs the instructions.

[0318] As a first example, the processor 1501 may be used to implement the functions of the above-mentioned determination module 1201 and execution module 1202 .

[0319] As a second example, the processor 1501 may be used to implement the functions of the above-mentioned determination module 1301 , and the interface circuit 1502 may be used to implement the functions of the above-mentioned sending module 1302 and receiving module 1303 .

[0320] As a second example, the interface circuit 1502 is used to implement the functions of the above-mentioned receiving module 1401 and sending module 1402.

[0321] The service processing apparatus 1500 may be a terminal device or a chip used in the terminal device.

[0322] The method steps in the embodiments of the present application can be implemented by hardware, or by a processor executing software instructions. The software instructions can be composed of corresponding software modules, and the software modules can be stored in a random access memory, a flash memory, a read-only memory, a programmable read-only memory, an erasable programmable read-only memory, an electrically erasable programmable read-only memory, a register, a hard disk, a mobile hard disk, a CD-ROM, or any other form of storage medium well known in the art. An exemplary storage medium is coupled to the processor so that the processor can read information from the storage medium and can write information to the storage medium. Of course, the storage medium can also be a component of the processor. The processor and the storage medium can be located in an ASIC. In addition, the ASIC can be located in a network device or a terminal device. Of course, the processor and the storage medium can also be present in a network device or a terminal device as discrete components.

[0323] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented by software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer programs or instructions. When the computer program or instruction is loaded and executed on a computer, the process or function described in the embodiment of the present application is executed in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, a network device, a user device or other programmable device. The computer program or instruction may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer program or instruction may be transmitted from one website site, computer, server or data center to another website site, computer, server or data center by wired or wireless means. The computer-readable storage medium may be any available medium that a computer can access or a data storage device such as a server, data center, etc. that integrates one or more available media. The available medium may be a magnetic medium, for example, a floppy disk, a hard disk, a tape; it may also be an optical medium, for example, a digital video disc; it may also be a semiconductor medium, for example, a solid-state hard disk.

[0324] In the various embodiments of the present application, unless otherwise specified or provided for in any logical conflict, the terms and / or descriptions between the different embodiments are consistent and may be referenced to each other, and the technical features in the different embodiments may be combined to form new embodiments according to their inherent logical relationships.

[0325] It is understood that the various numbers involved in the embodiments of the present application are only for the convenience of description and are not used to limit the scope of the embodiments of the present application. The size of the sequence number of the above-mentioned processes does not mean the order of execution, and the execution order of each process should be determined by its function and internal logic.

Claims

1. A business processing method, characterized in that: Applied to a terminal device, the method comprises: At a first moment, determining whether a first service is in an on state, the first service being a service that periodically starts a first sensor to collect data, the execution period of the first service being a first period, and the first sensor including a target sensor; If the first service is in an enabled state at the first moment, periodically executing the first service with the first moment as a start moment; At the first moment, determining whether a second service is in an on state, the second service is a service that periodically starts a second sensor to collect data, the execution period of the second service is a second period, and the second sensor includes the target sensor; If the second service is in an enabled state at the first moment, the second service is periodically executed with the first moment as a start moment.

2. The method according to claim 1, characterized in that The second period is greater than the first period, and the method further includes: If the first service is not in the on state at the first moment, it is determined at the second moment whether the first service is in the on state, the duration between the second moment and the first moment is equal to the first duration, and the first duration is equal to the greatest common divisor of the duration of the first cycle and the duration of the second cycle.

3. The method according to claim 2, characterized in that The method further comprises: If the second service is not in an enabled state at the first moment, determining whether the second service is in an enabled state at a third moment; If the second service is in an enabled state at the third time, the second service is periodically executed with the third time as a start time.

4. The method according to claim 3, characterized in that The method further comprises: If the second service is not in the turned-on state at the third moment and is judged to be not in the turned-on state at each of the M moments, then it is judged whether the second service is in the turned-on state at the fourth moment, the fourth moment is separated from the third moment by a duration of the second cycle, M is a positive integer, the duration between the mth moment among the M moments and the first moment is equal to m first durations, m is a positive integer and ranges from 1 to M, the Mth moment among the M moments is located before the fourth moment, the M+1th moment is located at the fourth moment, and the duration between the M+1th moment and the first moment is equal to M+1 first durations.

5. The method according to any one of claims 1 to 4, characterized in that The method further comprises: If the first service and the second service are both in the on state at the target time, the priorities of the first service and the second service are determined based on at least one of the first condition, the second condition and the third condition, the first condition being that the service requiring more sensors has a higher priority, the second condition being that the service requiring more sensor preset data reporting frequency has a higher priority, the third condition being that the service requiring less preset service running time has a higher priority, the first condition having a higher judgment priority than the second condition, and the second condition having a higher judgment priority than the third condition; The execution order of the first service and the second service is determined based on the order of priorities of the first service and the second service from high to low.

6. The method according to claim 5, characterized in that The determining the execution order of the first service and the second service based on the priority of the first service and the second service in descending order includes: If the priority of the first service is higher than the priority of the second service, determine to start the first sensor at the target time, and start other sensors of the second sensor except the target sensor after the target time; Or, if the priority of the first service is lower than the priority of the second service, it is determined to turn on the second sensor at the target time, and to turn on other sensors of the first sensors except the target sensor after the target time.

7. The method according to claim 5 or 6, characterized in that: The method further comprises: Determining a target data reporting frequency based on a preset data reporting frequency of the first service and a preset data reporting frequency of the second service, wherein the target data reporting frequency is equal to a greatest common divisor of the preset data reporting frequency of the first service and the preset data reporting frequency of the second service; The target data reporting frequency is determined as the data reporting frequency of the target sensor after the target time.

8. The method according to claim 7, characterized in that The method further comprises: Determine a target service from the first service and the second service, where the target service is a service with a shorter preset service running time among the first service and the second service; If the preset service running time of the target service is less than the preset service running time of other services in the first service and the second service except the target service, determining the end time of the target service based on the preset service running time of the target service, and the interval between the end time and the target time is equal to the preset service running time of the target service; The preset data reporting frequency of the other services is determined as the data reporting frequency of the target sensor after the end time.

9. A business processing method, characterized in that: Applied to a terminal device, the method comprises: The processor of the terminal device determines that the service to be processed is in an open state at the target time, the service to be processed is a service that periodically opens a third sensor to collect data, and the service to be processed includes the first service and / or the second service; When the processor determines to execute the service to be processed, the processor sends indication information to the third sensor, where the indication information is used to instruct the third sensor to collect and report data.

10. The method according to claim 9, characterized in that When the service to be processed includes a first service and a second service, the third sensor includes a first sensor and a second sensor, the first service is a service that periodically starts the first sensor to collect data, the second service is a service that periodically starts the second sensor to collect data, and the first sensor and the second sensor both include target sensors; The processor sending indication information to the third sensor includes: The processor sends the indication information to the first sensor and the second sensor based on priorities of the first service and the second service.

11. The method according to claim 10, characterized in that The processor sending the indication information to the first sensor and the second sensor based on the priorities of the first service and the second service includes: If the priority of the first service is higher than the priority of the second service, the processor sends first indication information to the first sensor, where the first indication information is used to instruct the first sensor to collect first data and upload the first data at the target time; and the processor sends second indication information to other sensors in the second sensors except the target sensor, wherein the second indication information is used to instruct the other sensors to collect second data after the target time and upload the second data; or, if the priority of the first service is lower than the priority of the second service, the processor sends third indication information to the second sensor, where the third indication information is used to instruct the second sensor to collect second data and upload the second data at the target time; And the processor sends fourth indication information to other sensors in the first sensor except the target sensor, where the fourth indication information is used to instruct the other sensors to collect first data and upload the first data after the target time.

12. The method according to claim 10 or 11, characterized in that: The method further comprises: The processor sends fifth indication information to the target sensor, where the fifth indication information is used to instruct the target sensor to report data based on a target data reporting frequency after the target time, where the target data reporting frequency is equal to the greatest common divisor of a preset data reporting frequency of the first service and a preset data reporting frequency of the second service.

13. The method according to claim 12, characterized in that The method further comprises: The processor sends sixth indication information to the target sensor, where the sixth indication information is used to instruct the target sensor to report data based on a preset data reporting frequency of other services after an end time of a target service, where the target service is a service with a shorter preset service running time among the first service and the second service, and the other service is other services among the first service and the second service except the target service.

14. A business processing method, characterized in that: Applied to a terminal device, the method comprises: The first processor of the terminal device receives service status information, where the service status information is used to indicate that the service to be processed is in an open state at the target time, where the service to be processed is a service that periodically opens a third sensor to collect data, and where the service to be processed includes the first service and / or the second service; When the first processor determines to execute the pending service, the first processor sends first information to the second processor, where the first information is used to instruct the execution of the pending service; The first processor receives instruction information from the second processor, where the instruction information is used to instruct the third sensor to collect and report data; The first processor sends the indication information to the third sensor.

15. The method according to claim 14, characterized in that When the service to be processed includes a first service and a second service, the third sensor includes a first sensor and a second sensor, the first service is a service that periodically starts the first sensor to collect data, the second service is a service that periodically starts the second sensor to collect data, and the first sensor and the second sensor both include target sensors; The first processor sending indication information to the third sensor includes: The first processor sends the indication information to the first sensor and the second sensor based on priorities of the first service and the second service.

16. The method according to claim 15, characterized in that The first processor sends the indication information to the first sensor and the second sensor based on the priorities of the first service and the second service, including: If the priority of the first service is higher than the priority of the second service, the first processor sends first indication information to the first sensor, where the first indication information is used to instruct the first sensor to collect first data and upload the first data at the target time; and the first processor sends second indication information to other sensors in the second sensors except the target sensor, wherein the second indication information is used to instruct the other sensors to collect second data after the target time and upload the second data; or, if the priority of the first service is lower than the priority of the second service, the first processor sends third indication information to the second sensor, where the third indication information is used to instruct the second sensor to collect second data and upload the second data at the target time; And the first processor sends fourth indication information to other sensors among the first sensors except the target sensor, where the fourth indication information is used to instruct the other sensors to collect first data and upload the first data after the target time.

17. The method according to claim 15 or 16, characterized in that The method further comprises: The first processor sends fifth indication information to the target sensor, where the fifth indication information is used to instruct the target sensor to report data based on a target data reporting frequency after the target time, where the target data reporting frequency is equal to the greatest common divisor of a preset data reporting frequency of the first service and a preset data reporting frequency of the second service.

18. The method according to claim 17, characterized in that The method further comprises: The first processor sends sixth indication information to the target sensor, where the sixth indication information is used to instruct the target sensor to report data based on a preset data reporting frequency of other services after an end time of a target service, where the target service is the service with a shorter preset service running time among the first service and the second service, and the other service is the service among the first service and the second service except the target service.

19. A device, characterized in that: The method comprises a functional module for implementing the method according to any one of claims 1 to 8, or comprises a functional module for implementing the method according to any one of claims 9 to 13, or comprises a functional module for implementing the method according to any one of claims 14 to 18.

20. A device, characterized in that: include: Memory and processor; The memory is used to store program instructions; The processor is used to execute program instructions in the memory to implement the method as described in any one of claims 1 to 8, or to execute program instructions in the memory to implement the method as described in any one of claims 9 to 13, or to execute program instructions in the memory to implement the method as described in any one of claims 14 to 18.

21. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a program code for computer execution, the program code including instructions for implementing the method according to any one of claims 1 to 8, any one of claims 9 to 13, or any one of claims 14 to 18.

22. A computer program product, characterized in that The computer program product comprises instructions for implementing the method of any one of claims 1 to 8 or any one of claims 9 to 13 or any one of claims 14 to 18.

Citation Information

Cited By

  • Service processing method and related apparatus

    EP4701282A1

  • Service processing method and related apparatus

    WO2025055593A1