Control device and method, storage medium, electronic equipment and chip
By designing the control device, the interrupt receiving module, the context management module and the reading module are used to manage sensor data, which solves the problem of increasing power consumption caused by frequent wake-up of the terminal processor, and achieves the effect of reducing power consumption and improving processing efficiency.
Patent Information
- Application Number
- CN202311619902.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-29
- Publication Date
- 2025-05-30
AI Technical Summary
The terminal processor is frequently waked up for sensor data acquisition, resulting in increased power consumption.
A control device is designed, including an interrupt receiving module, a context management module and a reading module. By receiving sensor interrupt information, managing the context and generating read instructions, sensor data is read and stored in a cache. When the amount of cached data reaches the threshold value, the wake-up processor to process.
Reduces the number of times the processor is waked up, reduces power consumption, and improves the efficiency of sensor data processing.
Smart Images

Figure CN120066236A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular, to a control device, method, storage medium, electronic device, and chip. Background Art
[0002] There are many sensors on a terminal, such as an acceleration sensor, an optical sensor, a temperature sensor, a barometer sensor, and a geomagnetic sensor, etc.
[0003] Currently, the processor on the terminal can periodically collect the data of the working sensors. However, different sensors have their own corresponding collection periods and short intervals. Therefore, within a period of time, it is necessary to frequently wake up the processor according to these sampling periods to collect the sensor data, which will increase the power consumption of the processor. Summary of the Invention
[0004] In view of this, this application provides a control device, method, storage medium, electronic device, and chip, mainly aiming to improve the technical problem that the processor on the current terminal is frequently woken up to collect sensor data, which will increase the power consumption of the processor.
[0005] In a first aspect, this application provides a control device, including: an interrupt receiving module, a context management module, and a reading module;
[0006] The interrupt receiving module is connected to the context management module, and the context management module is further connected to the reading module;
[0007] The interrupt receiving module is configured to receive interrupt information corresponding to at least one sensor and send it to the context management module;
[0008] The context management module is configured to obtain the context of the at least one sensor according to the interrupt information, and generate a data reading instruction based on the context of the at least one sensor and send it to the reading module;
[0009] The reading module is configured to read the sensor data of the at least one sensor by executing the data reading instruction and send it to the context management module;
[0010] The context management module is further configured to store the sensor data in a first cache, and determine whether to wake up the processor according to the data volume in the first cache to extract the sensor data in the first cache for processing.
[0011] Optionally, the device further includes: a communication module;
[0012] The communication module is connected to the context management module;
[0013] The context management module is further configured to send a notification message to the communication module when the amount of data in the first cache is greater than or equal to a first preset threshold value;
[0014] The communication module is configured to wake up the processor to extract the sensor data in the first cache for processing according to the notification message.
[0015] Optionally, the context management module is further configured to store the received sensor data into a second cache corresponding to each sensor respectively, and determine to store the sensor data in the second cache into the first cache when the amount of data in the second cache is greater than or equal to a second preset threshold value.
[0016] In a second aspect, the present application provides a control method, including:
[0017] Receiving interruption information corresponding to at least one sensor;
[0018] Obtaining the context of the at least one sensor according to the interruption information;
[0019] Reading the sensor data of the at least one sensor according to the context of the at least one sensor;
[0020] Storing the sensor data into a first cache;
[0021] Determining whether to wake up the processor according to the amount of data in the first cache to extract the sensor data in the first cache for processing.
[0022] Optionally, the determining whether to wake up the processor according to the amount of data in the first cache to extract the sensor data in the first cache for processing includes:
[0023] Waking up the processor to extract the sensor data in the first cache for processing when the amount of data in the first cache is greater than or equal to a first preset threshold value.
[0024] Optionally, the interruption information includes an interruption type and an interruption identifier;
[0025] The obtaining the context of the at least one sensor according to the interruption information includes:
[0026] Determining the identifier of the at least one sensor according to the interruption type and the interruption identifier;
[0027] Obtaining the context of the at least one sensor according to the identifier of the at least one sensor.
[0028] Optionally, the reading the sensor data of the at least one sensor according to the context of the at least one sensor includes:
[0029] Determine the bus type used by each of the at least one sensor according to the interruption type;
[0030] Generate a corresponding reading instruction for each of the at least one sensor according to the context of the at least one sensor;
[0031] Execute the reading instruction by calling the bus interface corresponding to the bus type to read the sensor data of the at least one sensor.
[0032] Optionally, storing the sensor data in the first buffer includes:
[0033] Store the read sensor data in a second buffer corresponding to each sensor;
[0034] When the amount of data in the second buffer is greater than or equal to a second preset threshold, determine to store the sensor data in the second buffer in the first buffer.
[0035] Optionally, storing the read sensor data in a second buffer corresponding to each sensor includes:
[0036] If the read sensor data includes the sensor data of the target sensor and there is no second buffer corresponding to the target sensor, apply for and allocate a second buffer corresponding to the target sensor;
[0037] Store the sensor data of the target sensor in the second buffer corresponding to the target sensor.
[0038] In a third aspect, the present application provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed, the method described in the second aspect is implemented.
[0039] In a fourth aspect, the present application provides a chip, including the control device described in the first aspect.
[0040] In a fifth aspect, the present application provides an electronic device, including: a processor, at least one sensor, and a chip as described in the fourth aspect.
[0041] With the above technical solution, the present application provides a control device, method, storage medium, electronic device and chip. Among them, the control device includes: an interrupt receiving module, a context management module, and a reading module; the interrupt receiving module is connected to the context management module, and the context management module is also connected to the reading module; the interrupt receiving module is configured to receive interrupt information corresponding to at least one sensor and send it to the context management module; the context management module is configured to obtain the context of the at least one sensor according to the interrupt information, and generate a data reading instruction according to the context of the at least one sensor and send it to the reading module; the reading module is configured to read the sensor data of the at least one sensor by executing the data reading instruction and send it to the context management module; the context management module is further configured to store the sensor data in a first cache, and determine whether to wake up the processor according to the data volume in the first cache, so as to extract the sensor data in the first cache for processing. The present application uses a control device, such as a Smart Sensor Control (SSC) microprocessor, to replace the processor of the terminal to complete sensor data acquisition. By uniformly managing all sensors, collecting the data of all sensors and putting them into the cache, and then waking up the processor when the data volume in the cache reaches the set threshold. In this way, on the one hand, there is no need for the processor to collect sensor data, and on the other hand, the number of times the processor is woken up is reduced, thereby achieving the purpose of reducing power consumption.
[0042] The above description is only an overview of the technical solution of the present application. In order to be able to understand the technical means of the present application more clearly, it can be implemented according to the content of the specification. And in order to make the above and other purposes, features and advantages of the present application more obvious and understandable, the specific embodiments of the present application are specifically described below. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] The accompanying drawings herein are incorporated into the specification and form a part of the specification, showing embodiments consistent with the present application and used together with the specification to explain the principles of the present application.
[0044] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, for those of ordinary skill in the art, without creative efforts, other drawings can also be obtained according to these drawings.
[0045] Figure 1 The structural schematic diagram of a control device provided by an embodiment of the present application is shown;
[0046] Figure 2 The flowchart of a control method provided by an embodiment of the present application is shown;
[0047] Figure 3 shows a schematic flowchart of an example provided by an embodiment of the present application;
[0048] Figure 4 shows a schematic flowchart of another control method provided by an embodiment of the present application;
[0049] Figure 5 shows a schematic flowchart of an example provided by an embodiment of the present application;
[0050] Figure 6 shows a schematic flowchart of an example provided by an embodiment of the present application;
[0051] Figure 7 shows a schematic structural diagram of a control device provided by an embodiment of the present application. Detailed implementation manners
[0052] Hereinafter, embodiments of the present application will be described in more detail with reference to the accompanying drawings. It should be noted that, without conflict, the embodiments in the present application and the features in the embodiments may be combined with each other.
[0053] To address the technical problem that the processor on the current terminal is frequently awakened to collect sensor data, which will increase the power consumption of the processor. This embodiment provides a control device, as Figure 1 shown, the device includes: an interrupt receiving module (INT Controller) 11, a context management module (Context Manager) 12, and a reading module 13.
[0054] The interrupt receiving module 11 is connected to the context management module 12, and the context management module 12 is also connected to the reading module 13.
[0055] The interrupt receiving module 11 is configured to receive interrupt information corresponding to at least one sensor and send it to the context management module 12.
[0056] The at least one sensor may be a sensor working in the terminal. In this embodiment, the terminal may be a smart device such as a smart phone, a tablet computer, a drone, a smart robot, a smart watch, a smart bracelet, etc., and there are many sensors on these terminals. For example, for a smart watch, more than a dozen sensors may be installed on it, and as long as the smart watch is in the on state, there will be sensors working.
[0057] The interrupt information can be a General-Purpose Input / Output Ports (GPIO) interrupt or a Timer interrupt. This interrupt information can be used to wake up the processor to collect sensor data, and in this embodiment, the control device can use the interrupt receiving module 11 to replace the processor to receive this interrupt information.
[0058] The context management module 12 can be used to manage the sensor context. The context management module 12 is configured to obtain the context of the at least one sensor according to the interrupt information sent by the interrupt receiving module 11, and generate a data reading instruction based on the context of the at least one sensor and send it to the reading module 13.
[0059] The reading module 13 can be used to read the sensor data of the sensor. The reading module 13 is configured to read the sensor data of the at least one sensor by executing the data reading instruction and send it to the context management module 12.
[0060] The context management module 12 is also configured to first store the sensor data sent by the reading module 13 in the first cache, and then determine whether to wake up the processor according to the data volume in the first cache, so as to extract the sensor data in the first cache for processing.
[0061] Compared with the current existing technologies, in this embodiment, a control device such as an SSC microprocessor can be used to replace the processor of the terminal to complete the acquisition of sensor data. By uniformly managing all sensors, collecting the data of all sensors and putting them into the cache, and then waking up the processor when the data volume in the cache reaches the set threshold. In this way, on the one hand, there is no need for the processor to collect sensor data, and on the other hand, the number of times the processor is woken up is reduced, so as to achieve the purpose of reducing power consumption.
[0062] In some examples of this embodiment, the control device further includes: a communication module, such as an M33 interface;
[0063] The communication module is connected to the context management module 12; correspondingly, the context management module 12 is further configured to send a notification message to the communication module when the data volume in the first cache is greater than or equal to a first preset threshold (the corresponding threshold can be set in advance according to actual needs); the communication module is configured to wake up the processor to extract the sensor data in the first cache for processing according to the notification message.
[0064] For example, if the sensor data in the first cache is greater than or equal to a certain threshold, the processor can be woken up through the communication module to extract the sensor data (including the sensor data of at least one sensor) in the first cache for processing. In this way, the wake-up of the processor for corresponding processing can be accurately controlled.
[0065] In some examples of this embodiment, the context management module 12 is further configured to store the received sensor data in a second cache corresponding to each sensor respectively, and determine to store the sensor data in the second cache into a first cache when the amount of data in the second cache is greater than or equal to a second preset threshold value (the corresponding threshold value can be set in advance according to actual requirements).
[0066] For example, sensor A corresponds to cache 1, that is, the sensor data of sensor A is first stored in cache 1; sensor B corresponds to cache 2, that is, the sensor data of sensor B is first stored in cache 2; sensor C corresponds to cache 3, that is, the sensor data of sensor C is first stored in cache 3; if the amount of data in cache 1 is greater than or equal to the threshold value x corresponding to this cache 1, then all the sensor data in cache 1 is stored in the first cache. If the amount of data in cache 2 is greater than or equal to the threshold value y corresponding to this cache 2, then all the sensor data in cache 2 is stored in the first cache.
[0067] Through this cache grading mechanism, the storage situation of sensor data can be better controlled, making the stored sensor data more complete and accurate, and thus the accuracy in subsequent data processing by the processor can be improved.
[0068] It should be noted that the control device provided in this embodiment can specifically be an electronic device or a chip of a terminal, etc.
[0069] Further, based on the control device as shown in Figure 1 this embodiment also provides a control method, which can be executed by this control device. As shown in Figure 2 this, this method includes:
[0070] Step 201, receive interruption information corresponding to at least one sensor.
[0071] There are usually many sensors on a terminal. For example, many sensors are configured on wearable electronic watches and bracelets to continuously monitor human behavior and health data for 24 hours.
[0072] For example, more than a dozen sensors can be configured on a smart watch. As long as the smart watch is in the powered-on state, there are sensors working. Among them, the sensors that are in the working state when the smart watch is in the screen-off state may include: an acceleration sensor, an optical heart rate sensor, a temperature sensor, etc. When the smart watch is in the screen-on state, in addition to the acceleration sensor, the optical heart rate sensor, the temperature sensor, etc., an ambient light sensor, an optical tracking sensor, etc. will also be turned on. Other sensors will work in different application scenarios. For example, when the compass APP is opened, the barometer sensor, the geomagnetic sensor, etc. will also enter the working mode.
[0073] In the embodiments of the present disclosure, an interruption refers to a situation that occurs during the running of a program, where the system presents a condition that must be immediately processed by the Central Processing Unit (CPU). For example, when a sensor generates data that requires waking up the processor for processing, at this time, the processor temporarily suspends the execution of the program and turns to process the program and execution process of this sensor data.
[0074] Step 202: Obtain the context of at least one sensor according to the interruption information.
[0075] Context is an ordered sequence of attributes that defines the environment for sensors residing within the environment. Context is created during the activation of the sensor, and the sensor is configured to request automatic services such as synchronization, real-time activation, security, etc. In computer technology, relative to a process, context is the environment in which the process executes. Specifically, it refers to various variables and data, including all register variables, files opened by the process, memory information, etc. The processor can be awakened by a GPIO interruption or a Timer interruption to obtain the context of the corresponding sensor.
[0076] Step 203: Read the sensor data of at least one sensor based on the context of at least one sensor.
[0077] Exemplarily, the sensor data is the corresponding data generated by the sensor according to its specific function over a period of time. For example, the data of an optical heart rate sensor can be 78 beats per minute, 85 beats per minute, 90 beats per minute, 88 beats per minute, 82 beats per minute, 84 beats per minute, 82 beats per minute, etc.; the data of a temperature sensor can be 36.4 °C, 36.5 °C, 36.3 °C, 36.7 °C, 36.9 °C, 36.8 °C, 36.5 °C, etc.
[0078] Step 205: Determine whether to wake up the processor according to the data volume in the first buffer, so as to extract the sensor data in the first buffer for processing.
[0079] The terminal realizes measurement, transmission, processing, and / or automatic control, etc. through internal sensors, and stores the obtained corresponding sensor data into the first buffer. The first buffer can be the buffer register (Buffer) in the free data block queue (SensorBufferFreeFIFO). Sensor data generated by one or more working sensors at different times will be stored in the first buffer, and the data volume in the first buffer will increase with the increase of the working duration.
[0080] Step 205: Determine whether to wake up the processor according to the data volume in the first buffer to extract the sensor data in the first buffer for processing.
[0081] In this embodiment, if it is monitored that the amount of data in the first cache reaches a preset threshold value, the terminal issues an instruction to wake up the processor, and extracts all the sensor data collected during this period from the first cache for processing.
[0082] Exemplarily, starting from when the terminal enters the working state, when it is monitored that the increased sensor data in the cache reaches the set data volume, the processor is woken up, and all the sensor data in the cache during this period is extracted for processing; then the data volume in the cache is continuously monitored until the increased sensor data in the cache reaches the set data volume again, and the processor is woken up again to process the newly added sensor data after the last time the processor was woken up; similarly, each time the processor is woken up, the sensor data within two adjacent time intervals is processed until the terminal enters the shutdown state. If it is monitored that the newly added data volume does not reach the set value, the processor is not woken up, which can reduce the number of times the processor is woken up to achieve the purpose of reducing power consumption.
[0083] Most sensors generate a small amount of data during the acquisition period, usually several bytes, resulting in a relatively small amount of data processed after the processor is woken up. The number of times the processor is woken up is related to the number of sensors and the acquisition frequency of the sensors. The more sensors there are and the higher the acquisition frequency, the more frequently the processor is woken up and the higher the power consumption.
[0084] Battery life is a very critical requirement for wearable electronic products. To reduce power consumption, based on the above content, the following describes Figure 3 a control system according to some embodiments of the present application.
[0085] This embodiment provides a control system, as Figure 3 shown, the sensor data acquisition scenario 300 includes an SSC microcontroller 301, a sensor 302, a cache register 303, and a processor 304. It mainly satisfies the following functions:
[0086] 1. Interrupt reception module design: Support different interrupt types and identify specific sensors through interrupts.
[0087] 2. Design dedicated instructions: Collect sensor data through a Serial Peripheral Interface (SPI) and an Inter-Integrated Circuit (I2C) interface.
[0088] 3. Design dual-logic channel concurrent execution instructions, which can concurrently read the data of 2 or more sensors.
[0089] 4. Cache management: Put sensor data into the cache according to the corresponding format, and different sensor data uses different buffer registers.
[0090] 5. Queue (FIFO) management: Put the collected sensor data into the FIFO and count the amount of data cached in the FIFO.
[0091] 6. Wake up the processor: After the FIFO reaches a certain threshold, wake up the processor to read the data from the cache and reduce the number of times the processor is woken up.
[0092] Most of the time, the electronic watch and bracelet are in the screen-off standby scenario. At this time, only the sensor is in the working state, and the processor needs to be continuously woken up to collect the sensor data for processing. Use the processor to complete the collection of sensor data.
[0093] In this embodiment, first, receive the interrupt information corresponding to at least one sensor; obtain the context of at least one sensor according to the interrupt information; then, based on the context of at least one sensor, read the sensor data of at least one sensor; store the sensor data in the first cache; and then determine whether to wake up the processor according to the amount of data in the first cache to extract the sensor data in the first cache for processing. In this embodiment, the SSC microprocessor can be used to replace the terminal processor to complete the sensor data collection. By uniformly managing all sensors, collect the data of all sensors and put them into the cache, and then wake up the processor when the amount of data in the cache reaches the set threshold. In this way, on the one hand, there is no need to use the processor to collect sensor data, and on the other hand, the number of times the processor is woken up is reduced, so as to achieve the purpose of reducing power consumption.
[0094] Based on the technical implementation content shown in the above embodiment, in order to further illustrate the specific implementation process of the method in this embodiment, this embodiment provides the following Figure 4 shown specific method, which includes:
[0095] Step 301, receive the interrupt information corresponding to at least one sensor.
[0096] Optionally, the interrupt information includes an interrupt type and an interrupt identifier;
[0097] In the embodiments of the present disclosure, the interrupt type mainly includes GPIO interrupt and / or Timer interrupt, etc., and the interrupt identifier can be used to determine the corresponding sensor.
[0098] Step 302, obtain the context of at least one sensor according to the interrupt information.
[0099] Based on the interrupt information in step 301 including an interrupt type and an interrupt identifier, correspondingly, step 302 may specifically include: determine the identifier of at least one sensor according to the interrupt type and the interrupt identifier; obtain the context of at least one sensor based on the identifier of at least one sensor.
[0100] Step 303: Read the sensor data of at least one sensor according to the context of the at least one sensor.
[0101] In some examples, the method of this embodiment further includes: determining the bus type used by each of the at least one sensor according to the interrupt type; generating a corresponding read instruction for each of the at least one sensor according to the context of the at least one sensor; and executing the read instruction by calling the bus interface corresponding to the bus type to read the sensor data of the at least one sensor.
[0102] Step 304: Store the read sensor data into the second cache corresponding to each sensor.
[0103] In some examples, the method of this embodiment further includes: if the sensor data read includes the sensor data of the target sensor and there is no second cache corresponding to the target sensor, applying for and allocating a second cache corresponding to the target sensor; and storing the sensor data of the target sensor into the second cache corresponding to the target sensor.
[0104] In the embodiments of the present disclosure, the number of second caches corresponds to the number of sensors. All working sensors first put the data into their respective second caches. Different sensors generate different amounts of data within the same period of time, and the amount of data in the second caches is also different.
[0105] Step 305: Determine to store the sensor data in the second cache into the first cache when the amount of data in the second cache is greater than or equal to the second preset threshold.
[0106] Exemplarily, if there is at least one target sensor among the working sensors that meets the condition for real-time data acquisition, determine the second preset threshold according to the second cache corresponding to each target sensor, where the second preset threshold is the amount of data cumulatively collected by the corresponding sensor system within a period of time.
[0107] In the embodiments of the present disclosure, setting the second preset threshold is to make the processing of sensor data more timely in devices or scenarios with high requirements for data real-time performance, which can improve the real-time performance of data reporting.
[0108] Step 306: Determine whether to wake up the processor according to the amount of data in the first cache to extract the sensor data in the first cache for processing.
[0109] In some examples, the method of this embodiment further includes: waking up the processor to extract the sensor data in the first cache for processing when the amount of data in the first cache is greater than or equal to the first preset threshold.
[0110] In the embodiments of the present disclosure, a preset threshold value can be used to determine whether to wake up the processor. Exemplarily, the target waterline value can be set to the amount of data generated by one or more working sensors within 1 s. Then, starting from the power-on time, when the working time of these sensors is 500 ms, the amount of data generated is less than the threshold value, and the processor will not be woken up; when the working time of the sensors is greater than or equal to 1 s, the amount of data generated is greater than or equal to the threshold value, then the processor is woken up and the sensor data generated during this period in the cache is extracted for processing.
[0111] Through the preset threshold value, the data collected by each working sensor according to different acquisition periods can wake up the processor to uniformly process the data in the cache when reaching the threshold value, reducing the frequency of the processor being woken up and at the same time reducing the power consumption during the process of the processor collecting sensor data.
[0112] As Figure 5 shown, the SSC microcontroller mainly includes the following parts:
[0113] 1. Interrupt control (INT Control) is used to receive sensor interrupts, including GPIO and Timer interrupts. 2. Interrupt handling (INT Handle) determines the sensor ID through the interrupt identity document (ID). 3. Context management (Context Manager) is used to manage sensor configuration information; apply for a buffer memory from the sensor data queue (SensorBufferPool) to save the read sensor data; execute the instructions corresponding to the sensor ID and generate instructions for I2C IF and / or SPI IF; determine whether the amount of sensor data collected reaches the threshold value and whether to put it into the idle data block queue. 4. M33 IF is used to configure the SPI bus; configure the I2C bus; configure the sensor context. 5. I2CIF is used to execute I2C instructions; select the corresponding I2C bus; collect sensor data through I2C and put it into the cache. 6. SPI IF is used to execute I2C instructions; select the corresponding I2C bus; collect sensor data through I2C and put it into the cache.
[0114] As an embodiment, based on the above content, the control method according to some embodiments of the present application will be described below in combination with Figure 6 description.
[0115] When powering on, the processor configures the I2C, SPI, sensor context, and idle data block queue managed by SSC through the M33 IF. The I2C configuration includes the number of I2C buses and the I2C bus register address space. The SPI configuration includes the number of SPI buses and the SPI bus register address space. The sensor context configuration includes the sensor ID, whether the bus type is SPI or I2C, the bus ID of I2C and / or SPI, and whether the interrupt type is Timer or GPIO. Information such as the address of the sensor read instruction, the threshold value for the sensor data volume to reach and be placed in the idle data block queue, and the ID of the sensor data queue for which cache is requested. The parameters of the idle data block queue include the FIFO depth and the threshold value for the cached data volume to wake up the processor. After the processor configures the SSC, it can enter the sleep low-power state.
[0116] After the configuration is completed, the interrupt control party waits for an interrupt from GPIO or Timer. After receiving the interrupt, it obtains the interrupt ID and interrupt type, and sends the interrupt-related information to the context management module.
[0117] The context management module calculates the sensor ID based on the interrupt ID and interrupt type. The sensor ID finds the corresponding sensor context, determines whether the bus type used by the sensor is SPI or I2C, generates instructions based on the instruction set base address in the sensor context, and sends the instructions to the cache instruction queue (CmdPendingFIFO) of the I2C IF and / or SPI IF in sequence.
[0118] The SPI IF or I2C IF reads the sensor data according to the instructions and sends the data to the context management module.
[0119] When the context management module receives the sensor data, if it finds that the sensor does not have a buffer register for storing data, it applies for a buffer register from the corresponding sensor data queue. The context management module puts the data into the buffer register in a certain format. If the data volume in the cache reaches the threshold value, the data in the cache is uniformly placed in the idle data block queue.
[0120] When the context management module finds that the cached data volume in the idle data block queue reaches the threshold value, it notifies the M33IF.
[0121] After receiving the notification, the M33 IF triggers an interrupt to wake up the processor. After the processor wakes up, it reads all the data cached in the idle data block queue.
[0122] Through the implementation mode of this embodiment, the SSC microprocessor can be used to replace the terminal processor to complete the acquisition of sensor data. By uniformly managing all sensors, collecting the data of all sensors and putting them into the cache, and then waking up the processor when the data volume in the cache reaches the set threshold value. In this way, on the one hand, there is no need for the processor to collect sensor data, and on the other hand, the number of times the processor is woken up is reduced, so as to achieve the purpose of reducing power consumption.
[0123] Further, as Figure 2 and Figure 4 a specific implementation of the method shown, this embodiment provides a control device, as Figure 7 shown, the device includes: an acquisition unit 41, a storage unit 42, and a determination unit 43.
[0124] The acquisition unit 41 is configured to receive interruption information corresponding to at least one sensor; obtain the context of the at least one sensor according to the interruption information; and read the sensor data of the at least one sensor according to the context of the at least one sensor.
[0125] The storage unit 42 is configured to store the sensor data in a first cache.
[0126] The determination unit 43 is configured to determine whether to wake up the processor according to the data volume in the first cache, so as to extract the sensor data in the first cache for processing.
[0127] In some examples of this embodiment, the determination unit 43 is specifically configured to wake up the processor to extract the sensor data in the first cache for processing when the data volume in the first cache is greater than or equal to a first preset threshold value.
[0128] In some examples of this embodiment, the interruption information includes an interruption type and an interruption identifier; the acquisition unit 41 is specifically configured to determine the identifier of the at least one sensor according to the interruption type and the interruption identifier; and obtain the context of the at least one sensor according to the identifier of the at least one sensor.
[0129] In some examples of this embodiment, the acquisition unit 41 is further specifically configured to determine the bus type used by each of the at least one sensor according to the interruption type; generate a read instruction corresponding to each of the at least one sensor according to the context of the at least one sensor; and execute the read instruction by calling the bus interface corresponding to the bus type to read the sensor data of the at least one sensor.
[0130] In some examples of this embodiment, the storage unit 42 is specifically configured to store the read sensor data into a second buffer corresponding to each sensor respectively; when the amount of data in the second buffer is greater than or equal to a second preset threshold, it is determined to store the sensor data in the second buffer into the first buffer.
[0131] In some examples of this embodiment, the storage unit 42 is further specifically configured to, if the read sensor data includes the sensor data of a target sensor and there is no second buffer corresponding to the target sensor, apply for allocating a second buffer corresponding to the target sensor; and store the sensor data of the target sensor into the second buffer corresponding to the target sensor.
[0132] It should be noted that for other corresponding descriptions of each functional unit involved in the control device provided in this embodiment, reference can be made to Figure 2 and Figure 4 the corresponding descriptions therein, which will not be elaborated here.
[0133] Based on the methods as shown in Figure 2 and Figure 4 above, correspondingly, this embodiment further provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed, the methods as shown in Figure 2 and Figure 4 above are implemented.
[0134] Based on such an understanding, the technical solution of this application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.), and includes several instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods of various implementation scenarios of this application.
[0135] Based on the methods as shown in Figure 2 and Figure 4 above, and Figure 1 and Figure 7 the device embodiments as shown in Figure 1 or Figure 7 above, this embodiment further provides a chip, which specifically may include the control device as shown in Figure 1 or Figure 7 above. The chip can specifically execute the methods as shown in Figure 2 and Figure 4 above.
[0136] Based on the methods as shown in Figure 2 and Figure 4 above, and Figure 1 and Figure 7For the device embodiments shown, to achieve the above object, embodiments of the present application further provide an electronic device, such as intelligent terminals like smart phones, smart watches, smart bracelets, tablet computers, drones, intelligent robots, etc. The device includes a processor, at least one sensor, and the above-mentioned chip.
[0137] Optionally, the above-mentioned electronic device may further include a user interface, a network interface, a camera, a radio frequency (RF) circuit, sensors, an audio circuit, a WI-FI module, etc. The user interface may include a display screen, an input unit such as a keyboard, etc. Optionally, the user interface may further include a USB interface, a card reader interface, etc. The network interface may optionally include a standard wired interface, a wireless interface (such as a WI-FI interface), etc.
[0138] Those skilled in the art can understand that the above-mentioned electronic device structure provided in this embodiment does not constitute a limitation on the electronic device, and may include more or fewer components, or combine certain components, or have different component arrangements.
[0139] The storage medium may further include an operating system and a network communication module. The operating system is a program for managing the hardware and software resources of the above-mentioned physical device, supporting the operation of information processing programs and other software and / or programs. The network communication module is used to implement communication between components within the storage medium, as well as communication with other hardware and software in the information processing physical device.
[0140] Through the description of the above embodiments, those skilled in the art can clearly understand that the present application can be implemented by means of software plus a necessary general hardware platform, or can also be implemented by hardware. By applying the solution of this embodiment, compared with the current existing technologies, this embodiment can use an SSC microprocessor to replace the terminal processor to complete sensor data acquisition. By uniformly managing all sensors, collecting all sensor data and putting it into the cache, and then waking up the processor when the data volume in the cache reaches the set threshold value. In this way, on the one hand, there is no need for the processor to collect sensor data, and on the other hand, the number of times the processor is woken up is reduced, thereby achieving the purpose of reducing power consumption.
[0141] It should be noted that in this document, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the terms "comprising", "including" or any other variation thereof are intended to cover non-exclusive inclusion, such that a process, method, article or device comprising a series of elements not only includes those elements but also includes other elements not expressly listed, or elements inherent to such process, method, article or device. Without further limitation, an element defined by the statement "comprising an..." does not exclude the presence of additional identical elements in the process, method, article or device comprising the said element.
[0142] The above are only specific embodiments of the present application, enabling those skilled in the art to understand or implement the present application. Various modifications to these embodiments will be obvious to those skilled in the art, and the general principles defined herein can be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to these embodiments described herein, but rather will be accorded the widest scope consistent with the principles and novel features claimed herein.
Claims
1. A control device, characterized in that, it includes: an interrupt receiving module, a context management module, and a reading module; the interrupt receiving module is connected to the context management module, and the context management module is further connected to the reading module; the interrupt receiving module is configured to receive interrupt information corresponding to at least one sensor and send it to the context management module; the context management module is configured to obtain the context of the at least one sensor according to the interrupt information, and generate a data reading instruction based on the context of the at least one sensor and send it to the reading module; the reading module is configured to read the sensor data of the at least one sensor by executing the data reading instruction and send it to the context management module; the context management module is further configured to store the sensor data in a first cache, and determine whether to wake up the processor according to the data volume in the first cache to extract the sensor data in the first cache for processing.
2. The device according to claim 1, characterized in that, the device further includes: a communication module; the communication module is connected to the context management module; the context management module is further configured to send a notification message to the communication module when the data volume in the first cache is greater than or equal to a first preset threshold; the communication module is configured to wake up the processor to extract the sensor data in the first cache for processing according to the notification message.
3. The device according to claim 1, characterized in that, the context management module is further configured to store the received sensor data in a second cache corresponding to each sensor respectively, and determine to store the sensor data in the second cache into the first cache when the data volume in the second cache is greater than or equal to a second preset threshold.
4. A control method, characterized in that, it includes: receiving interrupt information corresponding to at least one sensor; obtaining the context of the at least one sensor according to the interrupt information; reading the sensor data of the at least one sensor based on the context of the at least one sensor; storing the sensor data in a first cache; determining whether to wake up the processor according to the data volume in the first cache to extract the sensor data in the first cache for processing.
5. The method according to claim 4, characterized in that, the determining whether to wake up the processor according to the data volume in the first cache to extract the sensor data in the first cache for processing includes: waking up the processor to extract the sensor data in the first cache for processing when the data volume in the first cache is greater than or equal to a first preset threshold.
6. The method according to claim 4, characterized in that, the interrupt information includes an interrupt type and an interrupt identifier; the obtaining the context of the at least one sensor according to the interrupt information includes: determining the identifier of the at least one sensor according to the interrupt type and the interrupt identifier; obtaining the context of the at least one sensor based on the identifier of the at least one sensor.
7. The method according to claim 6, characterized in that, Reading the sensor data of the at least one sensor according to the context of the at least one sensor includes: Determining the bus type used by each of the at least one sensor according to the interrupt type; Generating a corresponding reading instruction for each of the at least one sensor according to the context of the at least one sensor; Executing the reading instruction by calling the bus interface corresponding to the bus type to read the sensor data of the at least one sensor.
8. The method according to claim 4, wherein, Storing the sensor data in the first cache includes: Storing the read sensor data in a second cache corresponding to each sensor; Determining to store the sensor data in the second cache in the first cache when the amount of data in the second cache is greater than or equal to a second preset threshold.
9. The method according to claim 8, wherein, Storing the read sensor data in a second cache corresponding to each sensor includes: If the read sensor data includes the sensor data of a target sensor and there is no second cache corresponding to the target sensor, applying for and allocating a second cache corresponding to the target sensor; Storing the sensor data of the target sensor in the second cache corresponding to the target sensor.
10. A computer-readable storage medium, on which a computer program is stored, wherein, The computer program, when executed, implements the method according to any one of claims 4 to 9.
11. A chip, wherein, includes: The control device according to any one of claims 1 to 3.
12. An electronic device, wherein, includes: A processor, at least one sensor and a chip according to claim 11.
Citation Information
Cited By
Data acquisition method, chip, circuit, electronic device, storage medium and computer program product
CN122507589A