Data communication method and system, intelligent electric energy meter and electronic equipment
By introducing high and low bit parts into the communication frame, indicating the read and write operations of the power metering chip and the number of registers, the problem of low communication efficiency between the MCU chip and the power metering chip is solved, and efficient data transmission and accuracy of multiple registers are achieved.
Patent Information
- Application Number
- CN202510586981.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-08
- Publication Date
- 2025-07-29
AI Technical Summary
In the prior art, MCU chips can only read and write data in one register in the power metering chip at a time, resulting in poor data communication efficiency between the MCU chip and the power metering chip.
By introducing a high bit part and a low bit part in the communication frame, the high bit part is used to indicate the read and write operation of the power metering chip, and the low bit part is used to indicate the number of registers for the read and write operation, achieving continuous access to multiple registers.
It improves the data communication efficiency between the MCU chip and the power metering chip, reduces communication time, and improves the flexibility and accuracy of data transmission.
Smart Images

Figure CN120386265A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of communication technologies, and particularly to a data communication method, system, intelligent electric energy meter, and electronic device. Background Art
[0002] In the prior art, a Microcontroller Unit (MCU) chip can only read and write data in one register of an electric energy metering chip at a time, which results in poor data communication efficiency between the MCU chip and the electric energy metering chip. Therefore, the data communication method between the MCU chip and the electric energy metering chip still needs to be improved. Summary of the Invention
[0003] The technical problem to be solved by the present disclosure is to overcome the defect that in the prior art, an MCU chip can only read and write data in one register of an electric energy metering chip at a time, which results in poor data communication efficiency between the MCU chip and the electric energy metering chip, and to provide a data communication method, system, intelligent electric energy meter, and electronic device.
[0004] The present disclosure solves the above technical problem through the following technical solutions:
[0005] In a first aspect, a data communication method is provided. The data communication method is applied to a communication system. The communication system includes an MCU chip and an electric energy metering chip. The communication method includes:
[0006] Obtain a communication frame sent by the MCU chip to the electric energy metering chip. Wherein, the read / write identification byte in the communication frame includes a high-bit part and a low-bit part. The high-bit part is used to indicate the read / write operation of the electric energy metering chip. The low-bit part is used to indicate a first quantity of registers for the electric energy metering chip to perform the read / write operation. The first quantity is determined by the value on the low-bit part;
[0007] Send the communication frame to the electric energy metering chip, so that the electric energy metering chip performs the read / write operation on the first quantity of registers.
[0008] Optionally, the communication frame further includes an initial register address byte. The initial register address byte is used to indicate the initial register address for the electric energy metering chip to perform the read / write operation. The step of sending the communication frame to the electric energy metering chip, so that the electric energy metering chip performs the read / write operation on the first quantity of registers includes:
[0009] Send the communication frame to the power metering chip, so that the power metering chip performs the read and write operations on the first number of registers starting from the initial register address.
[0010] Optionally, the number of bits of the high bit part and the low bit part is the same.
[0011] Optionally, the communication method further includes:
[0012] In response to the power metering chip performing the read and write operations on the first number of registers, control the power metering chip to return the target data in the first number of registers to the MCU chip.
[0013] Optionally, the communication method further includes:
[0014] Calculate a first check byte of the target data at the power metering chip end;
[0015] Calculate a second check byte of the target data at the MCU chip end;
[0016] In response to the first check byte being equal to the second check byte, determine that the target data is complete.
[0017] Optionally, the power metering chip includes a signal processing unit and registers; the signal processing unit and the registers are electrically connected; before the step of obtaining the communication frame sent by the MCU chip to the power metering chip includes:
[0018] Obtain an external first voltage signal and a first current signal;
[0019] Input the first voltage signal and the first current signal into the signal processing unit to obtain a voltage waveform and a current waveform;
[0020] Store the voltage waveform and the current waveform in the registers for the power metering chip to perform read and write operations.
[0021] Optionally, the signal processing unit includes a decimation filter and a high-pass filter; the step of inputting the first voltage signal and the first current signal into the signal processing unit to obtain voltage waveform data and current waveform data includes:
[0022] Input the first voltage signal and the first current signal into the decimation filter to obtain a second voltage signal and a second current signal with a preset sampling rate;
[0023] Input the second voltage signal and the second current signal into the high-pass filter to obtain a third voltage signal and a third current signal that are less than or equal to a preset cut-off frequency;
[0024] Draw the voltage waveform and the current waveform according to the correspondence between the third voltage signal and the third current signal and time.
[0025] In a second aspect, a data communication system is provided. The communication system includes an MCU chip and an electric energy metering chip; the communication system includes:
[0026] A first acquisition module for acquiring a communication frame sent by the MCU chip to the electric energy metering chip; wherein, the read / write identification byte in the communication frame includes a high-bit part and a low-bit part; the high-bit part is used to indicate the read / write operation of the electric energy metering chip; the low-bit part is used to indicate the first number of registers for the electric energy metering chip to perform the read / write operation; the first number is determined by the value on the low-bit part;
[0027] A sending module for sending the communication frame to the electric energy metering chip so that the electric energy metering chip performs the read / write operation on the first number of registers.
[0028] Optionally, the communication frame further includes an initial register address byte; the initial register address byte is used to indicate the initial register address for the electric energy metering chip to perform the read / write operation; the sending module includes:
[0029] A sending unit for sending the communication frame to the electric energy metering chip so that the electric energy metering chip performs the read / write operation on the first number of registers starting from the initial register address.
[0030] Optionally, the number of bits of the high-bit part and the low-bit part is the same.
[0031] Optionally, the communication system further includes:
[0032] A first response module, after the electric energy metering chip performs the read / write operation on the first number of registers, controls the electric energy metering chip to return the target data in the first number of registers to the MCU chip.
[0033] Optionally, the communication system further includes:
[0034] A first calculation module for calculating a first check byte of the target data at the electric energy metering chip end;
[0035] A second calculation module, configured to calculate a second check byte of the target data at the MCU chip side;
[0036] A second response module, in response to the first check byte being equal to the second check byte, determines that the target data is complete.
[0037] Optionally, the communication system further includes:
[0038] A second acquisition module, configured to acquire an external first voltage signal and a first current signal;
[0039] An input module, configured to input the first voltage signal and the first current signal into the signal processing unit to obtain a voltage waveform and a current waveform;
[0040] A storage module, configured to store the voltage waveform and the current waveform in the register for the power metering chip to perform read and write operations.
[0041] Optionally, the signal processing unit includes a decimation filter and a high-pass filter; the input module includes:
[0042] A first input unit, configured to input the first voltage signal and the first current signal into the decimation filter to obtain a second voltage signal and a second current signal with a preset sampling rate;
[0043] A second input unit, configured to input the second voltage signal and the second current signal into the high-pass filter to obtain a third voltage signal and a third current signal less than or equal to a preset cut-off frequency;
[0044] A plotting unit, configured to plot the voltage waveform and the current waveform according to the correspondence between the third voltage signal and the third current signal and time.
[0045] In a third aspect, there is provided an intelligent electricity meter, including a memory, a processor, and a computer program stored on the memory and configured to run on the processor. When the processor executes the computer program, the data communication method described above is implemented.
[0046] In a fourth aspect, there is provided an electronic device, including a memory, a processor, and a computer program stored on the memory and configured to run on the processor. When the processor executes the computer program, the data communication method described above is implemented.
[0047] On the basis of conforming to the common knowledge in the art, the above preferred conditions can be combined arbitrarily to obtain various preferred examples of the present disclosure.
[0048] The positive and progressive effects of the present disclosure are as follows: By using the high-bit part and the low-bit part of the read-write identification byte in the communication frame to respectively indicate the read-write operation required for the electric energy metering chip and the first quantity of the registers for the read-write operation required for the electric energy metering chip, multiple registers in the electric energy metering chip can be read and written through a single communication frame sent by the MCU chip, thereby improving the data communication efficiency between the MCU chip and the electric energy metering chip. BRIEF DESCRIPTION OF THE DRAWINGS
[0049] Figure 1 It is a flowchart of a data communication method provided in Embodiment 1 of the present disclosure.
[0050] Figure 2 It is the existing communication frame structure of a data communication method provided in Embodiment 1 of the present disclosure.
[0051] Figure 3 It is the communication frame structure of another data communication method provided in Embodiment 1 of the present disclosure.
[0052] Figure 4 It is a schematic structural diagram of a data communication method provided in Embodiment 1 of the present disclosure.
[0053] Figure 5 It is a schematic module diagram of a data communication system provided in Embodiment 2 of the present disclosure.
[0054] Figure 6 It is a schematic structural diagram of an electronic device shown in Embodiment 4 of the present disclosure. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0055] The present disclosure will be further described below by way of embodiments, but the present disclosure is not limited to the scope of the described embodiments.
[0056] In the embodiments of the present disclosure, prefix words such as "first" and "second" are only used to distinguish different described objects, and have no limiting effect on the position, order, priority, quantity, content, etc. of the described objects. The use of ordinal words and other prefix words for distinguishing described objects in the embodiments of the present disclosure does not constitute a limitation on the described objects. The description of the described objects refers to the description in the context of the embodiments, and should not constitute unnecessary limitations due to the use of such prefix words. In addition, in the description of this embodiment, unless otherwise specified, the meaning of "multiple" is two or more.
[0057] Embodiment 1
[0058] To improve the data communication efficiency between the MCU chip and the electric energy metering chip, Embodiment 1 of the present disclosure provides a data communication method. This data communication method is applied to a communication system; the communication system includes an MCU chip and an electric energy metering chip. The communication system can be devices such as smart sockets, smart switches, smart charging piles, smart street lights, smart air conditioners, smart home appliances, single-phase multifunctional electric energy meters, and power consumption information big data collection devices. The communication method of this communication is serial communication. Figure 1 It is a flowchart of a data communication method provided by Embodiment 1 of the present disclosure. This data communication method includes the following steps:
[0059] Step 101, obtain the communication frame sent by the MCU chip to the electric energy metering chip.
[0060] Among them, the read / write identification byte in the communication frame includes a high-bit part and a low-bit part; the high-bit part is used to indicate the read / write operation of the electric energy metering chip; the low-bit part is used to indicate the first quantity of registers for the electric energy metering chip to perform read / write operations; the first quantity is determined by the value on the low-bit part.
[0061] In the prior art, the read / write identification byte CMD in the communication frame sent by the MCU chip to the electric energy metering chip is [7,0], which means that the values of 8 bits (bit) in this read / write identification byte CMD are all used to indicate the read / write operation of the electric energy metering chip. It should be noted that the values of these 8 bits (bit) can be set by the user according to actual needs. Therefore, through this read / write identification byte CMD structure, the MCU chip can only perform read / write operations on the data in one register of the electric energy metering chip each time.
[0062] The read / write identification byte in the communication frame in step 101 includes a high-bit part and a low-bit part, and the structure of its read / write identification byte CMD can be [7:4], which means that the first four bits in this read / write identification byte CMD can be used to indicate the read / write operation of the electric energy metering chip, and the specific values of its first four bits can be set by the user according to actual needs. For example, the first four bits can be set to 0101 (binary value) to represent a read operation, and the first four bits can be set to 1010 (binary value) to represent a write operation. The last four bits in CMD can be used to indicate the first quantity of registers for the electric energy metering chip to perform read / write operations. The specific values of its last four bits can be set by the user according to actual needs. The setting range of the last four bits is 0000 (binary value) to 1111 (binary value), and its conversion range to decimal is 0 to 16. Therefore, through the 8-bit read / write identification byte in the communication frame in step 101, the first quantity of registers that can be continuously accessed is 16. If the total number of bits of the read / write identification byte is more, the first quantity of registers that can be continuously accessed is more.
[0063] Step 102: Send the communication frame to the power metering chip so that the power metering chip performs read and write operations on the first number of registers.
[0064] In this embodiment, the high bit part and the low bit part of the read / write identification byte in the communication frame are respectively used to indicate the read / write operation required by the power metering chip and the first number of registers for the read / write operation required by the power metering chip. In this way, a single communication frame sent by the MCU chip can perform read and write operations on multiple registers in the power metering chip, which can effectively reduce the time required for the MCU chip to read the electrical energy parameters measured by the power metering chip, thereby improving the data communication efficiency between the MCU chip and the power metering chip.
[0065] In one embodiment, the communication frame further includes an initial register address byte; the initial register address byte is used to indicate the initial register address for the power metering chip to perform read and write operations; the step of sending the communication frame to the power metering chip so that the power metering chip performs read and write operations on the first number of registers includes: sending the communication frame to the power metering chip so that the power metering chip performs read and write operations on the first number of registers starting from the initial register address.
[0066] In this embodiment, by specifying the initial register address, the starting point of the read and write operations can be dynamically selected as needed. Thus, multiple registers in the power metering chip can be accessed more flexibly. In addition, by clearly specifying the initial register address and the number of reads and writes in the communication frame, redundant information in the communication process can be reduced. Thereby, the data communication efficiency between the MCU chip and the power metering chip can be improved.
[0067] In one embodiment, the communication method further includes:
[0068] In response to the power metering chip performing read and write operations on the first number of registers, control the power metering chip to return the target data in the first number of registers to the MCU chip.
[0069] In this embodiment, by controlling the power metering chip to return the target data in the first number of registers to the MCU chip, the MCU can obtain the data of multiple registers with only one transmission, thereby improving the data communication efficiency between the MCU chip and the power metering chip.
[0070] In one embodiment, the communication method further includes:
[0071] Calculate the first check byte of the target data at the power metering chip end. Calculate the second check byte of the target data at the MCU chip end. In response to the first check byte being equal to the second check byte, determine that the target data is complete.
[0072] The following is an example of how to determine the completeness of the target data through the first check byte and the second check byte.
[0073] S1: Add all the bytes in the target data at the power metering chip end bit by bit, and then take the lower 8 bits of the result to obtain the first check byte.
[0074] For example, assume there is a set of target data [0x12, 0x34, 0x56, 0x78]. The process of calculating the first check byte is as follows: 0x12 + 0x34 + 0x56 + 0x78 = 0x11A (a hexadecimal number). Take the lower 8 bits: 0x1A. Therefore, the first check byte is 0x1A.
[0075] S2: Append this first check byte to the end of the target data and return it to the MCU chip end.
[0076] For example, its form is [0x12, 0x34, 0x56, 0x78, 0x1A].
[0077] S3: After the MCU chip end receives the data, separate the target data and the first check byte, and add all the bytes in the target data bit by bit, and then take the lower 8 bits of the result to obtain the second check byte.
[0078] For example, the separated target data is [0x12, 0x34, 0x56, 0x78]. The process of calculating the second check byte is as follows: 0x12 + 0x34 + 0x56 + 0x78 = 0x11A (a hexadecimal number). Take the lower 8 bits: 0x1A. Therefore, the second check byte is 0x1A.
[0079] S4: In response to the first check byte being equal to the second check byte, determine that the target data is complete.
[0080] For example, if the first check byte is 0x1A and the second check byte is also 0x1A, it indicates that the target data is transmitted completely.
[0081] In this embodiment, through the calculation and comparison of the check bytes, the integrity and accuracy of the target data during transmission and processing can be ensured, thereby avoiding the problem of inaccurate power metering caused by incorrect target data subsequently. Further, the integrity and accuracy of the target data are the basis for the stable operation of the communication system. Through the calculation and comparison of the check bytes, errors in the target data can be detected and processed in a timely manner, thereby improving the stability and reliability of the communication system.
[0082] In one embodiment, Figure 2 This is the existing communication frame structure of a data communication method provided in Embodiment 1 of the present disclosure. Figure 3 This is the communication frame structure of another data communication method provided in Embodiment 1 of the present disclosure. Combining Figure 2 and Figure 3 the communication frame structure of the present disclosure will be described.
[0083] As Figure 2 shown in the existing communication frame structure between the power metering chip and the MCU, when the MCU chip wants to read the electrical parameter register, it needs to first send the read / write identification byte CMD[7:0], and then send the target register address byte ADDR[7:0] ( Figure 2 ADDR_1[7:0] in Figure 2 ), that is, the target register address byte. After the power metering chip acquires and recognizes these two bytes, the read / write identification byte CMD[7:0] and the target register address byte ADDR[7:0], it only performs read / write operations on the target register and only returns the data in the target register ( Figure 2 DATA[7:0] and DATA[15:8] in
[0084] As Figure 3 shown in the communication frame structure of the present disclosure between the power metering chip and the MCU, the read / write identification byte CMD[7:0] is divided into the high-bit part CMD[7:4] and the low-bit part CMD[3:0]. The high-bit part CMD[7:4] is used to indicate the read / write operation of the power metering chip, and the low-bit part CMD[3:0] is used to indicate the first quantity N of the registers for which the power metering chip performs read / write operations. ADDR[7:0] ( Figure 3 ADDR_1[7:0] in
[0085] It should be noted that each byte in the above communication frame structure may also include a 1-bit start bit and a 1-bit stop bit. Therefore, each of the above bytes can also be 10-bit.
[0086] When the communication module is a UART (Universal Asynchronous Receiver-Transmitter) or an SPI (Serial Peripheral Interface), the Figure 3 shown communication frame structure can be used.
[0087] Taking UART as an example, when the baud rate is 4800, the 1-bit data time is 208 us. The MCU needs to continuously access the data of four electrical parameter registers, and the effective data bit width of each electrical parameter register is 16 bit.
[0088] If the Figure 2 communication frame structure is used for communication, the total time required is:
[0089] (2 * 10 + 2 * 10 + 10) * 4 * 208 us, totaling 41600 us.
[0090] Among them, the first 2 * 10 is the time spent sending a 10-bit read / write identification byte and a 10-bit register address byte. The second 2 * 10 is the time spent sending two 10-bit data bytes. 10 is the time spent sending a check byte. 4 is the time required for accessing the data of four electrical parameter registers.
[0091] If the Figure 3 communication frame structure is used for communication, the total time required is:
[0092] (2 * 10 + 2 * 10 * 4 + 10) * 208 us, totaling 22880 us.
[0093] Among them, the first 2 * 10 is the time spent sending a 10-bit read / write identification byte and a 10-bit register address byte. The second 2 * 10 is the time spent sending two 10-bit data bytes. 10 is the time spent sending a check byte. 4 is the time required for continuously accessing the data of four electrical parameter registers.
[0094] It should be noted that Figure 2 and Figure 3 each byte in the communication frame structure includes a 1-bit start bit and a 1-bit stop bit. Therefore, each of the above bytes is 10-bit.
[0095] Therefore, using the Figure 3 communication frame structure for communication, the communication efficiency is increased by 45%. In addition, as the number of continuously accessed registers increases, the improvement in communication efficiency will be more obvious.
[0096] In one embodiment, the electric energy metering chip includes a signal processing unit and a register; the signal processing unit and the register are electrically connected; before the step of obtaining the communication frame sent by the MCU chip to the electric energy metering chip, it includes:
[0097] S1: Obtain the external first voltage signal and the first current signal.
[0098] S2: Input the first voltage signal and the first current signal into the signal processing unit to obtain a voltage waveform and a current waveform.
[0099] S3: Store the voltage waveform and the current waveform in the register for the electric energy metering chip to perform read and write operations.
[0100] In this embodiment, since the voltage waveform and the current waveform can not only clearly reflect the amplitude and phase information of the first voltage signal and the first current signal at any moment, but also clearly reflect the transient change information of the first voltage signal and the first current signal, the accuracy of subsequent electric energy metering can be improved through these information. In addition, many electric energy metering standards require that the electric energy metering device can process and analyze the voltage waveform and the current waveform. Storing the external first voltage signal and the voltage waveform and the current waveform of the first current signal in the register can ensure that the communication system meets these standards, thereby improving the versatility and compatibility of the communication system.
[0101] In one embodiment, the signal processing unit includes a decimation filter and a high-pass filter; the step of inputting the first voltage signal and the first current signal into the signal processing unit to obtain voltage waveform data and current waveform data includes:
[0102] S1: Input the first voltage signal and the first current signal into the decimation filter to obtain a second voltage signal and a second current signal with a preset sampling rate.
[0103] It should be noted that the preset sampling rate can be set according to the user's needs.
[0104] S2: Input the second voltage signal and the second current signal into the high-pass filter to obtain a third voltage signal and a third current signal less than or equal to a preset cut-off frequency.
[0105] It should be noted that the preset cut-off frequency can be set according to the user's needs.
[0106] S3: Draw the voltage waveform and the current waveform according to the corresponding relationship between the third voltage signal and the third current signal and time.
[0107] In this embodiment, by using a downsampling filter, the sampling rates of the first voltage signal and the first current signal can be reduced to a preset sampling rate, thereby reducing the amount of data collected. Furthermore, the computational burden and storage requirements for subsequent processing can be reduced. By using a high-pass filter, signal components below the preset cut-off frequency in the second voltage signal and the second current signal can be removed, which helps to remove low-frequency interference in the second voltage signal and the second current signal, and further makes the obtained third voltage signal and third current signal more stable, thus making the plotted voltage waveform and current waveform more accurate.
[0108] In one embodiment, Figure 4 FIG. 5 is a schematic structural diagram of a data communication method provided in Embodiment 1 of the present disclosure. The data communication method is applied to a communication system, which, in addition to including an MCU chip and an electric energy metering chip, further includes an LCD (Liquid Crystal Display). The electric energy metering chip includes an analog signal processing module, a digital signal processing module, and a communication module. Among them, the analog signal processing module and the digital signal processing module together constitute the signal processing unit described above.
[0109] Specifically, the analog signal processing module includes a high-precision analog-to-digital converter (ADC) and a built-in clock, which can be used for power-on and power-off detection and power management, etc. The digital signal processing module includes a digital signal processing module, which is used to process electrical energy parameters such as active power and the effective values of current and voltage. The communication module includes registers, which are used to store the voltage waveform and the current waveform, and to serially output parameters such as the effective values of current and voltage, active power, and active electrical energy as digital signals. The electric energy metering chip can process the first voltage signal and the first current signal through these three modules it includes, and the communication module transmits the data to the MCU chip, thereby realizing complex control functions.
[0110] It should be noted that the above-mentioned various components are all electrically connected.
[0111] Combined with Figure 4 , the data communication method is further described.
[0112] S1: The analog signal processing module is used to receive the external first voltage signal and the first current signal, and the analog-to-digital converter converts the collected external first voltage signal and first current signal into digital signals.
[0113] S2: The first voltage signal and the first current signal are processed by a downsampling filter and a high-pass filter in the digital signal processing module to obtain a current waveform and a voltage waveform.
[0114] S3: The current waveform and the voltage waveform are sent to the registers for storage.
[0115] S4: Obtain the communication frame sent by the MCU chip to the electric energy metering chip, read the target data in the register through the communication module, and return it to the MCU chip.
[0116] S5: In response to the MCU chip obtaining the target data, after calculation and processing, output the result to the LCD display, so that the user can view the specific electric parameter values.
[0117] Embodiment 2
[0118] Corresponding to the foregoing embodiment of the data communication method, the present disclosure also provides an embodiment of a data communication system. Figure 5 It is a module schematic diagram of a data communication system provided in Embodiment 2 of the present disclosure. The data communication system includes:
[0119] The first acquisition module 51 is used to acquire the communication frame sent by the MCU chip to the electric energy metering chip; wherein, the read-write identification byte in the communication frame includes a high-bit part and a low-bit part; the high-bit part is used to indicate the read-write operation of the electric energy metering chip; the low-bit part is used to indicate the first quantity of the registers for the read-write operation of the electric energy metering chip; the first quantity is determined by the value on the low-bit part.
[0120] The sending module 52 is used to send the communication frame to the electric energy metering chip, so that the electric energy metering chip performs read-write operations on the first quantity of registers.
[0121] In one embodiment, the communication frame further includes an initial register address byte; the initial register address byte is used to indicate the initial register address for the read-write operation of the electric energy metering chip; the sending module 52 includes:
[0122] The sending unit is used to send the communication frame to the electric energy metering chip, so that the electric energy metering chip performs read-write operations on the first quantity of registers starting from the initial register address.
[0123] In one embodiment, the number of bits of the high-bit part and the low-bit part is the same.
[0124] In one embodiment, the communication system further includes:
[0125] The first response module, in response to the electric energy metering chip performing read-write operations on the first quantity of registers, controls the electric energy metering chip to return the target data in the first quantity of registers to the MCU chip.
[0126] In one embodiment, the communication system further includes:
[0127] The first calculation module is used to calculate the first check byte of the target data at the electric energy metering chip end.
[0128] A second calculation module, configured to calculate a second check byte of target data at the MCU chip side.
[0129] A second response module, which determines that the target data is complete in response to the first check byte being equal to the second check byte.
[0130] In one embodiment, the communication system further includes:
[0131] A second acquisition module, configured to acquire an external first voltage signal and a first current signal.
[0132] An input module, configured to input the first voltage signal and the first current signal into a signal processing unit to obtain a voltage waveform and a current waveform.
[0133] A storage module, configured to store the voltage waveform and the current waveform in a register for the power metering chip to perform read and write operations.
[0134] In one embodiment, the signal processing unit includes a decimation filter and a high-pass filter; the input module includes:
[0135] A first input unit, configured to input the first voltage signal and the first current signal into the decimation filter to obtain a second voltage signal and a second current signal with a preset sampling rate.
[0136] A second input unit, configured to input the second voltage signal and the second current signal into the high-pass filter to obtain a third voltage signal and a third current signal less than or equal to a preset cut-off frequency.
[0137] A plotting unit, configured to plot the voltage waveform and the current waveform according to the correspondence between the third voltage signal and the third current signal and time.
[0138] For the system embodiment, since it basically corresponds to the method embodiment, the relevant parts can refer to the partial description of the method embodiment. The system embodiments described above are only illustrative, where the units described as separate components may or may not be physically separated, and the components as units may or may not be physical units, that is, they may be located in one place or distributed to multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the present disclosure solution.
[0139] Embodiment 3
[0140] An embodiment of the present disclosure provides an intelligent electricity meter, including a memory, a processor, and a computer program stored on the memory and configured to run on the processor. When the processor executes the computer program, the above-mentioned data communication method is implemented.
[0141] Example 4
[0142] Figure 6 FIG. is a schematic structural diagram of an electronic device shown in an exemplary embodiment of the present disclosure. The electronic device includes a memory, a processor, and a computer program stored in the memory and configured to run on the processor. When the processor executes the computer program, the communication method of the data described in any of the above embodiments is implemented. Figure 6 The displayed electronic device 60 is merely an example and should not impose any limitation on the functions and usage scope of the embodiments of the present disclosure.
[0143] As Figure 6 shown, the electronic device 60 may be presented in the form of a general-purpose computing device, for example, it may be a server device. The components of the electronic device 60 may include, but are not limited to: at least one of the above-mentioned processors 61, at least one of the above-mentioned memories 62, and a bus 63 connecting different system components (including the memory 62 and the processor 61).
[0144] The bus 63 includes a data bus, an address bus, and a control bus.
[0145] The memory 62 may include volatile memory, such as a random access memory (RAM) 621 and / or a cache memory 622, and may further include a read-only memory (ROM) 623.
[0146] The memory 62 may further include a program tool 625 (or utility) having a set (at least one) of program modules 624. Such program modules 624 include, but are not limited to: an operating system, one or more application programs, other program modules, and program data. The implementation of a network environment may be included in each or some combination of these examples.
[0147] The processor 61 executes various functional applications and data processing by running the computer program stored in the memory 62, such as the communication method of the data provided in any of the above embodiments.
[0148] The electronic device 60 may also communicate with one or more external devices 64 (such as a keyboard, a pointing device, etc.). Such communication may be carried out through the input / output (I / O) interface 65. Also, the electronic device 60 may further communicate with one or more networks (such as a local area network (LAN), a wide area network (WAN) and / or a public network, such as the Internet) through the network adapter 66. As shown in the figure, the network adapter 66 communicates with other modules of the electronic device 60 through the bus 63. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in combination with the electronic device 60, including but not limited to: microcode, device drivers, redundant processors, external disk drive arrays, RAID (Redundant Array of Independent Disks) systems, tape drives, and data backup storage systems, etc.
[0149] It should be noted that, although several units / modules or sub-units / modules of the electronic device are mentioned in the above detailed description, this division is merely exemplary and not mandatory. In fact, according to the embodiments of the present disclosure, the features and functions of two or more units / modules described above may be embodied in one unit / module. Conversely, the features and functions of one unit / module described above may be further divided and embodied by multiple units / modules.
[0150] Although the specific embodiments of the present disclosure have been described above, those skilled in the art should understand that this is only an example, and the protection scope of the present disclosure is defined by the appended claims. Without departing from the principles and essence of the present disclosure, those skilled in the art may make various changes or modifications to these embodiments, but these changes and modifications all fall within the protection scope of the present disclosure.
Claims
1. A data communication method, characterized in that, The communication method of the data is applied to a communication system; The communication system includes an MCU chip and an electric energy metering chip; the communication method includes: Obtain a communication frame sent by the MCU chip to the electric energy metering chip; wherein, the read-write identification byte in the communication frame includes a high-bit part and a low-bit part; the high-bit part is used to indicate the read-write operation of the electric energy metering chip; the low-bit part is used to indicate the first quantity of registers for the electric energy metering chip to perform the read-write operation; the first quantity is determined by the value on the low-bit part; Send the communication frame to the electric energy metering chip, so that the electric energy metering chip performs the read-write operation on the first quantity of registers.
2. The communication method according to claim 1, wherein The communication frame further includes an initial register address byte; the initial register address byte is used to indicate the initial register address for the electric energy metering chip to perform the read-write operation; The step of sending the communication frame to the electric energy metering chip, so that the electric energy metering chip performs the read-write operation on the first quantity of registers includes: Send the communication frame to the electric energy metering chip, so that the electric energy metering chip performs the read-write operation on the first quantity of registers starting from the initial register address.
3. The communication method according to claim 1, wherein The number of bits of the high-bit part and the low-bit part is the same.
4. The communication method according to claim 1, characterized in that, The communication method further includes: In response to the electric energy metering chip performing the read-write operation on the first quantity of registers, control the electric energy metering chip to return the target data in the first quantity of registers to the MCU chip.
5. The communication method according to claim 4, wherein The communication method further includes: Calculate a first check byte of the target data at the electric energy metering chip end; Calculate a second check byte of the target data at the MCU chip end; In response to the first check byte being equal to the second check byte, determine that the target data is complete.
6. The communication method according to any one of claims 1 to 5, characterized in that The electric energy metering chip includes a signal processing unit and registers; the signal processing unit and the registers are electrically connected; before the step of obtaining the communication frame sent by the MCU chip to the electric energy metering chip includes: Obtain an external first voltage signal and a first current signal; Input the first voltage signal and the first current signal into the signal processing unit to obtain a voltage waveform and a current waveform; Store the voltage waveform and the current waveform in the registers for the electric energy metering chip to perform read-write operations.
7. The communication method according to claim 6, characterized in that The signal processing unit includes a decimation filter and a high-pass filter; the step of inputting the first voltage signal and the first current signal into the signal processing unit to obtain voltage waveform data and current waveform data includes: Input the first voltage signal and the first current signal into the decimation filter to obtain a second voltage signal and a second current signal with a preset sampling rate; Input the second voltage signal and the second current signal into the high-pass filter to obtain a third voltage signal and a third current signal less than or equal to a preset cut-off frequency; The voltage waveform and the current waveform are drawn according to the corresponding relationship between the third voltage signal and the third current signal and time.
8. A communication system for data, characterized in that, The communication system includes an MCU chip and an electric energy metering chip; the communication system includes: an acquisition module, configured to acquire a communication frame sent by the MCU chip to the electric energy metering chip; wherein the read / write identification byte in the communication frame includes a high-bit portion and a low-bit portion; the high-bit portion is used to indicate a read / write operation of the electric energy metering chip; the low-bit portion is used to indicate a first number of registers on which the electric energy metering chip performs the read / write operation; the first number is determined by a value on the low-bit portion; The sending module is configured to send the communication frame to the electric energy metering chip, so that the electric energy metering chip performs the read and write operations on the first number of registers.
9. A smart electric energy meter comprising a memory, a processor, and a computer program stored in the memory and configured to run on the processor, wherein: When the processor executes the computer program, the data communication method according to any one of claims 1 to 7 is implemented.
10. An electronic device, comprising a memory, a processor, and a computer program stored on the memory and adapted to run on the processor, characterized in that, When the processor executes the computer program, the data communication method according to any one of claims 1 to 7 is implemented.