Service processing method and related apparatus

By implementing a service processing method in the terminal device, determining the opening status of multiple cycle services and performing services coincidentally at a specific time, the problem of large power consumption of terminal devices when executing multiple cycle services is solved, and power consumption reduction and equipment efficiency improvement are achieved.

WO2025055593A1PCT designated stage expired Publication Date: 2025-03-20HUAWEI TECH CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2024/109612
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-09-15
Filing Date
2024-08-02
Publication Date
2025-03-20

AI Technical Summary

Technical Problem

When terminal equipment performs multiple cycles of services, it consumes a lot of power, resulting in shortening battery life and excessive heat from the equipment.

Method used

By implementing a service processing method in the terminal device, the opening status of multiple cycle services is judged, and the service is executed coincidentally at a specific moment, reducing the number of sensor opening times. The method includes determining at the first moment whether the first service and the second service are in the open state, and periodically performing the corresponding service with the moment as the starting moment. If the service is not in the on-state at the preset time, the service status is judged again after the preset time to ensure that the specific moments of the service execution time overlap.

Benefits of technology

By reducing the number of sensors turned on, the power consumption of terminal devices is reduced, the battery life is extended, the heat of the device is reduced, and the operation efficiency of the device is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024109612_20032025_PF_FP_ABST
    Figure CN2024109612_20032025_PF_FP_ABST
Patent Text Reader

Abstract

The present application provides a service processing method and a related apparatus, applicable to the technical field of terminals. In the present application, a terminal device can determine, at a first moment, whether a first service and a second service are in an on state, when the first service is in the on state, the first service is periodically executed, and when the second service is in the on state, the second service is periodically executed, wherein the first service is a service for periodically turning on a first sensor to collect data, the second service is a service for periodically turning on a second sensor to collect data, and the first sensor and the second sensor can both comprise a target sensor. According to the method in the present application, the execution time of the first service and the execution time of the second service can coincide at a specific moment, so that the target sensor only needs to be started once at the specific moment, thereby reducing the turning on frequency of the target sensor, and reducing the power consumption of the terminal device.
Need to check novelty before this filing date? Find Prior Art

Description

Business processing method and related device

[0001] This application claims priority to the Chinese patent application filed with the China Patent Office on September 15, 2023, with application number 202311193006.0 and application name “Business Processing Method and Related Devices”, the entire contents of which are incorporated by reference into this application. Technical Field

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

[0003] 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 various periodic services for health monitoring, such as periodic blood oxygen and periodic heart rate monitoring.

[0004] Currently, a method for a terminal device to execute a periodic service may include: after receiving a user's instruction to start a periodic service, the terminal device may periodically control sensors related to the periodic service to collect data based on an execution cycle of the periodic service.

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

[0006] Summary of the Invention

[0007] 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.

[0008] 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.

[0009] In this method, the first time may be preset in advance. For example, the first time may be 0:10.

[0010] Optionally, the first moment may also be the power-on moment of the terminal device. As an example, assuming that the terminal device is powered on at 0:10, the first moment may be 0:10.

[0011] Optionally, the time between the first moment and the time when the terminal device is turned on can also be a preset time. The preset time can be preset in advance. For example, assuming that the terminal device is turned on at 0:10 and the preset time is five minutes, the first moment can be 0:15.

[0012] 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.

[0013] In this 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 period and the second period.

[0014] 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.

[0015] 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 the open state at the first moment, then determining whether the first service is in the open state at the 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.

[0016] In one 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.

[0017] In this example, the greatest common divisor of the first cycle duration and the second cycle duration is equal to the first cycle duration. The duration between the second moment and the first moment can be equal to the first cycle duration. This allows the execution times of the first service and the second service to overlap at a specific moment, thereby reducing the number of times the target sensor is activated and thus reducing power consumption of the terminal device. The duration between the specific moment and the second moment can be a common multiple of the first and second cycles.

[0018] In addition, the duration between the second moment and the first moment can be equal to the duration of the first cycle. In this way, 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-out rate of the first service.

[0019] 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.

[0020] In this example, the duration between the second moment and the first moment can be equal to the greatest common divisor of the durations of the first cycle and the second cycle. In this way, the execution times 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 for reducing 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.

[0021] In addition, the duration between the second moment and the first moment can be shorter than the duration of the first cycle. In this way, 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-out rate of the first service.

[0022] 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 the starting moment.

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

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

[0025] 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 open 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 open state. When it is determined that the first business and the second business are in the open state at the second moment (or the third moment), each business can be periodically executed based on the execution cycle of each business.

[0026] 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 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 period and the second period.

[0027] 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 the terminal device's two consecutive judgments on 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.

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

[0029] 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 open 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 open state. When it is determined that the first business and the second business are in the open state at the second moment (or the third moment), each business can be periodically executed based on the execution cycle of each business.

[0030] 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 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 period and the second period.

[0031] In addition, the duration between the third moment and the first moment can be less than 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 the terminal device's two consecutive judgments on 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.

[0032] 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 in 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 in the M moments is before the fourth moment, the M+1th moment is in the fourth moment, and the duration between the M+1th moment and the first moment is equal to M+1 first durations.

[0033] 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 can be ten minutes. Assuming that the first moment is 0:10, if the terminal device determines that the second service is not in the on state at 0:10, it will determine 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 will determine 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 will determine 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 will determine again at 0:50 whether the second service is in the on state.

[0034] 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.

[0035] 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 can 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 will determine 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 will determine 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 will determine 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 will determine again at 0:30 whether the second service is in the on state.

[0036] 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.

[0037] 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 target sensor is turned on, which is beneficial for reducing the power consumption of the terminal device. The duration between the specific time and the second time can be a common multiple of the first period and the second period.

[0038] 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.

[0039] In some possible implementations, the method further 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 sensors has a higher priority, the third condition being that the service requiring less preset data reporting 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.

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

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

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

[0043] In the first example, assuming that the number of first sensors is greater than the number of second sensors, and the preset reporting frequency of sensors and the preset service running time 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.

[0044] 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.

[0045] 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.

[0046] 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.

[0047] 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 in 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 start the second sensor at the target time, and starting other sensors in the first sensor except the target sensor after the target time.

[0048] 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, thereby helping to reduce the power consumption of the terminal device.

[0049] In some possible implementations, the method further includes: determining a 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, the target data reporting frequency being 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 moment.

[0050] 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, 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.

[0051] 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, 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.

[0052] 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.

[0053] 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 the 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 other than the target business among the first business and the second 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.

[0054] 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.

[0055] In this example, it is possible to avoid the target sensor collecting and reporting some redundant data when the target sensor still reports at a high data reporting frequency after the first service is completed, thereby facilitating further reduction in power consumption of the terminal device.

[0056] In a second aspect, the present application provides a service processing method, which is applied to a terminal device. The method includes: a processor of the terminal device determining that a pending service is in an active state at a target time, the pending service being a service that periodically activates a third sensor to collect data, and the pending service including a first service and / or a second service; and when the processor determines to execute the pending service, sending an indication message to the third sensor, the indication message being used to instruct the third sensor to collect and report data.

[0057] In this method, the processor of the terminal device can be a single-core processor, and the terminal device determines whether the pending service is turned on and determines the method for executing the pending service. 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 coincide with a specific time. This not only reduces the power consumption of the terminal device, but also reduces the response time of the terminal device in executing the pending service, thereby improving the response speed of the pending service.

[0058] In some possible implementations, when the to-be-processed business includes a first business and a second business, the third sensor includes a first sensor and a second sensor, the first business is a business that periodically starts the first sensor to collect data, the second business is a business that periodically starts the second sensor to collect data, and the first sensor and the second sensor both include target sensors.

[0059] 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.

[0060] 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:

[0061] 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 among the second sensors except the target sensor, where the second indication information is used to instruct the other sensors to collect second data and upload the second data after the target time.

[0062] Alternatively, if the priority of the first service is lower than the priority of the second service, the processor sends a third indication message to the second sensor, wherein 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; and the processor sends a fourth indication message to other sensors in the first sensor except the target sensor, wherein 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.

[0063] In some possible implementations, the method further includes: the processor sending fifth indication information to the target sensor, wherein 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.

[0064] In some possible implementations, the method further includes: the processor sending sixth indication information to the target sensor, the sixth indication information being 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 being the service with the shorter preset running time between the first service and the second service, and the other services being other services between the first service and the second service except the target service.

[0065] In a third aspect, the present application provides a service processing method, which is applied to a terminal device. The method includes: a 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 a 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 instruct the execution of the service to be processed; the first processor receives indication information from the second processor, the indication information is used to instruct the third sensor to collect and report data; the first processor sends the indication information to the third sensor.

[0066] In this method, the processor of the terminal device can be a dual-core processor, and the methods for the terminal device to determine whether the pending service is turned on and to determine whether to execute the pending service are both 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.

[0067] In some possible implementations, when the to-be-processed business includes a first business and a second business, the third sensor includes a first sensor and a second sensor, the first business is a business that periodically starts the first sensor to collect data, the second business is a business that periodically starts the second sensor to collect data, and the first sensor and the second sensor both include target sensors.

[0068] 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.

[0069] 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:

[0070] 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 among the second sensors except the target sensor, where the second indication information is used to instruct the other sensors to collect second data and upload the second data after the target time.

[0071] Alternatively, 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 and upload the second data at the target time; 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.

[0072] In some possible implementations, the method further includes: the first processor sends fifth indication information to the target sensor, wherein 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.

[0073] 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 the 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.

[0074] In a fourth aspect, the present application provides an apparatus comprising 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.

[0075] In a fifth aspect, the present application provides an apparatus comprising 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.

[0076] In a sixth aspect, the present application provides an apparatus comprising 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.

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

[0078] The apparatus 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 apparatus may further include a communication interface for communicating between the apparatus and other devices. Exemplarily, the communication interface may be a transceiver, circuit, bus, module, or other type of communication interface.

[0079] 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.

[0080] 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.

[0081] 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

[0082] FIG1 is a schematic diagram of an applicable intelligent detection scenario according to an embodiment of the present application;

[0083] FIG2 is a schematic diagram of the structure of a terminal device provided in an embodiment of the present application;

[0084] FIG3 is a schematic diagram of a user interface provided in an embodiment of the present application;

[0085] Figure 4 is a schematic diagram of the execution time of different services;

[0086] FIG5 is a schematic diagram of a system architecture of a terminal device provided in an embodiment of the present application;

[0087] FIG6 is a schematic diagram of a system architecture of another terminal device provided in an embodiment of the present application;

[0088] FIG7 is a flowchart of a business processing method provided by this application;

[0089] FIG8 is a schematic diagram of multiple services provided by an embodiment of the present application;

[0090] FIG9 is a schematic diagram of scheduling multiple services provided in an embodiment of the present application;

[0091] FIG10 is a flow chart of a service processing method of a terminal device provided by another embodiment of the present application;

[0092] FIG11 is a flow chart of a service processing method of a terminal device provided in another embodiment of the present application;

[0093] FIG12 is a schematic diagram of the structure of a service processing device provided by an embodiment of the present application;

[0094] FIG13 is a schematic structural diagram of a service processing device provided by another embodiment of the present application;

[0095] FIG14 is a schematic structural diagram of a service processing device provided in yet another embodiment of the present application;

[0096] FIG15 is a schematic structural diagram of a business processing device provided in yet another embodiment of the present application. DETAILED DESCRIPTION

[0097] 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.

[0098] To facilitate a clear description of the technical solutions of the embodiments of the present application, in the embodiments of the present application, words such as "first" and "second" are used to distinguish between identical or similar items with substantially the same functions and effects. For example, the first information and the second information are merely used to distinguish different information and do not limit their order. Those skilled in the art will understand that words such as "first" and "second" do not limit the quantity or execution order, and words such as "first" and "second" do not necessarily limit differences.

[0099] In the embodiments of the present application, "at least one" refers to one or more, and "more" 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: the existence of A alone, the existence of A and B at the same time, and the existence of B 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 items" 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, b, and c. Among them, a, b, and c can be single or multiple.

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

[0101] 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.

[0102] 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.

[0103] 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 accelerometer (ACC), photoplethysmo graphy (PPG), and electrocardiography (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.

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

[0105] 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.

[0106] 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.

[0107] 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 processing unit (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), etc. The different processing units may be independent devices or integrated into one or more processors. The processor 210 may also include a memory for storing instructions and data.

[0108] USB interface 230 is an interface that complies with USB standards and specifications, and may be a Mini USB interface, a Micro USB interface, a USB Type-C interface, or the like. USB interface 230 can be used to connect a charger to charge the terminal device, or to transfer data between the terminal device and peripheral devices. It can also be used to connect headphones to play audio. This interface can also be used to connect to other terminal devices, such as AR devices.

[0109] 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.

[0110] 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 provides power to the processor 210, the internal memory 221, the external memory, the camera 293, the display 294, the audio module 270, the wireless communication module 260, and the like. In some embodiments, the power management module 241 may also be provided in the processor 210. In other embodiments, the power management module 241 and the charging management module 240 may also be provided in the same device.

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

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

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

[0114] Mobile communication module 250 can provide wireless communication solutions, including 2G / 3G / 4G / 5G, for terminal devices. It can include at least one filter, switch, power amplifier, and low-noise amplifier (LNA). Mobile communication module 250 receives electromagnetic waves from antenna 1, filters and amplifies them, and transmits them to the modem processor for demodulation. Mobile communication module 250 can also amplify the signals modulated by the modem processor and convert them into electromagnetic waves for radiation via antenna 1.

[0115] 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 terminal devices. 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, frequency modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 210. The wireless communication module 260 can also receive the signal to be sent from the processor 210, frequency modulate it, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2.

[0116] 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.

[0117] 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.

[0118] 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.

[0119] 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 present embodiment. It is understood that in some embodiments, the terminal device may include the display screen 294 or not. For example, when the terminal device is a wristband, it may include the display screen 294 or not. When the terminal device is a watch, it may include the display screen 294.

[0120] 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 via the external memory interface 220 to implement data storage functions. For example, files such as music and videos can be stored on the external memory card.

[0121] The internal memory 221 can be used to store computer-executable program code, which includes instructions. The internal memory 221 can include a program storage area and a data storage area. 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.).

[0122] The terminal device can implement audio functions such as music playback and recording through the audio module 270, the speaker 270A, the receiver 270B, the microphone 270C, the headphone jack 270D, and the application processor.

[0123] 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 heard 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.

[0124] The pressure sensor 280A is used to sense pressure signals and convert them into electrical signals. In some embodiments, the pressure sensor 280A can be provided on the display screen 294. When a touch operation is performed on the display screen 294, the terminal device can detect the intensity of the touch operation based on the pressure sensor 280A. The terminal device can also calculate the location of the touch based on 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.

[0125] Touch sensor 280B can be disposed on display screen 294. The touch sensor 280B and display screen 294 form a touch screen, also known as a "touch screen." Touch sensor 280B is configured to detect touch operations applied thereto or in the vicinity thereof. Touch sensor 280B can transmit the detected touch operations to application processor 210 to determine the type of touch event. Visual output related to the touch operations can be provided via display screen 294. In other embodiments, touch sensor 280B can also be disposed on the surface of display screen 294, at a location different from that of display screen 294.

[0126] The ACC sensor 280C can be used to measure the 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 user's guidance, the ACC sensor 280C can detect the acceleration in various directions to reflect the body's motion state.

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

[0128] In some embodiments, the capacitance 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, wherein the human body can be used as an electrode. When the capacitance sensor 280D is set on the electrode on the terminal device, the capacitance sensor 280D can detect the capacitance between the human body and the electrode. When the capacitance detected by the capacitance 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 capacitance 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 thus affect the generation of ECG, the terminal device can refer to the capacitance detected by the capacitance sensor 280D when generating ECG.

[0129] 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 the 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 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.

[0130] Keys 290 include a power button, a volume button, and the like. Keys 290 may be mechanical keys or touch-sensitive keys. The terminal device may receive key inputs and generate key signal inputs related to user settings and function control of the terminal device. Motor 291 may generate vibration prompts. Indicator 292 may be an indicator light that may be used to indicate charging status, power level changes, messages, missed calls, notifications, and the like. Timer 296 may be used to record time information. For example, when the terminal device is recording a video, the start and end times of the video may be recorded, as well as the duration of the recorded video.

[0131] It is understood that the structures illustrated in the embodiments of the present application do not constitute specific limitations on the terminal device. In other embodiments of the present application, the terminal device may include more or fewer components than shown, or may combine or separate certain components, or arrange the components differently. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.

[0132] In some embodiments, the terminal device can be a wearable device, such as a smart watch or a smart bracelet. The wearable device may further include a main body (not shown in FIG1 ) and a wristband (not shown in FIG1 ). The wristband may be fixedly connected or movably connected to the main body, and the wristband may be wrapped around a wrist, arm, leg or other part of the body to fix the wearable device to the user. The main body may include a shell and a cover, the shell surrounding 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 interior of the structure formed by the shell and the cover has a storage space that can accommodate a combination of one or more components shown in FIG1 and not shown to realize various functions of the wearable device. Optionally, the main body also includes an input device, and the storage space within 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 access.

[0133] 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.

[0134] Currently, a method for a terminal device to execute a periodic service may include: after receiving a user's instruction to start a periodic service, the terminal device may periodically control sensors related to the periodic service to collect data based on an execution cycle of the periodic service.

[0135] In some scenarios, the terminal device can be a mobile phone. Taking the periodic service as an example, assuming that a user interface of the terminal device is shown in Figure 3, the interface includes a periodic blood oximetry start button. When the user clicks the start button, the terminal device can receive an instruction to start the periodic blood oximetry. Then, based on the execution cycle of the periodic blood oximetry, 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 the processor then controls the display screen to display the data.

[0136] 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. Taking periodic blood oxygen as an example of a periodic service, after the user clicks the start button in the user interface shown in FIG3 , the other terminal device may receive an instruction to turn on periodic blood oxygen and send an instruction message to the wearable device, which is used to instruct the user to turn on periodic blood oxygen. After the wearable device receives the instruction, it may 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 may be uploaded to the processor. After the wearable device receives the data, it may send the data to other terminal devices, and then after the other terminal devices receive the data, the processors of the other terminal devices may control the display screens of the other terminal devices to display the data.

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

[0138] As shown in Figure 4, 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 again to collect and upload data at 0:10, and controls the sensor corresponding to service A again to collect and upload data at 0:20, and so on, until the user closes service A.

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

[0140] Assume 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.

[0141] 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.

[0142] 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 when in the on state, execute them periodically according to the execution cycle of each service with the first moment as the starting moment.

[0143] 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.

[0144] 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.

[0145] In some examples, the duration between the second moment and the first moment may be equal to the execution period of the first service. In other examples, the duration between the second 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] 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.

[0147] 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.

[0148] 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 sensor is turned on, which is beneficial to reducing the power consumption of the terminal device.

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

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

[0151] 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 reports and helping to reduce the power consumption of the terminal device.

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

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

[0154] In this 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.

[0155] Optionally, the processor of the terminal device may also be a dual-core processor. As shown in FIG6 , the processor of the terminal device may be an MCU processor, which may include a first processor and a second processor.

[0156] 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.

[0157] 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.

[0158] 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.

[0159] 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 enabled 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.

[0160] 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 and report data through the M33 core.

[0161] Next, this application will provide a detailed introduction to the solution of this application in conjunction with Figures 7 to 15.

[0162] Figure 7 is a flow chart of a service processing method provided by the present application. As shown in Figure 7, the method may include S701 to S704.

[0163] S701: The terminal device determines at a first moment whether a first service is in an enabled state, where the first service is a service that periodically enables 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.

[0164] In this method, the terminal device may be the terminal device shown in Figure 2. The processor of the terminal device may be a single-core processor as shown in Figure 5 or a dual-core processor as shown in Figure 6.

[0165] In this method, the first time may be preset in advance. For example, the first time may be 0:10.

[0166] Optionally, the first moment may also be the power-on moment of the terminal device. As an example, assuming that the terminal device is powered on at 0:10, the first moment may be 0:10.

[0167] Optionally, the time between the first moment and the time when the terminal device is turned on can also be a preset time. The preset time can be preset in advance. For example, assuming that the terminal device is turned on at 0:10 and the preset time is five minutes, the first moment can be 0:15.

[0168] 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.

[0169] 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.

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

[0171] In one example, the terminal device may be a mobile phone. Taking the first service as periodic blood oximetry, for example, assuming a user interface of the terminal device is shown in FIG3 , the interface includes a periodic blood oximetry activation button. When a user clicks the activation button, the terminal device may receive an instruction to activate periodic blood oximetry and, based on the instruction, determine that the first service is activated.

[0172] In another example, the terminal device may be a wearable device that can communicate with other terminal devices (e.g., a mobile phone). Taking the periodic service as periodic blood oximetry as an example, after the user clicks the start button in the user interface shown in FIG3 , the other terminal device may receive an instruction to turn on periodic blood oximetry and send an instruction message to the wearable device, instructing the user to turn on periodic blood oximetry. After receiving the instruction, the wearable device may determine that the user's first service is turned on.

[0173] In this 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 yet started.

[0174] 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.

[0175] Assuming the first time is 0:10 and the execution period of the first service is ten minutes, if the first service is enabled at the first time, the terminal device may execute the first service every ten minutes starting from 0:10.

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

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

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

[0179] In another example, the processor of the terminal device may be a dual-core processor. As shown in Figure 6, assuming that the processor of the terminal device includes an M33 core and an M55 core, after the M55 core determines that the user has activated the first service, it may send the on / off status information of the first service to the M33 core. The on / off status information of the first service is used to instruct the user to activate the first service. Optionally, after receiving the instruction information, the M33 core may send the instruction information to the first sensor.

[0180] 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.

[0181] 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 the 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.

[0182] In one example, the processor of the terminal device may be a single-core processor. As shown in Figure 5, assuming that the processor of the terminal device includes an M55 core, after the M55 core determines that the user has activated the first service, it may send an instruction to the first sensor, instructing the first sensor to collect and upload data. If the M55 core receives data collected by the first sensor or determines that the data collected by the first sensor has changed, the M55 core may determine to execute the first service.

[0183] In another example, the processor of the terminal device may be a dual-core processor. As shown in Figure 6, assuming that the processor of the terminal device includes an M33 core and an M55 core, after the M55 core determines that the user has turned 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.

[0184] 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.

[0185] 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.

[0186] S703: The terminal device determines at a first moment whether a second service is in an enabled state, where the second service is a service that periodically enables 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.

[0187] 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.

[0188] 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.

[0189] 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 the ACC sensor.

[0190] 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, and will not be repeated here.

[0191] 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.

[0192] Assuming the first time is 0:10 and the execution period of the second service is thirty minutes, if the second service is enabled at the first time, the terminal device may execute the second service every thirty minutes starting from 0:10.

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

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

[0195] 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.

[0196] 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.

[0197] 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.

[0198] In this 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 period and the second period.

[0199] 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.

[0200] 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 can be equal to the first duration, and the first duration can be equal to the greatest common divisor of the duration of the first period and the duration of the second period.

[0201] In one 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.

[0202] 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. The duration between the second moment and the first moment can be equal to the duration of the first cycle. In this way, the execution times 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 for 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.

[0203] In addition, the duration between the second moment and the first moment can be equal to the duration of the first cycle. In this way, 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-out rate of the first service.

[0204] 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.

[0205] In this example, the duration between the second moment and the first moment can be equal to the greatest common divisor of the durations of the first cycle and the second cycle. In this way, the execution times 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 for reducing 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.

[0206] In addition, the duration between the second moment and the first moment can be shorter than the duration of the first cycle. In this way, 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-out rate of the first service.

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

[0208] 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.

[0209] Furthermore, in this example, the execution times of the first service and the second service can also overlap at a specific moment, thereby reducing the number of times the target sensor is turned on, which is beneficial for 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 period and the second period.

[0210] In addition, the duration between the second moment and the first moment can be equal to the duration of the first cycle. In this way, 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-out rate of the first service.

[0211] 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.

[0212] In some possible implementations, if the second service is not enabled at the first moment, determining whether the second service is enabled is performed at a third moment. If the second service is enabled at the third moment, executing the second service periodically starting at the third moment.

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

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

[0215] 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 open 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 open state. When it is determined that the first business and the second business are in the open state at the second moment (or the third moment), each business can be periodically executed based on the execution cycle of each business.

[0216] 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 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 period and the second period.

[0217] 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 the terminal device's two consecutive judgments on 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.

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

[0219] 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 open 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 open state. When it is determined that the first business and the second business are in the open state at the second moment (or the third moment), each business can be periodically executed based on the execution cycle of each business.

[0220] 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 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 period and the second period.

[0221] In addition, the duration between the third moment and the first moment can be less than 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 the terminal device's two consecutive judgments on 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.

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

[0223] 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.

[0224] 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.

[0225] Furthermore, in this example, the execution times of the first service and the second service can also overlap at a specific moment, thereby reducing the number of times the target sensor is turned on, which is beneficial for 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 period and the second period.

[0226] In addition, the duration between the third moment and the first moment can be equal to the duration of the second cycle. In this way, the time interval between two consecutive judgments by the terminal device on 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-out rate of the second service.

[0227] Optionally, in some examples, after 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.

[0228] 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, and the fourth moment is separated from the third moment by the duration of a second cycle, M is a positive integer, the duration between the mth moment in 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 in 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.

[0229] 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 can be ten minutes. Assuming that the first moment is 0:10, if the terminal device determines that the second service is not in the on state at 0:10, it will determine 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 will determine 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 will determine 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 will determine again at 0:50 whether the second service is in the on state.

[0230] 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.

[0231] 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 can 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 will determine 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 will determine 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 will determine 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 will determine again at 0:30 whether the second service is in the on state.

[0232] 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.

[0233] 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 target sensor is turned on, which is beneficial for reducing the power consumption of the terminal device. The duration between the specific time and the second time can be a common multiple of the first period and the second period.

[0234] 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.

[0235] Optionally, in some embodiments, the terminal device may not determine whether the second service is at the activation time at a specific time (e.g., 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 activation time based on the detection period.

[0236] 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 priority 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 the priorities of the first business and the second business from high to low.

[0237] The first condition may be: the service requiring more sensors has a higher priority. The second condition may be: the service with a higher frequency of sensor preset data reporting has a higher priority. The third condition may be: the service with a shorter preset service running time has a higher priority.

[0238] 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.

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

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

[0241] In one possible implementation, the terminal device determines the order of execution of the first service and the second service based on the order of priority of the first service and the second service 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 start the second sensor at the target time, and starting other sensors in the first sensor except the target sensor after the target time.

[0242] In the first example, assuming that the number of first sensors is greater than the number of second sensors, and the preset reporting frequency of sensors and the preset service running time 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.

[0243] 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.

[0244] 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 the other sensors in the second sensor except the target sensor. This can reduce the number of times the target sensor is turned on, thereby helping to reduce power consumption of the terminal device.

[0245] 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.

[0246] 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.

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

[0248] 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.

[0249] 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.

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

[0251] Optionally, if there are at least two parameters different between the first service and the second service, 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.

[0252] 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.

[0253] Optionally, after the terminal device determines the order of execution of the first service and the second service based on the priority of the first service and the second service in descending order, 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 the target data reporting frequency is determined as the data reporting frequency of the target sensor after the target time.

[0254] 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, 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.

[0255] 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, 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.

[0256] 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.

[0257] Furthermore, the terminal device can also determine the target service from the first service and the second service, where the target service is 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.

[0258] 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.

[0259] In this example, it is possible to avoid the target sensor collecting and reporting some redundant data when the target sensor still reports at a high data reporting frequency after the first service is completed, thereby facilitating further reduction in power consumption of the terminal device.

[0260] 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.

[0261] 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.

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

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

[0264] As shown in Figure 8, assume that the sensor required by service A is an ACC sensor. The preset data reporting frequency of the sensor for service A is every 500 milliseconds, and the preset service runtime of service A is 1 second. The sensor required by service B is an ACC sensor. The preset data reporting frequency of the sensor for service B is every 50 milliseconds, and the preset service runtime of service B is 1 second. The sensors required by service C are an ACC sensor and a PPG sensor. The preset data reporting frequency of the sensor for service C is every 500 milliseconds, and the preset service runtime of service C is 1 second. The sensors required by service D are an ACC sensor and a PPG sensor. The preset data reporting frequency of the sensor for service D is every 500 milliseconds, and the preset service runtime of service C is 3 seconds.

[0265] Based on the parameter information such as the number of sensors required for each of the four services, the preset sensor data reporting frequency, 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, and 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 service A, service B, service C, and service D as shown in Figure 9.

[0266] 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 the data reporting frequency of the PPG is once every 500 milliseconds.

[0267] 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.

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

[0269] Next, the present application will provide a detailed description of a method for a terminal device to obtain sensor data. FIG10 is a flow chart of a service processing method for a terminal device provided by another embodiment of the present application.

[0270] In this method, the processor of the terminal device may be a single-core processor as shown in FIG5 .

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

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

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

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

[0275] 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.

[0276] The method for the terminal device to determine whether the to-be-processed service is in the enabled state at the target time may refer to the step in S701 where the terminal device determines whether the first service is in the enabled state, which will not be described in detail here.

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

[0278] The method for the processor of the terminal device to determine the execution of the pending service may refer to the step of the terminal device determining the execution of the first service in S702, which will not be repeated here.

[0279] 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.

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

[0281] Optionally, the method in which the processor of the terminal device sends 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 being used to instruct the first sensor to collect first data and upload the first data at a target time; and the processor sends second indication information to other sensors in the second sensor except the target sensor, the second indication information being used to instruct the other sensors to collect second data and upload the second data after the target time. Alternatively, 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 being 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, the fourth indication information being used to instruct the other sensors to collect first data and upload the first data after the target time.

[0282] Furthermore, the processor can also send fifth indication information to the target sensor, and the fifth indication information is used to instruct the target sensor to report data based on the 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 business and the preset data reporting frequency of the second business.

[0283] 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 the shorter running time of the preset services between the first service and the second service, and the other services are other services in the first service and the second service except the service to be processed.

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

[0285] 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.

[0286] In this method, the processor of the terminal device can be a single-core processor, and the terminal device determines whether the pending service is turned on and determines the method for executing the pending service. 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 coincide with a specific time. This not only reduces the power consumption of the terminal device, but also reduces the response time of the terminal device in executing the pending service, thereby improving the response speed of the pending service.

[0287] Optionally, FIG11 is a flowchart of a service processing method of a terminal device provided in another embodiment of the present application.

[0288] In this method, the processor of the terminal device may be a dual-core processor as shown in 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 an M33 core as shown in Figure 6, and the second processor may be an M55 core as shown in Figure 6.

[0289] S1101: A first processor receives service status information from a second processor, where the service status information indicates that a service to be processed is in an enabled state at a target time. The service to be processed is a service that periodically enables a third sensor to collect data.

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

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

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

[0293] 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.

[0294] 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.

[0295] 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 second processor to execute the pending service. Correspondingly, the second processor receives the first information.

[0296] In this method, the method for the first processor to determine to execute the pending service can refer to the step of the terminal device determining to execute the first service in S702, which will not be repeated here.

[0297] 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.

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

[0299] 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.

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

[0301] 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:

[0302] If the priority of the first service is higher than the priority of the second service, the second processor sends first instruction information to the first processor, where the first instruction information is used to instruct the first sensor to collect and upload first data at a target time. Accordingly, after receiving the first instruction information, the first processor may send the first instruction information to the first sensor. And the second processor sends second instruction information to the first processor, where the second instruction information is used to instruct other second sensors, excluding the target sensor, to collect and upload second data after the target time. Accordingly, after receiving the second instruction information, the first processor may send the second instruction information to the other sensors.

[0303] Alternatively, if the priority of the first service is lower than the priority of the second service, the second processor sends third indication information to the first processor, where the third indication information is used to instruct the second sensor to collect and upload the second data at the target time. Accordingly, after receiving the third indication information, the first processor may send the third indication information to the second sensor. Furthermore, the second processor sends fourth indication information to the first processor, where the fourth indication information is used to instruct the other sensor to collect and upload the first data after the target time. Accordingly, after receiving the fourth indication information, the first processor may send the fourth indication information to the other sensor.

[0304] Furthermore, the second processor may also send fifth indication information to the first processor, 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 the preset data reporting frequency of the first service and the 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.

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

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

[0307] 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.

[0308] 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.

[0309] In this method, the processor of the terminal device can be a dual-core processor, and the methods for the terminal device to determine whether the pending service is turned on and to determine whether to execute the pending service are both 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.

[0310] FIG12 is a schematic diagram of the structure of a service processing device provided by an embodiment of the present application. As shown in FIG12 , the service processing device 1200 may include a determination module 1201 and an execution module 1202 .

[0311] As an example, the service processing apparatus 1200 may be used to implement the service processing method of the embodiment shown in Figure 7. The determination module 1201 may be used to execute S701 and S703, and the execution module 1202 may be used to execute S702 and S704.

[0312] Optionally, the service processing apparatus 1200 may be applied to a terminal device. For example, the service processing apparatus 1200 may be applied to a processor of the terminal device. The processor of the terminal device may be a processor as shown in FIG5 or FIG6.

[0313] FIG13 is a schematic diagram of the structure of a service processing device provided by an embodiment of the present application. As shown in FIG13 , the service processing device 1300 may include a determination module 1301 , a sending module 1302 , and a receiving module 1303 .

[0314] As an example, the service processing apparatus 1300 may be used to implement the service processing method of the embodiment shown in Figure 10. The determining module 1301 may be used to execute S1001, the sending module 1302 may be used to execute S1002, and the receiving module 1303 may be used to execute S1004.

[0315] Optionally, the service processing apparatus 1300 may be applied to a processor of a terminal device as shown in FIG5 .

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

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

[0318] Optionally, the service processing apparatus 1400 may be applied to the first processor of the terminal device as shown in FIG6 .

[0319] Figure 15 is a schematic diagram of the structure of a service processing device provided in another embodiment of the present application. As shown in Figure 15, service processing device 1500 includes a processor 1501 and an interface circuit 1502. Processor 1501 and interface circuit 1502 are coupled to each other. It is understood that interface circuit 1502 can be a transceiver or an input / output interface. Optionally, service processing device 1500 may also include a memory 1503 for storing instructions executed by processor 1501, storing input data required by processor 1501 to execute instructions, or storing data generated after processor 1501 executes instructions.

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

[0321] As a second example, the processor 1501 may be configured to implement the functions of the aforementioned determining module 1301 , and the interface circuit 1502 may be configured to implement the functions of the aforementioned sending module 1302 and receiving module 1303 .

[0322] 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.

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

[0324] 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 write information to the storage medium. Of course, the storage medium can also be an integral part 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.

[0325] In the above embodiments, all or part of the embodiments may be implemented using software, hardware, firmware, or any combination thereof. When implemented using software, all or part of the embodiments may be implemented 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 instructions are loaded and executed on a computer, the processes or functions described in the embodiments of the present application are performed 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 instructions may be stored in a computer-readable storage medium or transferred from one computer-readable storage medium to another. For example, the computer program or instructions may be transferred from one website, computer, server, or data center to another website, computer, server, or data center via wired or wireless means. The computer-readable storage medium may be any available medium that can be accessed by a computer or a data storage device such as a server or data center that integrates one or more available media. The available medium may be a magnetic medium, such as a floppy disk, hard disk, or magnetic tape; an optical medium, such as a digital video disk; or a semiconductor medium, such as a solid-state drive.

[0326] In the various embodiments of the present application, unless otherwise specified or there is a logical conflict, the terms and / or descriptions between different embodiments are consistent and can be referenced by each other. The technical features in different embodiments can be combined to form new embodiments according to their inherent logical relationships.

[0327] It is understood that the various numbers used in the embodiments of this application are merely for ease of description and are not intended to limit the scope of the embodiments of this application. The order of the sequence numbers of the above-mentioned processes does not necessarily imply a specific order of execution; the order of execution of the processes should be determined by their functions and inherent 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

Patent Citations

  • Business processing method and related device

    CN119653458A

  • Sampling task scheduling method based on data sharing wireless sensor network

    CN104270789A

  • Method and apparatus for energy efficient collaborative sensing

    KR1020120082202A

  • Systems and methods involving diagnostic monitoring, aggregation, classification, analysis and visual insights

    US20170208151A1