Data processing method, electronic device and storage medium

By only waking up the high-power memory in electronic devices when the movement status and the current step count are not synchronized, the problem of high power consumption caused by the behavior recognition and step counting functions when the system is sleeping is solved, and the power consumption of the hibernation memory is reduced. effect.

CN117707322BActive Publication Date: 2024-09-06HONOR DEVICE CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202310816813.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-07-04
Publication Date
2024-09-06
Estimated Expiration
2043-07-04

AI Technical Summary

Technical Problem

In electronic devices, behavior recognition and step counting functions still run when the system is asleep, causing high-power memory to frequently wake up and increasing the power consumption of hibernation memory.

Method used

By waking up the high-power memory only once when the update of the motion status and current step count is out of sync, the behavior recognition driver is used to simultaneously obtain the motion status and current step count, and store them as global variables, so that the pedometer driver does not need to Wake up the memory again.

Benefits of technology

It effectively reduces the wake-up power consumption of hibernation memory, reduces the wake-up frequency of high-power memory, and improves the battery life of electronic devices.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117707322B
    Figure CN117707322B
Patent Text Reader

Abstract

The present application relates to the field of intelligent terminal technology, and specifically to a data processing method, an electronic device and a storage medium, which are applied to an electronic device including a first memory and a second memory, wherein the first memory stores a behavior recognition driver and a pedometer driver, and the second memory stores a first algorithm library. The method comprises: the behavior recognition driver obtains the first sensor data in the first data processing cycle; the behavior recognition driver calls the first algorithm library in the second memory to process the first sensor data to obtain the first behavior recognition data and the first pedometer data; the behavior recognition driver stores the first behavior recognition data and the first pedometer data in the first memory; the pedometer driver obtains the first pedometer data from the first memory. This makes it possible that when the update of the motion state and the current number of steps is not synchronized, refreshing the current number of steps and refreshing the motion state can only wake up the high-power second memory once, thereby effectively reducing the wake-up power consumption.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of intelligent terminals, and in particular to a data processing method, an electronic device and a computer-readable storage medium. Background Art

[0002] The behavior recognition (AR) function in electronic devices, also known as activity recognition, refers to the detection of the direction, position and movement of electronic devices through underlying sensors, such as accelerometers, to determine the movement state of the user holding the electronic device, and then determine the user's activity scene. For example, it can be determined whether the user is in a car, riding, walking, running, still, lying down and other activity scenes. The pedometer in an electronic device is a function that determines the user's current step count through underlying sensors. It returns the change in the number of steps from the time the pedometer program is activated to the current step count, and it will only be cleared when the system is restarted.

[0003] Behavior recognition and pedometer start running after the electronic device is started, and they are still running even when the electronic device's system is dormant. It can be understood that the implementation of the behavior recognition function requires obtaining sensor data through the behavior recognition driver, and combining the obtained sensor data with the behavior recognition algorithm to obtain the user's current motion state. The implementation of the pedometer function requires obtaining sensor data through the pedometer driver, and combining the obtained sensor data with the pedometer algorithm to obtain the user's current step count.

[0004] Therefore, the above-mentioned step counting function and behavior recognition function both need to be combined with the algorithm library to realize the functions. Summary of the invention

[0005] The present application provides a data processing method, an electronic device and a computer-readable storage medium, so that when the update of the motion state and the current step number is not synchronized, refreshing the current step number and refreshing the motion state can only wake up the high-power memory once, thereby effectively reducing the wake-up power consumption of the dormant memory.

[0006] Some embodiments of the present application provide a data processing method. The present application is introduced from multiple aspects below, and the embodiments and beneficial effects of the following multiple aspects can be referenced to each other.

[0007] In the first aspect, the present application proposes a data processing method, which is applied to an electronic device, wherein the electronic device includes a first memory and a second memory, the first memory stores a behavior recognition driver and a pedometer driver, and the second memory stores a first algorithm library; the method includes: the behavior recognition driver obtains first sensor data in a first data processing cycle; the behavior recognition driver calls the first algorithm library in the second memory to process the first sensor data to obtain first behavior recognition data and first pedometer data; the behavior recognition driver stores the first behavior recognition data and the first pedometer data in the first memory; the pedometer driver obtains the first pedometer data from the first memory.

[0008] It can be understood that the first data processing cycle is each cycle in which the behavior recognition driver refreshes the first behavior recognition data (i.e., the motion state hereinafter). After waking up the second memory, the behavior recognition driver can simultaneously obtain the first behavior recognition data and the first pedometer data (i.e., the current number of steps hereinafter), and the behavior recognition driver stores the first behavior recognition data and the first pedometer data in the first memory. The pedometer driver can directly obtain the first pedometer data from the first memory. This allows the high-power memory to be woken up only once by refreshing the current number of steps and refreshing the movement state when the motion state and the current number of steps are not updated synchronously, thereby effectively reducing the wake-up power consumption of the dormant memory.

[0009] In a possible implementation of the first aspect above, the first algorithm library includes a first interface and a second interface, and the behavior recognition driver calls the first algorithm library in the second memory to process the first sensor data to obtain first behavior recognition data and first pedometer data, including: the behavior recognition driver calls the first interface to process the first sensor data to determine the first behavior recognition data; the behavior recognition driver calls the second interface to process the first sensor data to determine the first pedometer data.

[0010] It can be understood that the first algorithm library (i.e., the second behavior recognition algorithm library hereinafter) can provide a first interface as an entry for calling the behavior recognition function, and can provide a second interface as an entry for calling the pedometer function. Therefore, the behavior recognition driver calling the first interface can call the behavior recognition algorithm to calculate the first sensor data (such as the accelerometer data hereinafter) to obtain the motion state; the behavior recognition driver calling the second interface can call the pedometer-related algorithm to calculate the first sensor data to obtain the current number of steps. This allows the second memory where the first algorithm library is located to be awakened only once during the first data processing cycle, so that the behavior recognition driver can obtain the motion state and the current number of steps.

[0011] In a possible implementation of the first aspect above, the first memory also stores an accelerometer driver, the first sensor data includes accelerometer data, and the behavior recognition driver obtains the first sensor data in a first data processing cycle, and also includes: within the first data processing cycle, the behavior recognition driver obtains accelerometer data from the accelerometer driver at a first frequency.

[0012] That is, the first memory also stores a sensor driver for obtaining first sensor data, such as an accelerometer driver, which can obtain accelerometer data from the accelerometer driver, and within the first data processing cycle, the behavior recognition driver can subscribe to the accelerometer data of the accelerometer driver at a first frequency.

[0013] In a possible implementation of the first aspect above, the behavior recognition driver calls the first algorithm library in the second memory to process the first sensor data to obtain the first behavior recognition data and the first pedometer data, including: the behavior recognition driver stores the accelerometer data in the first memory; corresponding to the number of stored accelerometer data being greater than or equal to the first number, the behavior recognition driver calls the first algorithm library in the second memory to process the first sensor data to obtain the first behavior recognition data and the first pedometer data.

[0014] That is, the behavior recognition driver stores the accelerometer data in the first memory. When the accelerometer data stores the first quantity, the behavior recognition driver can call the first algorithm library in the second memory to process the first sensor data to obtain the first behavior recognition data and the first step counting data, thereby extending the cycle of calling the second memory in the first data processing cycle, reducing the frequency of waking up the second memory, and reducing the power consumption of waking up the second memory in sleep. In some embodiments, the first data can be 50 sets of accelerometer data.

[0015] In a possible implementation of the first aspect above, the first memory also stores a second algorithm library, and corresponding to the number of stored accelerometer data being greater than or equal to the first number, the behavior recognition driver calls the first algorithm library in the second memory to process the first sensor data to obtain the first behavior recognition data and the first pedometer data, including: the behavior recognition driver inputs the first number of accelerometer data into the second algorithm library; the behavior recognition driver detects that the first number of accelerometer data has been transmitted to the second algorithm library, and inputs the first number of accelerometer data into the first algorithm library to obtain the first behavior recognition data and the first pedometer data.

[0016] That is, after storing the first amount of accelerometer data, the accelerometer data can be first transmitted to the second algorithm library in the first memory (i.e., the first behavior recognition algorithm library hereinafter), and after completing the transmission processing in the first memory, the preliminary judgment results of the three simple motion states of walking, running and stillness are obtained. Then, the first amount of accelerometer data is sent to the first algorithm library in the second memory (i.e., the second behavior recognition algorithm library hereinafter), which can ensure that the first algorithm library is awakened only once, thereby avoiding repeated awakening of the second memory and reducing the power consumption of awakening the second memory.

[0017] In a possible implementation of the first aspect above, the first memory is a cache of a processor of the electronic device, and the second memory is a memory of the electronic device; and the behavior recognition driver stores the first behavior recognition data and the first pedometer data in the first memory, including: the behavior recognition driver stores the first behavior recognition data in the original format in the cache, and stores the first pedometer data as a global variable, wherein the global variable is defined as a variable accessible to both the behavior recognition driver and the pedometer driver.

[0018] That is, the behavior recognition driver can store the acquired motion state and current number of steps in the cache where the behavior recognition driver is located in the first memory. The motion state can be stored in the original format, and the current number of steps is stored as a global variable that the pedometer driver can also access. This makes it convenient for the pedometer driver to obtain the current number of steps directly in the cache without waking up the memory again, effectively reducing the power consumption required to wake up the dormant memory.

[0019] In some embodiments, the first memory may be a secondary cache of a processor of an electronic device, such as SRAM; and the second memory may be DDR.

[0020] In a possible implementation of the first aspect above, the pedometer driver obtains the first step counting data from the first memory, including: the pedometer driver accesses the global variable in the second data processing cycle to obtain the first step counting data.

[0021] It can be understood that the second data processing cycle is the cycle for the pedometer driver to update the current number of steps. The second data processing cycle can be synchronized with the first data processing cycle, or the second data processing cycle can be asynchronous with the first data processing cycle. When the two cycles are asynchronous, the pedometer driver directly obtains the first step data (i.e., the current number of steps) from the cache by accessing the global variable, without waking up the memory, reducing the frequency of waking up the memory, and effectively reducing the power consumption of waking up the dormant memory.

[0022] In a possible implementation of the first aspect above, the first memory also stores an accelerometer driver, and the pedometer driver accesses the global variable in the second data processing cycle to obtain the first step data, and also includes: within the second data processing cycle, the pedometer driver obtains accelerometer data from the accelerometer driver at a second frequency; the pedometer driver detects that the obtained accelerometer data is greater than or equal to the second quantity, accesses the global variable, obtains the first step data, and ends the second data processing cycle.

[0023] It can be understood that within the second data processing cycle, the pedometer driver can subscribe to accelerometer data from the acceleration driver at a second frequency. When the pedometer driver detects that the acquired accelerometer data meets the second quantity, for example, 50 sets of acceleration data, it can access the global variables in the cache to obtain the first pedometer data (i.e., the current number of steps), thereby extending the second data processing cycle, reducing the frequency of accessing the cache global variables, and reducing the operating power consumption of the cache.

[0024] In a second aspect, the present application also provides an electronic device, comprising: one or more processors; one or more memories; one or more memories storing one or more programs, and when one or more programs are executed by one or more processors, the electronic device executes any possible data processing method of the first aspect mentioned above.

[0025] In a third aspect, the present application further provides a computer-readable storage medium having instructions stored thereon, which, when executed on a computer, enables the computer to execute any possible data processing method of the first aspect.

[0026] In a fourth aspect, an embodiment of the present application discloses a computer program product comprising instructions, which, when executed on a computer, enables the computer to execute any possible data processing method of the first aspect described above. BRIEF DESCRIPTION OF THE DRAWINGS

[0027] Figure 1 A schematic diagram of a display scene of step counting and motion status is shown;

[0028] Figure 2A A schematic diagram showing the principle of behavior recognition and pedometer data acquisition in a mobile phone 100 is shown;

[0029] Figure 2B A current curve diagram of a behavior recognition and a pedometer waking up the memory respectively is shown;

[0030] Figure 3A According to an embodiment of the present application, a structural block diagram of an electronic device 100 collecting pedometer data and motion status data is shown;

[0031] Figure 3BAccording to an embodiment of the present application, a current curve diagram of a unified wake-up memory of behavior recognition and pedometer is shown;

[0032] Figure 4A According to an embodiment of the present application, a hardware structure diagram of an electronic device 100 is shown;

[0033] Figure 4B According to an embodiment of the present application, a software structure block diagram of an electronic device 100 is shown;

[0034] Figure 5A According to an embodiment of the present application, a schematic diagram of an implementation flow of a data processing method is shown;

[0035] Figure 5B According to an embodiment of the present application, a flow chart comparing one behavior recognition flow and another behavior recognition flow is shown;

[0036] Figure 5C According to an embodiment of the present application, a flow chart comparing one pedometer flow and another pedometer flow is shown;

[0037] Figure 6 A schematic block diagram of the operation process of a pedometer and behavior recognition is shown;

[0038] Figure 7 According to an embodiment of the present application, a schematic block diagram of the operation process of another pedometer and behavior recognition is shown. DETAILED DESCRIPTION

[0039] In order to make the purpose, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be described in detail below in conjunction with the accompanying drawings and specific implementation methods.

[0040] The illustrative embodiments of the present application include, but are not limited to, data processing methods, electronic devices, and computer-readable storage media, among others.

[0041] It is understood that the electronic devices to which the present application is applicable may be mobile phones, tablet computers, desktop computers, laptop computers, handheld computers, netbooks, augmented reality (AR) / virtual reality (VR) devices, smart TVs, smart watches, etc., as well as other electronic devices embedded or coupled with one or more processors, or having a step counting function and a motion state detection function, without limitation. The following description takes the mobile phone 100 as an example, but it is understood that the technical solution of the present application is not only applicable to mobile phones.

[0042] Figure 1 A schematic diagram of a display scene of step counting and motion status is shown.

[0043] refer to Figure 1 When the mobile phone 100 detects the user's screen-on operation A1, the mobile phone 100 changes from the screen-off state to the screen-on state, and can display the current number of steps and exercise status on the interface. The interface provides a display area B1 for the current number of steps and a display area B2 for the exercise status, so that the user can view the current number of steps and exercise status in real time.

[0044] However, before the screen-lighting operation A1 is detected, when the operating system of the mobile phone 100 is in a dormant state, the cache of the mobile phone 100 will continue to run the behavior recognition and pedometer functions. Since the instructions corresponding to the algorithm for implementing the behavior recognition and pedometer functions occupy a large storage space, the cache in the processor of the mobile phone 100 is not sufficient to accommodate the instructions corresponding to the algorithm for implementing the behavior recognition and pedometer functions. Therefore, in some embodiments, the instructions corresponding to the algorithm for implementing the behavior recognition and pedometer functions can be stored in the memory of the mobile phone 100, so that the mobile phone 100 can wake up the dormant memory when behavior recognition and pedometer are needed, and read the corresponding instructions from the memory to implement behavior recognition and pedometer. In this way, it is possible to avoid waking up the memory of the mobile phone 100 all the time when the operating system of the mobile phone 100 is in a dormant state.

[0045] However, if the cycles of the behavior recognition and pedometer functions of the mobile phone 100 are not synchronized, that is, the behavior recognition and pedometer functions do not read the relevant instructions from the memory at the same time, the memory of the mobile phone 100 will be awakened every time the behavior recognition or pedometer function is performed, causing the dormant memory of the mobile phone 100 to be awakened frequently, increasing the power consumption of the memory. Figure 2A and Figure 2B The principle of increasing power consumption is explained in detail.

[0046] Figure 2A A schematic diagram of the data acquisition principle of behavior recognition and pedometer in a mobile phone 100 is shown.

[0047] refer to Figure 2A , the mobile phone 100 is configured with a cache 01 and a memory 02. Among them, the cache 01 stores an accelerometer driver 011, a behavior recognition driver 012 and a pedometer driver 013. The memory 02 stores a behavior recognition algorithm library 021. It can be understood that since the cache space in the cache 01 is small and cannot accommodate a complex and large behavior recognition algorithm, the behavior recognition algorithm library 021 is set in the memory 02.

[0048] Specifically, the behavior recognition function is implemented in the following ways:

[0049] The behavior recognition driver 012 periodically obtains the accelerometer data collected by the accelerometer driver 011, and calls the behavior recognition algorithm in the behavior recognition algorithm library 021 to calculate the accelerometer data to determine the user's motion state, and caches it in the cache 01. When a related application (such as a sports health application) sends a motion state request to the behavior recognition driver 012, the behavior recognition driver 012 can report the motion state to the application, so that the user can learn the real-time motion state from the application.

[0050] The pedometer function is implemented in the following ways:

[0051] The pedometer driver 013 periodically obtains the accelerometer data collected by the accelerometer driver 011, and calls the algorithm for step counting in the behavior recognition algorithm library 021 to calculate the accelerometer data to determine the current number of steps of the user, and caches it in the cache 01. When the relevant application (such as a sports health application) sends a step counting request to the pedometer driver 013, the pedometer driver 013 can report the current number of steps to the application, so that the user can learn the current number of steps from the application.

[0052] However, Figure 2A In the scheme shown, the update of the motion state and the current step count is usually not synchronized. If the memory of the mobile phone 100 is in a dormant state (for example, the mobile phone 100 is in a locked screen state), the behavior recognition driver 012 and the pedometer driver 013 will respectively wake up the high-power memory 02 to obtain instructions for implementing their respective functions from the behavior recognition algorithm library 021 of the memory 02, which increases the wake-up power consumption of the dormant memory.

[0053] For example, assume that the mobile phone 100 performs behavior recognition every 500ms and counts steps every 500ms. Figure 2B , the horizontal axis is time (times), the unit is seconds (s); the vertical axis is the average current of the standby bottom layer of the mobile phone 100 in the flight mode, the unit is milliampere (mA). Among them, P1 and P3 are the power consumption peaks driven by behavior recognition to wake up the memory, and P2 and P4 are the power consumption peaks driven by the pedometer to wake up the memory. In other words, during the period from 3s to 4s (including two cycles, one cycle is 500ms), the pedometer function and the behavior recognition function were performed twice, respectively, and the memory 02 was awakened 4 times. It can be understood that the power consumption peaks driven by behavior recognition to wake up the memory and the power consumption peaks driven by the pedometer to wake up the memory are generated periodically, and the memory is awakened twice periodically, which increases the power consumption of memory 02 in the sleep state.

[0054] In order to avoid the problem of increasing the power consumption of dormant memory due to the continuous secondary awakening of high-power memory, the embodiment provided by the present application provides a data processing method, which is applied to the scene where the memory of the electronic device is in a dormant state. In a single cycle of refreshing the motion state, the behavior recognition driver can synchronously call the behavior recognition function and the pedometer function of the behavior recognition algorithm when waking up the memory, and calculate the motion state and the current number of steps respectively. For example, the behavior recognition function is called through interface 1 to calculate the accelerometer data to determine the motion state, and the pedometer function is called through interface 2 to calculate the accelerometer data to determine the current number of steps. Thus, the behavior recognition driver obtains the motion state and the current number of steps, and stores them in cache 01. In a single cycle of refreshing the current number of steps, the pedometer driver can obtain the current number of steps stored from the behavior recognition driver without waking up the memory again. This makes it possible to wake up the high-power memory only once when the update of the motion state and the current number of steps is not synchronized, thereby effectively reducing the wake-up power consumption of the dormant memory.

[0055] In some embodiments of the present application, the behavior recognition driver 2012 can store the current number of steps obtained as a global variable, and define the global variable as accessible to both the behavior recognition driver and the pedometer driver. The pedometer driver 2013 can access the global variable in a low-power cache to obtain the current number of steps without waking up the high-power cache again.

[0056] It can be understood that the global variable is a variable defined or declared outside the function body or code segment, and its scope is from the definition to the end of the corresponding file. Therefore, the global variable can be defined so that multiple drivers can directly access it.

[0057] refer to Figure 3A Taking the mobile phone 100 as an example, within a single refresh cycle of the motion state, the behavior recognition driver 2012 in the cache 201 sends the sensor data to the behavior recognition algorithm library 2021 of the memory 202, and at the same time calls the behavior recognition algorithm for calculating the motion state and the behavior recognition algorithm for calculating the current number of steps to calculate the sensor data, and obtain the motion state and the current number of steps. The behavior recognition driver 2012 obtains the motion state and the current number of steps, and stores both of the above data in the cache 201. In a single refresh cycle of the current number of steps, the pedometer driver 2013 in the cache 201 can obtain the current number of steps from the behavior recognition driver 2012 without waking up the high-power memory 202. Therefore, even if the update cycle of the motion state and the current number of steps is not synchronized, the high-power cache is periodically awakened by the behavior recognition driver, which reduces the wake-up frequency of the high-power cache, thereby reducing the additional power consumption generated by the awakening of the dormant memory.

[0058] Furthermore, it is assumed that the mobile phone 100 performs behavior recognition once every 500ms and counts steps once every 500ms. Figure 3B , where the horizontal axis is time (times), in seconds (s); the vertical axis is the average current of the mobile phone 100 in the airplane mode, in milliamperes (mA). In each 500ms cycle, only the AR driver wakes up the memory once. Figure 2B In the embodiment, the memory wake-up can be reduced once in each 500ms cycle, and the peak frequency is significantly reduced, such as P5, P6, and P7, which reduces the memory power consumption.

[0059] In some embodiments of the present application, the behavior recognition algorithm library can call the corresponding algorithm by means of a preset interface, for example, interface 1 can be set to call the behavior recognition algorithm for calculating the motion state, and interface 2 can be set to call the behavior recognition algorithm for calculating the number of steps. The above interface can be an application programming interface (application programming interface, API), which can be defined by a specified protocol, such as a custom private protocol, and the protocol for defining the interface is not specifically limited here.

[0060] Furthermore, in some embodiments of the present application, the behavior recognition algorithm library can also be divided into a first behavior algorithm library and a second behavior algorithm library. The first behavior algorithm library is set in a low-power cache 201, and the second behavior algorithm library is set in a high-power memory 202. Among them, the behavior recognition algorithm contained in the first behavior algorithm library is relatively simple, and can only recognize simple behavior recognitions such as walking, running and standing still. The behavior recognition algorithm contained in the second behavior recognition algorithm library is more complex, and can accurately identify the user's life behavior scenes, such as taking a high-speed rail, taking an airplane or riding a bicycle. Due to the large size of the complex behavior recognition algorithm, the cache cannot accommodate the above-mentioned second behavior recognition algorithm library. This can reduce the number of algorithms called from the high-power memory, thereby shortening the time the memory is awakened and reducing the power consumption generated by the awakening of the dormant memory of the electronic device.

[0061] In some embodiments of the present application, the behavior recognition driver mentioned above can refresh the motion status at a first frequency, and the pedometer driver can refresh the current step count at a second frequency, wherein the first frequency and the second frequency can be equal or unequal.

[0062] It is understood that the first frequency and the second frequency can be equal, for example, both can be 100 Hz, or other frequencies, and no specific limitation is made here. It should be noted that even if the value of the first frequency is equal to the value of the second frequency, the refresh cycle of the motion state and the current step number can also be asynchronous, that is, the starting time of the refresh cycle of the motion state is different from the starting time of the refresh cycle of the current frequency.

[0063] In some embodiments of the present application, the low-power cache 201 can be a static random access memory (SRAM), and the data stored in the SRAM can be kept constant as long as the SRAM remains powered. In some embodiments, the cache 201 can be set inside the processor of the mobile phone 100.

[0064] The high power consumption memory 202 may be a double data rate synchronous dynamic random access memory (DDR SDRAM). DDR SDRAM is a synchronous dynamic random access memory (SDRAM) with a double data transfer rate, and is a dynamic random access memory with a synchronous interface. The data transfer speed of DDR SDRAM is twice the system clock frequency. Due to the increased speed, its transmission performance is better than that of traditional SDRAM. In some embodiments, the memory 202 may be disposed outside the processor of the mobile phone 100.

[0065] It can be understood that the technical solution provided in the embodiments of the present application is applicable to various electronic devices, including but not limited to mobile phones, tablet computers, desktops, laptops, handheld computers, netbooks, augmented reality (AR) / virtual reality (VR) devices, smart TVs, smart watches, etc., as well as other electronic devices embedded or coupled with one or more processors, or having a step counting function and a motion state detection function, without limitation here. The following continues to take an electronic device as an example to introduce the specific implementation process of the data processing method provided in the embodiments of the present application.

[0066] Figure 4A According to an embodiment of the present application, a hardware structure diagram of an electronic device 100 is shown.

[0067] like Figure 4AAs shown, the electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.

[0068] It is understandable that the structure illustrated in the embodiment of the present application does not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may include more or fewer components than shown, or combine certain components, or separate certain components, or arrange the components differently, which is not limited here.

[0069] The processor 110 may include one or more processing units, for example, the processor 110 may include an application processor (AP), a modem processor, a graphics processor (GPU), an image signal processor (ISP), a controller, a video codec, etc. Among them, different processing units may be independent devices or integrated into one or more processors.

[0070] In some embodiments, the controller generates an operation control signal based on the instruction opcode and timing signal of the processor 110 to complete the control of instruction fetching and instruction execution to execute the data processing method provided in the embodiments of the present application.

[0071] In some embodiments, the processor 110 may include one or more interfaces. In some embodiments, the processor 110 may include one or more interfaces. The interface may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface, etc. Among them, the USB interface 130 can be used to connect a charger to charge the electronic device 100, and can also be used to transmit data between the electronic device 100 and peripheral devices.

[0072] In some embodiments, the processor 110 may include multiple groups of I2C buses. The processor 110 may be coupled to the acceleration sensor 180E, the charger, the flash, the camera 193, etc. through different I2C bus interfaces. For example, the processor 110 may be coupled to the acceleration sensor 180E through the I2C interface, so that the processor 110 communicates with the acceleration sensor 180E through the I2C bus, thereby realizing the pedometer function of the electronic device 100.

[0073] For example, in the embodiment of the present application, the processor 110 can couple the acceleration sensor 180E through the I2C interface, so that the processor 110 and the acceleration sensor 180E communicate through the I2C bus interface. When the user carries the electronic device for exercise, the acceleration sensor 180E can pass the number of steps generated by the user's exercise to the processor 110 to realize the function of reporting the exercise data. At the same time, the processor 110 can also control the interface display on the display screen 194 according to the user step information reported by the acceleration sensor 180E. The processor 110 and the display screen 194 communicate through the DSI interface, thereby controlling the data display of the step information on the display screen 194 of the electronic device 100.

[0074] A memory may also be provided in the processor 110 for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may store instructions or data that the processor 110 has just used or circulated. If the processor 110 needs to use the instruction or data again, it may be directly called from the memory. Repeated access is avoided, the waiting time of the processor 110 is reduced, and the efficiency of the system is improved. In some embodiments, the memory may include the aforementioned cache 201, which may be used to set the behavior recognition drive, the pedometer drive, and the accelerometer drive.

[0075] In some embodiments, the processor 110 may include one or more interfaces. The interface may include a universal serial bus (USB) interface, etc. Among them, the USB interface 130 can be used to connect a charger to charge the electronic device 100, and can also be used to transmit data between the electronic device 100 and a peripheral device.

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

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

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

[0079] The mobile communication module 150 may provide solutions for wireless communications including 2G / 3G / 4G / 5G etc. applied to the electronic device 100. The modem processor may include a modulator and a demodulator.

[0080] The wireless communication module 160 can provide wireless communication solutions for application in the electronic device 100, including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication technology (NFC), infrared technology (IR), etc.

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

[0082] The electronic device 100 implements the display function through a GPU, a display screen 194, and an application processor, etc. The GPU is a microprocessor for image processing, and is connected to the display screen 194 and the application processor.

[0083] The display screen 194 is used to display images, videos, etc. The display screen 194 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light emitting diode or an active-matrix organic light emitting diode (AMOLED), a flexible light-emitting diode (FLED), Mini-LED, Micro-LED, Micro-OLED, quantum dot light-emitting diodes (QLED), etc. In some embodiments, the electronic device 100 may include 1 or N display screens 194, where N is a positive integer greater than 1.

[0084] The electronic device 100 can realize the shooting function through ISP, camera 193, video codec, GPU, display screen 194 and application processor.

[0085] The ISP is used to process the data fed back by the camera 193. For example, when taking a photo or shooting a video, the shutter is opened, and the light is transmitted to the camera photosensitive element through the lens. The light signal is converted into an electrical signal, and the camera photosensitive element transmits the electrical signal to the ISP for processing and converts it into an image visible to the naked eye. The ISP can also perform algorithm optimization on the noise, brightness, and skin color of the image. The ISP can also optimize the exposure, color temperature and other parameters of the shooting scene. In some embodiments, the ISP can be set in the camera 193.

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

[0087] Video codecs are used to compress or decompress digital video.

[0088] The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100 .

[0089] The internal memory 121 can be used to store computer executable program codes, which include instructions. The internal memory 121 may include a program storage area and a data storage area. Among them, the data storage area can store data created during the use of the electronic device 100 (such as video data obtained by shooting, etc.). In addition, the internal memory 121 may include a high-speed random access memory, and may also include a non-volatile memory, etc. The processor 110 executes various functional applications and data processing of the electronic device 100 by running instructions stored in the internal memory 121 and / or instructions stored in a memory provided in the processor.

[0090] In some embodiments, the internal memory 121 may include the aforementioned memory 202 , and the storage space of the memory 202 may be used to set the behavior recognition algorithm library.

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

[0092] The pressure sensor 180A is used to sense the pressure signal and can convert the pressure signal into an electrical signal. In some embodiments, the pressure sensor 180A can be disposed on the display screen 194 .

[0093] There are many types of pressure sensors 180A, such as resistive pressure sensors, inductive pressure sensors, capacitive pressure sensors, etc. Capacitive pressure sensors can be at least two parallel plates with conductive materials. When a force acts on the pressure sensor 180A, the capacitance between the electrodes changes. The electronic device 100 determines the intensity of the pressure based on the change in capacitance. When a touch operation acts on the display screen 194, the electronic device 100 detects the intensity of the touch operation based on the pressure sensor 180A. The electronic device 100 can also calculate the position of the touch based on the detection signal of the pressure sensor 180A.

[0094] The gyro sensor 180B may be used to determine the motion posture of the electronic device 100 .

[0095] The air pressure sensor 180C is used to measure air pressure. In some embodiments, the electronic device 100 calculates the altitude through the air pressure value measured by the air pressure sensor 180C to assist positioning and navigation.

[0096] The magnetic sensor 180D includes a Hall sensor, and the electronic device 100 can detect the opening and closing of the flip leather case by using the magnetic sensor 180D.

[0097] The acceleration sensor 180E can detect the magnitude of the acceleration of the electronic device 100 in all directions (generally three axes). When the electronic device 100 is stationary, the magnitude and direction of gravity can be detected. It can also be used to identify the posture of the electronic device and is applied to applications such as horizontal and vertical screen switching and pedometers.

[0098] The distance sensor 180F is used to measure the distance. The electronic device 100 can measure the distance by infrared or laser.

[0099] The proximity light sensor 180G may include, for example, a light emitting diode (LED) and a light detector.

[0100] The ambient light sensor 180L is used to sense the brightness of ambient light.

[0101] The fingerprint sensor 180H is used to collect fingerprints.

[0102] The temperature sensor 180J is used to detect temperature. In some embodiments, the electronic device 100 uses the temperature detected by the temperature sensor 180J to execute a temperature processing strategy. For example, when the temperature reported by the temperature sensor 180J exceeds a threshold, the electronic device 100 reduces the performance of a processor located near the temperature sensor 180J to reduce power consumption and implement thermal protection.

[0103] The touch sensor 180K is also called a "touch panel". The touch sensor 180K can be set on the display screen 194. The touch sensor 180K and the display screen 194 form a touch screen, also called a "touch screen". The touch sensor 180K is used to detect a touch operation acting on or near it. The touch sensor can pass the detected touch operation to the application processor to determine the type of touch event. Visual output related to the touch operation can be provided through the display screen 194.

[0104] In addition, in the embodiments of the present application, wearable devices may also be referred to as wearable smart devices, which are a general term for the intelligent design and development of wearable devices for daily wear using wearable technology, such as glasses, gloves, watches, clothing and shoes. A wearable device is a portable device that is worn directly on the body or integrated into the user's clothes or accessories. Wearable devices are not only hardware devices, but also achieve powerful functions through software support, data interaction, and cloud interaction. Broadly speaking, wearable devices include full-featured, large-sized, and fully or partially functional devices that do not rely on smartphones, such as smart watches or smart glasses, as well as devices that only focus on a certain function and need to be used in conjunction with other devices such as smartphones, such as various smart bracelets and smart jewelry for vital sign monitoring.

[0105] In an embodiment of the present application, a pedometer of an electronic device (for example, but not limited to, an accelerometer 180E, etc.) detects changes in the number of steps taken by a user and reports the number of steps based on a request from a sports application. The processor controls the display of the sports data on the display screen based on changes in the number of steps taken by the user.

[0106] Those skilled in the art can understand that the method for processing motion data provided in the embodiments of the present application can be applied to scenarios in which motion data is requested to be processed and displayed.

[0107] Below is Android TM ) system as an example, combined with Figure 4B The transmission process of motion data is illustrated by way of example.

[0108] Figure 4B According to an embodiment of the present application, a software structure block diagram of an electronic device 100 is shown.

[0109] refer to Figure 4BThe software system of the electronic device 100 may adopt a layered architecture, an event-driven architecture, a micro-kernel architecture, a micro-service architecture, or a cloud architecture. The layered architecture may divide the software into several layers, each with a clear role and division of labor. The layers communicate with each other through software interfaces.

[0110] In some embodiments, the Android system is divided into five layers, from top to bottom, namely, the application layer 440, the application framework layer 430 (framework, FWK), the Android runtime (Android runtime) and the system library 420, as well as the kernel layer (Kernel) 410 and the sensor hub layer 400 (also called the sensorhub layer).

[0111] The application layer 440 may include a series of applications, such as sports health 441, which may be used to provide the user with current step count and exercise status information.

[0112] The application framework layer 430 provides an application programming interface (API) and a programming framework for the application programs of the application layer. The application framework layer 430 includes some predefined functions. For example, the application framework layer 430 includes a sensor manager 431, which can distribute messages for applications, for example, the enabling information of sports health 441 can be distributed in batches, for example, distributed to the system library 420, to form batch data information requests, for example, batch step requests or batch motion status requests.

[0113] Android Runtime includes core libraries and virtual machines. Android runtime is responsible for scheduling and management of the Android system.

[0114] The core library consists of two parts: one part is the function that needs to be called by the Java language, and the other part is the Android core library.

[0115] In an embodiment of the present application, the system library 420 may include a sensor module 421, which is used to convert the enabling information distributed by batch processing into requests for various types of information and send them to the kernel layer 410, so that the sensor driver in the kernel layer 410 obtains requests for various types of information and then obtains the current number of steps or motion status.

[0116] The application layer 440 and the application framework layer 430 run in a virtual machine. The virtual machine executes the Java files of the application layer 440 and the application framework layer 430 as binary files. The virtual machine is used to perform functions such as object life cycle management, stack management, thread management, security and exception management, and garbage collection.

[0117] The kernel layer 410 (Kernel layer) provides underlying drivers for various hardware of the electronic device 100 . For example, corresponding sensor drivers 411 may be provided for all sensors to provide corresponding data transmission paths for the sensor hub layer 400 .

[0118] The sensor hub layer 400 (sensorhub layer) is a software and hardware solution based on a low-power microcontroller unit (MCU) and a lightweight real-time operating system (RTOS), and its main function is to connect and process data from various sensor devices. The sensor hub layer 400 can provide various hardware drivers, such as providing a pedometer driver 2013 for a pedometer to request the current number of steps; and a behavior recognition driver 2012 can also be provided. The behavior recognition driver 2012 can request the motion state, and when requesting the motion state, call the motion state algorithm library to obtain the motion state interface and the current number of steps interface, so as to obtain the current number of steps information while obtaining the motion state, so that the pedometer driver 2013 can access the current number of steps from the behavior recognition driver 2012 to return to the sports health 441 of the application layer 440.

[0119] It should be noted that although the embodiments of the present application are described using the Android system as an example, its basic principles are also applicable to electronic devices based on operating systems such as "IOS", "Windows" or "Linux".

[0120] In an application scenario provided by an embodiment of the present application, a user deploys a sports health application in a mobile phone and carries the mobile phone with him during exercise. The user's exercise may include but is not limited to: brisk walking, jogging, variable speed running or other types of exercise, and the user's life behavior scenarios may also be identified, such as taking a high-speed train, subway, and riding a bicycle.

[0121] During the user's exercise, the pedometer 2013 in the electronic device 100 can obtain the number of steps taken by the user during the exercise in real time, and transmit the number of steps to the sports health 441 in the application layer 440. The sports health 441 can output the number of steps through the user interface or voice broadcast; or, the sports health 441 can calculate the user's current step frequency based on the number of steps, and output the step frequency through the user interface or voice broadcast.

[0122] The following is combined with the above Figure 4B , describing in detail the software process for obtaining the current number of steps and motion status in the embodiment of the present application.

[0123] refer to Figure 4BIn some embodiments, the sports health 441 sends an enable information to the sensor manager 431 in the application framework layer 430, for example, the above enable information can be subscribed from the accelerometer driver (not shown) according to a preset frequency. The sensor module 421 in the system library 420 sends the application's enable information as a batch of step requests and motion state requests through a standard channel. The step request and motion state request are sent to the sensor driver 411 in the kernel layer 410, and the sensor driver 411 sends the step request to the pedometer driver 2013 of the sensor hub layer 400 (sensorhub layer), and sends the motion state request to the behavior recognition driver 2012 of the sensor hub layer 400. So that the pedometer driver 2013 can perceive the step request command sent by the sports health 441, and the behavior recognition driver 2012 can perceive the motion state request command sent by the sports health 441, so as to report the current step number and motion state to the application.

[0124] Further, in the embodiment of the present application, the behavior recognition driver 2012 can call two interfaces when acquiring the motion state, one interface is used to acquire the motion state, and the other interface is used to acquire the current number of steps. This allows the behavior recognition driver 2012 to acquire the motion state and the current number of steps at the same time. Then, the behavior recognition driver 2012 will store the current number of steps as a global variable that the behavior recognition driver 2012 can also access, and report the motion state information to the sports health 441. The pedometer driver 2013 can acquire the current number of steps by accessing the global variable of the behavior recognition driver 2012, and report the current number of steps to the sports health 441.

[0125] It can be understood that the specific implementation process of the data interaction between the above-mentioned behavior recognition driver 2012 and the pedometer driver 2013 will be described in detail below in conjunction with relevant drawings, and for the sake of brevity, it will not be repeated here.

[0126] Based on the above Figure 4A The structure of the electronic device 100 shown in FIG. Figure 4B The interaction process within the system architecture shown is described in detail below in conjunction with specific embodiments and related drawings to describe the specific implementation process of a data processing method provided by the present application.

[0127] The specific implementation process of a data processing method provided by an embodiment of the present application is described in detail below in conjunction with related services.

[0128] Figure 5A According to an embodiment of the present application, a schematic diagram of an implementation flow of a data processing method is shown.

[0129] Understandable, reference Figure 5A, the accelerometer driver 2011, the behavior recognition driver 2012, the pedometer driver 2013 and the first behavior algorithm library 211 are all set in a low-power cache, while the second behavior recognition algorithm library 212 is set in a high-power memory. Among them, the behavior recognition algorithm contained in the first behavior algorithm library 211 is relatively simple, and can only recognize simple behavior recognitions such as walking, running and standing still. The behavior recognition algorithm contained in the second behavior recognition algorithm library 212 is relatively complex, and can further recognize a large number of user's life behavior scenes, such as taking a high-speed train, taking an airplane or riding a bicycle, etc. The complex behavior recognition algorithm is large in size, so the cache cannot accommodate the above-mentioned second behavior recognition algorithm library 212. Therefore, in the present application, during the cycle of updating the motion state and the current number of steps, only a single wake-up of the high-power memory is required to obtain the behavior state data and the current number of steps data, thereby effectively reducing the power consumption of the electronic device 100.

[0130] Specifically, Figure 5A As shown, the process includes the following steps:

[0131] S501 , the behavior recognition driver 2012 subscribes to accelerometer data from the accelerometer driver 2011 at a first frequency.

[0132] It can be understood that the behavior recognition driver 2012 can subscribe to the accelerometer data of the accelerometer driver 2011 by obtaining the enable instruction issued by the accelerometer driver 2011. The enable instruction includes enable parameters, such as the subscription frequency, so as to control the wake-up frequency of the behavior recognition driver 2012.

[0133] In some embodiments, the first frequency may be 100 Hz, that is, the accelerometer driver 2011 sends an enable instruction every 10 milliseconds.

[0134] S502, the behavior recognition driver 2012 determines whether the cached accelerometer data is greater than the first number. If the accelerometer data is greater than the first number, the following step S503 is executed to send the accelerometer data to the first behavior recognition algorithm library 211; if the accelerometer data is less than or equal to the first number, the step S501 is continued to be executed to continue to obtain the accelerometer data.

[0135] It can be understood that when the behavior recognition driver 2012 caches accelerometer data that meets the first quantity, the accelerometer data is sent to the first behavior recognition algorithm library 211, which can extend the wake-up cycle of the behavior recognition driver 2012 and reduce the operating power consumption of the behavior recognition driver 2012.

[0136] In some embodiments, the first number may be 50 groups, that is, when the cached accelerometer data is greater than 50 groups, the accelerometer data is sent to the first behavior recognition algorithm library 211 .

[0137] S503 , the behavior recognition driver 2012 sends the accelerometer data to the first behavior recognition algorithm library 211 .

[0138] It can be understood that the first behavior recognition algorithm library 211 and the behavior recognition driver 2012 are both in the low-power cache, so the accelerometer data is first sent to the first behavior recognition algorithm library 211 to obtain a simple judgment of the motion state, and then sent to the second behavior recognition algorithm library 212 in the high-power memory, avoiding secondary interactions in the high-power memory and reducing the power consumption of the electronic device 100.

[0139] It can be understood that the behavior recognition algorithm in the first behavior recognition algorithm library 211 can only recognize the three motion states of walking, running, and stillness. The algorithm is simple and the storage space occupied by the algorithm is small. Therefore, after the accelerometer data is input into the first behavior recognition algorithm library 211, the current motion state can be preliminarily classified. For further accurate judgment of the motion state, such as riding, taking the subway, and taking the high-speed rail, a more complex algorithm needs to be called, and the more complex algorithm is set in the second behavior recognition algorithm library 212 in the memory.

[0140] For example, judging the movement speed of the electronic device based on the accelerometer data indicates that the user is running, but the rough classification of running is based only on the speed threshold greater than walking, which may include precise classifications such as riding, taking the subway, and taking the high-speed rail. At this time, the following steps S505 to S506 are executed again, the accelerometer data is sent to the second behavior algorithm library 212, and the behavior recognition algorithm that can recognize precise movement states such as riding, taking the subway, and taking the high-speed rail is called to accurately classify the current movement state and accurately determine the user's movement state.

[0141] It can be understood that setting the first behavior recognition algorithm library 211 in the cache means running the preliminary judgment process of the motion state in the cache, which can effectively reduce the operating power consumption of the memory.

[0142] In some embodiments, the user only needs to make a preliminary judgment on the motion state, and can only send the accelerometer data to the first behavior recognition algorithm library 211 to obtain the motion state of walking, running or stillness, and calculate the step frequency. There is no need to send the accelerometer data to the second behavior recognition algorithm library 212, and there is no need to wake up the memory to obtain the motion state and current step number.

[0143] S504, the behavior recognition driver 2012 determines whether the first amount of accelerometer data has been transmitted. If the first amount of accelerometer data has been transmitted, the following step S505 is executed to send the accelerometer data to the second behavior recognition algorithm library 212; if the first amount of accelerometer data has not been transmitted, the step S503 is continued to be executed to continue to transmit the accelerometer data.

[0144] It can be understood that the behavior recognition driver 2012 starts a simple judgment of the current motion state after the first amount of accelerometer data is transmitted, thereby extending the wake-up cycle of the first behavior recognition algorithm library 211 in the low-power cache and reducing the wake-up power consumption of the dormant memory.

[0145] In some embodiments, the behavior recognition driver 2012 can count the data transmission by adding tags. When the data transmission is completed, all the data are marked with corresponding tags. When the number of statistical tags meets the first quantity, it can be determined that the first quantity of accelerometer data transmission is completed.

[0146] S505 , the behavior recognition driver 2012 sends the accelerometer data to the second behavior algorithm library 212 .

[0147] It can be understood that after the first amount of accelerometer data is transmitted, the behavior recognition driver 2012 sends the accelerometer data to the second behavior recognition algorithm library 212 to accurately determine the motion state, thereby extending the wake-up cycle of the second behavior recognition algorithm library 212 in the high-power memory and reducing the wake-up power consumption of the dormant memory. In addition, it can also ensure that the memory is only woken up once during the cycle of updating the motion state and the current number of steps, reducing the wake-up power consumption of the dormant memory.

[0148] Exemplarily, the second behavior recognition algorithm library 212 can provide the behavior recognition driver 2012 with a function interface for calling algorithms, such as an interface for calling a behavior recognition function and an interface for calling a pedometer function, so that when the behavior recognition driver 2012 calls the above two interfaces, it simultaneously calls the algorithm for calculating the number of steps and the algorithm for calculating the motion state, so as to synchronously obtain the motion state and the current number of steps.

[0149] In some embodiments, the algorithm call interface related to the motion state of the second behavior algorithm library 212 can be named AlgGetResult_AR interface, and the algorithm call interface related to the current step count of the second behavior algorithm library 212 can be named AlgGetResult_Pedometer. The behavior recognition driver 2012 calls the above two interfaces at the same time to calculate the current motion state and the current step count.

[0150] It can be understood that the above function naming is only an example for easy understanding, and other customized names are also possible, which is not limited here.

[0151] S506 , the second behavior recognition algorithm library 212 sends the current motion state and the current number of steps to the behavior recognition driver 2012 .

[0152] It can be understood that the second behavior recognition algorithm library 212 uses the called algorithm to calculate the accelerometer data to obtain the motion state and the current number of steps, and transmits the motion state and the current number of steps to the behavior recognition driver 2012 in the cache.

[0153] It can be understood that, for the motion state, the behavior recognition driver 2012 can run S512 below to return the motion state to the corresponding application (e.g., sports health 341) in the application layer 340. For the current number of steps, the behavior recognition driver 2012 can run S507 below to record the current number of steps into a global variable, so that the pedometer driver 2013 can directly access the current number of steps in the low-power cache.

[0154] S507, the behavior recognition driver 2012 records the current number of steps into a global variable.

[0155] Exemplarily, the behavior recognition driver 2012 can record the current number of steps as a global variable accessible to both the pedometer driver 2013 and the behavior recognition driver 2012, so that the pedometer driver 2013 does not need to call the second behavior algorithm library 212 again to obtain the current number of steps, thereby reducing the need to wake up the high-power memory once and instead performing the wake-up operation in the low-power cache, effectively reducing the power consumption of the electronic device 100.

[0156] S508 , the pedometer driver 2013 subscribes to the accelerometer data from the accelerometer driver 2011 at a second frequency.

[0157] Exemplarily, the pedometer driver 2013 may subscribe to the accelerometer data of the accelerometer driver 2011 at the second frequency by acquiring an enable instruction issued by the accelerometer driver 2011 .

[0158] It can be understood that the execution process of the above step S508 can refer to the specific implementation process of the above step S501, which will not be repeated here.

[0159] S509, the pedometer driver 2013 determines whether the cached accelerometer data is greater than the second number. If the accelerometer data is greater than the second number, the following step S510 is executed to read the global variable to obtain the current number of steps; if the accelerometer data is less than or equal to the second number, the step S508 is continued to be executed to continue to obtain the accelerometer data.

[0160] It can be understood that when the pedometer driver 2013 caches accelerometer data that meets the second quantity, the global variable is read to obtain the current number of steps, which can extend the wake-up cycle of the pedometer driver 2013 and reduce the operating power consumption of the pedometer driver 2013.

[0161] It can be understood that the second number may be equal to or different from the first number in S502 and S504 above.

[0162] S510, the pedometer driver 2013 reads the global variable from the behavior recognition driver 2012 to obtain the current number of steps.

[0163] It can be understood that the global variable is defined as accessible to both the pedometer driver 2012 and the behavior recognition driver 2012, so the pedometer driver 2013 can directly access the global variable from the behavior recognition driver 2012 to obtain the current number of steps. This step S510 is performed in a low-power cache without waking up a high-power memory, thus reducing the wake-up of the high-power memory once and effectively reducing the power consumption of the electronic device 100.

[0164] S511, the pedometer driver 2013 reports the number of steps according to the screen on / off status.

[0165] It can be understood that the pedometer driver 2013 can report the number of steps when the screen of the electronic device 100 is on, so that the user can view the current number of steps.

[0166] In some embodiments, the pedometer driver 2013 can register a monitoring service in the screen-on / off state, and when the screen-on state message is monitored, the pedometer driver 2013 reports the current number of steps.

[0167] Exemplarily, the kernel layer 310 has a screen-on status node and provides a standard interface for the pedometer driver 2013 to obtain the screen-on status message. If it is determined to switch from the screen-off state to the screen-on state, the sensor hub layer 300 can be notified, so that the pedometer driver 2013 in the sensor hub layer 300 can monitor the screen-on status message.

[0168] S512, the behavior recognition driver 2012 reports the motion status according to the subscription status.

[0169] It can be understood that the behavior recognition driver 2012 can report the motion status in real time according to the subscription frequency, for example, it reports the motion status in real time every time it is obtained, so that the user can confirm his or her motion status in real time, providing the user with a good user experience.

[0170] It can be understood that based on the above steps S511 to S512, the data processing method of the example of the present application can wake up the second behavior recognition algorithm library in the high-power memory at a single time, and the behavior recognition driver can simultaneously obtain the current number of steps and the motion state, and save the current number of steps as a global variable accessible to the pedometer driver. The pedometer driver can asynchronously access the global variable in the low-power cache to determine the current number of steps, thereby reducing the wake-up of the high-power memory once, and effectively reducing the power consumption of the electronic device 100.

[0171] Combine the following Figure 5B The specific implementation method of the behavior identification process is further described in detail.

[0172] Figure 5B A schematic block diagram of a behavior identification process 5000 is shown, and a schematic block diagram of a behavior identification process 5100 is shown according to an embodiment of the present application.

[0173] It can be understood that the execution subject of each step in the behavior recognition process 5000 can be the above-mentioned behavior recognition driver 012. To avoid repeated description, the execution subject of each step will not be repeated when describing the execution content of each step below.

[0174] refer to Figure 5B ,The specific implementation steps of the behavior recognition process 5000 are as follows:

[0175] S5001, obtain accelerometer data.

[0176] S5002, determining whether the amount of cached accelerometer data is greater than 50 groups, if so, sending the accelerometer data to the first behavior recognition algorithm library 211; if not, continuing to execute S5001 to obtain the accelerometer data.

[0177] S5003 , input the accelerometer data into the first behavior recognition algorithm library 211 .

[0178] S5004 , input the accelerometer data into the second behavior recognition algorithm library 212 .

[0179] S5005 , determining whether the transmission of 50 sets of accelerometer data is complete, if so, executing S5006 , reading and recording the motion state; if not, continuing to execute S5003 , inputting the accelerometer data into the first behavior recognition algorithm library 211 .

[0180] S5006, read and record the current motion status.

[0181] S5007, report the movement status according to the subscription status.

[0182] It can be understood that the above steps S5001 to S5007 only determine whether the accelerometer data has been transmitted when the accelerometer data is output. It cannot guarantee that the first behavior recognition algorithm library 211 in the cache is first input and then the second behavior recognition algorithm library 212 in the memory is input, which may cause repeated wake-up of the memory.

[0183] Therefore, a behavior recognition process 5100 is proposed to avoid guaranteeing the accelerometer data transmission order of the two algorithm libraries. It can be understood that the execution subject of each step in the behavior recognition process 5100 can be the above-mentioned behavior recognition driver 2012. To avoid repeated description, the execution subject of each step will not be repeated when describing the execution content of each step below.

[0184] The specific implementation steps of the behavior recognition process 5100 are as follows:

[0185] S5101, obtain accelerometer data.

[0186] S5102, determine whether the amount of cached accelerometer data is greater than 50 groups, if so, send the accelerometer data to the first behavior recognition algorithm library 211; if not, continue to execute S5101 to obtain the accelerometer data.

[0187] S5103 , input the accelerometer data into the first behavior recognition algorithm library 211 .

[0188] S5104, determine whether the 50 sets of accelerometer data have been transmitted. If so, send the accelerometer data to the second behavior recognition algorithm library 212; if not, continue to execute S5105 to input the accelerometer data into the second behavior recognition algorithm library 212.

[0189] S5105 , input the accelerometer data into the second behavior recognition algorithm library 212 .

[0190] S5106, determine whether the 50 sets of accelerometer data have been transmitted. If so, execute S5107 to record the current motion state; if not, continue to execute S5105 to input the accelerometer data into the second behavior recognition algorithm library 212.

[0191] S5107, read and record the current motion status.

[0192] S5108, read the current step number and record the current step number as a global variable.

[0193] It can be understood that the specific implementation of the above steps S5101 to S5108 can refer to the above steps S501 to S507.

[0194] S5109, report the movement status according to the subscription status.

[0195] It can be understood that the specific implementation of the above step S5109 can refer to the above step S512.

[0196] It can be understood that based on the above steps S5101 to S5109, when transmitting data to the first behavior recognition algorithm library 211 in the cache, it is possible to ensure that the transmission is completed before transmitting the accelerometer data to the second behavior recognition algorithm library 212, thereby ensuring that the memory is woken up only once.

[0197] Combine the following Figure 5C The specific implementation of the pedometer process is further described in detail.

[0198] Figure 5C A schematic block diagram of a pedometer process 5200 is shown, and a schematic block diagram of a pedometer process 5300 is shown according to an embodiment of the present application.

[0199] It can be understood that the execution entity of each step of the pedometer process 5200 can be the above-mentioned pedometer driver 013. To avoid repeated description, the execution entity of each step will not be repeated when describing the execution content of each step below.

[0200] The specific implementation steps of the pedometer process 5200 are as follows:

[0201] S5201 , obtaining accelerometer data from the accelerometer device 201 .

[0202] S5202, sending the accelerometer data to the behavior recognition algorithm library 021.

[0203] S5203, read the current number of steps from the fourth behavior recognition algorithm library 0214 and record the current state.

[0204] S5204, reporting the number of steps according to the screen on / off status.

[0205] It can be understood that through the above steps S5201 to S5204, the pedometer driver needs to call the algorithm data in the behavior recognition algorithm library in the memory. That is, in a single update cycle of the motion state and the current number of steps, the pedometer driver needs to wake up the high-power memory to obtain the current number of steps.

[0206] It can be understood that the execution entity of each step of the pedometer process 5300 can be the above-mentioned pedometer driver 2013. To avoid repeated description, the execution entity of each step will not be repeated when describing the execution content of each step below.

[0207] The specific implementation steps of the pedometer process 5300 are as follows:

[0208] S5301 , acquiring accelerometer data from the accelerometer device 201 .

[0209] S5302, determine whether the amount of cached accelerometer data is greater than the second amount. If so, execute S5303, read the current number of steps from the global variable to record the current state; if not, continue to execute S5301 to obtain accelerometer data.

[0210] S5303, read the current step number from the global variable to record the current status.

[0211] S5304, reporting the number of steps according to the screen on / off status.

[0212] It can be understood that the execution process of the above steps S5301 to S5304 can refer to the specific implementation process of steps S508 to S511 above, and will not be repeated here.

[0213] It can be understood that through the above steps S5301 to S5304, the pedometer driver does not need to call the memory, and only needs to obtain the current step count from the global variable stored by the behavior recognition driver in the cache. That is, in a single update cycle of the motion state and the current step count, the pedometer driver does not wake up the memory, and can obtain the current step count only by relying on the cache.

[0214] Combine the following Figure 6 and Figure 7 The specific implementation of the data processing method provided in the embodiments of the present application is further described in detail.

[0215] Figure 6 A schematic block diagram of the operation process of a pedometer and behavior recognition is shown.

[0216] refer to Figure 6 , if the behavior recognition algorithm library 021 is also split into a third behavior recognition algorithm library 0213 including a simple behavior recognition algorithm and a fourth behavior recognition algorithm library 0214 including an accurate behavior recognition algorithm, and the third behavior recognition algorithm library 0213 is set in a low-power cache, and the fourth behavior recognition algorithm library 0214 is set in a high-power memory. Figure 6 The illustrated implementation still requires waking up the fourth behavior recognition algorithm library 0214 twice, resulting in one more wake-up of the high-power memory, which will increase the power consumption of the electronic device 100 .

[0217] Figure 6 The specific process shown can be divided into a pedometer process 601 and a behavior recognition process 602 .

[0218] It can be understood that the execution entity of each step of the pedometer process 601 can be the above-mentioned pedometer driver 013. To avoid repeated description, the execution entity of each step will not be repeated when describing the execution content of each step below.

[0219] The specific implementation steps of the pedometer process 601 are as follows:

[0220] S6011 , acquiring accelerometer data from the accelerometer device 201 , and sending the data to the behavior recognition algorithm library 021 .

[0221] S6012, read the current number of steps from the fourth behavior recognition algorithm library 0214 and record the current state.

[0222] S6013, report the number of steps according to the screen on / off status.

[0223] Continue to refer Figure 6 It can be understood that the execution subject of each step of the behavior recognition process 602 can be the above-mentioned behavior recognition driver 012. To avoid repeated description, the execution subject of each step will not be repeated when describing the execution content of each step below.

[0224] The specific implementation steps of the behavior identification process 602 are as follows:

[0225] S6021 , obtaining accelerometer data from the accelerometer device 201 .

[0226] S6022, determine whether the amount of cached accelerometer data is greater than a preset threshold, if so, send the accelerometer data to the fourth behavior recognition algorithm library 0214; if not, continue to execute S6021 to obtain the accelerometer data.

[0227] S6023, sending the accelerometer data to the third behavior recognition algorithm library 0213.

[0228] S6024, read the current motion state from the third behavior recognition algorithm library 0213 and record it.

[0229] S6025, report the movement status according to the subscription status.

[0230] It can be understood that based on the above-mentioned pedometer process 601 and behavior recognition process 602, the pedometer process 601 and the behavior recognition process 602 both need to request data from the fourth behavior recognition algorithm library 0214 located in the high-power memory. In a single update cycle of the motion status and the current number of steps, the high-power memory needs to be woken up twice to obtain the current number of steps and motion status, resulting in an increase in the power consumption of the dormant memory when it is woken up.

[0231] Figure 7 According to an embodiment of the present application, a schematic block diagram of the operation process of another pedometer and behavior recognition is shown.

[0232] refer to Figure 7In some embodiments of the present application, the behavior recognition algorithm library 021 is split into a first behavior recognition algorithm library 211 including a simple behavior recognition algorithm and a second behavior recognition algorithm library 212 including a precise behavior recognition algorithm, and the first behavior recognition algorithm library 211 is set in a low-power SRAM cache space, and the second behavior recognition algorithm library 212 is set in a high-power DDR cache space. Figure 7 The illustrated implementation process only requires waking up the second behavior recognition algorithm library 212 once, thereby reducing the number of times the high-power DDR cache is woken up, and effectively reducing the power consumption of the electronic device 100 .

[0233] Figure 7 The specific process shown can be divided into a pedometer process 701 and a behavior recognition process 702 .

[0234] It can be understood that the execution entity of each step of the pedometer process 701 can be the above-mentioned pedometer driver 2013. To avoid repeated description, the execution entity of each step will not be repeated when describing the execution content of each step below.

[0235] The specific implementation steps of the pedometer process 701 are as follows:

[0236] S7011 , acquiring accelerometer data from the accelerometer device 201 .

[0237] S7012, determine whether the amount of cached accelerometer data is greater than the second amount. If so, execute S7013, read the current step number from the global variable to record the current state; if not, continue to execute S7011 to obtain accelerometer data.

[0238] S7013, read the current step number from the global variable to record the current status.

[0239] S7014, report the number of steps according to the screen on / off status.

[0240] It can be understood that the execution process of the above steps S7011 to S7014 can refer to the specific implementation process of steps S508 to S511 above, which will not be repeated here.

[0241] Continue to refer Figure 7 It can be understood that the execution subject of each step of the behavior recognition process 702 can be the above-mentioned behavior recognition driver 2012. To avoid repeated description, the execution subject of each step will not be repeated when describing the execution content of each step below.

[0242] S7021 , acquiring accelerometer data from the accelerometer device 201 .

[0243] S7022, determine whether the amount of cached accelerometer data is greater than the first amount, if so, execute S7023 to send the accelerometer data to the first behavior recognition algorithm library 211; if not, continue to execute S7021 to obtain the accelerometer data.

[0244] S7023 , sending the accelerometer data from the first behavior recognition algorithm library 211 to the second behavior recognition algorithm library 212 .

[0245] S7024, read the current motion state from the second behavior recognition algorithm library 212 and record the current number of steps as a global variable.

[0246] It can be understood that the execution process of the above steps S7021 to S7024 can refer to the specific implementation process of steps S501 to S507 above, and will not be repeated here.

[0247] S7025, report the movement status according to the subscription status.

[0248] It can be understood that the execution process of the above step S7025 can refer to the specific implementation process of step S512 above, which will not be repeated here.

[0249] It can be understood that based on the above-mentioned pedometer process 701 and behavior recognition process 702, only the behavior recognition process 702 requests data from the second behavior recognition algorithm library 212 located in the high-power DDR. By waking up the high-power DDR only once in a single cycle of updating the motion state and the current number of steps, the current number of steps and the motion state can be obtained at the same time. The pedometer driver 2013 only needs to access the global variables of the behavior recognition driver 2012 in the low-power SRAM cache space to read the current number of steps. The wake-up times and wake-up frequency of the high-power DDR memory are effectively reduced, and the wake-up power consumption of the memory is reduced.

[0250] References to "one embodiment" or "an embodiment" in the specification mean that the specific features, structures, or characteristics described in conjunction with the embodiment are included in at least one exemplary implementation or technology disclosed according to the embodiment of the present application. The appearance of the phrase "in one embodiment" in various places in the specification does not necessarily all refer to the same embodiment.

[0251] The disclosure of the embodiment of the present application also relates to an operating device for executing the text. The device can be specially constructed for the required purpose or it can include a general-purpose computer selectively activated or reconfigured by a computer program stored in the computer. Such a computer program can be stored in a computer-readable medium, such as, but not limited to any type of disk, including a floppy disk, an optical disk, a CD-ROM, a magneto-optical disk, a read-only memory (ROM), a random access memory (RAM), an EPROM, an EEPROM, a magnetic or optical card, an application-specific integrated circuit (ASIC) or any type of medium suitable for storing electronic instructions, and each can be coupled to a computer system bus. In addition, the computer mentioned in the specification may include a single processor or may be an architecture involving multiple processors for increased computing power.

[0252] In addition, the language used in this specification has been primarily selected for readability and instructional purposes and may not be selected to describe or limit the disclosed subject matter. Therefore, the present application embodiment disclosure is intended to illustrate rather than limit the scope of the concepts discussed herein.

Claims

1. A data processing method, applied to an electronic device, characterized in that: The electronic device comprises a first memory and a second memory, the first memory stores a behavior recognition driver and a pedometer driver, and the second memory stores a first algorithm library; The method comprises: The behavior recognition driver acquires first sensor data in a first data processing cycle; The behavior recognition driver calls the first algorithm library in the second memory to process the first sensor data to obtain first behavior recognition data and first step counting data; The behavior recognition driver stores the first behavior recognition data and the first step counting data in the first memory; The pedometer driver obtains the first step counting data from the first memory.

2. The method according to claim 1, characterized in that The first algorithm library includes a first interface and a second interface, and The behavior recognition driver calls the first algorithm library in the second memory to process the first sensor data to obtain first behavior recognition data and first step counting data, including: The behavior recognition driver calls the first interface to process the first sensor data to determine first behavior recognition data; The behavior recognition driver calls the second interface to process the first sensor data to determine the first step counting data.

3. The method according to claim 1, characterized in that The first memory further stores an accelerometer driver, the first sensor data includes accelerometer data, and, The behavior recognition driver acquires the first sensor data in the first data processing cycle, and further includes: During the first data processing cycle, the behavior recognition driver obtains the accelerometer data from the accelerometer driver at a first frequency.

4. The method according to claim 3, characterized in that The behavior recognition driver calls the first algorithm library in the second memory to process the first sensor data to obtain first behavior recognition data and first step counting data, including: The behavior recognition driver stores the accelerometer data in the first memory; Corresponding to the number of stored accelerometer data being greater than or equal to the first number, the behavior recognition driver calls the first algorithm library in the second memory to process the first sensor data to obtain first behavior recognition data and first step counting data.

5. The method according to claim 4, characterized in that The first memory further stores a second algorithm library, and The number of stored accelerometer data is greater than or equal to the first number, and the behavior recognition driver calls the first algorithm library in the second memory to process the first sensor data to obtain the first behavior recognition data and the first step counting data, including: The behavior recognition driver inputs a first amount of the accelerometer data into the second algorithm library; The behavior recognition driver detects that the first amount of the accelerometer data has been transmitted to the second algorithm library, inputs the first amount of the accelerometer data into the first algorithm library, and obtains the first behavior recognition data and the first step counting data.

6. The method according to claim 1, characterized in that The first memory is a cache of a processor of the electronic device, and the second memory is a memory of the electronic device; and, The behavior recognition driver stores the first behavior recognition data and the first step counting data in the first memory, including: The behavior recognition driver stores the first behavior recognition data in the cache in an original format, and stores the first pedometer data as a global variable, wherein the global variable is defined as a variable accessible to both the behavior recognition driver and the pedometer driver.

7. The method according to claim 6, characterized in that The pedometer driver obtains the first step counting data from the first memory, including: The pedometer driver accesses the global variable in the second data processing cycle to obtain the first step counting data.

8. The method according to claim 7, characterized in that The first memory further stores an accelerometer drive, and The pedometer driver accesses the global variable in the second data processing period to obtain the first step counting data, and further includes: During the second data processing period, the pedometer driver acquires accelerometer data from the accelerometer driver at a second frequency; The pedometer driver detects that the acquired accelerometer data is greater than or equal to a second quantity, accesses the global variable, acquires the first step counting data, and ends the second data processing cycle.

9. An electronic device, characterized in that: include: one or more processors; One or more memories; the one or more memories store one or more programs, and when the one or more programs are executed by the one or more processors, the electronic device executes the data processing method described in any one of claims 1 to 8.

10. A computer-readable storage medium, characterized in that: The storage medium stores instructions, which, when executed on a computer, cause the computer to execute the data processing method according to any one of claims 1 to 8.

Citation Information

Patent Citations

  • Methods, systems and devices for activity tracking device data synchronization with computing devices

    CN107329965A

  • Wearable device, step counting method thereof and computer storage medium

    CN112486258A

  • Data processing method and device and terminal equipment

    CN115727870A

  • Power-saving method and associated electronic device

    US20160018879A1