Double-MCU ultra-low power consumption interaction method and device, electricity meter and electronic equipment
By adopting a dual MCU ultra-low power interaction method in IoT devices, using pin state changes and timing operations to control data transmission, the problem of high power consumption in IoT devices when responding to communication quickly is solved, and real-time communication is achieved in low-power scenarios.
Patent Information
- Application Number
- CN202411981247.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-31
- Publication Date
- 2025-05-02
AI Technical Summary
IoT devices consume high power when responding to communication quickly, making it difficult to achieve real-time communication and low power consumption when powered by batteries or charging capacitors alone.
The dual MCU ultra-low power consumption interaction method is adopted to electrically connect through the serial communication interface between the first MCU and the second MCU. When in the low power consumption state, data transmission is controlled through pin state changes and timing operations to ensure that the low power consumption state is maintained when there is no data transmission.
It realizes that the IoT devices are in a low-power state independently when there is no data transmission, effectively reducing the power consumption of the MCU, adapting to low-power scenarios powered by batteries or supercapacitors, and ensuring timely response to communications when needed.
Smart Images

Figure CN119916919A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of Internet of Things device communication, and in particular to a dual MCU ultra-low power consumption interaction method, device, electric meter and electronic equipment. Background Art
[0002] With the rapid development of IoT technology, there are more and more IoT devices, and with them comes the consumption of electricity. Therefore, it is crucial to achieve real-time communication between and within IoT devices while reducing power consumption.
[0003] Usually, in order for any IoT device to respond to the communication of other IoT devices in real time, the MCU of the IoT device and the MCU in its internal communication module need to operate at high speed. However, this will make the operating power consumption of the MCU and the corresponding system very high, making it unsuitable for use in some occasions where only a fixed amount of electricity is supplied by batteries or charging capacitors. Summary of the invention
[0004] Therefore, the technical problem to be solved by the present invention is to overcome the defect of high power consumption of IoT devices when responding to communications quickly, thereby providing a dual MCU ultra-low power consumption interaction method, device, electric meter and electronic equipment.
[0005] According to a first aspect, an embodiment of the present invention discloses a dual-MCU ultra-low power interaction method, wherein the dual MCU includes a first MCU in a device for realizing device control and data processing and a second MCU integrated in a communication module of the device, wherein the first MCU includes a first pin for transmitting a signal, and the second MCU includes a second pin for transmitting a signal, and the first MCU and the second MCU are electrically connected through the first pin, the second pin, and a serial communication interface, and the first MCU and the second MCU can be independently in a low power consumption state during normal operation, and the corresponding first pin and second pin are both in a low level state; the method includes: when the second MCU needs to send data to the first MCU, setting the second pin from the low level state to a high level state and responding to a first timing operation; when the first target duration is reached, setting the second pin from the high level state to a low level state and responding to a second timing operation; when the second target duration is reached, sending the data to be sent to the first MCU through the serial communication interface. When the first MCU needs to send data to the second MCU, the first pin is set from the low level state to the high level state and responds to the third timing operation; when the third target duration is reached, the first pin is set from the high level state to the low level state and responds to the fourth timing operation; when the fourth target duration is reached, the data to be sent is sent to the second MCU through the serial communication interface.
[0006] Optionally, the method also includes: when the first MCU detects that the state of the second pin in the second MCU has changed, the first MCU may exit the low power consumption state and enter the high power consumption state to ensure that the data sent by the second MCU can be received; when the second MCU detects that the state of the first pin in the first MCU has changed, the second MCU may exit the low power consumption state and enter the high power consumption state to ensure that the data sent by the first MCU can be received.
[0007] Optionally, the method also includes: when the first MCU monitors that the state of the second pin in the second MCU has changed, the first MCU may exit the low power consumption state and enter the high power consumption state, and if the first MCU does not receive the data sent by the second MCU within a certain period of time, the first MCU may exit the high power consumption state and enter the low power consumption state; when the second MCU monitors that the state of the first pin in the first MCU has changed, the second MCU may exit the low power consumption state and enter the high power consumption state, and if the second MCU does not receive the data sent by the first MCU within a certain period of time, the second MCU may exit the high power consumption state and enter the low power consumption state.
[0008] According to the second aspect, an embodiment of the present invention further discloses a dual-MCU ultra-low power interaction device, wherein the dual-MCU includes a first MCU in a device for realizing device control and data processing and a second MCU integrated in a communication module of the device, wherein the first MCU includes a first pin for transmitting a signal, and the second MCU includes a second pin for transmitting a signal, and the first MCU and the second MCU are electrically connected through the first pin, the second pin and a serial communication interface, and the first MCU and the second MCU can be independently in a low power consumption state during normal operation, and the corresponding first pin and second pin are both in a low level state; the device includes: a first response module, which is used to set the second pin from the low level state to the high level state and respond to a first timing operation when the second MCU needs to send data to the first MCU; a second response module, which is used to set the second pin from the high level state to the low level state and respond to a second timing operation when the first target duration is reached; a first sending module, which is used to send the data to be sent to the first MCU through the serial communication interface when the second target duration is reached. The third response module is used to set the first pin from the low level state to the high level state and respond to the third timing operation when the first MCU needs to send data to the second MCU; the fourth response module is used to set the first pin from the high level state to the low level state and respond to the fourth timing operation when the third target duration is reached; the second sending module is used to send the data to be sent to the second MCU through the serial communication interface when the fourth target duration is reached.
[0009] Optionally, the device also includes: a first data receiving activation module, which is used for when the first MCU detects that the state of the second pin in the second MCU has changed, the first MCU can exit the low power consumption state and enter the high power consumption state to ensure that the data sent by the second MCU can be received; a second data receiving activation module, which is used for when the second MCU detects that the state of the first pin in the first MCU has changed, the second MCU can exit the low power consumption state and enter the high power consumption state to ensure that the data sent by the first MCU can be received.
[0010] Optionally, the device also includes: a first state conversion module, which is used for when the first MCU monitors that the state of the second pin in the second MCU has changed, the first MCU can exit the low power consumption state and enter the high power consumption state, and within a certain period of time, if the first MCU does not receive the data sent by the second MCU, then the first MCU can exit the high power consumption state and enter the low power consumption state; a second state conversion module, which is used for when the second MCU monitors that the state of the first pin in the first MCU has changed, the second MCU can exit the low power consumption state and enter the high power consumption state, and within a certain period of time, if the second MCU does not receive the data sent by the first MCU, then the second MCU can exit the high power consumption state and enter the low power consumption state.
[0011] According to a third aspect, an embodiment of the present invention further discloses an electric meter, comprising: a second MCU, arranged in a communication module in the electric meter, comprising a second pin for transmitting a signal, for executing when the second MCU needs to send data to the first MCU, setting the second pin from a low level state to a high level state and responding to a first timing; when the first target duration is reached, setting the second pin from the high level state to a low level state and responding to a second timing operation; when the second target duration is reached, sending the data to be sent to the first MCU through a serial communication interface; a first MCU, comprising a first pin for transmitting a signal, the first MCU and the second MCU being electrically connected through the first pin, the second pin and the serial communication interface, for executing when the first pin is set from the low level state to a high level state and responding to a third timing operation: when the third target duration is reached, setting the first pin from the high level state to a low level state and responding to a fourth timing operation; when the fourth target duration is reached, sending the data to be sent to the second MCU through the serial communication interface.
[0012] According to the fourth aspect, an embodiment of the present invention also discloses an electronic device, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor performs the steps of the dual MCU ultra-low power consumption interaction method as described in the first aspect or any optional embodiment of the first aspect.
[0013] According to the fifth aspect, an embodiment of the present invention further discloses a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the dual MCU ultra-low power consumption interaction method as described in the first aspect or any optional embodiment of the first aspect.
[0014] The technical solution of the present invention has the following advantages:
[0015] The dual MCU ultra-low power interaction method provided by the present invention is that when the device is operating normally, the first MCU and the second MCU can be independently in a low power state, and the corresponding first pin and second pin are both in a low level state. When the second MCU needs to send data to the first MCU, the second pin is set from the low level state to a high level state and responds to the first timing operation; when the first target duration is reached, the second pin is set from the high level state to a low level state and responds to the second timing operation; when the second target duration is reached, the data to be sent is sent to the first MCU through a serial communication interface. When the first MCU needs to send data to the second MCU, the first pin is set from the low level state to a high level state and responds to the third timing operation; when the third target duration is reached, the first pin is set from the high level state to a low level state and responds to the fourth timing operation; when the fourth target duration is reached, the data to be sent is sent to the second MCU through a serial communication interface. This method is applied to communication between IoT devices. When there is no data to be transmitted, the first pin of the first MCU and the second pin of the second MCU are both in a low level state, that is, the first MCU and the second MCU can be independently in a low power consumption state. When there is data transmission, the first pin and the second pin are set from a low level to a high level to prepare for data transmission. This method enables the first MCU and the second MCU to be independently in a low power consumption state when there is no data communication, effectively reducing the power consumption of the first MCU and the second MCU, thereby adapting to low power consumption scenarios that are powered only by batteries or super capacitors and need to respond to communications in a timely manner. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0017] Figure 1 This is a flowchart of a specific example of the dual MCU interactive ultra-low power consumption method in an embodiment of the present invention;
[0018] Figure 2 A schematic diagram of a specific example of the dual MCU ultra-low power consumption interaction method in an embodiment of the present invention;
[0019] Figure 3 It is a schematic diagram of another specific example of the dual MCU ultra-low power consumption interaction method in an embodiment of the present invention;
[0020] Figure 4 It is a principle block diagram of a specific example of a dual MCU ultra-low power consumption interaction device in an embodiment of the present invention;
[0021] Figure 5 FIG. 4 is a specific example diagram of an electronic device in an embodiment of the present invention. DETAILED DESCRIPTION
[0022] The technical solution of the present invention will be described clearly and completely below in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0023] In the description of the present invention, it should be noted that the terms "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inner", "outer", etc., indicating the orientation or positional relationship, are based on the orientation or positional relationship shown in the drawings, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as limiting the present invention. In addition, the terms "first", "second", and "third" are used for descriptive purposes only, and cannot be understood as indicating or implying relative importance.
[0024] In the description of the present invention, it should be noted that, unless otherwise clearly specified and limited, the terms "installed", "connected", and "connected" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or it can be indirectly connected through an intermediate medium, it can also be the internal connection of two components, it can be a wireless connection, or it can be a wired connection. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.
[0025] In addition, the technical features involved in the different embodiments of the present invention described below can be combined with each other as long as they do not conflict with each other.
[0026] The embodiment of the present invention discloses a dual-MCU ultra-low power interaction method, wherein the dual-MCU includes a first MCU in a device for realizing device control and data processing and a second MCU integrated in a communication module of the device, wherein the first MCU includes a first pin for transmitting a signal, and the second MCU includes a second pin for transmitting a signal, and the first MCU and the second MCU are electrically connected through the first pin, the second pin, and a serial communication interface, and the first MCU and the second MCU can be independently in a low power consumption state when operating normally, and the corresponding first pin and second pin are both in a low level state, wherein the first pin and the second pin can be IO pins, and the connection relationship between the first MCU and the second MCU is as follows: Figure 2 As shown. In the embodiment of the present application, the device takes an electric meter that can be used as an Internet of Things device as an example. The communication module integrated in the electric meter may include but is not limited to a Bluetooth module, a Lora communication module, a GPRS / 3G / 4G communication module, a WIFI module or a Wi-Sun module, etc. The serial communication interface may be Uart, SPI, or IIC. The embodiment of the present application takes the Bluetooth module as an example to illustrate the dual MCU interaction method recorded in the embodiment of the present application. In the embodiment of the present application, the first MCU takes the main MCU integrated in the electric meter, and the second MCU takes the Bluetooth module as an example. The specific connection relationship is as follows Figure 3 As shown, BT_MODE is the indication signal transmitted by the electric meter to the Bluetooth module through the first pin, and BT_IND is the indication signal transmitted by the Bluetooth module to the electric meter through the second pin. In the embodiment of the present application, the state of the second pin can be controlled by the Bluetooth module to be placed in a low level state when the electric meter is powered on, and the state of the first pin of the main MCU can be controlled by the main MCU to be placed in a low level state when the electric meter is powered on. Figure 1 As shown, the following steps are included:
[0027] Step 101, when the second MCU needs to send data to the first MCU, the second pin is set from the low level state to the high level state and responds to the first timing operation. Exemplarily, when the second MCU sends data to the first MCU, the second pin is set from the low level state to the high level state, and the timing operation can be responded to by a timing module set in the device.
[0028] Step 102: When the first target duration is reached, the second pin is set from the high level state to the low level state and responds to the second timing operation; illustratively, the first target duration is not limited in the embodiment of the present application, and those skilled in the art can determine it according to actual needs. In the embodiment of the present application, the first target duration can be 80ms. When the first target duration is reached, after the second pin is set from the high level state to the low level state, the timing module is controlled to respond to the second timing operation.
[0029] Step 103, when the second target duration is reached, the data to be sent is sent to the first MCU via the serial communication interface. For example, the first target duration is not limited in the present embodiment, and those skilled in the art can determine it according to actual needs. In the present embodiment, the second target duration can be 200ms.
[0030] Specifically, by default, the second MCU in the Bluetooth module is in a low-power state and the second pin is in a low-level state. When the Bluetooth module receives data from a mobile phone APP or other device, the indication signal BT_IND sent by the second pin of the second MCU is high, which switches to a low level after a continuous 80ms pulse wake-up, and then delays 200ms before sending the received data to the main MCU through the serial communication interface (UART). After the sending is completed, the Bluetooth module enters a low-power state.
[0031] Step 104: When the first MCU needs to send data to the second MCU, the first pin is set from the low level state to the high level state and responds to the third timing operation. Exemplarily, when the first MCU sends data to the second MCU, after the first pin is set from the low level state to the high level state, the timing operation can be responded to by the timing module set in the device.
[0032] Step 105: When the third target duration is reached, the first pin is set from the high level state to the low level state and responds to the fourth timing operation. For example, the third target duration is not limited in the embodiment of the present application, and those skilled in the art can determine it according to actual needs. In the embodiment of the present application, the third target duration can be 80ms. When the third target duration is reached, after the first pin is set from the high level state to the low level state, the timing module is controlled to respond to the fourth timing operation.
[0033] Step 106: When the fourth target duration is reached, the data to be sent is sent to the second MCU via the serial communication interface. For example, the fourth target duration is not limited in the present embodiment, and those skilled in the art can determine it according to actual needs. In the present embodiment, the fourth target duration can be 200ms.
[0034] The timing operation duration used in the embodiments of the present application, such as 80ms, 200ms, etc., can be determined according to the running speed and operation method of each MCU; and the mentioned 80ms, 200ms, etc. times can be asymmetric, that is, the signal sent by the first MCU can be 80ms and 200ms, and the signal sent by the second MCU of the Bluetooth module can be 60ms and 150ms.
[0035] The dual MCU ultra-low power interaction method provided by the embodiment of the present invention is that when the device is operating normally, the first MCU and the second MCU can be independently in a low power state, and the corresponding first pin and second pin are both in a low level state. When the second MCU needs to send data to the first MCU, the second pin is set from the low level state to a high level state and responds to the first timing operation; when the first target duration is reached, the second pin is set from the high level state to a low level state and responds to the second timing operation; when the second target duration is reached, the data to be sent is sent to the first MCU through a serial communication interface. When the first MCU needs to send data to the second MCU, the first pin is set from the low level state to a high level state and responds to the third timing operation; when the third target duration is reached, the first pin is set from the high level state to a low level state and responds to the fourth timing operation; when the fourth target duration is reached, the data to be sent is sent to the second MCU through a serial communication interface. This method is applied to communication between IoT devices. When there is no data to be transmitted, the first pin of the first MCU and the second pin of the second MCU are both in a low level state, that is, the first MCU and the second MCU can be independently in a low power consumption state. When there is data transmission, the first pin and the second pin are set from a low level to a high level to prepare for data transmission. This method enables the first MCU and the second MCU to be independently in a low power consumption state when there is no data communication, effectively reducing the power consumption of the first MCU and the second MCU, thereby adapting to low power consumption scenarios that are powered only by batteries or super capacitors and need to respond to communications in a timely manner.
[0036] As an optional embodiment of the present invention, the method also includes: when the first MCU detects that the state of the second pin in the second MCU has changed, the first MCU can exit the low power consumption state and enter the high power consumption state to ensure that the data sent by the second MCU can be received; when the second MCU detects that the state of the first pin in the first MCU has changed, the second MCU can exit the low power consumption state and enter the high power consumption state to ensure that the data sent by the first MCU can be received.
[0037] Exemplarily, when the first MCU detects that the state of the second pin of the second MCU has changed, the first MCU exits the low power state and enters the high power state to prepare for receiving the data sent by the second MCU; when the second MCU detects that the state of the first pin of the first MCU has changed, the second MCU exits the low power state and enters the high power state to prepare for receiving the data sent by the first MCU. Specifically, after receiving the change of the BT_IND signal of the second pin, the main MCU adjusts from the low power state to the high power state to cope with the next data reception. Since the BT_IND signal will change from low level to high level and from high level to low level in this process, this will provide a rising edge and a falling edge to the main MCU, so when the main MCU is in sleep, it can be set to wake up by the rising edge or the falling edge. Then, by setting a 200ms delay, it is convenient for the main MCU to check itself. It is possible that the main MCU is in deep sleep and needs an initialization process after being awakened by the rising edge or the falling edge. Setting the delay operation provides the main MCU with time for initialization or internal information processing.
[0038] As an optional implementation of the present invention, the method also includes: when the first MCU monitors that the state of the second pin in the second MCU has changed, the first MCU exits the low power consumption state and enters the high power consumption state. Within a certain period of time, if the first MCU does not receive the data sent by the second MCU, the first MCU may exit the high power consumption state and enter the low power consumption state; when the second MCU monitors that the state of the first pin in the first MCU has changed, the second MCU may exit the low power consumption state and enter the high power consumption state. Within a certain period of time, if the second MCU does not receive the data sent by the first MCU, the second MCU may exit the high power consumption state and enter the low power consumption state.
[0039] Exemplarily, a certain period of time is the target duration. The embodiment of the present application does not limit the target duration. In the embodiment of the present application, when the Bluetooth module needs to send data to the main MCU, the indication signal BT_IND sent by the second pin of the Bluetooth module is high, and the BT_IND signal is used to wake up the main MCU. The second pin is switched to a low level after waking up by sending an 80ms pulse, and then the received data is sent to the main MCU through serial port communication after a delay of 200ms; when the main MCU does not receive the data sent by the Bluetooth module within the target duration, the main MCU enters a low power consumption state; when the main MCU needs to send data to the Bluetooth module, the indication signal BT_MODE sent by the main MCU is high, and the BT_MODE signal is used to wake up the Bluetooth module, and the first pin is sent An 80ms pulse is switched to a low level after waking up, and then the received data is sent to the Bluetooth module through serial port communication after a delay of 200ms; when the Bluetooth module does not receive the data sent by the main MCU within the target duration, the Bluetooth module enters a low power consumption state.
[0040] When the main MCU wants to send data to the communication module, it first controls the first pin to send a specific signal, and then sends the data to the communication module through serial communication; when the communication module wants to send data to the main MCU, it first controls the second pin to send a specific signal, and then sends the data to the main MCU through serial communication. When there is no interactive data between the main MCU and the communication module, the work does not affect each other, and each can enter a low power state. Through the above solution, both parties can work independently and achieve low power consumption.
[0041] The embodiment of the present invention further discloses a dual-MCU ultra-low power interaction device, wherein the dual-MCU includes a first MCU in a device for realizing device control and data processing and a second MCU integrated in a communication module of the device, wherein the first MCU includes a first pin for transmitting a signal, and the second MCU includes a second pin for transmitting a signal, and the first MCU and the second MCU are electrically connected via the first pin, the second pin, and a serial communication interface, and the first MCU and the second MCU can be independently in a low power consumption state during normal operation, and the corresponding first pin and second pin are both in a low level state; Figure 4As shown, the device includes: a first response module 201, which is used to set the second pin from the low level state to the high level state and respond to the first timing operation when the second MCU needs to send data to the first MCU; a second response module 202, which is used to set the second pin from the high level state to the low level state and respond to the second timing operation when the first target duration is reached; a first sending module 203, which is used to send the data to be sent to the first MCU through the serial communication interface when the second target duration is reached; a third response module 204, which is used to set the first pin from the low level state to the high level state and respond to the third timing operation when the first MCU needs to send data to the second MCU; a fourth response module 205, which is used to set the first pin from the high level state to the low level state and respond to the fourth timing operation when the third target duration is reached; and a second sending module 206, which is used to send the data to be sent to the second MCU through the serial communication interface when the fourth target duration is reached.
[0042] The present invention provides a dual MCU ultra-low power interaction method device, wherein the dual MCU includes a first MCU in a device for realizing device control and data processing and a second MCU integrated in a communication module of the device, wherein the first MCU includes a first pin for transmitting a signal, and the second MCU includes a second pin for transmitting a signal, and the first MCU and the second MCU are electrically connected via the first pin, the second pin, and a serial communication interface, and the first MCU and the second MCU can be independently in a low power consumption state during normal operation, and the corresponding first pin and second pin are both in a low level state; the device includes: a first response module, which is used to set the second pin from the low level state to a high level state when the second MCU needs to send data to the first MCU and respond to the first timing operation; a second response module, used to set the second pin from the high level state to the low level state and respond to the second timing operation when the first target duration is reached; a first sending module, used to send the data to be sent to the first MCU through the serial communication interface when the second target duration is reached; a third response module, used to set the first pin from the low level state to the high level state and respond to the third timing operation when the first MCU needs to send data to the second MCU; a fourth response module, used to set the first pin from the high level state to the low level state and respond to the fourth timing operation when the third target duration is reached; the second sending module, used to send the data to be sent to the second MCU through the serial communication interface when the fourth target duration is reached. The device is applied to communication between IoT devices. When there is no data to be transmitted, the first pin of the first MCU and the second pin of the second MCU are both in a low level state, that is, the first MCU and the second MCU can be independently in a low power consumption state. When there is data transmission, the first pin and the second pin are set from a low level to a high level to prepare for data transmission. This method enables the first MCU and the second MCU to be independently in a low power consumption state when there is no data communication, effectively reducing the power consumption of the first MCU and the second MCU, thereby adapting to low power consumption scenarios that are powered only by batteries or super capacitors and need to respond to communications in a timely manner.
[0043] As an optional embodiment of the present invention, the device also includes: a first data receiving activation module, which is used for when the first MCU detects that the state of the second pin in the second MCU has changed, the first MCU exits the low power consumption state and enters the high power consumption state to ensure that the data sent by the second MCU can be received; a second data receiving activation module, which is used for when the second MCU detects that the state of the first pin in the first MCU has changed, the second MCU exits the low power consumption state and enters the high power consumption state to ensure that the data sent by the first MCU can be received.
[0044] As an optional embodiment of the present invention, the device also includes: the device also includes: a first state conversion module, which is used for the first MCU to monitor that the state of the second pin in the second MCU has changed, and the first MCU can exit the low power consumption state and enter the high power consumption state. Within a certain period of time, if the first MCU does not receive the data sent by the second MCU, the first MCU can exit the high power consumption state and enter the low power consumption state; a second state conversion module, which is used for when the second MCU monitors that the state of the first pin in the first MCU has changed, the second MCU can exit the low power consumption state and enter the high power consumption state. Within a certain period of time, if the second MCU does not receive the data sent by the first MCU, the second MCU can exit the high power consumption state and enter the low power consumption state.
[0045] The embodiment of the present invention also provides an electric meter, including: a second MCU, which is arranged in a communication module in the electric meter, including a second pin for transmitting a signal, and is used to execute when the second MCU needs to send data to the first MCU, the second pin is set from a low level state to a high level state and responds to a first timing; when the first target duration is reached, the second pin is set from the high level state to a low level state and responds to a second timing operation; when the second target duration is reached, the data to be sent is sent to the first MCU through a serial communication interface; the first MCU includes a first pin for transmitting a signal, the first MCU and the second MCU are electrically connected through the first pin, the second pin and the serial communication interface, and is used to execute when the first pin is set from the low level state to a high level state and responds to a third timing operation: when the third target duration is reached, the first pin is set from the high level state to a low level state and responds to a fourth timing operation; when the fourth target duration is reached, the data to be sent is sent to the second MCU through a serial communication interface. Please refer to the description of the corresponding part of the above embodiment for details, which will not be repeated here.
[0046] The embodiment of the present invention further provides an electronic device, such as Figure 5 As shown, the electronic device may include a processor 401 and a memory 402, wherein the processor 401 and the memory 402 may be connected via a bus or other means. Figure 5 The example of connecting through bus is taken in the following.
[0047] The processor 401 may be a central processing unit (CPU). The processor 401 may also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or a combination of the above chips.
[0048] The memory 402 is a non-transient computer-readable storage medium that can be used to store non-transient software programs, non-transient computer executable programs and modules, such as program instructions / modules corresponding to the dual MCU interaction method in the embodiment of the present invention. The processor 401 executes various functional applications and data processing of the processor by running the non-transient software programs, instructions and modules stored in the memory 402, that is, the dual MCU ultra-low power interaction method in the above method embodiment is implemented.
[0049] The memory 402 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required by at least one function; the data storage area may store data created by the processor 401, etc. In addition, the memory 402 may include a high-speed random access memory, and may also include a non-transitory memory, such as at least one disk storage device, a flash memory device, or other non-transitory solid-state storage device. In some embodiments, the memory 402 may optionally include a memory remotely arranged relative to the processor 401, and these remote memories may be connected to the processor 401 via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0050] The one or more modules are stored in the memory 502, and when executed by the processor 401, perform the following steps: Figure 1 The dual MCU ultra-low power consumption interaction method in the illustrated embodiment.
[0051] For details of the above electronic equipment, please refer to Figure 1 The corresponding related descriptions and effects in the illustrated embodiments can be understood and will not be repeated here.
[0052] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program, and the program can be stored in a computer-readable storage medium, and when the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, the storage medium can be a disk, an optical disk, a read-only memory (ROM), a random access memory (RAM), a flash memory, a hard disk drive (HDD) or a solid-state drive (SSD), etc.; the storage medium can also include a combination of the above-mentioned types of memory.
[0053] Although the embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present invention, and such modifications and variations are all within the scope defined by the appended claims.
Claims
1. A dual MCU ultra-low power interaction method, wherein the dual MCU includes a first MCU in a device for implementing device control and data processing and a second MCU integrated in a communication module of the device, wherein the first MCU includes a first pin for transmitting a signal, and the second MCU includes a second pin for transmitting a signal, and the first MCU and the second MCU are electrically connected through the first pin, the second pin and a serial communication interface, characterized in that: When the first MCU and the second MCU are in normal operation, they can be in a low power consumption state independently, and the corresponding first pin and second pin are both in a low level state; the method includes: When the second MCU needs to send data to the first MCU, the second pin is set from the low level state to the high level state and responds to the first timing operation; When the first target duration is reached, the second pin is set from the high level state to the low level state and responds to a second timing operation; When the second target duration is reached, the data to be sent is sent to the first MCU via the serial communication interface; When the first MCU needs to send data to the second MCU, the first pin is set from the low level state to the high level state and responds to the third timing operation; When the third target duration is reached, the first pin is set from the high level state to the low level state and responds to a fourth timing operation; When the fourth target duration is reached, the data to be sent is sent to the second MCU via the serial communication interface.
2. The method according to claim 1, characterized in that The method further comprises: When the first MCU detects that the state of the second pin in the second MCU changes, the first MCU may exit the low power consumption state and enter the high power consumption state to ensure that the data sent by the second MCU can be received; When the second MCU detects that the state of the first pin in the first MCU changes, the second MCU may exit the low power consumption state and enter the high power consumption state to ensure that the data sent by the first MCU can be received.
3. The method according to claim 2, characterized in that The method further comprises: When the first MCU detects that the state of the second pin in the second MCU changes, the first MCU may exit the low power consumption state and enter the high power consumption state. If the first MCU does not receive data sent by the second MCU within a certain period of time, the first MCU may exit the high power consumption state and enter the low power consumption state. When the second MCU detects that the state of the first pin in the first MCU has changed, the second MCU may exit the low power consumption state and enter the high power consumption state. If the second MCU does not receive the data sent by the first MCU within a certain period of time, the second MCU may exit the high power consumption state and enter the low power consumption state.
4. A dual-MCU ultra-low power interaction device, the dual MCU comprising a first MCU in a device for implementing device control and data processing and a second MCU integrated in a communication module of the device, the first MCU comprising a first pin for transmitting a signal, the second MCU comprising a second pin for transmitting a signal, the first MCU and the second MCU being electrically connected via the first pin, the second pin and a serial communication interface, characterized in that: When the first MCU and the second MCU are in normal operation, they can be in a low power consumption state independently, and the corresponding first pin and second pin are both in a low level state; the device includes: A first response module, configured to set the second pin from the low level state to the high level state and respond to a first timing operation when the second MCU needs to send data to the first MCU; A second response module, configured to set the second pin from the high level state to the low level state and respond to a second timing operation when the first target duration is reached; A first sending module, used for sending the data to be sent to the first MCU through a serial communication interface when the second target duration is reached; A third response module, configured to set the first pin from the low level state to the high level state and respond to a third timing operation when the first MCU needs to send data to the second MCU; a fourth response module, configured to, when a third target duration is reached, set the first pin from the high level state to a low level state and respond to a fourth timing operation; The second sending module is used to send the data to be sent to the second MCU through the serial communication interface when the fourth target duration is reached.
5. The device according to claim 4, characterized in that The device also includes: A first data receiving activation module, configured to enable the first MCU to exit a low power consumption state and enter a high power consumption state when the first MCU detects that the state of the second pin in the second MCU changes, so as to ensure that the first MCU can receive data sent by the second MCU; The second data receiving activation module is used for when the second MCU detects that the state of the first pin in the first MCU changes, the second MCU can exit the low power consumption state and enter the high power consumption state to ensure that the data sent by the first MCU can be received.
6. The device according to claim 5, characterized in that The device also includes: A first state conversion module, configured to, when the first MCU detects that the state of the second pin in the second MCU changes, the first MCU may exit the low power consumption state and enter the high power consumption state; if the first MCU does not receive data sent by the second MCU within a certain period of time, the first MCU may exit the high power consumption state and enter the low power consumption state; The second state conversion module is used for when the second MCU detects that the state of the first pin in the first MCU has changed, the second MCU can exit the low power consumption state and enter the high power consumption state. If the second MCU does not receive the data sent by the first MCU within a certain period of time, the second MCU can exit the high power consumption state and enter the low power consumption state.
7. An electric meter, characterized in that: include: The second MCU is arranged in the communication module in the electric meter, and includes a second pin for transmitting a signal, and is used to execute when the second MCU needs to send data to the first MCU, setting the second pin from a low level state to a high level state and responding to a first timing; when the first target duration is reached, setting the second pin from the high level state to a low level state and responding to a second timing operation; when the second target duration is reached, sending the data to be sent to the first MCU through a serial communication interface; The first MCU includes a first pin for transmitting a signal. The first MCU and the second MCU are electrically connected through the first pin, the second pin and a serial communication interface, and are used to execute when the first pin is set from the low level state to the high level state and responds to a third timing operation: when a third target duration is reached, the first pin is set from the high level state to the low level state and responds to a fourth timing operation; when the fourth target duration is reached, the data to be sent is sent to the second MCU through the serial communication interface.
8. An electronic device, characterized in that: include: at least one processor; And a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor performs the steps of the dual MCU ultra-low power interaction method as described in any one of claims 1-3.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the dual MCU ultra-low power consumption interaction method as described in any one of claims 1-3 are implemented.